UNPKG

webdriverio-automation

Version:

WebdriverIO-Automation android ios project

84 lines (78 loc) 34.8 kB
function(){return function(){var g=this;function k(a){return"string"==typeof a}function aa(a,b){a=a.split(".");var c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b} function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(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 ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea=ca:ea=da;return ea.apply(null,arguments)}function fa(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 ga=Date.now||function(){return+new Date}; function l(a,b){function c(){}c.prototype=b.prototype;a.P=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.O=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 ha=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; function ia(a,b){var c=0;a=ha(String(a)).split(".");b=ha(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;!c&&e<d;e++){var f=a[e]||"",h=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==f[0].length&&0==h[0].length)break;c=ja(0==f[1].length?0:parseInt(f[1],10),0==h[1].length?0:parseInt(h[1],10))||ja(0==f[2].length,0==h[2].length)||ja(f[2],h[2]);f=f[3];h=h[3]}while(!c)}return c}function ja(a,b){return a<b?-1:a>b?1:0};function n(a,b){for(var c=a.length,d=k(a)?a.split(""):a,e=0;e<c;e++)e in d&&b.call(void 0,d[e],e,a)}function ka(a,b){for(var c=a.length,d=[],e=0,f=k(a)?a.split(""):a,h=0;h<c;h++)if(h in f){var m=f[h];b.call(void 0,m,h,a)&&(d[e++]=m)}return d}function p(a,b,c){var d=c;n(a,function(c,f){d=b.call(void 0,d,c,f,a)});return d}function la(a,b){for(var c=a.length,d=k(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 ma(a,b){a:{for(var c=a.length,d=k(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:k(a)?a.charAt(b):a[b]}function na(a){return Array.prototype.concat.apply([],arguments)}function oa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};function q(a,b){this.code=a;this.a=r[a]||pa;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||""}l(q,Error);var pa="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=pa;r[30]=pa;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=pa;r[9]="unknown command";q.prototype.toString=function(){return this.name+": "+this.message};var t;a:{var qa=g.navigator;if(qa){var ra=qa.userAgent;if(ra){t=ra;break a}}t=""}function u(a){return-1!=t.indexOf(a)};function sa(){return(u("Chrome")||u("CriOS"))&&!u("Edge")};function ta(){return u("iPhone")&&!u("iPod")&&!u("iPad")};function ua(a,b){var c=va;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var wa=u("Opera"),v=u("Trident")||u("MSIE"),xa=u("Edge"),w=u("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),ya=-1!=t.toLowerCase().indexOf("webkit")&&!u("Edge"),za=u("Macintosh"),Aa=u("Windows");function Ba(){var a=g.document;return a?a.documentMode:void 0}var Ca; a:{var Da="",Ea=function(){var a=t;if(w)return/rv\:([^\);]+)(\)|;)/.exec(a);if(xa)return/Edge\/([\d\.]+)/.exec(a);if(v)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ya)return/WebKit\/(\S+)/.exec(a);if(wa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Ea&&(Da=Ea?Ea[1]:"");if(v){var Fa=Ba();if(null!=Fa&&Fa>parseFloat(Da)){Ca=String(Fa);break a}}Ca=Da}var va={};function Ga(a){return ua(a,function(){return 0<=ia(Ca,a)})}var Ha;var Ia=g.document; Ha=Ia&&v?Ba()||("CSS1Compat"==Ia.compatMode?parseInt(Ca,10):5):void 0;var Ja=u("Firefox"),Ka=ta()||u("iPod"),La=u("iPad"),Ma=u("Android")&&!(sa()||u("Firefox")||u("Opera")||u("Silk")),Na=sa(),Oa=u("Safari")&&!(sa()||u("Coast")||u("Opera")||u("Edge")||u("Silk")||u("Android"))&&!(ta()||u("iPad")||u("iPod"));function y(a){return(a=a.exec(t))?a[1]:""}(function(){if(Ja)return y(/Firefox\/([0-9.]+)/);if(v||xa||wa)return Ca;if(Na)return ta()||u("iPad")||u("iPod")?y(/CriOS\/([0-9.]+)/):y(/Chrome\/([0-9.]+)/);if(Oa&&!(ta()||u("iPad")||u("iPod")))return y(/Version\/([0-9.]+)/);if(Ka||La){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t);if(a)return a[1]+"."+a[2]}else if(Ma)return(a=y(/Android\s+([0-9.]+)/))?a:y(/Version\/([0-9.]+)/);return""})();var Pa,z;function Qa(a){return A?Pa(a):v?0<=ia(Ha,a):Ga(a)}var A=function(){if(!w)return!1;var a=g.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;Pa=function(a){return 0<=c.compare(d,""+a)};z=function(a){c.compare(e,""+a)};return!0}();Ma&&A&&z(2.3);Ma&&A&&z(4);Oa&&A&&z(6);function Ra(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 Sa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(v&&!(9<=Number(Ha))){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?Ta(a,b):!c&&Ra(e,b)?-1*Ua(a,b):!d&&Ra(f,a)?Ua(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType? a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(g.Range.START_TO_END,a)}function Ua(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return Ta(b,a)}function Ta(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1};/* 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 B(a,b,c){this.a=a;this.b=b||1;this.h=c||1};var D=v&&!(9<=Number(Ha)),Va=v&&!(8<=Number(Ha));function E(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Wa(a,b){var c=Va&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new E(b,a,b.nodeName,c)};function Xa(a){this.b=a;this.a=0}function Ya(a){a=a.match(Za);for(var b=0;b<a.length;b++)$a.test(a[b])&&a.splice(b,1);return new Xa(a)}var Za=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,$a=/^\s/;function F(a,b){return a.b[a.a+(b||0)]}Xa.prototype.next=function(){return this.b[this.a++]};function ab(a){return a.b.length<=a.a};function G(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(D&&"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),D&&"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 H(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Va&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function bb(a,b,c,d,e){return(D?cb:db).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new I)} function cb(a,b,c,d,e){if(a instanceof J||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;var h=eb(a);if("*"!=h&&(f=b.getElementsByTagName(h),!f))return e;if(c){var m=[];for(a=0;b=f[a++];)H(b,c,d)&&m.push(b);f=m}for(a=0;b=f[a++];)"*"==h&&"!"==b.tagName||K(e,b);return e}fb(a,b,c,d,e);return e} function db(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!v?(b=b.getElementsByName(d),n(b,function(b){a.a(b)&&K(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),n(b,function(b){b.className==d&&a.a(b)&&K(e,b)})):a instanceof L?fb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.h()),n(b,function(a){H(a,c,d)&&K(e,a)}));return e} function gb(a,b,c,d,e){var f;if((a instanceof J||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var h=eb(a);if("*"!=h&&(f=ka(f,function(a){return a.tagName&&a.tagName.toLowerCase()==h}),!f))return e;c&&(f=ka(f,function(a){return H(a,c,d)}));n(f,function(a){"*"==h&&("!"==a.tagName||"*"==h&&1!=a.nodeType)||K(e,a)});return e}return hb(a,b,c,d,e)}function hb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&K(e,b);return e} function fb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&K(e,b),fb(a,b,c,d,e)}function eb(a){if(a instanceof L){if(8==a.b)return"!";if(null===a.b)return"*"}return a.h()};function I(){this.b=this.a=null;this.s=0}function ib(a){this.node=a;this.next=this.a=null}function jb(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 h=b.node;e==h||e instanceof E&&h instanceof E&&e.a==h.a?(e=c,c=c.next,b=b.next):0<Sa(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 kb(a,b){b=new ib(b);b.next=a.a;a.b?a.a.a=b:a.a=a.b=b;a.a=b;a.s++} function K(a,b){b=new ib(b);b.a=a.b;a.a?a.b.next=b:a.a=a.b=b;a.b=b;a.s++}function lb(a){return(a=a.a)?a.node:null}function mb(a){return(a=lb(a))?G(a):""}I.prototype.iterator=function(a){return new nb(this,!!a)};function nb(a,b){this.h=a;this.b=(this.A=b)?a.b:a.a;this.a=null}nb.prototype.next=function(){var a=this.b;if(a){var b=this.a=a;this.b=this.A?a.a:a.next;return b.node}return null};function M(a){this.l=a;this.b=this.i=!1;this.h=null}function N(a){return"\n "+a.toString().split("\n").join("\n ")}function ob(a,b){a.i=b}function pb(a,b){a.b=b}function O(a,b){a=a.a(b);return a instanceof I?+mb(a):+a}function P(a,b){a=a.a(b);return a instanceof I?mb(a):""+a}function Q(a,b){a=a.a(b);return a instanceof I?!!a.s:!!a};function qb(a,b,c){M.call(this,a.l);this.c=a;this.j=b;this.v=c;this.i=b.i||c.i;this.b=b.b||c.b;this.c==rb&&(c.b||c.i||4==c.l||0==c.l||!b.h?b.b||b.i||4==b.l||0==b.l||!c.h||(this.h={name:c.h.name,B:b}):this.h={name:b.h.name,B:c})}l(qb,M); function R(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof I&&c instanceof I){b=b.iterator();for(d=b.next();d;d=b.next())for(e=c.iterator(),f=e.next();f;f=e.next())if(a(G(d),G(f)))return!0;return!1}if(b instanceof I||c instanceof I){b instanceof I?(e=b,d=c):(e=c,d=b);f=e.iterator();for(var h=typeof d,m=f.next();m;m=f.next()){switch(h){case "number":m=+G(m);break;case "boolean":m=!!G(m);break;case "string":m=G(m);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(m, d)||e==c&&a(d,m))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)}qb.prototype.a=function(a){return this.c.u(this.j,this.v,a)};qb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+N(this.j);return a+=N(this.v)};function sb(a,b,c,d){this.M=a;this.I=b;this.l=c;this.u=d}sb.prototype.toString=function(){return this.M};var tb={}; function S(a,b,c,d){if(tb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new sb(a,b,c,d);return tb[a.toString()]=a}S("div",6,1,function(a,b,c){return O(a,c)/O(b,c)});S("mod",6,1,function(a,b,c){return O(a,c)%O(b,c)});S("*",6,1,function(a,b,c){return O(a,c)*O(b,c)});S("+",5,1,function(a,b,c){return O(a,c)+O(b,c)});S("-",5,1,function(a,b,c){return O(a,c)-O(b,c)});S("<",4,2,function(a,b,c){return R(function(a,b){return a<b},a,b,c)}); S(">",4,2,function(a,b,c){return R(function(a,b){return a>b},a,b,c)});S("<=",4,2,function(a,b,c){return R(function(a,b){return a<=b},a,b,c)});S(">=",4,2,function(a,b,c){return R(function(a,b){return a>=b},a,b,c)});var rb=S("=",3,2,function(a,b,c){return R(function(a,b){return a==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){return R(function(a,b){return a!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){return Q(a,c)&&Q(b,c)});S("or",1,2,function(a,b,c){return Q(a,c)||Q(b,c)});function ub(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");M.call(this,a.l);this.c=a;this.j=b;this.i=a.i;this.b=a.b}l(ub,M);ub.prototype.a=function(a){a=this.c.a(a);return vb(this.j,a)};ub.prototype.toString=function(){var a="Filter:"+N(this.c);return a+=N(this.j)};function wb(a,b){if(b.length<a.G)throw Error("Function "+a.o+" expects at least"+a.G+" arguments, "+b.length+" given");if(null!==a.F&&b.length>a.F)throw Error("Function "+a.o+" expects at most "+a.F+" arguments, "+b.length+" given");a.L&&n(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});M.call(this,a.l);this.C=a;this.c=b;ob(this,a.i||la(b,function(a){return a.i}));pb(this,a.K&&!b.length||a.J&&!!b.length||la(b,function(a){return a.b}))} l(wb,M);wb.prototype.a=function(a){return this.C.u.apply(null,na(a,this.c))};wb.prototype.toString=function(){var a="Function: "+this.C;if(this.c.length)var b=p(this.c,function(a,b){return a+N(b)},"Arguments:"),a=a+N(b);return a};function xb(a,b,c,d,e,f,h,m,x){this.o=a;this.l=b;this.i=c;this.K=d;this.J=e;this.u=f;this.G=h;this.F=void 0!==m?m:h;this.L=!!x}xb.prototype.toString=function(){return this.o};var yb={}; function T(a,b,c,d,e,f,h,m){if(yb.hasOwnProperty(a))throw Error("Function already created: "+a+".");yb[a]=new xb(a,b,c,d,!1,e,f,h,m)}T("boolean",2,!1,!1,function(a,b){return Q(b,a)},1);T("ceiling",1,!1,!1,function(a,b){return Math.ceil(O(b,a))},1);T("concat",3,!1,!1,function(a,b){return p(oa(arguments,1),function(b,d){return b+P(d,a)},"")},2,null);T("contains",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return-1!=b.indexOf(a)},2);T("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){return Math.floor(O(b,a))},1); T("id",4,!1,!1,function(a,b){function c(a){if(D){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ma(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=P(b,a).split(/\s+/);var f=[];n(a,function(a){a=c(a);var b;if(!(b=!a)){a:if(k(f))b=k(a)&&1==a.length?f.indexOf(a,0):-1;else{for(b=0;b<f.length;b++)if(b in f&&f[b]===a)break a;b=-1}b=0<=b}b||f.push(a)});f.sort(Sa);var h=new I;n(f,function(a){K(h,a)});return h},1); T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.h},0);T("local-name",3,!1,!0,function(a,b){return(a=b?lb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);T("name",3,!1,!0,function(a,b){return(a=b?lb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);T("namespace-uri",3,!0,!1,function(){return""},0,1,!0); T("normalize-space",3,!1,!0,function(a,b){return(b?P(b,a):G(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);T("not",2,!1,!1,function(a,b){return!Q(b,a)},1);T("number",1,!1,!0,function(a,b){return b?O(b,a):+G(a.a)},0,1);T("position",1,!0,!1,function(a){return a.b},0);T("round",1,!1,!1,function(a,b){return Math.round(O(b,a))},1);T("starts-with",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return!b.lastIndexOf(a,0)},2);T("string",3,!1,!0,function(a,b){return b?P(b,a):G(a.a)},0,1); T("string-length",1,!1,!0,function(a,b){return(b?P(b,a):G(a.a)).length},0,1);T("substring",3,!1,!1,function(a,b,c,d){c=O(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?O(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=P(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);T("substring-after",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); T("substring-before",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);T("sum",1,!1,!1,function(a,b){a=b.a(a).iterator();b=0;for(var c=a.next();c;c=a.next())b+=+G(c);return b},1,1,!0);T("translate",3,!1,!1,function(a,b,c,d){b=P(b,a);c=P(c,a);var e=P(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);T("true",2,!1,!1,function(){return!0},0);function L(a,b){this.j=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function zb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}L.prototype.a=function(a){return null===this.b||this.b==a.nodeType};L.prototype.h=function(){return this.j}; L.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=N(this.c));return a};function Ab(a){M.call(this,3);this.c=a.substring(1,a.length-1)}l(Ab,M);Ab.prototype.a=function(){return this.c};Ab.prototype.toString=function(){return"Literal: "+this.c};function J(a,b){this.o=a.toLowerCase();a="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}J.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=void 0!==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")};J.prototype.h=function(){return this.o}; J.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.o};function Bb(a){M.call(this,1);this.c=a}l(Bb,M);Bb.prototype.a=function(){return this.c};Bb.prototype.toString=function(){return"Number: "+this.c};function Cb(a,b){M.call(this,a.l);this.j=a;this.c=b;this.i=a.i;this.b=a.b;1==this.c.length&&(a=this.c[0],a.D||a.c!=Db||(a=a.v,"*"!=a.h()&&(this.h={name:a.h(),B:null})))}l(Cb,M);function Eb(){M.call(this,4)}l(Eb,M);Eb.prototype.a=function(a){var b=new I;a=a.a;9==a.nodeType?K(b,a):K(b,a.ownerDocument);return b};Eb.prototype.toString=function(){return"Root Helper Expression"};function Fb(){M.call(this,4)}l(Fb,M);Fb.prototype.a=function(a){var b=new I;K(b,a.a);return b};Fb.prototype.toString=function(){return"Context Helper Expression"}; function Gb(a){return"/"==a||"//"==a}Cb.prototype.a=function(a){var b=this.j.a(a);if(!(b instanceof I))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.A);if(e.i||e.c!=Hb)if(e.i||e.c!=Ib){var h=f.next();for(b=e.a(new B(h));h=f.next();)h=e.a(new B(h)),b=jb(b,h)}else h=f.next(),b=e.a(new B(h));else{for(h=f.next();(b=f.next())&&(!h.contains||h.contains(b))&&b.compareDocumentPosition(h)&8;h=b);b=e.a(new B(h))}}return b}; Cb.prototype.toString=function(){var a="Path Expression:"+N(this.j);if(this.c.length){var b=p(this.c,function(a,b){return a+N(b)},"Steps:");a+=N(b)}return a};function Jb(a,b){this.a=a;this.A=!!b} function vb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=b.iterator(),f=b.s,h,m=0;h=e.next();m++){var x=a.A?f-m:m+1;h=d.a(new B(h,x,f));if("number"==typeof h)x=x==h;else if("string"==typeof h||"boolean"==typeof h)x=!!h;else if(h instanceof I)x=0<h.s;else throw Error("Predicate.evaluate returned an unexpected type.");if(!x){x=e;h=x.h;var C=x.a;if(!C)throw Error("Next must be called at least once before remove.");var X=C.a,C=C.next;X?X.next=C:h.a=C;C?C.a=X:h.b=X;h.s--;x.a=null}}return b} Jb.prototype.toString=function(){return p(this.a,function(a,b){return a+N(b)},"Predicates:")};function U(a,b,c,d){M.call(this,4);this.c=a;this.v=b;this.j=c||new Jb([]);this.D=!!d;b=this.j;b=0<b.a.length?b.a[0].h:null;a.N&&b&&(a=b.name,a=D?a.toLowerCase():a,this.h={name:a,B:b.B});a:{a=this.j;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.i||1==c.l||0==c.l){a=!0;break a}a=!1}this.i=a}l(U,M); U.prototype.a=function(a){var b=a.a,c=this.h,d=null,e=null,f=0;c&&(d=c.name,e=c.B?P(c.B,a):null,f=1);if(this.D)if(this.i||this.c!=Kb)if(b=(new U(Lb,new L("node"))).a(a).iterator(),c=b.next())for(a=this.u(c,d,e,f);c=b.next();)a=jb(a,this.u(c,d,e,f));else a=new I;else a=bb(this.v,b,d,e),a=vb(this.j,a,f);else a=this.u(a.a,d,e,f);return a};U.prototype.u=function(a,b,c,d){a=this.c.C(this.v,a,b,c);return a=vb(this.j,a,d)}; U.prototype.toString=function(){var a="Step:"+N("Operator: "+(this.D?"//":"/"));this.c.o&&(a+=N("Axis: "+this.c));a+=N(this.v);if(this.j.a.length){var b=p(this.j.a,function(a,b){return a+N(b)},"Predicates:");a+=N(b)}return a};function Mb(a,b,c,d){this.o=a;this.C=b;this.A=c;this.N=d}Mb.prototype.toString=function(){return this.o};var Nb={};function V(a,b,c,d){if(Nb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new Mb(a,b,c,!!d);return Nb[a]=b} V("ancestor",function(a,b){for(var c=new I;b=b.parentNode;)a.a(b)&&kb(c,b);return c},!0);V("ancestor-or-self",function(a,b){var c=new I;do a.a(b)&&kb(c,b);while(b=b.parentNode);return c},!0); var Db=V("attribute",function(a,b){var c=new I,d=a.h();if("style"==d&&D&&b.style)return K(c,new E(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof L&&null===a.b||"*"==d)for(d=0;a=e[d];d++)D?a.nodeValue&&K(c,Wa(b,a)):K(c,a);else(a=e.getNamedItem(d))&&(D?a.nodeValue&&K(c,Wa(b,a)):K(c,a));return c},!1),Kb=V("child",function(a,b,c,d,e){return(D?gb:hb).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new I)},!1,!0);V("descendant",bb,!1,!0); var Lb=V("descendant-or-self",function(a,b,c,d){var e=new I;H(b,c,d)&&a.a(b)&&K(e,b);return bb(a,b,c,d,e)},!1,!0),Hb=V("following",function(a,b,c,d){var e=new I;do for(var f=b;f=f.nextSibling;)H(f,c,d)&&a.a(f)&&K(e,f),e=bb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);V("following-sibling",function(a,b){for(var c=new I;b=b.nextSibling;)a.a(b)&&K(c,b);return c},!1);V("namespace",function(){return new I},!1); var Ob=V("parent",function(a,b){var c=new I;if(9==b.nodeType)return c;if(2==b.nodeType)return K(c,b.ownerElement),c;b=b.parentNode;a.a(b)&&K(c,b);return c},!1),Ib=V("preceding",function(a,b,c,d){var e=new I,f=[];do f.unshift(b);while(b=b.parentNode);for(var h=1,m=f.length;h<m;h++){var x=[];for(b=f[h];b=b.previousSibling;)x.unshift(b);for(var C=0,X=x.length;C<X;C++)b=x[C],H(b,c,d)&&a.a(b)&&K(e,b),e=bb(a,b,c,d,e)}return e},!0,!0); V("preceding-sibling",function(a,b){for(var c=new I;b=b.previousSibling;)a.a(b)&&kb(c,b);return c},!0);var Pb=V("self",function(a,b){var c=new I;a.a(b)&&K(c,b);return c},!1);function Qb(a){M.call(this,1);this.c=a;this.i=a.i;this.b=a.b}l(Qb,M);Qb.prototype.a=function(a){return-O(this.c,a)};Qb.prototype.toString=function(){return"Unary Expression: -"+N(this.c)};function Rb(a){M.call(this,4);this.c=a;ob(this,la(this.c,function(a){return a.i}));pb(this,la(this.c,function(a){return a.b}))}l(Rb,M);Rb.prototype.a=function(a){var b=new I;n(this.c,function(c){c=c.a(a);if(!(c instanceof I))throw Error("Path expression must evaluate to NodeSet.");b=jb(b,c)});return b};Rb.prototype.toString=function(){return p(this.c,function(a,b){return a+N(b)},"Union Expression:")};function Sb(a,b){this.a=a;this.b=b}function Tb(a){for(var b,c=[];;){W(a,"Missing right hand side of binary expression.");b=Ub(a);var d=a.a.next();if(!d)break;var e=(d=tb[d]||null)&&d.I;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].I;)b=new qb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new qb(c.pop(),c.pop(),b);return b}function W(a,b){if(ab(a.a))throw Error(b);}function Vb(a,b){a=a.a.next();if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);} function Wb(a){a=a.a.next();if(")"!=a)throw Error("Bad token: "+a);}function Xb(a){a=a.a.next();if(2>a.length)throw Error("Unclosed literal string");return new Ab(a)} function Yb(a){var b=[];if(Gb(F(a.a))){var c=a.a.next();var d=F(a.a);if("/"==c&&(ab(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Eb;d=new Eb;W(a,"Missing next location step.");c=Zb(a,c);b.push(c)}else{a:{c=F(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":a.a.next();c=Tb(a);W(a,'unclosed "("');Vb(a,")");break;case '"':case "'":c=Xb(a);break;default:if(isNaN(+c))if(!zb(c)&&/(?![0-9])[\w]/.test(d)&&"("==F(a.a, 1)){c=a.a.next();c=yb[c]||null;a.a.next();for(d=[];")"!=F(a.a);){W(a,"Missing function argument list.");d.push(Tb(a));if(","!=F(a.a))break;a.a.next()}W(a,"Unclosed function argument list.");Wb(a);c=new wb(c,d)}else{c=null;break a}else c=new Bb(+a.a.next())}"["==F(a.a)&&(d=new Jb($b(a)),c=new ub(c,d))}if(c)if(Gb(F(a.a)))d=c;else return c;else c=Zb(a,"/"),d=new Fb,b.push(c)}for(;Gb(F(a.a));)c=a.a.next(),W(a,"Missing next location step."),c=Zb(a,c),b.push(c);return new Cb(d,b)} function Zb(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==F(a.a)){var c=new U(Pb,new L("node"));a.a.next();return c}if(".."==F(a.a))return c=new U(Ob,new L("node")),a.a.next(),c;if("@"==F(a.a)){var d=Db;a.a.next();W(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());var e=a.a.next();d=Nb[e]||null;if(!d)throw Error("No axis with name: "+e);a.a.next();W(a,"Missing node name")}else d=Kb;e= F(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==F(a.a,1)){if(!zb(e))throw Error("Invalid node type: "+e);e=a.a.next();if(!zb(e))throw Error("Invalid type name: "+e);Vb(a,"(");W(a,"Bad nodetype");var f=F(a.a).charAt(0),h=null;if('"'==f||"'"==f)h=Xb(a);W(a,"Bad nodetype");Wb(a);e=new L(e,h)}else if(e=a.a.next(),f=e.indexOf(":"),-1==f)e=new J(e);else{var h=e.substring(0,f);if("*"==h)var m="*";else if(m=a.b(h),!m)throw Error("Namespace prefix not declared: "+h);e=e.substr(f+1);e=new J(e,m)}else throw Error("Bad token: "+ a.a.next());a=new Jb($b(a),d.A);return c||new U(d,e,a,"//"==b)}function $b(a){for(var b=[];"["==F(a.a);){a.a.next();W(a,"Missing predicate expression.");var c=Tb(a);b.push(c);W(a,"Unclosed predicate expression.");Vb(a,"]")}return b}function Ub(a){if("-"==F(a.a))return a.a.next(),new Qb(Ub(a));var b=Yb(a);if("|"!=F(a.a))a=b;else{for(b=[b];"|"==a.a.next();)W(a,"Missing next union location path."),b.push(Yb(a));a.a.a--;a=new Rb(b)}return a};function ac(a){switch(a.nodeType){case 1:return fa(bc,a);case 9:return ac(a.documentElement);case 11:case 10:case 6:case 12:return cc;default:return a.parentNode?ac(a.parentNode):cc}}function cc(){return null}function bc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?bc(a.parentNode,b):null};function dc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=Ya(a);if(ab(a))throw Error("Invalid XPath expression.");b?"function"==ba(b)||(b=ea(b.lookupNamespaceURI,b)):b=function(){return null};var c=Tb(new Sb(a,b));if(!ab(a))throw Error("Bad token: "+a.next());this.evaluate=function(a,b){a=c.a(new B(a));return new Y(a,b)}} function Y(a,b){if(!b)if(a instanceof I)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 I))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof I?mb(a):""+a;break;case 1:this.numberValue=a instanceof I?+mb(a):+a;break;case 3:this.booleanValue=a instanceof I?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 E?e.a:e);this.snapshotLength=a.s;this.invalidIteratorState=!1;break;case 8:case 9:a=lb(a);this.singleNodeValue=a instanceof E?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]}}Y.ANY_TYPE=0;Y.NUMBER_TYPE=1;Y.STRING_TYPE=2;Y.BOOLEAN_TYPE=3;Y.UNORDERED_NODE_ITERATOR_TYPE=4;Y.ORDERED_NODE_ITERATOR_TYPE=5;Y.UNORDERED_NODE_SNAPSHOT_TYPE=6;Y.ORDERED_NODE_SNAPSHOT_TYPE=7;Y.ANY_UNORDERED_NODE_TYPE=8;Y.FIRST_ORDERED_NODE_TYPE=9;function ec(a){this.lookupNamespaceURI=ac(a)} aa("wgxpath.install",function(a,b){a=a||g;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=Y,c.evaluate=function(a,b,c,h){return(new dc(a,c)).evaluate(b,h)},c.createExpression=function(a,b){return new dc(a,b)},c.createNSResolver=function(a){return new ec(a)}});ya||A&&A&&z(3.6);v&&Qa(10);Ma&&A&&z(4);function fc(a,b){this.w={};this.m=[];this.a=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){if(a instanceof fc){d=gc(a);hc(a);var e=[];for(c=0;c<a.m.length;c++)e.push(a.w[a.m[c]])}else{var c=[],f=0;for(d in a)c[f++]=d;d=c;c=[];f=0;for(e in a)c[f++]=a[e];e=c}for(c=0;c<d.length;c++)this.set(d[c],e[c])}}function gc(a){hc(a);return a.m.concat()} function hc(a){var b,c;if(a.a!=a.m.length){for(b=c=0;c<a.m.length;){var d=a.m[c];Object.prototype.hasOwnProperty.call(a.w,d)&&(a.m[b++]=d);c++}a.m.length=b}if(a.a!=a.m.length){var e={};for(b=c=0;c<a.m.length;)d=a.m[c],Object.prototype.hasOwnProperty.call(e,d)||(a.m[b++]=d,e[d]=1),c++;a.m.length=b}}fc.prototype.get=function(a,b){return Object.prototype.hasOwnProperty.call(this.w,a)?this.w[a]:b}; fc.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.w,a)||(this.a++,this.m.push(a));this.w[a]=b};var ic={};function Z(a,b,c){var d=typeof a;("object"==d&&null!=a||"function"==d)&&(a=w?a.f:a.g);a=new jc(a);!b||b in ic&&!c||(ic[b]={key:a,shift:!1},c&&(ic[c]={key:a,shift:!0}));return a}function jc(a){this.code=a}Z(8);Z(9);Z(13);var kc=Z(16),lc=Z(17),mc=Z(18);Z(19);Z(20);Z(27);Z(32," ");Z(33);Z(34);Z(35);Z(36);Z(37);Z(38);Z(39);Z(40);Z(44);Z(45);Z(46);Z(48,"0",")");Z(49,"1","!");Z(50,"2","@");Z(51,"3","#");Z(52,"4","$");Z(53,"5","%");Z(54,"6","^");Z(55,"7","&");Z(56,"8","*");Z(57,"9","("); Z(65,"a","A");Z(66,"b","B");Z(67,"c","C");Z(68,"d","D");Z(69,"e","E");Z(70,"f","F");Z(71,"g","G");Z(72,"h","H");Z(73,"i","I");Z(74,"j","J");Z(75,"k","K");Z(76,"l","L");Z(77,"m","M");Z(78,"n","N");Z(79,"o","O");Z(80,"p","P");Z(81,"q","Q");Z(82,"r","R");Z(83,"s","S");Z(84,"t","T");Z(85,"u","U");Z(86,"v","V");Z(87,"w","W");Z(88,"x","X");Z(89,"y","Y");Z(90,"z","Z");var nc=Z(Aa?{f:91,g:91}:za?{f:224,g:91}:{f:0,g:91});Z(Aa?{f:92,g:92}:za?{f:224,g:93}:{f:0,g:92});Z(Aa?{f:93,g:93}:za?{f:0,g:0}:{f:93,g:null}); Z({f:96,g:96},"0");Z({f:97,g:97},"1");Z({f:98,g:98},"2");Z({f:99,g:99},"3");Z({f:100,g:100},"4");Z({f:101,g:101},"5");Z({f:102,g:102},"6");Z({f:103,g:103},"7");Z({f:104,g:104},"8");Z({f:105,g:105},"9");Z({f:106,g:106},"*");Z({f:107,g:107},"+");Z({f:109,g:109},"-");Z({f:110,g:110},".");Z({f:111,g:111},"/");Z(144);Z(112);Z(113);Z(114);Z(115);Z(116);Z(117);Z(118);Z(119);Z(120);Z(121);Z(122);Z(123);Z({f:107,g:187},"=","+");Z(108,",");Z({f:109,g:189},"-","_");Z(188,",","<");Z(190,".",">");Z(191,"/","?"); Z(192,"`","~");Z(219,"[","{");Z(220,"\\","|");Z(221,"]","}");Z({f:59,g:186},";",":");Z(222,"'",'"');var oc=new fc;oc.set(1,kc);oc.set(2,lc);oc.set(4,mc);oc.set(8,nc);(function(a){var b=new fc;n(gc(a),function(c){b.set(a.get(c).code,c)});return b})(oc);w&&Qa(12);ya||w&&Qa(3.5)||v&&Qa(8);function pc(a){a=decodeURIComponent(a);var b=document;var c=b||document;var d=c.$wdc_;d||(d=c.$wdc_={},d.H=ga());d.H||(d.H=ga());c=d;if(!(null!==c&&a in c))throw new q(10,"Element does not exist in cache");d=c[a];if(null!==d&&"setInterval"in d){if(d.closed)throw delete c[a],new q(23,"Window has been closed.");return d}for(var e=d;e;){if(e==b.documentElement)return d;e=e.parentNode}delete c[a];throw new q(10,"Element is no longer attached to the DOM");};aa("_",function(a,b){a=pc(a);b=pc(b);return null===a||null===b?JSON.stringify({status:10,value:null}):JSON.stringify({status:0,value:a===b})});; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);}