var b,k=k||{};k.global=this;k.exportPath_=function(a,c,d){a=a.split(".");d=d||k.global;a[0]in d||!d.execScript||d.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===c?d=d[e]?d[e]:d[e]={}:d[e]=c};k.define=function(a,c){k.exportPath_(a,c)};k.DEBUG=!0;k.LOCALE="en";k.TRUSTED_SITE=!0;k.provide=function(a){k.exportPath_(a)};k.setTestOnly=function(a){if(!k.DEBUG)throw a=a||"",Error("Importing test-only code into non-debug environment"+a?": "+a:".");};k.forwardDeclare=function(){};
k.getObjectByName=function(a){a=a.split(".");for(var c=k.global,d;d=a.shift();)if(k.isDefAndNotNull(c[d]))c=c[d];else return null;return c};k.globalize=function(a,c){var d=c||k.global,e;for(e in a)d[e]=a[e]};k.addDependency=function(a,c,d){if(k.DEPENDENCIES_ENABLED){var e;a=a.replace(/\\/g,"/");for(var f=k.dependencies_,g=0;e=c[g];g++)f.nameToPath[e]=a,a in f.pathToNames||(f.pathToNames[a]={}),f.pathToNames[a][e]=!0;for(e=0;c=d[e];e++)a in f.requires||(f.requires[a]={}),f.requires[a][c]=!0}};
k.useStrictRequires=!1;k.ENABLE_DEBUG_LOADER=!0;k.require=function(){};k.basePath="";k.nullFunction=function(){};k.identityFunction=function(a){return a};k.abstractMethod=function(){throw Error("unimplemented abstract method");};k.addSingletonGetter=function(a){a.getInstance=function(){if(a.instance_)return a.instance_;k.DEBUG&&(k.instantiatedSingletons_[k.instantiatedSingletons_.length]=a);return a.instance_=new a}};k.instantiatedSingletons_=[];k.DEPENDENCIES_ENABLED=!1;
k.DEPENDENCIES_ENABLED&&(k.included_={},k.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}},k.inHtmlDocument_=function(){var a=k.global.document;return"undefined"!=typeof a&&"write"in a},k.findBasePath_=function(){if(k.global.CLOSURE_BASE_PATH)k.basePath=k.global.CLOSURE_BASE_PATH;else if(k.inHtmlDocument_())for(var a=k.global.document.getElementsByTagName("script"),c=a.length-1;0<=c;--c){var d=a[c].src,e=d.lastIndexOf("?"),e=-1==e?d.length:e;if("base.js"==d.substr(e-
7,7)){k.basePath=d.substr(0,e-7);break}}},k.importScript_=function(a){var c=k.global.CLOSURE_IMPORT_SCRIPT||k.writeScriptTag_;!k.dependencies_.written[a]&&c(a)&&(k.dependencies_.written[a]=!0)},k.writeScriptTag_=function(a){if(k.inHtmlDocument_()){var c=k.global.document;if("complete"==c.readyState){if(/\bdeps.js$/.test(a))return!1;throw Error('Cannot write "'+a+'" after document load');}c.write('<script type="text/javascript" src="'+a+'">\x3c/script>');return!0}return!1},k.writeScripts_=function(){function a(f){if(!(f in
e.written)){if(!(f in e.visited)&&(e.visited[f]=!0,f in e.requires))for(var h in e.requires[f])if(!k.isProvided_(h))if(h in e.nameToPath)a(e.nameToPath[h]);else throw Error("Undefined nameToPath for "+h);f in d||(d[f]=!0,c.push(f))}}var c=[],d={},e=k.dependencies_,f;for(f in k.included_)e.written[f]||a(f);for(f=0;f<c.length;f++)if(c[f])k.importScript_(k.basePath+c[f]);else throw Error("Undefined script input");},k.getPathFromDeps_=function(a){return a in k.dependencies_.nameToPath?k.dependencies_.nameToPath[a]:
null},k.findBasePath_(),k.global.CLOSURE_NO_DEPS||k.importScript_(k.basePath+"deps.js"));
k.typeOf=function(a){var c=typeof a;if("object"==c)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return c;var d=Object.prototype.toString.call(a);if("[object Window]"==d)return"object";if("[object Array]"==d||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==d||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==c&&"undefined"==typeof a.call)return"object";return c};k.isDef=function(a){return void 0!==a};k.isNull=function(a){return null===a};k.isDefAndNotNull=function(a){return null!=a};k.isArray=function(a){return"array"==k.typeOf(a)};k.isArrayLike=function(a){var c=k.typeOf(a);return"array"==c||"object"==c&&"number"==typeof a.length};k.isDateLike=function(a){return k.isObject(a)&&"function"==typeof a.getFullYear};k.isString=function(a){return"string"==typeof a};
k.isBoolean=function(a){return"boolean"==typeof a};k.isNumber=function(a){return"number"==typeof a};k.isFunction=function(a){return"function"==k.typeOf(a)};k.isObject=function(a){var c=typeof a;return"object"==c&&null!=a||"function"==c};k.getUid=function(a){return a[k.UID_PROPERTY_]||(a[k.UID_PROPERTY_]=++k.uidCounter_)};k.hasUid=function(a){return!!a[k.UID_PROPERTY_]};k.removeUid=function(a){"removeAttribute"in a&&a.removeAttribute(k.UID_PROPERTY_);try{delete a[k.UID_PROPERTY_]}catch(c){}};
k.UID_PROPERTY_="closure_uid_"+(1E9*Math.random()>>>0);k.uidCounter_=0;k.getHashCode=k.getUid;k.removeHashCode=k.removeUid;k.cloneObject=function(a){var c=k.typeOf(a);if("object"==c||"array"==c){if(a.clone)return a.clone();var c="array"==c?[]:{},d;for(d in a)c[d]=k.cloneObject(a[d]);return c}return a};k.bindNative_=function(a,c,d){return a.call.apply(a.bind,arguments)};
k.bindJs_=function(a,c,d){if(!a)throw Error();if(2<arguments.length){var e=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(d,e);return a.apply(c,d)}}return function(){return a.apply(c,arguments)}};k.bind=function(a,c,d){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?k.bind=k.bindNative_:k.bind=k.bindJs_;return k.bind.apply(null,arguments)};
k.partial=function(a,c){var d=Array.prototype.slice.call(arguments,1);return function(){var c=d.slice();c.push.apply(c,arguments);return a.apply(this,c)}};k.mixin=function(a,c){for(var d in c)a[d]=c[d]};k.now=k.TRUSTED_SITE&&Date.now||function(){return+new Date};
k.globalEval=function(a){if(k.global.execScript)k.global.execScript(a,"JavaScript");else if(k.global.eval)if(null==k.evalWorksForGlobals_&&(k.global.eval("var _et_ = 1;"),"undefined"!=typeof k.global._et_?(delete k.global._et_,k.evalWorksForGlobals_=!0):k.evalWorksForGlobals_=!1),k.evalWorksForGlobals_)k.global.eval(a);else{var c=k.global.document,d=c.createElement("script");d.type="text/javascript";d.defer=!1;d.appendChild(c.createTextNode(a));c.body.appendChild(d);c.body.removeChild(d)}else throw Error("goog.globalEval not available");
};k.evalWorksForGlobals_=null;k.getCssName=function(a,c){var d=function(a){return k.cssNameMapping_[a]||a},e=function(a){a=a.split("-");for(var c=[],e=0;e<a.length;e++)c.push(d(a[e]));return c.join("-")},e=k.cssNameMapping_?"BY_WHOLE"==k.cssNameMappingStyle_?d:e:function(a){return a};return c?a+"-"+e(c):e(a)};k.setCssNameMapping=function(a,c){k.cssNameMapping_=a;k.cssNameMappingStyle_=c};
k.getMsg=function(a,c){var d=c||{},e;for(e in d){var f=(""+d[e]).replace(/\$/g,"$$$$");a=a.replace(RegExp("\\{\\$"+e+"\\}","gi"),f)}return a};k.getMsgWithFallback=function(a){return a};k.exportSymbol=function(a,c,d){k.exportPath_(a,c,d)};k.exportProperty=function(a,c,d){a[c]=d};
k.inherits=function(a,c){function d(){}d.prototype=c.prototype;a.superClass_=c.prototype;a.prototype=new d;a.prototype.constructor=a;a.base=function(a,d,g){var h=Array.prototype.slice.call(arguments,2);return c.prototype[d].apply(a,h)}};
k.base=function(a,c,d){var e=arguments.callee.caller;if(k.DEBUG&&!e)throw Error("arguments.caller not defined.  goog.base() expects not to be running in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(e.superClass_)return e.superClass_.constructor.apply(a,Array.prototype.slice.call(arguments,1));for(var f=Array.prototype.slice.call(arguments,2),g=!1,h=a.constructor;h;h=h.superClass_&&h.superClass_.constructor)if(h.prototype[c]===e)g=!0;else if(g)return h.prototype[c].apply(a,
f);if(a[c]===e)return a.constructor.prototype[c].apply(a,f);throw Error("goog.base called from a method of one name to a method of a different name");};k.scope=function(a){a.call(k.global)};k.MODIFY_FUNCTION_PROTOTYPES=!0;
k.MODIFY_FUNCTION_PROTOTYPES&&(Function.prototype.bind=Function.prototype.bind||function(a,c){if(1<arguments.length){var d=Array.prototype.slice.call(arguments,1);d.unshift(this,a);return k.bind.apply(null,d)}return k.bind(this,a)},Function.prototype.partial=function(a){var c=Array.prototype.slice.call(arguments);c.unshift(this,null);return k.bind.apply(null,c)},Function.prototype.inherits=function(a){k.inherits(this,a)},Function.prototype.mixin=function(a){k.mixin(this.prototype,a)});k.craw={};k.craw.AppWindowDelegate=function(){};k.craw.AppWindowDelegate.defaultImpl_=k.craw.AppWindowDelegate;k.craw.AppWindowDelegate.setDefaultImpl=function(){k.craw.AppWindowDelegate.defaultImpl_=n.WindowDelegate};k.craw.AppWindowDelegate.createDefaultImpl=function(a){return new k.craw.AppWindowDelegate.defaultImpl_(a)};k.craw.AppWindowDelegate.prototype.onWindowReady=function(){};k.craw.AppWindowDelegate.prototype.pollOnlineStatus=function(){return null};
k.craw.AppWindowDelegate.prototype.finishedLaunch=function(){return!0};k.craw.AppWindowDelegate.prototype.getAppUnavailableMessage=function(){return chrome.i18n.getMessage("craw_app_unavailable")};k.debug={};k.debug.Error=function(a){if(Error.captureStackTrace)Error.captureStackTrace(this,k.debug.Error);else{var c=Error().stack;c&&(this.stack=c)}a&&(this.message=String(a))};k.inherits(k.debug.Error,Error);k.debug.Error.prototype.name="CustomError";k.dom={};k.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};k.string={};k.string.Unicode={NBSP:"\u00a0"};k.string.startsWith=function(a,c){return 0==a.lastIndexOf(c,0)};k.string.endsWith=function(a){var c=a.length-1;return 0<=c&&a.indexOf("/",c)==c};k.string.caseInsensitiveStartsWith=function(a,c){return 0==k.string.caseInsensitiveCompare(c,a.substr(0,c.length))};k.string.caseInsensitiveEndsWith=function(a,c){return 0==k.string.caseInsensitiveCompare(c,a.substr(a.length-c.length,c.length))};
k.string.caseInsensitiveEquals=function(a){return k.net.XhrIo.CONTENT_TYPE_HEADER.toLowerCase()==a.toLowerCase()};k.string.subs=function(a,c){for(var d=a.split("%s"),e="",f=Array.prototype.slice.call(arguments,1);f.length&&1<d.length;)e+=d.shift()+f.shift();return e+d.join("%s")};k.string.collapseWhitespace=function(a){return a.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};k.string.isEmpty=function(a){return/^[\s\xa0]*$/.test(a)};k.string.isEmptySafe=function(a){return k.string.isEmpty(k.string.makeSafe(a))};
k.string.isBreakingWhitespace=function(a){return!/[^\t\n\r ]/.test(a)};k.string.isAlpha=function(a){return!/[^a-zA-Z]/.test(a)};k.string.isNumeric=function(a){return!/[^0-9]/.test(a)};k.string.isAlphaNumeric=function(a){return!/[^a-zA-Z0-9]/.test(a)};k.string.isSpace=function(a){return" "==a};k.string.isUnicodeChar=function(a){return 1==a.length&&" "<=a&&"~">=a||"\u0080"<=a&&"\ufffd">=a};k.string.stripNewlines=function(a){return a.replace(/(\r\n|\r|\n)+/g," ")};
k.string.canonicalizeNewlines=function(a){return a.replace(/(\r\n|\r|\n)/g,"\n")};k.string.normalizeWhitespace=function(a){return a.replace(/\xa0|\s/g," ")};k.string.normalizeSpaces=function(a){return a.replace(/\xa0|[ \t]+/g," ")};k.string.collapseBreakingSpaces=function(a){return a.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};k.string.trim=function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};k.string.trimLeft=function(a){return a.replace(/^[\s\xa0]+/,"")};
k.string.trimRight=function(a){return a.replace(/[\s\xa0]+$/,"")};k.string.caseInsensitiveCompare=function(a,c){var d=String(a).toLowerCase(),e=String(c).toLowerCase();return d<e?-1:d==e?0:1};k.string.numerateCompareRegExp_=/(\.\d+)|(\d+)|(\D+)/g;
k.string.numerateCompare=function(a,c){if(a==c)return 0;if(!a)return-1;if(!c)return 1;for(var d=a.toLowerCase().match(k.string.numerateCompareRegExp_),e=c.toLowerCase().match(k.string.numerateCompareRegExp_),f=Math.min(d.length,e.length),g=0;g<f;g++){var h=d[g],l=e[g];if(h!=l)return d=parseInt(h,10),!isNaN(d)&&(e=parseInt(l,10),!isNaN(e)&&d-e)?d-e:h<l?-1:1}return d.length!=e.length?d.length-e.length:a<c?-1:1};k.string.urlEncode=function(a){return encodeURIComponent(String(a))};
k.string.urlDecode=function(a){return decodeURIComponent(a.replace(/\+/g," "))};k.string.newLineToBr=function(a,c){return a.replace(/(\r\n|\r|\n)/g,c?"<br />":"<br>")};
k.string.htmlEscape=function(a){if(!k.string.allRe_.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(k.string.amperRe_,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(k.string.ltRe_,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(k.string.gtRe_,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(k.string.quotRe_,"&quot;"));-1!=a.indexOf("'")&&(a=a.replace(k.string.singleQuoteRe_,"&#39;"));return a};k.string.amperRe_=/&/g;k.string.ltRe_=/</g;k.string.gtRe_=/>/g;k.string.quotRe_=/"/g;k.string.singleQuoteRe_=/'/g;
k.string.allRe_=/[&<>"']/;k.string.unescapeEntities=function(a){return k.string.contains(a,"&")?"document"in k.global?k.string.unescapeEntitiesUsingDom_(a):k.string.unescapePureXmlEntities_(a):a};k.string.unescapeEntitiesWithDocument=function(a,c){return k.string.contains(a,"&")?k.string.unescapeEntitiesUsingDom_(a,c):a};
k.string.unescapeEntitiesUsingDom_=function(a,c){var d={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},e;e=c?c.createElement("div"):document.createElement("div");return a.replace(k.string.HTML_ENTITY_PATTERN_,function(a,c){var h=d[a];if(h)return h;if("#"==c.charAt(0)){var l=Number("0"+c.substr(1));isNaN(l)||(h=String.fromCharCode(l))}h||(e.innerHTML=a+" ",h=e.firstChild.nodeValue.slice(0,-1));return d[a]=h})};
k.string.unescapePureXmlEntities_=function(a){return a.replace(/&([^;]+);/g,function(a,d){switch(d){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if("#"==d.charAt(0)){var e=Number("0"+d.substr(1));if(!isNaN(e))return String.fromCharCode(e)}return a}})};k.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;k.string.whitespaceEscape=function(a,c){return k.string.newLineToBr(a.replace(/  /g," &#160;"),c)};
k.string.stripQuotes=function(a,c){for(var d=c.length,e=0;e<d;e++){var f=1==d?c:c.charAt(e);if(a.charAt(0)==f&&a.charAt(a.length-1)==f)return a.substring(1,a.length-1)}return a};k.string.truncate=function(a,c,d){d&&(a=k.string.unescapeEntities(a));a.length>c&&(a=a.substring(0,c-3)+"...");d&&(a=k.string.htmlEscape(a));return a};
k.string.truncateMiddle=function(a,c,d,e){d&&(a=k.string.unescapeEntities(a));if(e&&a.length>c)e>c&&(e=c),a=a.substring(0,c-e)+"..."+a.substring(a.length-e);else if(a.length>c){e=Math.floor(c/2);var f=a.length-e;a=a.substring(0,e+c%2)+"..."+a.substring(f)}d&&(a=k.string.htmlEscape(a));return a};k.string.specialEscapeChars_={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\"};k.string.jsEscapeCache_={"'":"\\'"};
k.string.quote=function(a){a=String(a);if(a.quote)return a.quote();for(var c=['"'],d=0;d<a.length;d++){var e=a.charAt(d),f=e.charCodeAt(0);c[d+1]=k.string.specialEscapeChars_[e]||(31<f&&127>f?e:k.string.escapeChar(e))}c.push('"');return c.join("")};k.string.escapeString=function(a){for(var c=[],d=0;d<a.length;d++)c[d]=k.string.escapeChar(a.charAt(d));return c.join("")};
k.string.escapeChar=function(a){if(a in k.string.jsEscapeCache_)return k.string.jsEscapeCache_[a];if(a in k.string.specialEscapeChars_)return k.string.jsEscapeCache_[a]=k.string.specialEscapeChars_[a];var c=a,d=a.charCodeAt(0);if(31<d&&127>d)c=a;else{if(256>d){if(c="\\x",16>d||256<d)c+="0"}else c="\\u",4096>d&&(c+="0");c+=d.toString(16).toUpperCase()}return k.string.jsEscapeCache_[a]=c};k.string.toMap=function(a){for(var c={},d=0;d<a.length;d++)c[a.charAt(d)]=!0;return c};
k.string.contains=function(a,c){return-1!=a.indexOf(c)};k.string.countOf=function(a,c){return a&&c?a.split(c).length-1:0};k.string.removeAt=function(a,c,d){var e=a;0<=c&&c<a.length&&0<d&&(e=a.substr(0,c)+a.substr(c+d,a.length-c-d));return e};k.string.remove=function(a,c){var d=RegExp(k.string.regExpEscape(c),"");return a.replace(d,"")};k.string.removeAll=function(a,c){var d=RegExp(k.string.regExpEscape(c),"g");return a.replace(d,"")};
k.string.regExpEscape=function(a){return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};k.string.repeat=function(a,c){return Array(c+1).join(a)};k.string.padNumber=function(a,c,d){a=k.isDef(d)?a.toFixed(d):String(a);d=a.indexOf(".");-1==d&&(d=a.length);return k.string.repeat("0",Math.max(0,c-d))+a};k.string.makeSafe=function(a){return null==a?"":String(a)};k.string.buildString=function(a){return Array.prototype.join.call(arguments,"")};
k.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^k.now()).toString(36)};
k.string.compareVersions=function(a,c){for(var d=0,e=k.string.trim(String(a)).split("."),f=k.string.trim(String(c)).split("."),g=Math.max(e.length,f.length),h=0;0==d&&h<g;h++){var l=e[h]||"",m=f[h]||"",p=RegExp("(\\d*)(\\D*)","g"),K=RegExp("(\\d*)(\\D*)","g");do{var v=p.exec(l)||["","",""],u=K.exec(m)||["","",""];if(0==v[0].length&&0==u[0].length)break;d=k.string.compareElements_(0==v[1].length?0:parseInt(v[1],10),0==u[1].length?0:parseInt(u[1],10))||k.string.compareElements_(0==v[2].length,0==u[2].length)||
k.string.compareElements_(v[2],u[2])}while(0==d)}return d};k.string.compareElements_=function(a,c){return a<c?-1:a>c?1:0};k.string.HASHCODE_MAX_=4294967296;k.string.hashCode=function(a){for(var c=0,d=0;d<a.length;++d)c=31*c+a.charCodeAt(d),c%=k.string.HASHCODE_MAX_;return c};k.string.uniqueStringCounter_=2147483648*Math.random()|0;k.string.createUniqueString=function(){return"goog_"+k.string.uniqueStringCounter_++};
k.string.toNumber=function(a){var c=Number(a);return 0==c&&k.string.isEmpty(a)?NaN:c};k.string.isLowerCamelCase=function(a){return/^[a-z]+([A-Z][a-z]*)*$/.test(a)};k.string.isUpperCamelCase=function(a){return/^([A-Z][a-z]*)+$/.test(a)};k.string.toCamelCase=function(a){return String(a).replace(/\-([a-z])/g,function(a,d){return d.toUpperCase()})};k.string.toSelectorCase=function(a){return String(a).replace(/([A-Z])/g,"-$1").toLowerCase()};
k.string.toTitleCase=function(a,c){var d=k.isString(c)?k.string.regExpEscape(c):"\\s";return a.replace(RegExp("(^"+(d?"|["+d+"]+":"")+")([a-z])","g"),function(a,c,d){return c+d.toUpperCase()})};k.string.parseInt=function(a){isFinite(a)&&(a=String(a));return k.isString(a)?/^\s*-?0x/i.test(a)?parseInt(a,16):parseInt(a,10):NaN};k.string.splitLimit=function(a,c,d){a=a.split(c);for(var e=[];0<d&&a.length;)e.push(a.shift()),d--;a.length&&e.push(a.join(c));return e};k.asserts={};k.asserts.ENABLE_ASSERTS=k.DEBUG;k.asserts.AssertionError=function(a,c){c.unshift(a);k.debug.Error.call(this,k.string.subs.apply(null,c));c.shift()};k.inherits(k.asserts.AssertionError,k.debug.Error);k.asserts.AssertionError.prototype.name="AssertionError";k.asserts.doAssertFailure_=function(a,c,d,e){var f="Assertion failed";if(d)var f=f+(": "+d),g=e;else a&&(f+=": "+a,g=c);throw new k.asserts.AssertionError(""+f,g||[]);};
k.asserts.assert=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!a&&k.asserts.doAssertFailure_("",null,c,Array.prototype.slice.call(arguments,2));return a};k.asserts.fail=function(a,c){if(k.asserts.ENABLE_ASSERTS)throw new k.asserts.AssertionError("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};
k.asserts.assertNumber=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isNumber(a)&&k.asserts.doAssertFailure_("Expected number but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2));return a};k.asserts.assertString=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isString(a)&&k.asserts.doAssertFailure_("Expected string but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2))};
k.asserts.assertFunction=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isFunction(a)&&k.asserts.doAssertFailure_("Expected function but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2));return a};k.asserts.assertObject=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isObject(a)&&k.asserts.doAssertFailure_("Expected object but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2));return a};
k.asserts.assertArray=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isArray(a)&&k.asserts.doAssertFailure_("Expected array but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2))};k.asserts.assertBoolean=function(a,c,d){k.asserts.ENABLE_ASSERTS&&!k.isBoolean(a)&&k.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2));return a};
k.asserts.assertElement=function(a,c,d){!k.asserts.ENABLE_ASSERTS||k.isObject(a)&&a.nodeType==k.dom.NodeType.ELEMENT||k.asserts.doAssertFailure_("Expected Element but got %s: %s.",[k.typeOf(a),a],c,Array.prototype.slice.call(arguments,2));return a};k.asserts.assertInstanceof=function(a,c,d,e){!k.asserts.ENABLE_ASSERTS||a instanceof c||k.asserts.doAssertFailure_("instanceof check failed.",null,d,Array.prototype.slice.call(arguments,3));return a};
k.asserts.assertObjectPrototypeIsIntact=function(){for(var a in Object.prototype)k.asserts.fail(a+" should not be enumerable in Object.prototype.")};k.array={};k.NATIVE_ARRAY_PROTOTYPES=k.TRUSTED_SITE;k.array.ASSUME_NATIVE_FUNCTIONS=!1;k.array.peek=function(a){return a[a.length-1]};k.array.ARRAY_PROTOTYPE_=Array.prototype;
k.array.indexOf=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.indexOf)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.indexOf.call(a,c,d)}:function(a,c,d){d=null==d?0:0>d?Math.max(0,a.length+d):d;if(k.isString(a))return k.isString(c)&&1==c.length?a.indexOf(c,d):-1;for(;d<a.length;d++)if(d in a&&a[d]===c)return d;return-1};
k.array.lastIndexOf=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.lastIndexOf)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a,c,null==d?a.length-1:d)}:function(a,c,d){d=null==d?a.length-1:d;0>d&&(d=Math.max(0,a.length+d));if(k.isString(a))return k.isString(c)&&1==c.length?a.lastIndexOf(c,d):-1;for(;0<=d;d--)if(d in a&&a[d]===c)return d;return-1};
k.array.forEach=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.forEach)?function(a,c,d){k.asserts.assert(null!=a.length);k.array.ARRAY_PROTOTYPE_.forEach.call(a,c,d)}:function(a,c,d){for(var e=a.length,f=k.isString(a)?a.split(""):a,g=0;g<e;g++)g in f&&c.call(d,f[g],g,a)};k.array.forEachRight=function(a,c){for(var d=a.length,e=k.isString(a)?a.split(""):a,d=d-1;0<=d;--d)d in e&&c.call(void 0,e[d],d,a)};
k.array.filter=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.filter)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.filter.call(a,c,d)}:function(a,c,d){for(var e=a.length,f=[],g=0,h=k.isString(a)?a.split(""):a,l=0;l<e;l++)if(l in h){var m=h[l];c.call(d,m,l,a)&&(f[g++]=m)}return f};
k.array.map=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.map)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.map.call(a,c,d)}:function(a,c,d){for(var e=a.length,f=Array(e),g=k.isString(a)?a.split(""):a,h=0;h<e;h++)h in g&&(f[h]=c.call(d,g[h],h,a));return f};
k.array.reduce=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.reduce)?function(a,c,d,e){k.asserts.assert(null!=a.length);e&&(c=k.bind(c,e));return k.array.ARRAY_PROTOTYPE_.reduce.call(a,c,d)}:function(a,c,d,e){var f=d;k.array.forEach(a,function(d,h){f=c.call(e,f,d,h,a)});return f};
k.array.reduceRight=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.reduceRight)?function(a,c,d,e){k.asserts.assert(null!=a.length);e&&(c=k.bind(c,e));return k.array.ARRAY_PROTOTYPE_.reduceRight.call(a,c,d)}:function(a,c,d,e){var f=d;k.array.forEachRight(a,function(d,h){f=c.call(e,f,d,h,a)});return f};
k.array.some=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.some)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.some.call(a,c,d)}:function(a,c,d){for(var e=a.length,f=k.isString(a)?a.split(""):a,g=0;g<e;g++)if(g in f&&c.call(d,f[g],g,a))return!0;return!1};
k.array.every=k.NATIVE_ARRAY_PROTOTYPES&&(k.array.ASSUME_NATIVE_FUNCTIONS||k.array.ARRAY_PROTOTYPE_.every)?function(a,c,d){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.every.call(a,c,d)}:function(a,c,d){for(var e=a.length,f=k.isString(a)?a.split(""):a,g=0;g<e;g++)if(g in f&&!c.call(d,f[g],g,a))return!1;return!0};k.array.count=function(a,c,d){var e=0;k.array.forEach(a,function(a,g,h){c.call(d,a,g,h)&&++e},d);return e};
k.array.find=function(a,c,d){c=k.array.findIndex(a,c,d);return 0>c?null:k.isString(a)?a.charAt(c):a[c]};k.array.findIndex=function(a,c,d){for(var e=a.length,f=k.isString(a)?a.split(""):a,g=0;g<e;g++)if(g in f&&c.call(d,f[g],g,a))return g;return-1};k.array.findRight=function(a,c,d){c=k.array.findIndexRight(a,c,d);return 0>c?null:k.isString(a)?a.charAt(c):a[c]};
k.array.findIndexRight=function(a,c,d){for(var e=a.length,f=k.isString(a)?a.split(""):a,e=e-1;0<=e;e--)if(e in f&&c.call(d,f[e],e,a))return e;return-1};k.array.contains=function(a,c){return 0<=k.array.indexOf(a,c)};k.array.isEmpty=function(a){return 0==a.length};k.array.clear=function(a){if(!k.isArray(a))for(var c=a.length-1;0<=c;c--)delete a[c];a.length=0};k.array.insert=function(a,c){k.array.contains(a,c)||a.push(c)};k.array.insertAt=function(a,c,d){k.array.splice(a,d,0,c)};
k.array.insertArrayAt=function(a,c,d){k.partial(k.array.splice,a,d,0).apply(null,c)};k.array.insertBefore=function(a,c,d){var e;2==arguments.length||0>(e=k.array.indexOf(a,d))?a.push(c):k.array.insertAt(a,c,e)};k.array.remove=function(a,c){var d=k.array.indexOf(a,c),e;(e=0<=d)&&k.array.removeAt(a,d);return e};k.array.removeAt=function(a,c){k.asserts.assert(null!=a.length);return 1==k.array.ARRAY_PROTOTYPE_.splice.call(a,c,1).length};
k.array.removeIf=function(a,c,d){c=k.array.findIndex(a,c,d);return 0<=c?(k.array.removeAt(a,c),!0):!1};k.array.concat=function(a){return k.array.ARRAY_PROTOTYPE_.concat.apply(k.array.ARRAY_PROTOTYPE_,arguments)};k.array.toArray=function(a){var c=a.length;if(0<c){for(var d=Array(c),e=0;e<c;e++)d[e]=a[e];return d}return[]};k.array.clone=k.array.toArray;
k.array.extend=function(a,c){for(var d=1;d<arguments.length;d++){var e=arguments[d],f;if(k.isArray(e)||(f=k.isArrayLike(e))&&Object.prototype.hasOwnProperty.call(e,"callee"))a.push.apply(a,e);else if(f)for(var g=a.length,h=e.length,l=0;l<h;l++)a[g+l]=e[l];else a.push(e)}};k.array.splice=function(a,c,d,e){k.asserts.assert(null!=a.length);return k.array.ARRAY_PROTOTYPE_.splice.apply(a,k.array.slice(arguments,1))};
k.array.slice=function(a,c,d){k.asserts.assert(null!=a.length);return 2>=arguments.length?k.array.ARRAY_PROTOTYPE_.slice.call(a,c):k.array.ARRAY_PROTOTYPE_.slice.call(a,c,d)};k.array.removeDuplicates=function(a,c){for(var d=c||a,e={},f=0,g=0;g<a.length;){var h=a[g++],l=k.isObject(h)?"o"+k.getUid(h):(typeof h).charAt(0)+h;Object.prototype.hasOwnProperty.call(e,l)||(e[l]=!0,d[f++]=h)}d.length=f};k.array.binarySearch=function(a,c,d){return k.array.binarySearch_(a,d||k.array.defaultCompare,!1,c)};
k.array.binarySelect=function(a,c,d){return k.array.binarySearch_(a,c,!0,void 0,d)};k.array.binarySearch_=function(a,c,d,e,f){for(var g=0,h=a.length,l;g<h;){var m=g+h>>1,p;p=d?c.call(f,a[m],m,a):c(e,a[m]);0<p?g=m+1:(h=m,l=!p)}return l?g:~g};k.array.sort=function(a,c){a.sort(c||k.array.defaultCompare)};
k.array.stableSort=function(a,c){for(var d=0;d<a.length;d++)a[d]={index:d,value:a[d]};var e=c||k.array.defaultCompare;k.array.sort(a,function(a,c){return e(a.value,c.value)||a.index-c.index});for(d=0;d<a.length;d++)a[d]=a[d].value};k.array.sortObjectsByKey=function(a,c,d){var e=d||k.array.defaultCompare;k.array.sort(a,function(a,d){return e(a[c],d[c])})};k.array.isSorted=function(a){for(var c=k.array.defaultCompare,d=1;d<a.length;d++)if(0<c(a[d-1],a[d]))return!1;return!0};
k.array.equals=function(a,c,d){if(!k.isArrayLike(a)||!k.isArrayLike(c)||a.length!=c.length)return!1;var e=a.length;d=d||k.array.defaultCompareEquality;for(var f=0;f<e;f++)if(!d(a[f],c[f]))return!1;return!0};k.array.compare3=function(a,c,d){d=d||k.array.defaultCompare;for(var e=Math.min(a.length,c.length),f=0;f<e;f++){var g=d(a[f],c[f]);if(0!=g)return g}return k.array.defaultCompare(a.length,c.length)};k.array.defaultCompare=function(a,c){return a>c?1:a<c?-1:0};
k.array.defaultCompareEquality=function(a,c){return a===c};k.array.binaryInsert=function(a,c,d){d=k.array.binarySearch(a,c,d);return 0>d?(k.array.insertAt(a,c,-(d+1)),!0):!1};k.array.binaryRemove=function(a,c,d){c=k.array.binarySearch(a,c,d);return 0<=c?k.array.removeAt(a,c):!1};k.array.bucket=function(a,c,d){for(var e={},f=0;f<a.length;f++){var g=a[f],h=c.call(d,g,f,a);k.isDef(h)&&(e[h]||(e[h]=[])).push(g)}return e};
k.array.toObject=function(a,c,d){var e={};k.array.forEach(a,function(f,g){e[c.call(d,f,g,a)]=f});return e};k.array.range=function(a,c,d){var e=[],f=0,g=a;d=d||1;void 0!==c&&(f=a,g=c);if(0>d*(g-f))return[];if(0<d)for(a=f;a<g;a+=d)e.push(a);else for(a=f;a>g;a+=d)e.push(a);return e};k.array.repeat=function(a,c){for(var d=[],e=0;e<c;e++)d[e]=a;return d};k.array.flatten=function(a){for(var c=[],d=0;d<arguments.length;d++){var e=arguments[d];k.isArray(e)?c.push.apply(c,k.array.flatten.apply(null,e)):c.push(e)}return c};
k.array.rotate=function(a,c){k.asserts.assert(null!=a.length);a.length&&(c%=a.length,0<c?k.array.ARRAY_PROTOTYPE_.unshift.apply(a,a.splice(-c,c)):0>c&&k.array.ARRAY_PROTOTYPE_.push.apply(a,a.splice(0,-c)));return a};k.array.moveItem=function(a,c,d){k.asserts.assert(0<=c&&c<a.length);k.asserts.assert(0<=d&&d<a.length);c=k.array.ARRAY_PROTOTYPE_.splice.call(a,c,1);k.array.ARRAY_PROTOTYPE_.splice.call(a,d,0,c[0])};
k.array.zip=function(a){if(!arguments.length)return[];for(var c=[],d=0;;d++){for(var e=[],f=0;f<arguments.length;f++){var g=arguments[f];if(d>=g.length)return c;e.push(g[d])}c.push(e)}};k.array.shuffle=function(a,c){for(var d=c||Math.random,e=a.length-1;0<e;e--){var f=Math.floor(d()*(e+1)),g=a[e];a[e]=a[f];a[f]=g}};k.functions={};k.functions.constant=function(a){return function(){return a}};k.functions.FALSE=k.functions.constant(!1);k.functions.TRUE=k.functions.constant(!0);k.functions.NULL=k.functions.constant(null);k.functions.identity=function(a){return a};k.functions.error=function(a){return function(){throw Error(a);}};k.functions.fail=function(a){return function(){throw a;}};k.functions.lock=function(a,c){c=c||0;return function(){return a.apply(this,Array.prototype.slice.call(arguments,0,c))}};
k.functions.nth=function(a){return function(){return arguments[a]}};k.functions.withReturnValue=function(a,c){return k.functions.sequence(a,k.functions.constant(c))};k.functions.compose=function(a,c){var d=arguments,e=d.length;return function(){var a;e&&(a=d[e-1].apply(this,arguments));for(var c=e-2;0<=c;c--)a=d[c].call(this,a);return a}};k.functions.sequence=function(a){var c=arguments,d=c.length;return function(){for(var a,f=0;f<d;f++)a=c[f].apply(this,arguments);return a}};
k.functions.and=function(a){var c=arguments,d=c.length;return function(){for(var a=0;a<d;a++)if(!c[a].apply(this,arguments))return!1;return!0}};k.functions.or=function(a){var c=arguments,d=c.length;return function(){for(var a=0;a<d;a++)if(c[a].apply(this,arguments))return!0;return!1}};k.functions.not=function(a){return function(){return!a.apply(this,arguments)}};k.functions.create=function(a,c){var d=function(){};d.prototype=a.prototype;d=new d;a.apply(d,Array.prototype.slice.call(arguments,1));return d};
k.functions.CACHE_RETURN_VALUE=!0;k.functions.cacheReturnValue=function(a){var c=!1,d;return function(){if(!k.functions.CACHE_RETURN_VALUE)return a();c||(d=a(),c=!0);return d}};k.math={};k.math.randomInt=function(){return Math.floor(Math.random()*k.craw.AppWindow.NETWORK_TEST_URLS_.length)};k.math.uniformRandom=function(a,c){return a+Math.random()*(c-a)};k.math.clamp=function(a,c,d){return Math.min(Math.max(a,c),d)};k.math.modulo=function(a){a%=360;return 0>360*a?a+360:a};k.math.lerp=function(a,c,d){return a+d*(c-a)};k.math.nearlyEquals=function(a,c,d){return Math.abs(a-c)<=(d||1E-6)};k.math.standardAngle=function(a){return k.math.modulo(a)};
k.math.toRadians=function(a){return a*Math.PI/180};k.math.toDegrees=function(a){return 180*a/Math.PI};k.math.angleDx=function(a,c){return c*Math.cos(k.math.toRadians(a))};k.math.angleDy=function(a,c){return c*Math.sin(k.math.toRadians(a))};k.math.angle=function(a,c){return k.math.standardAngle(k.math.toDegrees(Math.atan2(c-0,a-0)))};k.math.angleDifference=function(a,c){var d=k.math.standardAngle(c)-k.math.standardAngle(a);180<d?d-=360:-180>=d&&(d=360+d);return d};
k.math.sign=function(a){return 0==a?0:0>a?-1:1};k.math.longestCommonSubsequence=function(a,c,d,e){d=d||function(a,c){return a==c};e=e||function(c){return a[c]};for(var f=a.length,g=c.length,h=[],l=0;l<f+1;l++)h[l]=[],h[l][0]=0;for(var m=0;m<g+1;m++)h[0][m]=0;for(l=1;l<=f;l++)for(m=1;m<=g;m++)d(a[l-1],c[m-1])?h[l][m]=h[l-1][m-1]+1:h[l][m]=Math.max(h[l-1][m],h[l][m-1]);for(var p=[],l=f,m=g;0<l&&0<m;)d(a[l-1],c[m-1])?(p.unshift(e(l-1,m-1)),l--,m--):h[l-1][m]>h[l][m-1]?l--:m--;return p};
k.math.sum=function(a){return k.array.reduce(arguments,function(a,d){return a+d},0)};k.math.average=function(a){return k.math.sum.apply(null,arguments)/arguments.length};k.math.sampleVariance=function(a){var c=arguments.length;if(2>c)return 0;var d=k.math.average.apply(null,arguments);return k.math.sum.apply(null,k.array.map(arguments,function(a){return Math.pow(a-d,2)}))/(c-1)};k.math.standardDeviation=function(a){return Math.sqrt(k.math.sampleVariance.apply(null,arguments))};
k.math.isInt=function(a){return isFinite(a)&&0==a%1};k.math.isFiniteNumber=function(a){return isFinite(a)&&!isNaN(a)};k.math.safeFloor=function(a,c){k.asserts.assert(!k.isDef(c)||0<c);return Math.floor(a+(c||2E-15))};k.math.safeCeil=function(a,c){k.asserts.assert(!k.isDef(c)||0<c);return Math.ceil(a-(c||2E-15))};k.iter={};k.iter.StopIteration="StopIteration"in k.global?k.global.StopIteration:Error("StopIteration");k.iter.Iterator=function(){};k.iter.Iterator.prototype.next=function(){throw k.iter.StopIteration;};k.iter.Iterator.prototype.__iterator__=function(){return this};
k.iter.toIterator=function(a){if(a instanceof k.iter.Iterator)return a;if("function"==typeof a.__iterator__)return a.__iterator__(!1);if(k.isArrayLike(a)){var c=0,d=new k.iter.Iterator;d.next=function(){for(;;){if(c>=a.length)throw k.iter.StopIteration;if(c in a)return a[c++];c++}};return d}throw Error("Not implemented");};
k.iter.forEach=function(a,c,d){if(k.isArrayLike(a))try{k.array.forEach(a,c,d)}catch(e){if(e!==k.iter.StopIteration)throw e;}else{a=k.iter.toIterator(a);try{for(;;)c.call(d,a.next(),void 0,a)}catch(f){if(f!==k.iter.StopIteration)throw f;}}};k.iter.filter=function(a,c,d){var e=k.iter.toIterator(a);a=new k.iter.Iterator;a.next=function(){for(;;){var a=e.next();if(c.call(d,a,void 0,e))return a}};return a};
k.iter.range=function(a,c,d){var e=0,f=a,g=d||1;1<arguments.length&&(e=a,f=c);if(0==g)throw Error("Range step argument must not be zero");var h=new k.iter.Iterator;h.next=function(){if(0<g&&e>=f||0>g&&e<=f)throw k.iter.StopIteration;var a=e;e+=g;return a};return h};k.iter.join=function(a,c){return k.iter.toArray(a).join(c)};k.iter.map=function(a,c,d){var e=k.iter.toIterator(a);a=new k.iter.Iterator;a.next=function(){for(;;){var a=e.next();return c.call(d,a,void 0,e)}};return a};
k.iter.reduce=function(a,c,d,e){var f=d;k.iter.forEach(a,function(a){f=c.call(e,f,a)});return f};k.iter.some=function(a,c,d){a=k.iter.toIterator(a);try{for(;;)if(c.call(d,a.next(),void 0,a))return!0}catch(e){if(e!==k.iter.StopIteration)throw e;}return!1};k.iter.every=function(a,c,d){a=k.iter.toIterator(a);try{for(;;)if(!c.call(d,a.next(),void 0,a))return!1}catch(e){if(e!==k.iter.StopIteration)throw e;}return!0};
k.iter.chain=function(a){var c=k.iter.toIterator(arguments),d=new k.iter.Iterator,e=null;d.next=function(){for(;;){if(null==e){var a=c.next();e=k.iter.toIterator(a)}try{return e.next()}catch(d){if(d!==k.iter.StopIteration)throw d;e=null}}};return d};k.iter.chainFromIterable=function(a){return k.iter.chain.apply(void 0,a)};
k.iter.dropWhile=function(a,c,d){var e=k.iter.toIterator(a);a=new k.iter.Iterator;var f=!0;a.next=function(){for(;;){var a=e.next();if(!f||!c.call(d,a,void 0,e))return f=!1,a}};return a};k.iter.takeWhile=function(a,c,d){var e=k.iter.toIterator(a);a=new k.iter.Iterator;var f=!0;a.next=function(){for(;;)if(f){var a=e.next();if(c.call(d,a,void 0,e))return a;f=!1}else throw k.iter.StopIteration;};return a};
k.iter.toArray=function(a){if(k.isArrayLike(a))return k.array.toArray(a);a=k.iter.toIterator(a);var c=[];k.iter.forEach(a,function(a){c.push(a)});return c};k.iter.equals=function(a,c){var d=k.iter.zipLongest({},a,c);return k.iter.every(d,function(a){return a[0]==a[1]})};k.iter.nextOrValue=function(a){try{k.iter.toIterator(a).next()}catch(c){if(c!=k.iter.StopIteration)throw c;}};
k.iter.product=function(a){if(k.array.some(arguments,function(a){return!a.length})||!arguments.length)return new k.iter.Iterator;var c=new k.iter.Iterator,d=arguments,e=k.array.repeat(0,d.length);c.next=function(){if(e){for(var a=k.array.map(e,function(a,c){return d[c][a]}),c=e.length-1;0<=c;c--){k.asserts.assert(e);if(e[c]<d[c].length-1){e[c]++;break}if(0==c){e=null;break}e[c]=0}return a}throw k.iter.StopIteration;};return c};
k.iter.cycle=function(a){var c=k.iter.toIterator(a),d=[],e=0;a=new k.iter.Iterator;var f=!1;a.next=function(){var a=null;if(!f)try{return a=c.next(),d.push(a),a}catch(h){if(h!=k.iter.StopIteration||k.array.isEmpty(d))throw h;f=!0}a=d[e];e=(e+1)%d.length;return a};return a};k.iter.count=function(a,c){var d=a||0,e=k.isDef(c)?c:1,f=new k.iter.Iterator;f.next=function(){var a=d;d+=e;return a};return f};k.iter.repeat=function(a){var c=new k.iter.Iterator;c.next=k.functions.constant(a);return c};
k.iter.accumulate=function(a){var c=k.iter.toIterator(a),d=0;a=new k.iter.Iterator;a.next=function(){return d+=c.next()};return a};k.iter.zip=function(a){var c=arguments,d=new k.iter.Iterator;if(0<c.length){var e=k.array.map(c,k.iter.toIterator);d.next=function(){return k.array.map(e,function(a){return a.next()})}}return d};
k.iter.zipLongest=function(a,c){var d=k.array.slice(arguments,1),e=new k.iter.Iterator;if(0<d.length){var f=k.array.map(d,k.iter.toIterator);e.next=function(){var c=!1,d=k.array.map(f,function(d){var e;try{e=d.next(),c=!0}catch(f){if(f!==k.iter.StopIteration)throw f;e=a}return e});if(!c)throw k.iter.StopIteration;return d}}return e};k.iter.compress=function(a,c){var d=k.iter.toIterator(c);return k.iter.filter(a,function(){return!!d.next()})};
k.iter.GroupByIterator_=function(a,c){this.iterator=k.iter.toIterator(a);this.keyFunc=c||k.functions.identity};k.inherits(k.iter.GroupByIterator_,k.iter.Iterator);
k.iter.GroupByIterator_.prototype.next=function(){for(;this.currentKey==this.targetKey;)this.currentValue=this.iterator.next(),this.currentKey=this.keyFunc(this.currentValue);for(var a=this.targetKey=this.currentKey,c=this.targetKey,d=[];this.currentKey==c;){d.push(this.currentValue);try{this.currentValue=this.iterator.next()}catch(e){if(e!==k.iter.StopIteration)throw e;break}this.currentKey=this.keyFunc(this.currentValue)}return[a,d]};
k.iter.groupBy=function(a,c){return new k.iter.GroupByIterator_(a,c)};k.iter.tee=function(a,c){var d=k.iter.toIterator(a),e=k.array.map(k.array.range(k.isNumber(c)?c:2),function(){return[]}),f=function(){var a=d.next();k.array.forEach(e,function(c){c.push(a)})};return k.array.map(e,function(a){var c=new k.iter.Iterator;c.next=function(){k.array.isEmpty(a)&&f();k.asserts.assert(!k.array.isEmpty(a));return a.shift()};return c})};k.iter.enumerate=function(a,c){return k.iter.zip(k.iter.count(c),a)};
k.iter.limit=function(a,c){k.asserts.assert(k.math.isInt(c)&&0<=c);var d=k.iter.toIterator(a),e=new k.iter.Iterator,f=c;e.next=function(){if(0<f--)return d.next();throw k.iter.StopIteration;};return e};k.iter.consume=function(a,c){k.asserts.assert(k.math.isInt(c)&&0<=c);for(var d=k.iter.toIterator(a);0<c--;)k.iter.nextOrValue(d);return d};
k.iter.slice=function(a,c,d){k.asserts.assert(k.math.isInt(c)&&0<=c);a=k.iter.consume(a,c);k.isNumber(d)&&(k.asserts.assert(k.math.isInt(d)&&d>=c),a=k.iter.limit(a,d-c));return a};k.iter.hasDuplicates_=function(a){var c=[];k.array.removeDuplicates(a,c);return a.length!=c.length};k.iter.permutations=function(a,c){var d=k.iter.toArray(a),d=k.array.repeat(d,k.isNumber(c)?c:d.length),d=k.iter.product.apply(void 0,d);return k.iter.filter(d,function(a){return!k.iter.hasDuplicates_(a)})};
k.iter.combinations=function(a,c){function d(a){return e[a]}var e=k.iter.toArray(a),f=k.iter.range(e.length),f=k.iter.permutations(f,c),g=k.iter.filter(f,function(a){return k.array.isSorted(a)}),f=new k.iter.Iterator;f.next=function(){return k.array.map(g.next(),d)};return f};
k.iter.combinationsWithReplacement=function(a,c){function d(a){return e[a]}var e=k.iter.toArray(a),f=k.array.range(e.length),f=k.array.repeat(f,c),f=k.iter.product.apply(void 0,f),g=k.iter.filter(f,function(a){return k.array.isSorted(a)}),f=new k.iter.Iterator;f.next=function(){return k.array.map(g.next(),d)};return f};k.object={};k.object.forEach=function(a,c,d){for(var e in a)c.call(d,a[e],e,a)};k.object.filter=function(a,c,d){var e={},f;for(f in a)c.call(d,a[f],f,a)&&(e[f]=a[f]);return e};k.object.map=function(a,c,d){var e={},f;for(f in a)e[f]=c.call(d,a[f],f,a);return e};k.object.some=function(a,c,d){for(var e in a)if(c.call(d,a[e],e,a))return!0;return!1};k.object.every=function(a,c,d){for(var e in a)if(!c.call(d,a[e],e,a))return!1;return!0};k.object.getCount=function(a){var c=0,d;for(d in a)c++;return c};
k.object.getAnyKey=function(a){for(var c in a)return c};k.object.getAnyValue=function(a){for(var c in a)return a[c]};k.object.contains=function(a,c){return k.object.containsValue(a,c)};k.object.getValues=function(a){var c=[],d=0,e;for(e in a)c[d++]=a[e];return c};k.object.getKeys=function(a){var c=[],d=0,e;for(e in a)c[d++]=e;return c};k.object.getValueByKeys=function(a,c){for(var d=k.isArrayLike(c),e=d?c:arguments,d=d?0:1;d<e.length&&(a=a[e[d]],k.isDef(a));d++);return a};
k.object.containsKey=function(a,c){return c in a};k.object.containsValue=function(a,c){for(var d in a)if(a[d]==c)return!0;return!1};k.object.findKey=function(a,c,d){for(var e in a)if(c.call(d,a[e],e,a))return e};k.object.findValue=function(a,c,d){return(c=k.object.findKey(a,c,d))&&a[c]};k.object.isEmpty=function(a){for(var c in a)return!1;return!0};k.object.clear=function(a){for(var c in a)delete a[c]};k.object.remove=function(a,c){var d;(d=c in a)&&delete a[c];return d};
k.object.add=function(a,c,d){if(c in a)throw Error('The object already contains the key "'+c+'"');k.object.set(a,c,d)};k.object.get=function(a,c,d){return c in a?a[c]:d};k.object.set=function(a,c,d){a[c]=d};k.object.setIfUndefined=function(a,c,d){return c in a?a[c]:a[c]=d};k.object.clone=function(a){var c={},d;for(d in a)c[d]=a[d];return c};
k.object.unsafeClone=function(a){var c=k.typeOf(a);if("object"==c||"array"==c){if(a.clone)return a.clone();var c="array"==c?[]:{},d;for(d in a)c[d]=k.object.unsafeClone(a[d]);return c}return a};k.object.transpose=function(a){var c={},d;for(d in a)c[a[d]]=d;return c};k.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
k.object.extend=function(a,c){for(var d,e,f=1;f<arguments.length;f++){e=arguments[f];for(d in e)a[d]=e[d];for(var g=0;g<k.object.PROTOTYPE_FIELDS_.length;g++)d=k.object.PROTOTYPE_FIELDS_[g],Object.prototype.hasOwnProperty.call(e,d)&&(a[d]=e[d])}};k.object.create=function(a){var c=arguments.length;if(1==c&&k.isArray(arguments[0]))return k.object.create.apply(null,arguments[0]);if(c%2)throw Error("Uneven number of arguments");for(var d={},e=0;e<c;e+=2)d[arguments[e]]=arguments[e+1];return d};
k.object.createSet=function(a){var c=arguments.length;if(1==c&&k.isArray(arguments[0]))return k.object.createSet.apply(null,arguments[0]);for(var d={},e=0;e<c;e++)d[arguments[e]]=!0;return d};k.object.createImmutableView=function(a){var c=a;Object.isFrozen&&!Object.isFrozen(a)&&(c=Object.create(a),Object.freeze(c));return c};k.object.isImmutableView=function(a){return!!Object.isFrozen&&Object.isFrozen(a)};k.structs={};k.structs.Map=function(a,c){this.map_={};this.keys_=[];this.version_=this.count_=0;var d=arguments.length;if(1<d){if(d%2)throw Error("Uneven number of arguments");for(var e=0;e<d;e+=2)this.set(arguments[e],arguments[e+1])}else a&&this.addAll(a)};b=k.structs.Map.prototype;b.getCount=function(){return this.count_};b.getValues=function(){r(this);for(var a=[],c=0;c<this.keys_.length;c++)a.push(this.map_[this.keys_[c]]);return a};b.getKeys=function(){r(this);return this.keys_.concat()};
b.containsKey=function(a){return k.structs.Map.hasKey_(this.map_,a)};b.containsValue=function(a){for(var c=0;c<this.keys_.length;c++){var d=this.keys_[c];if(k.structs.Map.hasKey_(this.map_,d)&&this.map_[d]==a)return!0}return!1};b.equals=function(a,c){if(this===a)return!0;if(this.count_!=a.getCount())return!1;var d=c||k.structs.Map.defaultEquals;r(this);for(var e,f=0;e=this.keys_[f];f++)if(!d(this.get(e),a.get(e)))return!1;return!0};k.structs.Map.defaultEquals=function(a,c){return a===c};
k.structs.Map.prototype.isEmpty=function(){return 0==this.count_};k.structs.Map.prototype.clear=function(){this.map_={};this.version_=this.count_=this.keys_.length=0};k.structs.Map.prototype.remove=function(a){return k.structs.Map.hasKey_(this.map_,a)?(delete this.map_[a],this.count_--,this.version_++,this.keys_.length>2*this.count_&&r(this),!0):!1};
var r=function(a){if(a.count_!=a.keys_.length){for(var c=0,d=0;c<a.keys_.length;){var e=a.keys_[c];k.structs.Map.hasKey_(a.map_,e)&&(a.keys_[d++]=e);c++}a.keys_.length=d}if(a.count_!=a.keys_.length){for(var f={},d=c=0;c<a.keys_.length;)e=a.keys_[c],k.structs.Map.hasKey_(f,e)||(a.keys_[d++]=e,f[e]=1),c++;a.keys_.length=d}};b=k.structs.Map.prototype;b.get=function(a,c){return k.structs.Map.hasKey_(this.map_,a)?this.map_[a]:c};
b.set=function(a,c){k.structs.Map.hasKey_(this.map_,a)||(this.count_++,this.keys_.push(a),this.version_++);this.map_[a]=c};b.addAll=function(a){var c;a instanceof k.structs.Map?(c=a.getKeys(),a=a.getValues()):(c=k.object.getKeys(a),a=k.object.getValues(a));for(var d=0;d<c.length;d++)this.set(c[d],a[d])};b.clone=function(){return new k.structs.Map(this)};b.transpose=function(){for(var a=new k.structs.Map,c=0;c<this.keys_.length;c++){var d=this.keys_[c];a.set(this.map_[d],d)}return a};
b.toObject=function(){r(this);for(var a={},c=0;c<this.keys_.length;c++){var d=this.keys_[c];a[d]=this.map_[d]}return a};b.__iterator__=function(a){r(this);var c=0,d=this.keys_,e=this.map_,f=this.version_,g=this,h=new k.iter.Iterator;h.next=function(){for(;;){if(f!=g.version_)throw Error("The map has changed since the iterator was created");if(c>=d.length)throw k.iter.StopIteration;var h=d[c++];return a?h:e[h]}};return h};
k.structs.Map.hasKey_=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)};k.structs.getCount=function(a){return"function"==typeof a.getCount?a.getCount():k.isArrayLike(a)||k.isString(a)?a.length:k.object.getCount(a)};k.structs.getValues=function(a){if("function"==typeof a.getValues)return a.getValues();if(k.isString(a))return a.split("");if(k.isArrayLike(a)){for(var c=[],d=a.length,e=0;e<d;e++)c.push(a[e]);return c}return k.object.getValues(a)};
k.structs.getKeys=function(a){if("function"==typeof a.getKeys)return a.getKeys();if("function"!=typeof a.getValues){if(k.isArrayLike(a)||k.isString(a)){var c=[];a=a.length;for(var d=0;d<a;d++)c.push(d);return c}return k.object.getKeys(a)}};k.structs.contains=function(a,c){return"function"==typeof a.contains?a.contains(c):"function"==typeof a.containsValue?a.containsValue(c):k.isArrayLike(a)||k.isString(a)?k.array.contains(a,c):k.object.containsValue(a,c)};
k.structs.isEmpty=function(a){return"function"==typeof a.isEmpty?a.isEmpty():k.isArrayLike(a)||k.isString(a)?k.array.isEmpty(a):k.object.isEmpty(a)};k.structs.clear=function(a){"function"==typeof a.clear?a.clear():k.isArrayLike(a)?k.array.clear(a):k.object.clear(a)};
k.structs.forEach=function(a,c,d){if("function"==typeof a.forEach)a.forEach(c,d);else if(k.isArrayLike(a)||k.isString(a))k.array.forEach(a,c,d);else for(var e=k.structs.getKeys(a),f=k.structs.getValues(a),g=f.length,h=0;h<g;h++)c.call(d,f[h],e&&e[h],a)};
k.structs.filter=function(a,c,d){if("function"==typeof a.filter)return a.filter(c,d);if(k.isArrayLike(a)||k.isString(a))return k.array.filter(a,c,d);var e,f=k.structs.getKeys(a),g=k.structs.getValues(a),h=g.length;if(f){e={};for(var l=0;l<h;l++)c.call(d,g[l],f[l],a)&&(e[f[l]]=g[l])}else for(e=[],l=0;l<h;l++)c.call(d,g[l],void 0,a)&&e.push(g[l]);return e};
k.structs.map=function(a,c,d){if("function"==typeof a.map)return a.map(c,d);if(k.isArrayLike(a)||k.isString(a))return k.array.map(a,c,d);var e,f=k.structs.getKeys(a),g=k.structs.getValues(a),h=g.length;if(f){e={};for(var l=0;l<h;l++)e[f[l]]=c.call(d,g[l],f[l],a)}else for(e=[],l=0;l<h;l++)e[l]=c.call(d,g[l],void 0,a);return e};
k.structs.some=function(a,c,d){if("function"==typeof a.some)return a.some(c,d);if(k.isArrayLike(a)||k.isString(a))return k.array.some(a,c,d);for(var e=k.structs.getKeys(a),f=k.structs.getValues(a),g=f.length,h=0;h<g;h++)if(c.call(d,f[h],e&&e[h],a))return!0;return!1};
k.structs.every=function(a,c,d){if("function"==typeof a.every)return a.every(c,d);if(k.isArrayLike(a)||k.isString(a))return k.array.every(a,c,d);for(var e=k.structs.getKeys(a),f=k.structs.getValues(a),g=f.length,h=0;h<g;h++)if(!c.call(d,f[h],e&&e[h],a))return!1;return!0};k.userAgent={};k.userAgent.ASSUME_IE=!1;k.userAgent.ASSUME_GECKO=!1;k.userAgent.ASSUME_WEBKIT=!1;k.userAgent.ASSUME_MOBILE_WEBKIT=!1;k.userAgent.ASSUME_OPERA=!1;k.userAgent.ASSUME_ANY_VERSION=!1;k.userAgent.BROWSER_KNOWN_=k.userAgent.ASSUME_IE||k.userAgent.ASSUME_GECKO||k.userAgent.ASSUME_MOBILE_WEBKIT||k.userAgent.ASSUME_WEBKIT||k.userAgent.ASSUME_OPERA;k.userAgent.getUserAgentString=function(){return k.global.navigator?k.global.navigator.userAgent:null};k.userAgent.getNavigator=function(){return k.global.navigator};
k.userAgent.init_=function(){k.userAgent.detectedOpera_=!1;k.userAgent.detectedIe_=!1;k.userAgent.detectedWebkit_=!1;k.userAgent.detectedMobile_=!1;k.userAgent.detectedGecko_=!1;var a;if(!k.userAgent.BROWSER_KNOWN_&&(a=k.userAgent.getUserAgentString())){var c=k.userAgent.getNavigator();k.userAgent.detectedOpera_=k.string.startsWith(a,"Opera");k.userAgent.detectedIe_=!k.userAgent.detectedOpera_&&(k.string.contains(a,"MSIE")||k.string.contains(a,"Trident"));k.userAgent.detectedWebkit_=!k.userAgent.detectedOpera_&&
k.string.contains(a,"WebKit");k.userAgent.detectedMobile_=k.userAgent.detectedWebkit_&&k.string.contains(a,"Mobile");k.userAgent.detectedGecko_=!k.userAgent.detectedOpera_&&!k.userAgent.detectedWebkit_&&!k.userAgent.detectedIe_&&"Gecko"==c.product}};k.userAgent.BROWSER_KNOWN_||k.userAgent.init_();k.userAgent.OPERA=k.userAgent.BROWSER_KNOWN_?k.userAgent.ASSUME_OPERA:k.userAgent.detectedOpera_;k.userAgent.IE=k.userAgent.BROWSER_KNOWN_?k.userAgent.ASSUME_IE:k.userAgent.detectedIe_;
k.userAgent.GECKO=k.userAgent.BROWSER_KNOWN_?k.userAgent.ASSUME_GECKO:k.userAgent.detectedGecko_;k.userAgent.WEBKIT=k.userAgent.BROWSER_KNOWN_?k.userAgent.ASSUME_WEBKIT||k.userAgent.ASSUME_MOBILE_WEBKIT:k.userAgent.detectedWebkit_;k.userAgent.MOBILE=k.userAgent.ASSUME_MOBILE_WEBKIT||k.userAgent.detectedMobile_;k.userAgent.SAFARI=k.userAgent.WEBKIT;k.userAgent.determinePlatform_=function(){var a=k.userAgent.getNavigator();return a&&a.platform||""};k.userAgent.PLATFORM=k.userAgent.determinePlatform_();
k.userAgent.ASSUME_MAC=!1;k.userAgent.ASSUME_WINDOWS=!1;k.userAgent.ASSUME_LINUX=!1;k.userAgent.ASSUME_X11=!1;k.userAgent.ASSUME_ANDROID=!1;k.userAgent.ASSUME_IPHONE=!1;k.userAgent.ASSUME_IPAD=!1;k.userAgent.PLATFORM_KNOWN_=k.userAgent.ASSUME_MAC||k.userAgent.ASSUME_WINDOWS||k.userAgent.ASSUME_LINUX||k.userAgent.ASSUME_X11||k.userAgent.ASSUME_ANDROID||k.userAgent.ASSUME_IPHONE||k.userAgent.ASSUME_IPAD;
k.userAgent.initPlatform_=function(){k.userAgent.detectedMac_=k.string.contains(k.userAgent.PLATFORM,"Mac");k.userAgent.detectedWindows_=k.string.contains(k.userAgent.PLATFORM,"Win");k.userAgent.detectedLinux_=k.string.contains(k.userAgent.PLATFORM,"Linux");k.userAgent.detectedX11_=!!k.userAgent.getNavigator()&&k.string.contains(k.userAgent.getNavigator().appVersion||"","X11");var a=k.userAgent.getUserAgentString();k.userAgent.detectedAndroid_=!!a&&k.string.contains(a,"Android");k.userAgent.detectedIPhone_=
!!a&&k.string.contains(a,"iPhone");k.userAgent.detectedIPad_=!!a&&k.string.contains(a,"iPad")};k.userAgent.PLATFORM_KNOWN_||k.userAgent.initPlatform_();k.userAgent.MAC=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_MAC:k.userAgent.detectedMac_;k.userAgent.WINDOWS=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_WINDOWS:k.userAgent.detectedWindows_;k.userAgent.LINUX=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_LINUX:k.userAgent.detectedLinux_;
k.userAgent.X11=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_X11:k.userAgent.detectedX11_;k.userAgent.ANDROID=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_ANDROID:k.userAgent.detectedAndroid_;k.userAgent.IPHONE=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_IPHONE:k.userAgent.detectedIPhone_;k.userAgent.IPAD=k.userAgent.PLATFORM_KNOWN_?k.userAgent.ASSUME_IPAD:k.userAgent.detectedIPad_;
k.userAgent.determineVersion_=function(){var a="",c;k.userAgent.OPERA&&k.global.opera?(a=k.global.opera.version,a="function"==typeof a?a():a):(k.userAgent.GECKO?c=/rv\:([^\);]+)(\)|;)/:k.userAgent.IE?c=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:k.userAgent.WEBKIT&&(c=/WebKit\/(\S+)/),c&&(a=(a=c.exec(k.userAgent.getUserAgentString()))?a[1]:""));return k.userAgent.IE&&(c=k.userAgent.getDocumentMode_(),c>parseFloat(a))?String(c):a};
k.userAgent.getDocumentMode_=function(){var a=k.global.document;return a?a.documentMode:void 0};k.userAgent.VERSION=k.userAgent.determineVersion_();k.userAgent.compare=function(a,c){return k.string.compareVersions(a,c)};k.userAgent.isVersionOrHigherCache_={};k.userAgent.isVersionOrHigher=function(a){return k.userAgent.ASSUME_ANY_VERSION||k.userAgent.isVersionOrHigherCache_[a]||(k.userAgent.isVersionOrHigherCache_[a]=0<=k.string.compareVersions(k.userAgent.VERSION,a))};k.userAgent.isVersion=k.userAgent.isVersionOrHigher;
k.userAgent.isDocumentModeOrHigher=function(a){return k.userAgent.IE&&k.userAgent.DOCUMENT_MODE>=a};k.userAgent.isDocumentMode=k.userAgent.isDocumentModeOrHigher;var s=k.global.document;k.userAgent.DOCUMENT_MODE=s&&k.userAgent.IE?k.userAgent.getDocumentMode_()||("CSS1Compat"==s.compatMode?parseInt(k.userAgent.VERSION,10):5):void 0;k.uri={};k.uri.utils={};k.uri.utils.CharCode_={AMPERSAND:38,EQUAL:61,HASH:35,QUESTION:63};k.uri.utils.buildFromEncodedParts=function(a,c,d,e,f,g,h){var l="";a&&(l+=a+":");d&&(l+="//",c&&(l+=c+"@"),l+=d,e&&(l+=":"+e));f&&(l+=f);g&&(l+="?"+g);h&&(l+="#"+h);return l};k.uri.utils.splitRe_=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");k.uri.utils.ComponentIndex={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};
k.uri.utils.split=function(a){k.uri.utils.phishingProtection_();return a.match(k.uri.utils.splitRe_)};k.uri.utils.needsPhishingProtection_=k.userAgent.WEBKIT;k.uri.utils.phishingProtection_=function(){if(k.uri.utils.needsPhishingProtection_){k.uri.utils.needsPhishingProtection_=!1;var a=k.global.location;if(a){var c=a.href;if(c&&(c=k.uri.utils.getDomain(c))&&c!=a.hostname)throw k.uri.utils.needsPhishingProtection_=!0,Error();}}};k.uri.utils.decodeIfPossible_=function(a){return a&&decodeURIComponent(a)};
k.uri.utils.getComponentByIndex_=function(a,c){return k.uri.utils.split(c)[a]||null};k.uri.utils.getScheme=function(a){return k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.SCHEME,a)};k.uri.utils.getEffectiveScheme=function(a){a=k.uri.utils.getScheme(a);!a&&self.location&&(a=self.location.protocol,a=a.substr(0,a.length-1));return a?a.toLowerCase():""};k.uri.utils.getUserInfoEncoded=function(a){return k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.USER_INFO,a)};
k.uri.utils.getUserInfo=function(a){return k.uri.utils.decodeIfPossible_(k.uri.utils.getUserInfoEncoded(a))};k.uri.utils.getDomainEncoded=function(a){return k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.DOMAIN,a)};k.uri.utils.getDomain=function(a){return k.uri.utils.decodeIfPossible_(k.uri.utils.getDomainEncoded(a))};k.uri.utils.getPort=function(a){return Number(k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.PORT,a))||null};
k.uri.utils.getPathEncoded=function(a){return k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.PATH,a)};k.uri.utils.getPath=function(a){return k.uri.utils.decodeIfPossible_(k.uri.utils.getPathEncoded(a))};k.uri.utils.getQueryData=function(a){return k.uri.utils.getComponentByIndex_(k.uri.utils.ComponentIndex.QUERY_DATA,a)};k.uri.utils.getFragmentEncoded=function(a){var c=a.indexOf("#");return 0>c?null:a.substr(c+1)};
k.uri.utils.setFragmentEncoded=function(a,c){return k.uri.utils.removeFragment(a)+(c?"#"+c:"")};k.uri.utils.getFragment=function(a){return k.uri.utils.decodeIfPossible_(k.uri.utils.getFragmentEncoded(a))};k.uri.utils.getHost=function(a){a=k.uri.utils.split(a);return k.uri.utils.buildFromEncodedParts(a[k.uri.utils.ComponentIndex.SCHEME],a[k.uri.utils.ComponentIndex.USER_INFO],a[k.uri.utils.ComponentIndex.DOMAIN],a[k.uri.utils.ComponentIndex.PORT])};
k.uri.utils.getPathAndAfter=function(a){a=k.uri.utils.split(a);return k.uri.utils.buildFromEncodedParts(null,null,null,null,a[k.uri.utils.ComponentIndex.PATH],a[k.uri.utils.ComponentIndex.QUERY_DATA],a[k.uri.utils.ComponentIndex.FRAGMENT])};k.uri.utils.removeFragment=function(a){var c=a.indexOf("#");return 0>c?a:a.substr(0,c)};
k.uri.utils.haveSameDomain=function(a,c){var d=k.uri.utils.split(a),e=k.uri.utils.split(c);return d[k.uri.utils.ComponentIndex.DOMAIN]==e[k.uri.utils.ComponentIndex.DOMAIN]&&d[k.uri.utils.ComponentIndex.SCHEME]==e[k.uri.utils.ComponentIndex.SCHEME]&&d[k.uri.utils.ComponentIndex.PORT]==e[k.uri.utils.ComponentIndex.PORT]};
k.uri.utils.assertNoFragmentsOrQueries_=function(a){if(k.DEBUG&&(0<=a.indexOf("#")||0<=a.indexOf("?")))throw Error("goog.uri.utils: Fragment or query identifiers are not supported: ["+a+"]");};k.uri.utils.appendQueryData_=function(a){if(a[1]){var c=a[0],d=c.indexOf("#");0<=d&&(a.push(c.substr(d)),a[0]=c=c.substr(0,d));d=c.indexOf("?");0>d?a[1]="?":d==c.length-1&&(a[1]=void 0)}return a.join("")};
k.uri.utils.appendKeyValuePairs_=function(a,c,d){if(k.isArray(c)){k.asserts.assertArray(c);for(var e=0;e<c.length;e++)k.uri.utils.appendKeyValuePairs_(a,String(c[e]),d)}else null!=c&&d.push("&",a,""===c?"":"=",k.string.urlEncode(c))};k.uri.utils.buildQueryDataBuffer_=function(a,c,d){k.asserts.assert(0==Math.max(c.length-(d||0),0)%2,"goog.uri.utils: Key/value lists must be even in length.");for(d=d||0;d<c.length;d+=2)k.uri.utils.appendKeyValuePairs_(c[d],c[d+1],a);return a};
k.uri.utils.buildQueryData=function(a,c){var d=k.uri.utils.buildQueryDataBuffer_([],a,c);d[0]="";return d.join("")};k.uri.utils.buildQueryDataBufferFromMap_=function(a,c){for(var d in c)k.uri.utils.appendKeyValuePairs_(d,c[d],a);return a};k.uri.utils.buildQueryDataFromMap=function(a){a=k.uri.utils.buildQueryDataBufferFromMap_([],a);a[0]="";return a.join("")};
k.uri.utils.appendParams=function(a,c){return k.uri.utils.appendQueryData_(2==arguments.length?k.uri.utils.buildQueryDataBuffer_([a],arguments[1],0):k.uri.utils.buildQueryDataBuffer_([a],arguments,1))};k.uri.utils.appendParamsFromMap=function(a,c){return k.uri.utils.appendQueryData_(k.uri.utils.buildQueryDataBufferFromMap_([a],c))};k.uri.utils.appendParam=function(a,c,d){a=[a,"&",c];k.isDefAndNotNull(d)&&a.push("=",k.string.urlEncode(d));return k.uri.utils.appendQueryData_(a)};
k.uri.utils.findParam_=function(a,c,d,e){for(var f=d.length;0<=(c=a.indexOf(d,c))&&c<e;){var g=a.charCodeAt(c-1);if(g==k.uri.utils.CharCode_.AMPERSAND||g==k.uri.utils.CharCode_.QUESTION)if(g=a.charCodeAt(c+f),!g||g==k.uri.utils.CharCode_.EQUAL||g==k.uri.utils.CharCode_.AMPERSAND||g==k.uri.utils.CharCode_.HASH)return c;c+=f+1}return-1};k.uri.utils.hashOrEndRe_=/#|$/;k.uri.utils.hasParam=function(a,c){return 0<=k.uri.utils.findParam_(a,0,c,a.search(k.uri.utils.hashOrEndRe_))};
k.uri.utils.getParamValue=function(a,c){var d=a.search(k.uri.utils.hashOrEndRe_),e=k.uri.utils.findParam_(a,0,c,d);if(0>e)return null;var f=a.indexOf("&",e);if(0>f||f>d)f=d;e+=c.length+1;return k.string.urlDecode(a.substr(e,f-e))};k.uri.utils.getParamValues=function(a,c){for(var d=a.search(k.uri.utils.hashOrEndRe_),e=0,f,g=[];0<=(f=k.uri.utils.findParam_(a,e,c,d));){e=a.indexOf("&",f);if(0>e||e>d)e=d;f+=c.length+1;g.push(k.string.urlDecode(a.substr(f,e-f)))}return g};
k.uri.utils.trailingQueryPunctuationRe_=/[?&]($|#)/;k.uri.utils.removeParam=function(a,c){for(var d=a.search(k.uri.utils.hashOrEndRe_),e=0,f,g=[];0<=(f=k.uri.utils.findParam_(a,e,c,d));)g.push(a.substring(e,f)),e=Math.min(a.indexOf("&",f)+1||d,d);g.push(a.substr(e));return g.join("").replace(k.uri.utils.trailingQueryPunctuationRe_,"$1")};
k.uri.utils.setParam=function(a){var c=k.uri.utils.StandardQueryParam.RANDOM,d=k.string.getRandomString();return k.uri.utils.appendParam(k.uri.utils.removeParam(a,c),c,d)};k.uri.utils.appendPath=function(a,c){k.uri.utils.assertNoFragmentsOrQueries_(a);k.string.endsWith(a)&&(a=a.substr(0,a.length-1));k.string.startsWith(c,"/")&&(c=c.substr(1));return k.string.buildString(a,"/",c)};
k.uri.utils.setPath=function(a,c){k.string.startsWith(c,"/")||(c="/"+c);var d=k.uri.utils.split(a);return k.uri.utils.buildFromEncodedParts(d[k.uri.utils.ComponentIndex.SCHEME],d[k.uri.utils.ComponentIndex.USER_INFO],d[k.uri.utils.ComponentIndex.DOMAIN],d[k.uri.utils.ComponentIndex.PORT],c,d[k.uri.utils.ComponentIndex.QUERY_DATA],d[k.uri.utils.ComponentIndex.FRAGMENT])};k.uri.utils.StandardQueryParam={RANDOM:"zx"};k.uri.utils.makeUnique=function(a){return k.uri.utils.setParam(a)};k.Uri=function(a,c){var d;a instanceof k.Uri?(this.ignoreCase_=k.isDef(c)?c:a.ignoreCase_,t(this,a.getScheme()),w(this,a.getUserInfo()),x(this,a.getDomain()),y(this,a.getPort()),this.setPath(a.getPath()),z(this,a.getQueryData().clone()),A(this,a.getFragment())):a&&(d=k.uri.utils.split(String(a)))?(this.ignoreCase_=!!c,t(this,d[k.uri.utils.ComponentIndex.SCHEME]||"",!0),w(this,d[k.uri.utils.ComponentIndex.USER_INFO]||"",!0),x(this,d[k.uri.utils.ComponentIndex.DOMAIN]||"",!0),y(this,d[k.uri.utils.ComponentIndex.PORT]),
this.setPath(d[k.uri.utils.ComponentIndex.PATH]||"",!0),z(this,d[k.uri.utils.ComponentIndex.QUERY_DATA]||"",!0),A(this,d[k.uri.utils.ComponentIndex.FRAGMENT]||"",!0)):(this.ignoreCase_=!!c,this.queryData_=new k.Uri.QueryData(null,0,this.ignoreCase_))};k.Uri.preserveParameterTypesCompatibilityFlag=!1;k.Uri.RANDOM_PARAM=k.uri.utils.StandardQueryParam.RANDOM;b=k.Uri.prototype;b.scheme_="";b.userInfo_="";b.domain_="";b.port_=null;b.path_="";b.fragment_="";b.isReadOnly_=!1;b.ignoreCase_=!1;
b.toString=function(){var a=[],c=this.getScheme();c&&a.push(k.Uri.encodeSpecialChars_(c,k.Uri.reDisallowedInSchemeOrUserInfo_),":");if(c=this.getDomain()){a.push("//");var d=this.getUserInfo();d&&a.push(k.Uri.encodeSpecialChars_(d,k.Uri.reDisallowedInSchemeOrUserInfo_),"@");a.push(k.string.urlEncode(c));c=this.getPort();null!=c&&a.push(":",String(c))}if(c=this.getPath())this.domain_&&"/"!=c.charAt(0)&&a.push("/"),a.push(k.Uri.encodeSpecialChars_(c,"/"==c.charAt(0)?k.Uri.reDisallowedInAbsolutePath_:
k.Uri.reDisallowedInRelativePath_));(c=this.queryData_.toString())&&a.push("?",c);(c=this.getFragment())&&a.push("#",k.Uri.encodeSpecialChars_(c,k.Uri.reDisallowedInFragment_));return a.join("")};
b.resolve=function(a){var c=this.clone(),d=!!a.scheme_;d?t(c,a.getScheme()):d=!!a.userInfo_;d?w(c,a.getUserInfo()):d=!!a.domain_;d?x(c,a.getDomain()):d=null!=a.port_;var e=a.getPath();if(d)y(c,a.getPort());else if(d=!!a.path_){if("/"!=e.charAt(0))if(this.domain_&&!this.path_)e="/"+e;else{var f=c.getPath().lastIndexOf("/");-1!=f&&(e=c.getPath().substr(0,f+1)+e)}e=k.Uri.removeDotSegments(e)}d?c.setPath(e):d=""!==a.queryData_.toString();d?z(c,k.Uri.decodeOrEmpty_(a.queryData_.toString())):d=!!a.fragment_;
d&&A(c,a.getFragment());return c};b.clone=function(){return new k.Uri(this)};b.getScheme=function(){return this.scheme_};var t=function(a,c,d){B(a);a.scheme_=d?k.Uri.decodeOrEmpty_(c):c;a.scheme_&&(a.scheme_=a.scheme_.replace(/:$/,""))};k.Uri.prototype.getUserInfo=function(){return this.userInfo_};var w=function(a,c,d){B(a);a.userInfo_=d?k.Uri.decodeOrEmpty_(c):c};k.Uri.prototype.getDomain=function(){return this.domain_};var x=function(a,c,d){B(a);a.domain_=d?k.Uri.decodeOrEmpty_(c):c};
k.Uri.prototype.getPort=function(){return this.port_};var y=function(a,c){B(a);if(c){c=Number(c);if(isNaN(c)||0>c)throw Error("Bad port number "+c);a.port_=c}else a.port_=null};k.Uri.prototype.getPath=function(){return this.path_};k.Uri.prototype.setPath=function(a,c){B(this);this.path_=c?k.Uri.decodeOrEmpty_(a):a;return this};
var z=function(a,c,d){B(a);c instanceof k.Uri.QueryData?(a.queryData_=c,a.queryData_.setIgnoreCase(a.ignoreCase_)):(d||(c=k.Uri.encodeSpecialChars_(c,k.Uri.reDisallowedInQuery_)),a.queryData_=new k.Uri.QueryData(c,0,a.ignoreCase_))};k.Uri.prototype.getQueryData=function(){return this.queryData_};var C=function(a,c,d){B(a);a.queryData_.set(c,d)};k.Uri.prototype.getFragment=function(){return this.fragment_};var A=function(a,c,d){B(a);a.fragment_=d?k.Uri.decodeOrEmpty_(c):c};
k.Uri.prototype.makeUnique=function(){B(this);C(this,k.Uri.RANDOM_PARAM,k.string.getRandomString());return this};var B=function(a){if(a.isReadOnly_)throw Error("Tried to modify a read-only Uri");};k.Uri.prototype.setIgnoreCase=function(a){this.ignoreCase_=a;this.queryData_&&this.queryData_.setIgnoreCase(a);return this};k.Uri.parse=function(a,c){return a instanceof k.Uri?a.clone():new k.Uri(a,c)};
k.Uri.create=function(a,c,d,e,f,g,h,l){l=new k.Uri(null,l);a&&t(l,a);c&&w(l,c);d&&x(l,d);e&&y(l,e);f&&l.setPath(f);g&&z(l,g);h&&A(l,h);return l};k.Uri.resolve=function(a,c){a instanceof k.Uri||(a=k.Uri.parse(a));c instanceof k.Uri||(c=k.Uri.parse(c));return a.resolve(c)};
k.Uri.removeDotSegments=function(a){if(".."==a||"."==a)return"";if(k.string.contains(a,"./")||k.string.contains(a,"/.")){var c=k.string.startsWith(a,"/");a=a.split("/");for(var d=[],e=0;e<a.length;){var f=a[e++];"."==f?c&&e==a.length&&d.push(""):".."==f?((1<d.length||1==d.length&&""!=d[0])&&d.pop(),c&&e==a.length&&d.push("")):(d.push(f),c=!0)}return d.join("/")}return a};k.Uri.decodeOrEmpty_=function(a){return a?decodeURIComponent(a):""};
k.Uri.encodeSpecialChars_=function(a,c){return k.isString(a)?encodeURI(a).replace(c,k.Uri.encodeChar_):null};k.Uri.encodeChar_=function(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)};k.Uri.reDisallowedInSchemeOrUserInfo_=/[#\/\?@]/g;k.Uri.reDisallowedInRelativePath_=/[\#\?:]/g;k.Uri.reDisallowedInAbsolutePath_=/[\#\?]/g;k.Uri.reDisallowedInQuery_=/[\#\?@]/g;k.Uri.reDisallowedInFragment_=/#/g;
k.Uri.haveSameDomain=function(a,c){var d=k.uri.utils.split(a),e=k.uri.utils.split(c);return d[k.uri.utils.ComponentIndex.DOMAIN]==e[k.uri.utils.ComponentIndex.DOMAIN]&&d[k.uri.utils.ComponentIndex.PORT]==e[k.uri.utils.ComponentIndex.PORT]};k.Uri.QueryData=function(a,c,d){this.encodedQuery_=a||null;this.ignoreCase_=!!d};
var E=function(a){if(!a.keyMap_&&(a.keyMap_=new k.structs.Map,a.count_=0,a.encodedQuery_))for(var c=a.encodedQuery_.split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("="),f=null,g=null;0<=e?(f=c[d].substring(0,e),g=c[d].substring(e+1)):f=c[d];f=k.string.urlDecode(f);f=D(a,f);a.add(f,g?k.string.urlDecode(g):"")}};
k.Uri.QueryData.createFromMap=function(a,c,d){c=k.structs.getKeys(a);if("undefined"==typeof c)throw Error("Keys are undefined");d=new k.Uri.QueryData(null,0,d);a=k.structs.getValues(a);for(var e=0;e<c.length;e++){var f=c[e],g=a[e];k.isArray(g)?F(d,f,g):d.add(f,g)}return d};k.Uri.QueryData.createFromKeysValues=function(a,c,d,e){if(a.length!=c.length)throw Error("Mismatched lengths for keys/values");d=new k.Uri.QueryData(null,0,e);for(e=0;e<a.length;e++)d.add(a[e],c[e]);return d};b=k.Uri.QueryData.prototype;
b.keyMap_=null;b.count_=null;b.getCount=function(){E(this);return this.count_};b.add=function(a,c){E(this);this.encodedQuery_=null;a=D(this,a);var d=this.keyMap_.get(a);d||this.keyMap_.set(a,d=[]);d.push(c);this.count_++;return this};b.remove=function(a){E(this);a=D(this,a);return this.keyMap_.containsKey(a)?(this.encodedQuery_=null,this.count_-=this.keyMap_.get(a).length,this.keyMap_.remove(a)):!1};b.clear=function(){this.keyMap_=this.encodedQuery_=null;this.count_=0};
b.isEmpty=function(){E(this);return 0==this.count_};b.containsKey=function(a){E(this);a=D(this,a);return this.keyMap_.containsKey(a)};b.containsValue=function(a){var c=this.getValues();return k.array.contains(c,a)};b.getKeys=function(){E(this);for(var a=this.keyMap_.getValues(),c=this.keyMap_.getKeys(),d=[],e=0;e<c.length;e++)for(var f=a[e],g=0;g<f.length;g++)d.push(c[e]);return d};
b.getValues=function(a){E(this);var c=[];if(k.isString(a))this.containsKey(a)&&(c=k.array.concat(c,this.keyMap_.get(D(this,a))));else{a=this.keyMap_.getValues();for(var d=0;d<a.length;d++)c=k.array.concat(c,a[d])}return c};b.set=function(a,c){E(this);this.encodedQuery_=null;a=D(this,a);this.containsKey(a)&&(this.count_-=this.keyMap_.get(a).length);this.keyMap_.set(a,[c]);this.count_++;return this};
b.get=function(a,c){var d=a?this.getValues(a):[];return k.Uri.preserveParameterTypesCompatibilityFlag?0<d.length?d[0]:c:0<d.length?String(d[0]):c};var F=function(a,c,d){a.remove(c);0<d.length&&(a.encodedQuery_=null,a.keyMap_.set(D(a,c),k.array.clone(d)),a.count_+=d.length)};
k.Uri.QueryData.prototype.toString=function(){if(this.encodedQuery_)return this.encodedQuery_;if(!this.keyMap_)return"";for(var a=[],c=this.keyMap_.getKeys(),d=0;d<c.length;d++)for(var e=c[d],f=k.string.urlEncode(e),e=this.getValues(e),g=0;g<e.length;g++){var h=f;""!==e[g]&&(h+="="+k.string.urlEncode(e[g]));a.push(h)}return this.encodedQuery_=a.join("&")};
k.Uri.QueryData.prototype.clone=function(){var a=new k.Uri.QueryData;a.encodedQuery_=this.encodedQuery_;this.keyMap_&&(a.keyMap_=this.keyMap_.clone(),a.count_=this.count_);return a};var D=function(a,c){var d=String(c);a.ignoreCase_&&(d=d.toLowerCase());return d};k.Uri.QueryData.prototype.setIgnoreCase=function(a){a&&!this.ignoreCase_&&(E(this),this.encodedQuery_=null,k.structs.forEach(this.keyMap_,function(a,d){var e=d.toLowerCase();d!=e&&(this.remove(d),F(this,e,a))},this));this.ignoreCase_=a};
k.Uri.QueryData.prototype.extend=function(a){for(var c=0;c<arguments.length;c++)k.structs.forEach(arguments[c],function(a,c){this.add(c,a)},this)};var n={Errors:{}};n.Errors.ErrorTypes={MINT_JWT_ERROR:"MINT_JWT_ERROR",PURCHASE_CANCELED:"PURCHASE_CANCELED",GET_PURCHASES_ERROR:"GET_PURCHASES_ERROR",GET_SKU_DETAILS_ERROR:"GET_SKU_DETAILS_ERROR",ENV_NOT_SUPPORTED_ERROR:"ENV_NOT_SUPPORTED_ERROR",TOKEN_MISSING_ERROR:"TOKEN_MISSING_ERROR",INVALID_RESPONSE_ERROR:"INVALID_RESPONSE_ERROR"};n.Errors.getErrorResponse=function(a){return{request:{},response:{errorType:a}}};n.WebStoreService=function(a){this.baseUrl_=a||n.WebStoreService.Environment.SANDBOX;this.baseUrlAndPath_=this.baseUrl_+n.WebStoreService.WEB_STORE_REQUEST_PATH_};n.WebStoreService.Environment={PROD:"https://www.googleapis.com",SANDBOX:"https://www-googleapis-staging.sandbox.google.com"};n.WebStoreService.WEB_STORE_REQUEST_PATH_="/chromewebstore/v1.1";
var H=function(a,c,d,e,f,g,h,l,m,p){var K=d?d:"",v=l||"application/x-www-form-urlencoded",u=function(a,c){if(c&&200==a){var d=null;try{d=JSON.parse(c)}catch(e){g(n.Errors.ErrorTypes.INVALID_RESPONSE_ERROR);return}f(d)}else g(n.Errors.ErrorTypes.INVALID_RESPONSE_ERROR)},Q=function(G){G||g(n.Errors.ErrorTypes.TOKEN_MISSING_ERROR);var q=new XMLHttpRequest;q.open(e,c);q.setRequestHeader("Authorization","Bearer "+G);q.setRequestHeader("Content-Type",v);q.onreadystatechange=function(){4==q.readyState&&
(401==q.status&&G?chrome.identity.removeCachedAuthToken({token:G},function(){h?H(a,e,d,e,f,g,!1,l,m,p):(console.log(q),u(q.status,q.responseText))}):(console.log(q),u(q.status,q.responseText)))};q.send(K)};p?Q(p):chrome.identity.getAuthToken({interactive:m||!1},Q)};n.WebStoreService.prototype.onFailure_=function(a,c,d){a(n.Errors.getErrorResponse(d||c))};
var aa=function(a,c,d,e,f,g,h){c={hl:window.navigator.language,itemId:c,sku:d};h&&(c.gl=h);h=a.baseUrlAndPath_+"/payments/buy";f=k.bind(a.onFailure_,a,f,n.Errors.ErrorTypes.MINT_JWT_ERROR);H(a,h,JSON.stringify(c),"POST",function(a){e(a.jwt)},f,!0,"application/json",void 0,g)};k.math.Coordinate=function(a,c){this.x=k.isDef(a)?a:0;this.y=k.isDef(c)?c:0};k.math.Coordinate.prototype.clone=function(){return new k.math.Coordinate(this.x,this.y)};k.DEBUG&&(k.math.Coordinate.prototype.toString=function(){return"("+this.x+", "+this.y+")"});k.math.Coordinate.equals=function(a,c){return a==c?!0:a&&c?a.x==c.x&&a.y==c.y:!1};k.math.Coordinate.distance=function(a,c){var d=a.x-c.x,e=a.y-c.y;return Math.sqrt(d*d+e*e)};
k.math.Coordinate.magnitude=function(a){return Math.sqrt(a.x*a.x+a.y*a.y)};k.math.Coordinate.azimuth=function(a){return k.math.angle(a.x,a.y)};k.math.Coordinate.squaredDistance=function(a,c){var d=a.x-c.x,e=a.y-c.y;return d*d+e*e};k.math.Coordinate.difference=function(a,c){return new k.math.Coordinate(a.x-c.x,a.y-c.y)};k.math.Coordinate.sum=function(a,c){return new k.math.Coordinate(a.x+c.x,a.y+c.y)};k.math.Coordinate.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};
k.math.Coordinate.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};k.math.Size=function(a,c){this.width=a;this.height=c};k.math.Size.equals=function(a,c){return a==c?!0:a&&c?a.width==c.width&&a.height==c.height:!1};k.math.Size.prototype.clone=function(){return new k.math.Size(this.width,this.height)};k.DEBUG&&(k.math.Size.prototype.toString=function(){return"("+this.width+" x "+this.height+")"});k.math.Size.prototype.isEmpty=function(){return!(this.width*this.height)};
k.math.Size.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};k.math.Size.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};k.dom.BrowserFeature={CAN_ADD_NAME_OR_TYPE_ATTRIBUTES:!k.userAgent.IE||k.userAgent.isDocumentModeOrHigher(9),CAN_USE_CHILDREN_ATTRIBUTE:!k.userAgent.GECKO&&!k.userAgent.IE||k.userAgent.IE&&k.userAgent.isDocumentModeOrHigher(9)||k.userAgent.GECKO&&k.userAgent.isVersionOrHigher("1.9.1"),CAN_USE_INNER_TEXT:k.userAgent.IE&&!k.userAgent.isVersionOrHigher("9"),CAN_USE_PARENT_ELEMENT_PROPERTY:k.userAgent.IE||k.userAgent.OPERA||k.userAgent.WEBKIT,INNER_HTML_NEEDS_SCOPED_ELEMENT:k.userAgent.IE};k.dom.classes={};k.dom.classes.set=function(a,c){a.className=c};k.dom.classes.get=function(a){a=a.className;return k.isString(a)&&a.match(/\S+/g)||[]};k.dom.classes.add=function(a,c){var d=k.dom.classes.get(a),e=k.array.slice(arguments,1),f=d.length+e.length;k.dom.classes.add_(d,e);k.dom.classes.set(a,d.join(" "));return d.length==f};
k.dom.classes.remove=function(a,c){var d=k.dom.classes.get(a),e=k.array.slice(arguments,1),f=k.dom.classes.getDifference_(d,e);k.dom.classes.set(a,f.join(" "));return f.length==d.length-e.length};k.dom.classes.add_=function(a,c){for(var d=0;d<c.length;d++)k.array.contains(a,c[d])||a.push(c[d])};k.dom.classes.getDifference_=function(a,c){return k.array.filter(a,function(a){return!k.array.contains(c,a)})};
k.dom.classes.swap=function(a,c,d){for(var e=k.dom.classes.get(a),f=!1,g=0;g<e.length;g++)e[g]==c&&(k.array.splice(e,g--,1),f=!0);f&&(e.push(d),k.dom.classes.set(a,e.join(" ")));return f};k.dom.classes.addRemove=function(a,c,d){var e=k.dom.classes.get(a);k.isString(c)?k.array.remove(e,c):k.isArray(c)&&(e=k.dom.classes.getDifference_(e,c));k.isString(d)&&!k.array.contains(e,d)?e.push(d):k.isArray(d)&&k.dom.classes.add_(e,d);k.dom.classes.set(a,e.join(" "))};
k.dom.classes.has=function(a,c){return k.array.contains(k.dom.classes.get(a),c)};k.dom.classes.enable=function(a,c,d){d?k.dom.classes.add(a,c):k.dom.classes.remove(a,c)};k.dom.classes.toggle=function(a,c){var d=!k.dom.classes.has(a,c);k.dom.classes.enable(a,c,d);return d};k.dom.TagName={A:"A",ABBR:"ABBR",ACRONYM:"ACRONYM",ADDRESS:"ADDRESS",APPLET:"APPLET",AREA:"AREA",ARTICLE:"ARTICLE",ASIDE:"ASIDE",AUDIO:"AUDIO",B:"B",BASE:"BASE",BASEFONT:"BASEFONT",BDI:"BDI",BDO:"BDO",BIG:"BIG",BLOCKQUOTE:"BLOCKQUOTE",BODY:"BODY",BR:"BR",BUTTON:"BUTTON",CANVAS:"CANVAS",CAPTION:"CAPTION",CENTER:"CENTER",CITE:"CITE",CODE:"CODE",COL:"COL",COLGROUP:"COLGROUP",COMMAND:"COMMAND",DATA:"DATA",DATALIST:"DATALIST",DD:"DD",DEL:"DEL",DETAILS:"DETAILS",DFN:"DFN",DIALOG:"DIALOG",DIR:"DIR",DIV:"DIV",
DL:"DL",DT:"DT",EM:"EM",EMBED:"EMBED",FIELDSET:"FIELDSET",FIGCAPTION:"FIGCAPTION",FIGURE:"FIGURE",FONT:"FONT",FOOTER:"FOOTER",FORM:"FORM",FRAME:"FRAME",FRAMESET:"FRAMESET",H1:"H1",H2:"H2",H3:"H3",H4:"H4",H5:"H5",H6:"H6",HEAD:"HEAD",HEADER:"HEADER",HGROUP:"HGROUP",HR:"HR",HTML:"HTML",I:"I",IFRAME:"IFRAME",IMG:"IMG",INPUT:"INPUT",INS:"INS",ISINDEX:"ISINDEX",KBD:"KBD",KEYGEN:"KEYGEN",LABEL:"LABEL",LEGEND:"LEGEND",LI:"LI",LINK:"LINK",MAP:"MAP",MARK:"MARK",MATH:"MATH",MENU:"MENU",META:"META",METER:"METER",
NAV:"NAV",NOFRAMES:"NOFRAMES",NOSCRIPT:"NOSCRIPT",OBJECT:"OBJECT",OL:"OL",OPTGROUP:"OPTGROUP",OPTION:"OPTION",OUTPUT:"OUTPUT",P:"P",PARAM:"PARAM",PRE:"PRE",PROGRESS:"PROGRESS",Q:"Q",RP:"RP",RT:"RT",RUBY:"RUBY",S:"S",SAMP:"SAMP",SCRIPT:"SCRIPT",SECTION:"SECTION",SELECT:"SELECT",SMALL:"SMALL",SOURCE:"SOURCE",SPAN:"SPAN",STRIKE:"STRIKE",STRONG:"STRONG",STYLE:"STYLE",SUB:"SUB",SUMMARY:"SUMMARY",SUP:"SUP",SVG:"SVG",TABLE:"TABLE",TBODY:"TBODY",TD:"TD",TEXTAREA:"TEXTAREA",TFOOT:"TFOOT",TH:"TH",THEAD:"THEAD",
TIME:"TIME",TITLE:"TITLE",TR:"TR",TRACK:"TRACK",TT:"TT",U:"U",UL:"UL",VAR:"VAR",VIDEO:"VIDEO",WBR:"WBR"};k.dom.ASSUME_QUIRKS_MODE=!1;k.dom.ASSUME_STANDARDS_MODE=!1;k.dom.COMPAT_MODE_KNOWN_=k.dom.ASSUME_QUIRKS_MODE||k.dom.ASSUME_STANDARDS_MODE;k.dom.getDomHelper=function(a){return a?new k.dom.DomHelper(k.dom.getOwnerDocument(a)):k.dom.defaultDomHelper_||(k.dom.defaultDomHelper_=new k.dom.DomHelper)};k.dom.getDocument=function(){return document};k.dom.getElement=function(a){return k.dom.getElementHelper_(document,a)};k.dom.getElementHelper_=function(a,c){return k.isString(c)?a.getElementById(c):c};
k.dom.getRequiredElement=function(a){return k.dom.getRequiredElementHelper_(document,a)};k.dom.getRequiredElementHelper_=function(a,c){k.asserts.assertString(c);var d=k.dom.getElementHelper_(a,c);return d=k.asserts.assertElement(d,"No element found with id: "+c)};k.dom.$=k.dom.getElement;k.dom.getElementsByTagNameAndClass=function(a,c,d){return k.dom.getElementsByTagNameAndClass_(document,a,c,d)};
k.dom.getElementsByClass=function(a,c){var d=c||document;return k.dom.canUseQuerySelector_(d)?d.querySelectorAll("."+a):k.dom.getElementsByTagNameAndClass_(document,"*",a,c)};k.dom.getElementByClass=function(a,c){var d=c||document,e=null;return(e=k.dom.canUseQuerySelector_(d)?d.querySelector("."+a):k.dom.getElementsByTagNameAndClass_(document,"*",a,c)[0])||null};
k.dom.getRequiredElementByClass=function(a,c){var d=k.dom.getElementByClass(a,c);return k.asserts.assert(d,"No element found with className: "+a)};k.dom.canUseQuerySelector_=function(a){return!(!a.querySelectorAll||!a.querySelector)};
k.dom.getElementsByTagNameAndClass_=function(a,c,d,e){a=e||a;c=c&&"*"!=c?c.toUpperCase():"";if(k.dom.canUseQuerySelector_(a)&&(c||d))return a.querySelectorAll(c+(d?"."+d:""));if(d&&a.getElementsByClassName){a=a.getElementsByClassName(d);if(c){e={};for(var f=0,g=0,h;h=a[g];g++)c==h.nodeName&&(e[f++]=h);e.length=f;return e}return a}a=a.getElementsByTagName(c||"*");if(d){e={};for(g=f=0;h=a[g];g++)c=h.className,"function"==typeof c.split&&k.array.contains(c.split(/\s+/),d)&&(e[f++]=h);e.length=f;return e}return a};
k.dom.$$=k.dom.getElementsByTagNameAndClass;k.dom.setProperties=function(a,c){k.object.forEach(c,function(c,e){"style"==e?a.style.cssText=c:"class"==e?a.className=c:"for"==e?a.htmlFor=c:e in k.dom.DIRECT_ATTRIBUTE_MAP_?a.setAttribute(k.dom.DIRECT_ATTRIBUTE_MAP_[e],c):k.string.startsWith(e,"aria-")||k.string.startsWith(e,"data-")?a.setAttribute(e,c):a[e]=c})};
k.dom.DIRECT_ATTRIBUTE_MAP_={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};k.dom.getViewportSize=function(a){return k.dom.getViewportSize_(a||window)};k.dom.getViewportSize_=function(a){a=a.document;a=k.dom.isCss1CompatMode_(a)?a.documentElement:a.body;return new k.math.Size(a.clientWidth,a.clientHeight)};
k.dom.getDocumentHeight=function(){return k.dom.getDocumentHeight_(window)};k.dom.getDocumentHeight_=function(a){var c=a.document,d=0;if(c){a=k.dom.getViewportSize_(a).height;var d=c.body,e=c.documentElement;if(k.dom.isCss1CompatMode_(c)&&e.scrollHeight)d=e.scrollHeight!=a?e.scrollHeight:e.offsetHeight;else{var c=e.scrollHeight,f=e.offsetHeight;e.clientHeight!=f&&(c=d.scrollHeight,f=d.offsetHeight);d=c>a?c>f?c:f:c<f?c:f}}return d};
k.dom.getPageScroll=function(a){return k.dom.getDomHelper((a||k.global||window).document).getDocumentScroll()};k.dom.getDocumentScroll=function(){return k.dom.getDocumentScroll_(document)};k.dom.getDocumentScroll_=function(a){var c=k.dom.getDocumentScrollElement_(a);a=k.dom.getWindow_(a);return k.userAgent.IE&&k.userAgent.isVersionOrHigher("10")&&a.pageYOffset!=c.scrollTop?new k.math.Coordinate(c.scrollLeft,c.scrollTop):new k.math.Coordinate(a.pageXOffset||c.scrollLeft,a.pageYOffset||c.scrollTop)};
k.dom.getDocumentScrollElement=function(){return k.dom.getDocumentScrollElement_(document)};k.dom.getDocumentScrollElement_=function(a){return!k.userAgent.WEBKIT&&k.dom.isCss1CompatMode_(a)?a.documentElement:a.body||a.documentElement};k.dom.getWindow=function(a){return a?k.dom.getWindow_(a):window};k.dom.getWindow_=function(a){return a.parentWindow||a.defaultView};k.dom.createDom=function(a,c,d){return k.dom.createDom_(document,arguments)};
k.dom.createDom_=function(a,c){var d=c[0],e=c[1];if(!k.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES&&e&&(e.name||e.type)){d=["<",d];e.name&&d.push(' name="',k.string.htmlEscape(e.name),'"');if(e.type){d.push(' type="',k.string.htmlEscape(e.type),'"');var f={};k.object.extend(f,e);delete f.type;e=f}d.push(">");d=d.join("")}d=a.createElement(d);e&&(k.isString(e)?d.className=e:k.isArray(e)?k.dom.classes.add.apply(null,[d].concat(e)):k.dom.setProperties(d,e));2<c.length&&k.dom.append_(a,d,c,2);
return d};k.dom.append_=function(a,c,d,e){function f(d){d&&c.appendChild(k.isString(d)?a.createTextNode(d):d)}for(;e<d.length;e++){var g=d[e];k.isArrayLike(g)&&!k.dom.isNodeLike(g)?k.array.forEach(k.dom.isNodeList(g)?k.array.toArray(g):g,f):f(g)}};k.dom.$dom=k.dom.createDom;k.dom.createElement=function(a){return document.createElement(a)};k.dom.createTextNode=function(a){return document.createTextNode(String(a))};k.dom.createTable=function(a,c,d){return k.dom.createTable_(document,a,c,!!d)};
k.dom.createTable_=function(a,c,d,e){for(var f=["<tr>"],g=0;g<d;g++)f.push(e?"<td>&nbsp;</td>":"<td></td>");f.push("</tr>");f=f.join("");d=["<table>"];for(g=0;g<c;g++)d.push(f);d.push("</table>");a=a.createElement(k.dom.TagName.DIV);a.innerHTML=d.join("");return a.removeChild(a.firstChild)};k.dom.htmlToDocumentFragment=function(a){return k.dom.htmlToDocumentFragment_(document,a)};
k.dom.htmlToDocumentFragment_=function(a,c){var d=a.createElement("div");k.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT?(d.innerHTML="<br>"+c,d.removeChild(d.firstChild)):d.innerHTML=c;if(1==d.childNodes.length)return d.removeChild(d.firstChild);for(var e=a.createDocumentFragment();d.firstChild;)e.appendChild(d.firstChild);return e};k.dom.isCss1CompatMode=function(){return k.dom.isCss1CompatMode_(document)};
k.dom.isCss1CompatMode_=function(a){return k.dom.COMPAT_MODE_KNOWN_?k.dom.ASSUME_STANDARDS_MODE:"CSS1Compat"==a.compatMode};k.dom.canHaveChildren=function(a){if(a.nodeType!=k.dom.NodeType.ELEMENT)return!1;switch(a.tagName){case k.dom.TagName.APPLET:case k.dom.TagName.AREA:case k.dom.TagName.BASE:case k.dom.TagName.BR:case k.dom.TagName.COL:case k.dom.TagName.COMMAND:case k.dom.TagName.EMBED:case k.dom.TagName.FRAME:case k.dom.TagName.HR:case k.dom.TagName.IMG:case k.dom.TagName.INPUT:case k.dom.TagName.IFRAME:case k.dom.TagName.ISINDEX:case k.dom.TagName.KEYGEN:case k.dom.TagName.LINK:case k.dom.TagName.NOFRAMES:case k.dom.TagName.NOSCRIPT:case k.dom.TagName.META:case k.dom.TagName.OBJECT:case k.dom.TagName.PARAM:case k.dom.TagName.SCRIPT:case k.dom.TagName.SOURCE:case k.dom.TagName.STYLE:case k.dom.TagName.TRACK:case k.dom.TagName.WBR:return!1}return!0};
k.dom.appendChild=function(a,c){a.appendChild(c)};k.dom.append=function(a,c){k.dom.append_(k.dom.getOwnerDocument(a),a,arguments,1)};k.dom.removeChildren=function(a){for(var c;c=a.firstChild;)a.removeChild(c)};k.dom.insertSiblingBefore=function(a,c){c.parentNode&&c.parentNode.insertBefore(a,c)};k.dom.insertSiblingAfter=function(a,c){c.parentNode&&c.parentNode.insertBefore(a,c.nextSibling)};k.dom.insertChildAt=function(a,c,d){a.insertBefore(c,a.childNodes[d]||null)};
k.dom.removeNode=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null};k.dom.replaceNode=function(a,c){var d=c.parentNode;d&&d.replaceChild(a,c)};k.dom.flattenElement=function(a){var c,d=a.parentNode;if(d&&d.nodeType!=k.dom.NodeType.DOCUMENT_FRAGMENT){if(a.removeNode)return a.removeNode(!1);for(;c=a.firstChild;)d.insertBefore(c,a);return k.dom.removeNode(a)}};
k.dom.getChildren=function(a){return k.dom.BrowserFeature.CAN_USE_CHILDREN_ATTRIBUTE&&void 0!=a.children?a.children:k.array.filter(a.childNodes,function(a){return a.nodeType==k.dom.NodeType.ELEMENT})};k.dom.getFirstElementChild=function(a){return void 0!=a.firstElementChild?a.firstElementChild:k.dom.getNextElementNode_(a.firstChild,!0)};k.dom.getLastElementChild=function(a){return void 0!=a.lastElementChild?a.lastElementChild:k.dom.getNextElementNode_(a.lastChild,!1)};
k.dom.getNextElementSibling=function(a){return void 0!=a.nextElementSibling?a.nextElementSibling:k.dom.getNextElementNode_(a.nextSibling,!0)};k.dom.getPreviousElementSibling=function(a){return void 0!=a.previousElementSibling?a.previousElementSibling:k.dom.getNextElementNode_(a.previousSibling,!1)};k.dom.getNextElementNode_=function(a,c){for(;a&&a.nodeType!=k.dom.NodeType.ELEMENT;)a=c?a.nextSibling:a.previousSibling;return a};
k.dom.getNextNode=function(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null};k.dom.getPreviousNode=function(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a};k.dom.isNodeLike=function(a){return k.isObject(a)&&0<a.nodeType};k.dom.isElement=function(a){return k.isObject(a)&&a.nodeType==k.dom.NodeType.ELEMENT};
k.dom.isWindow=function(a){return k.isObject(a)&&a.window==a};k.dom.getParentElement=function(a){if(k.dom.BrowserFeature.CAN_USE_PARENT_ELEMENT_PROPERTY&&!(k.userAgent.IE&&k.userAgent.isVersionOrHigher("9")&&!k.userAgent.isVersionOrHigher("10")&&k.global.SVGElement&&a instanceof k.global.SVGElement))return a.parentElement;a=a.parentNode;return k.dom.isElement(a)?a:null};
k.dom.contains=function(a,c){if(a.contains&&c.nodeType==k.dom.NodeType.ELEMENT)return a==c||a.contains(c);if("undefined"!=typeof a.compareDocumentPosition)return a==c||Boolean(a.compareDocumentPosition(c)&16);for(;c&&a!=c;)c=c.parentNode;return c==a};
k.dom.compareNodeOrder=function(a,c){if(a==c)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(c)&2?1:-1;if(k.userAgent.IE&&!k.userAgent.isDocumentModeOrHigher(9)){if(a.nodeType==k.dom.NodeType.DOCUMENT)return-1;if(c.nodeType==k.dom.NodeType.DOCUMENT)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var d=a.nodeType==k.dom.NodeType.ELEMENT,e=c.nodeType==k.dom.NodeType.ELEMENT;if(d&&e)return a.sourceIndex-c.sourceIndex;var f=a.parentNode,g=c.parentNode;
return f==g?k.dom.compareSiblingOrder_(a,c):!d&&k.dom.contains(f,c)?-1*k.dom.compareParentsDescendantNodeIe_(a,c):!e&&k.dom.contains(g,a)?k.dom.compareParentsDescendantNodeIe_(c,a):(d?a.sourceIndex:f.sourceIndex)-(e?c.sourceIndex:g.sourceIndex)}e=k.dom.getOwnerDocument(a);d=e.createRange();d.selectNode(a);d.collapse(!0);e=e.createRange();e.selectNode(c);e.collapse(!0);return d.compareBoundaryPoints(k.global.Range.START_TO_END,e)};
k.dom.compareParentsDescendantNodeIe_=function(a,c){var d=a.parentNode;if(d==c)return-1;for(var e=c;e.parentNode!=d;)e=e.parentNode;return k.dom.compareSiblingOrder_(e,a)};k.dom.compareSiblingOrder_=function(a,c){for(var d=c;d=d.previousSibling;)if(d==a)return-1;return 1};
k.dom.findCommonAncestor=function(a){var c,d=arguments.length;if(!d)return null;if(1==d)return arguments[0];var e=[],f=Infinity;for(c=0;c<d;c++){for(var g=[],h=arguments[c];h;)g.unshift(h),h=h.parentNode;e.push(g);f=Math.min(f,g.length)}g=null;for(c=0;c<f;c++){for(var h=e[0][c],l=1;l<d;l++)if(h!=e[l][c])return g;g=h}return g};k.dom.getOwnerDocument=function(a){return a.nodeType==k.dom.NodeType.DOCUMENT?a:a.ownerDocument||a.document};
k.dom.getFrameContentDocument=function(a){return a.contentDocument||a.contentWindow.document};k.dom.getFrameContentWindow=function(a){return a.contentWindow||k.dom.getWindow(k.dom.getFrameContentDocument(a))};
k.dom.setTextContent=function(a,c){k.asserts.assert(null!=a,"goog.dom.setTextContent expects a non-null value for node");if("textContent"in a)a.textContent=c;else if(a.nodeType==k.dom.NodeType.TEXT)a.data=c;else if(a.firstChild&&a.firstChild.nodeType==k.dom.NodeType.TEXT){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=c}else{k.dom.removeChildren(a);var d=k.dom.getOwnerDocument(a);a.appendChild(d.createTextNode(String(c)))}};
k.dom.getOuterHtml=function(a){if("outerHTML"in a)return a.outerHTML;var c=k.dom.getOwnerDocument(a).createElement("div");c.appendChild(a.cloneNode(!0));return c.innerHTML};k.dom.findNode=function(a,c){var d=[];return k.dom.findNodes_(a,c,d,!0)?d[0]:void 0};k.dom.findNodes=function(a,c){var d=[];k.dom.findNodes_(a,c,d,!1);return d};k.dom.findNodes_=function(a,c,d,e){if(null!=a)for(a=a.firstChild;a;){if(c(a)&&(d.push(a),e)||k.dom.findNodes_(a,c,d,e))return!0;a=a.nextSibling}return!1};
k.dom.TAGS_TO_IGNORE_={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1};k.dom.PREDEFINED_TAG_VALUES_={IMG:" ",BR:"\n"};k.dom.isFocusableTabIndex=function(a){return k.dom.hasSpecifiedTabIndex_(a)&&k.dom.isTabIndexFocusable_(a)};k.dom.setFocusableTabIndex=function(a,c){c?a.tabIndex=0:(a.tabIndex=-1,a.removeAttribute("tabIndex"))};
k.dom.isFocusable=function(a){var c;return(c=k.dom.nativelySupportsFocus_(a)?!a.disabled&&(!k.dom.hasSpecifiedTabIndex_(a)||k.dom.isTabIndexFocusable_(a)):k.dom.isFocusableTabIndex(a))&&k.userAgent.IE?k.dom.hasNonZeroBoundingRect_(a):c};k.dom.hasSpecifiedTabIndex_=function(a){a=a.getAttributeNode("tabindex");return k.isDefAndNotNull(a)&&a.specified};k.dom.isTabIndexFocusable_=function(a){a=a.tabIndex;return k.isNumber(a)&&0<=a&&32768>a};
k.dom.nativelySupportsFocus_=function(a){return a.tagName==k.dom.TagName.A||a.tagName==k.dom.TagName.INPUT||a.tagName==k.dom.TagName.TEXTAREA||a.tagName==k.dom.TagName.SELECT||a.tagName==k.dom.TagName.BUTTON};k.dom.hasNonZeroBoundingRect_=function(a){a=k.isFunction(a.getBoundingClientRect)?a.getBoundingClientRect():{height:a.offsetHeight,width:a.offsetWidth};return k.isDefAndNotNull(a)&&0<a.height&&0<a.width};
k.dom.getTextContent=function(a){if(k.dom.BrowserFeature.CAN_USE_INNER_TEXT&&"innerText"in a)a=k.string.canonicalizeNewlines(a.innerText);else{var c=[];k.dom.getTextContent_(a,c,!0);a=c.join("")}a=a.replace(/ \xAD /g," ").replace(/\xAD/g,"");a=a.replace(/\u200B/g,"");k.dom.BrowserFeature.CAN_USE_INNER_TEXT||(a=a.replace(/ +/g," "));" "!=a&&(a=a.replace(/^\s*/,""));return a};k.dom.getRawTextContent=function(a){var c=[];k.dom.getTextContent_(a,c,!1);return c.join("")};
k.dom.getTextContent_=function(a,c,d){if(!(a.nodeName in k.dom.TAGS_TO_IGNORE_))if(a.nodeType==k.dom.NodeType.TEXT)d?c.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):c.push(a.nodeValue);else if(a.nodeName in k.dom.PREDEFINED_TAG_VALUES_)c.push(k.dom.PREDEFINED_TAG_VALUES_[a.nodeName]);else for(a=a.firstChild;a;)k.dom.getTextContent_(a,c,d),a=a.nextSibling};k.dom.getNodeTextLength=function(a){return k.dom.getTextContent(a).length};
k.dom.getNodeTextOffset=function(a,c){for(var d=c||k.dom.getOwnerDocument(a).body,e=[];a&&a!=d;){for(var f=a;f=f.previousSibling;)e.unshift(k.dom.getTextContent(f));a=a.parentNode}return k.string.trimLeft(e.join("")).replace(/ +/g," ").length};
k.dom.getNodeAtOffset=function(a,c,d){a=[a];for(var e=0,f=null;0<a.length&&e<c;)if(f=a.pop(),!(f.nodeName in k.dom.TAGS_TO_IGNORE_))if(f.nodeType==k.dom.NodeType.TEXT)var g=f.nodeValue.replace(/(\r\n|\r|\n)/g,"").replace(/ +/g," "),e=e+g.length;else if(f.nodeName in k.dom.PREDEFINED_TAG_VALUES_)e+=k.dom.PREDEFINED_TAG_VALUES_[f.nodeName].length;else for(g=f.childNodes.length-1;0<=g;g--)a.push(f.childNodes[g]);k.isObject(d)&&(d.remainder=f?f.nodeValue.length+c-e-1:0,d.node=f);return f};
k.dom.isNodeList=function(a){if(a&&"number"==typeof a.length){if(k.isObject(a))return"function"==typeof a.item||"string"==typeof a.item;if(k.isFunction(a))return"function"==typeof a.item}return!1};k.dom.getAncestorByTagNameAndClass=function(a,c,d){if(!c&&!d)return null;var e=c?c.toUpperCase():null;return k.dom.getAncestor(a,function(a){return(!e||a.nodeName==e)&&(!d||k.dom.classes.has(a,d))},!0)};k.dom.getAncestorByClass=function(a,c){return k.dom.getAncestorByTagNameAndClass(a,null,c)};
k.dom.getAncestor=function(a,c,d,e){d||(a=a.parentNode);d=null==e;for(var f=0;a&&(d||f<=e);){if(c(a))return a;a=a.parentNode;f++}return null};k.dom.getActiveElement=function(a){try{return a&&a.activeElement}catch(c){}return null};
k.dom.getPixelRatio=k.functions.cacheReturnValue(function(){var a=k.dom.getWindow(),c=k.userAgent.GECKO&&k.userAgent.MOBILE;return k.isDef(a.devicePixelRatio)&&!c?a.devicePixelRatio:a.matchMedia?k.dom.matchesPixelRatio_(0.75)||k.dom.matchesPixelRatio_(1.5)||k.dom.matchesPixelRatio_(2)||k.dom.matchesPixelRatio_(3)||1:1});
k.dom.matchesPixelRatio_=function(a){return k.dom.getWindow().matchMedia("(-webkit-min-device-pixel-ratio: "+a+"),(min--moz-device-pixel-ratio: "+a+"),(min-resolution: "+a+"dppx)").matches?a:0};k.dom.DomHelper=function(a){this.document_=a||k.global.document||document};b=k.dom.DomHelper.prototype;b.getDomHelper=k.dom.getDomHelper;b.getDocument=function(){return this.document_};b.getElement=function(a){return k.dom.getElementHelper_(this.document_,a)};
b.getRequiredElement=function(a){return k.dom.getRequiredElementHelper_(this.document_,a)};b.$=k.dom.DomHelper.prototype.getElement;b.getElementsByTagNameAndClass=function(a,c,d){return k.dom.getElementsByTagNameAndClass_(this.document_,a,c,d)};b.getElementsByClass=function(a,c){return k.dom.getElementsByClass(a,c||this.document_)};b.getElementByClass=function(a,c){return k.dom.getElementByClass(a,c||this.document_)};
b.getRequiredElementByClass=function(a,c){return k.dom.getRequiredElementByClass(a,c||this.document_)};b.$$=k.dom.DomHelper.prototype.getElementsByTagNameAndClass;b.setProperties=k.dom.setProperties;b.getViewportSize=function(a){return k.dom.getViewportSize(a||this.getWindow())};b.getDocumentHeight=function(){return k.dom.getDocumentHeight_(this.getWindow())};b.createDom=function(a,c,d){return k.dom.createDom_(this.document_,arguments)};b.$dom=k.dom.DomHelper.prototype.createDom;b.createElement=function(a){return this.document_.createElement(a)};
b.createTextNode=function(a){return this.document_.createTextNode(String(a))};b.createTable=function(a,c,d){return k.dom.createTable_(this.document_,a,c,!!d)};b.htmlToDocumentFragment=function(a){return k.dom.htmlToDocumentFragment_(this.document_,a)};b.isCss1CompatMode=function(){return k.dom.isCss1CompatMode_(this.document_)};b.getWindow=function(){return k.dom.getWindow_(this.document_)};b.getDocumentScrollElement=function(){return k.dom.getDocumentScrollElement_(this.document_)};
b.getDocumentScroll=function(){return k.dom.getDocumentScroll_(this.document_)};b.getActiveElement=function(a){return k.dom.getActiveElement(a||this.document_)};b.appendChild=k.dom.appendChild;b.append=k.dom.append;b.canHaveChildren=k.dom.canHaveChildren;b.removeChildren=k.dom.removeChildren;b.insertSiblingBefore=k.dom.insertSiblingBefore;b.insertSiblingAfter=k.dom.insertSiblingAfter;b.insertChildAt=k.dom.insertChildAt;b.removeNode=k.dom.removeNode;b.replaceNode=k.dom.replaceNode;
b.flattenElement=k.dom.flattenElement;b.getChildren=k.dom.getChildren;b.getFirstElementChild=k.dom.getFirstElementChild;b.getLastElementChild=k.dom.getLastElementChild;b.getNextElementSibling=k.dom.getNextElementSibling;b.getPreviousElementSibling=k.dom.getPreviousElementSibling;b.getNextNode=k.dom.getNextNode;b.getPreviousNode=k.dom.getPreviousNode;b.isNodeLike=k.dom.isNodeLike;b.isElement=k.dom.isElement;b.isWindow=k.dom.isWindow;b.getParentElement=k.dom.getParentElement;b.contains=k.dom.contains;
b.compareNodeOrder=k.dom.compareNodeOrder;b.findCommonAncestor=k.dom.findCommonAncestor;b.getOwnerDocument=k.dom.getOwnerDocument;b.getFrameContentDocument=k.dom.getFrameContentDocument;b.getFrameContentWindow=k.dom.getFrameContentWindow;b.setTextContent=k.dom.setTextContent;b.getOuterHtml=k.dom.getOuterHtml;b.findNode=k.dom.findNode;b.findNodes=k.dom.findNodes;b.isFocusableTabIndex=k.dom.isFocusableTabIndex;b.setFocusableTabIndex=k.dom.setFocusableTabIndex;b.isFocusable=k.dom.isFocusable;
b.getTextContent=k.dom.getTextContent;b.getNodeTextLength=k.dom.getNodeTextLength;b.getNodeTextOffset=k.dom.getNodeTextOffset;b.getNodeAtOffset=k.dom.getNodeAtOffset;b.isNodeList=k.dom.isNodeList;b.getAncestorByTagNameAndClass=k.dom.getAncestorByTagNameAndClass;b.getAncestorByClass=k.dom.getAncestorByClass;b.getAncestor=k.dom.getAncestor;n.WindowDelegate=function(){k.craw.AppWindowDelegate.call(this);this.isFinishedLaunch_=this.retrieveJwtFailed_=this.transactionStarted_=this.walletIsLoaded_=!1;this.webStoreService_=new n.WebStoreService};k.inherits(n.WindowDelegate,k.craw.AppWindowDelegate);k.craw.AppWindowDelegate.setDefaultImpl();n.WindowDelegate.prototype.getAppUnavailableMessage=function(){return chrome.i18n.getMessage("iap_unavailable")};
n.WindowDelegate.prototype.pollOnlineStatus=function(){if(!window.iapParams_.oauthToken)return chrome.i18n.getMessage("please_sign_in");if(this.retrieveJwtFailed_)return chrome.i18n.getMessage("jwt_retrieve_failed")};n.WindowDelegate.prototype.finishedLaunch=function(){return this.isFinishedLaunch_};
var I=function(a){var c=window.iapParams_;a.isFinishedLaunch_&&c.oauthToken&&a.walletIsLoaded_&&!a.transactionStarted_&&(a.transactionStarted_=!0,k.dom.getDocument().querySelector("webview").contentWindow.postMessage({jwt:window.iapJwt_,parameters:c},"*"))};n.WindowDelegate.prototype.retrieveJwtOnSuccess_=function(a){window.iapJwt_=a;this.retrieveJwtFailed_=!1;this.isFinishedLaunch_=!0;I(this)};
n.WindowDelegate.prototype.retrieveJwtOnFailed_=function(){this.isFinishedLaunch_=this.retrieveJwtFailed_=!0};
n.WindowDelegate.prototype.onWindowReady=function(){var a=k.dom.getDocument().querySelector("webview");if(a){a.style.borderTop="1px #eaeaea solid";var c=!1,d=!1,e=window.iapParams_,f=this,g=function(a){if(window.sku_){var c=window.sku_,d=window.iapParams_||{},e=f.webStoreService_,g=d||{};if("env"in g){switch(g.env){case "prod":e.baseUrl_=n.WebStoreService.Environment.PROD;break;default:e.baseUrl_=n.WebStoreService.Environment.SANDBOX}e.baseUrlAndPath_=e.baseUrl_+n.WebStoreService.WEB_STORE_REQUEST_PATH_}f.retrieveJwtFailed_=
!1;f.isFinishedLaunch_=!1;aa(f.webStoreService_,d.applicationId,c,k.bind(f.retrieveJwtOnSuccess_,f),k.bind(f.retrieveJwtOnFailed_,f),a,d.gl)}else f.isFinishedLaunch_=!0,I(f)};e.oauthToken?g(e.oauthToken):chrome.identity.getAuthToken({interactive:!0},function(a){window.iapParams_.oauthToken=a;g(a)});a.addEventListener("contentload",function(){if(!c){c=!0;var f;switch(e.env||"sandbox"){case "prod":f="https://checkout.google.com/inapp/lib/buy.js";break;default:f="https://sandbox.google.com/checkout/inapp/lib/buy.js"}a.executeScript({runAt:"document_start",
code:'document.write("<script type=\\"text/javascript\\" src=\\"'+f+"\\\">\x3c/script><script type=\\\"text/javascript\\\">window.addEventListener('message', function(e) {  if (e.origin != 'chrome-extension://"+chrome.runtime.id+"') return;  google.payments.inapp.buy({parameters: e.data.parameters,                              jwt: e.data.jwt,       success: function(res) {        e.source.postMessage({type: 'success', result: res}, e.origin);      },      failure: function(res) {        e.source.postMessage({type: 'failure', result: res}, e.origin);      },      resize: function(size) {        e.source.postMessage({resize: size}, e.origin);      }  });}, false);\x3c/script>&nbsp;\");"},
function(){console.log("did exec once");a.executeScript({runAt:"document_start",code:'document.write("<script type=\\"text/javascript\\">document.dispatchEvent(new Event(\'DOMContentLoaded\'));\x3c/script>");'},function(){console.log("did execute twice");d=!0})})}},!1);a.addEventListener("loadcommit",function(){d&&(f.walletIsLoaded_=!0,I(f))},!1);a.addEventListener("newwindow",function(a){window.open(a.targetUrl);a.window.discard()},!1)}};
window.addEventListener("message",function(a){console.log(a);if("type"in a.data)window.purchase_result=a.data.result,window.close();else if("resize"in a.data){var c=chrome.app.window.current(),d=c.getBounds();c.resizeTo(d.width+0,a.data.resize.height)}},!1);k.debug.entryPointRegistry={};k.debug.EntryPointMonitor=function(){};k.debug.entryPointRegistry.refList_=[];k.debug.entryPointRegistry.monitors_=[];k.debug.entryPointRegistry.monitorsMayExist_=!1;k.debug.entryPointRegistry.register=function(a){k.debug.entryPointRegistry.refList_[k.debug.entryPointRegistry.refList_.length]=a;if(k.debug.entryPointRegistry.monitorsMayExist_)for(var c=k.debug.entryPointRegistry.monitors_,d=0;d<c.length;d++)a(k.bind(c[d].wrap,c[d]))};
k.debug.entryPointRegistry.monitorAll=function(a){k.debug.entryPointRegistry.monitorsMayExist_=!0;for(var c=k.bind(a.wrap,a),d=0;d<k.debug.entryPointRegistry.refList_.length;d++)k.debug.entryPointRegistry.refList_[d](c);k.debug.entryPointRegistry.monitors_.push(a)};
k.debug.entryPointRegistry.unmonitorAllIfPossible=function(a){var c=k.debug.entryPointRegistry.monitors_;k.asserts.assert(a==c[c.length-1],"Only the most recent monitor can be unwrapped.");a=k.bind(a.unwrap,a);for(var d=0;d<k.debug.entryPointRegistry.refList_.length;d++)k.debug.entryPointRegistry.refList_[d](a);c.length--};k.disposable={};k.disposable.IDisposable=function(){};k.Disposable=function(){k.Disposable.MONITORING_MODE!=k.Disposable.MonitoringMode.OFF&&(k.Disposable.instances_[k.getUid(this)]=this)};k.Disposable.MonitoringMode={OFF:0,PERMANENT:1,INTERACTIVE:2};k.Disposable.MONITORING_MODE=0;k.Disposable.INCLUDE_STACK_ON_CREATION=!0;k.Disposable.instances_={};k.Disposable.getUndisposedObjects=function(){var a=[],c;for(c in k.Disposable.instances_)k.Disposable.instances_.hasOwnProperty(c)&&a.push(k.Disposable.instances_[Number(c)]);return a};
k.Disposable.clearUndisposedObjects=function(){k.Disposable.instances_={}};k.Disposable.prototype.disposed_=!1;k.Disposable.prototype.isDisposed=function(){return this.disposed_};
k.Disposable.prototype.dispose=function(){if(!this.disposed_&&(this.disposed_=!0,this.disposeInternal(),k.Disposable.MONITORING_MODE!=k.Disposable.MonitoringMode.OFF)){var a=k.getUid(this);if(k.Disposable.MONITORING_MODE==k.Disposable.MonitoringMode.PERMANENT&&!k.Disposable.instances_.hasOwnProperty(a))throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call");delete k.Disposable.instances_[a]}};
k.Disposable.prototype.disposeInternal=function(){if(this.onDisposeCallbacks_)for(;this.onDisposeCallbacks_.length;)this.onDisposeCallbacks_.shift()()};k.Disposable.isDisposed=function(a){return a&&"function"==typeof a.isDisposed?a.isDisposed():!1};k.dispose=function(a){a&&"function"==typeof a.dispose&&a.dispose()};k.disposeAll=function(a){for(var c=0,d=arguments.length;c<d;++c){var e=arguments[c];k.isArrayLike(e)?k.disposeAll.apply(null,e):k.dispose(e)}};k.events={};k.events.EventId=function(a){this.id=a};k.events.EventId.prototype.toString=function(){return this.id};k.events.Event=function(a,c){this.type=a instanceof k.events.EventId?String(a):a;this.currentTarget=this.target=c;this.defaultPrevented=this.propagationStopped_=!1;this.returnValue_=!0};k.events.Event.prototype.disposeInternal=function(){};k.events.Event.prototype.dispose=function(){};k.events.Event.prototype.stopPropagation=function(){this.propagationStopped_=!0};k.events.Event.prototype.preventDefault=function(){this.defaultPrevented=!0;this.returnValue_=!1};k.events.Event.stopPropagation=function(a){a.stopPropagation()};
k.events.Event.preventDefault=function(a){a.preventDefault()};k.reflect={};k.reflect.object=function(a,c){return c};k.reflect.sinkValue=function(a){k.reflect.sinkValue[" "](a);return a};k.reflect.sinkValue[" "]=k.nullFunction;k.reflect.canAccessProperty=function(a){try{return k.reflect.sinkValue(a.nodeName),!0}catch(c){}return!1};k.events.BrowserFeature={HAS_W3C_BUTTON:!k.userAgent.IE||k.userAgent.isDocumentModeOrHigher(9),HAS_W3C_EVENT_SUPPORT:!k.userAgent.IE||k.userAgent.isDocumentModeOrHigher(9),SET_KEY_CODE_TO_PREVENT_DEFAULT:k.userAgent.IE&&!k.userAgent.isVersionOrHigher("9"),HAS_NAVIGATOR_ONLINE_PROPERTY:!k.userAgent.WEBKIT||k.userAgent.isVersionOrHigher("528"),HAS_HTML5_NETWORK_EVENT_SUPPORT:k.userAgent.GECKO&&k.userAgent.isVersionOrHigher("1.9b")||k.userAgent.IE&&k.userAgent.isVersionOrHigher("8")||k.userAgent.OPERA&&
k.userAgent.isVersionOrHigher("9.5")||k.userAgent.WEBKIT&&k.userAgent.isVersionOrHigher("528"),HTML5_NETWORK_EVENTS_FIRE_ON_BODY:k.userAgent.GECKO&&!k.userAgent.isVersionOrHigher("8")||k.userAgent.IE&&!k.userAgent.isVersionOrHigher("9"),TOUCH_ENABLED:"ontouchstart"in k.global||!!(k.global.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!k.global.navigator||!k.global.navigator.msMaxTouchPoints)};k.events.getVendorPrefixedName_=function(a){return k.userAgent.WEBKIT?"webkit"+a:k.userAgent.OPERA?"o"+a.toLowerCase():a.toLowerCase()};
k.events.EventType={CLICK:"click",DBLCLICK:"dblclick",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEMOVE:"mousemove",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",SELECTSTART:"selectstart",KEYPRESS:"keypress",KEYDOWN:"keydown",KEYUP:"keyup",BLUR:"blur",FOCUS:"focus",DEACTIVATE:"deactivate",FOCUSIN:k.userAgent.IE?"focusin":"DOMFocusIn",FOCUSOUT:k.userAgent.IE?"focusout":"DOMFocusOut",CHANGE:"change",SELECT:"select",SUBMIT:"submit",INPUT:"input",PROPERTYCHANGE:"propertychange",
DRAGSTART:"dragstart",DRAG:"drag",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",DRAGEND:"dragend",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",TOUCHCANCEL:"touchcancel",BEFOREUNLOAD:"beforeunload",CONSOLEMESSAGE:"consolemessage",CONTEXTMENU:"contextmenu",DOMCONTENTLOADED:"DOMContentLoaded",ERROR:"error",HELP:"help",LOAD:"load",LOSECAPTURE:"losecapture",ORIENTATIONCHANGE:"orientationchange",READYSTATECHANGE:"readystatechange",RESIZE:"resize",SCROLL:"scroll",
UNLOAD:"unload",HASHCHANGE:"hashchange",PAGEHIDE:"pagehide",PAGESHOW:"pageshow",POPSTATE:"popstate",COPY:"copy",PASTE:"paste",CUT:"cut",BEFORECOPY:"beforecopy",BEFORECUT:"beforecut",BEFOREPASTE:"beforepaste",ONLINE:"online",OFFLINE:"offline",MESSAGE:"message",CONNECT:"connect",ANIMATIONSTART:k.events.getVendorPrefixedName_("AnimationStart"),ANIMATIONEND:k.events.getVendorPrefixedName_("AnimationEnd"),ANIMATIONITERATION:k.events.getVendorPrefixedName_("AnimationIteration"),TRANSITIONEND:k.events.getVendorPrefixedName_("TransitionEnd"),
POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTERCANCEL:"pointercancel",POINTERMOVE:"pointermove",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",GOTPOINTERCAPTURE:"gotpointercapture",LOSTPOINTERCAPTURE:"lostpointercapture",MSGESTURECHANGE:"MSGestureChange",MSGESTUREEND:"MSGestureEnd",MSGESTUREHOLD:"MSGestureHold",MSGESTURESTART:"MSGestureStart",MSGESTURETAP:"MSGestureTap",MSGOTPOINTERCAPTURE:"MSGotPointerCapture",MSINERTIASTART:"MSInertiaStart",
MSLOSTPOINTERCAPTURE:"MSLostPointerCapture",MSPOINTERCANCEL:"MSPointerCancel",MSPOINTERDOWN:"MSPointerDown",MSPOINTERENTER:"MSPointerEnter",MSPOINTERHOVER:"MSPointerHover",MSPOINTERLEAVE:"MSPointerLeave",MSPOINTERMOVE:"MSPointerMove",MSPOINTEROUT:"MSPointerOut",MSPOINTEROVER:"MSPointerOver",MSPOINTERUP:"MSPointerUp",TEXTINPUT:"textinput",COMPOSITIONSTART:"compositionstart",COMPOSITIONUPDATE:"compositionupdate",COMPOSITIONEND:"compositionend",EXIT:"exit",LOADABORT:"loadabort",LOADCOMMIT:"loadcommit",
LOADREDIRECT:"loadredirect",LOADSTART:"loadstart",LOADSTOP:"loadstop",RESPONSIVE:"responsive",SIZECHANGED:"sizechanged",UNRESPONSIVE:"unresponsive",VISIBILITYCHANGE:"visibilitychange",STORAGE:"storage"};k.events.BrowserEvent=function(a,c){k.events.Event.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=this.offsetY=this.offsetX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.event_=this.state=null;if(a){var d=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=c;var e=a.relatedTarget;e?k.userAgent.GECKO&&(k.reflect.canAccessProperty(e)||(e=null)):
d==k.events.EventType.MOUSEOVER?e=a.fromElement:d==k.events.EventType.MOUSEOUT&&(e=a.toElement);this.relatedTarget=e;this.offsetX=k.userAgent.WEBKIT||void 0!==a.offsetX?a.offsetX:a.layerX;this.offsetY=k.userAgent.WEBKIT||void 0!==a.offsetY?a.offsetY:a.layerY;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==d?a.keyCode:
0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.event_=a;a.defaultPrevented&&this.preventDefault()}};k.inherits(k.events.BrowserEvent,k.events.Event);k.events.BrowserEvent.MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};k.events.BrowserEvent.IEButtonMap=[1,4,2];
k.events.BrowserEvent.prototype.stopPropagation=function(){k.events.BrowserEvent.superClass_.stopPropagation.call(this);this.event_.stopPropagation?this.event_.stopPropagation():this.event_.cancelBubble=!0};
k.events.BrowserEvent.prototype.preventDefault=function(){k.events.BrowserEvent.superClass_.preventDefault.call(this);var a=this.event_;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,k.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(c){}};k.events.BrowserEvent.prototype.disposeInternal=function(){};k.events.Listenable=function(){};k.events.Listenable.IMPLEMENTED_BY_PROP="closure_listenable_"+(1E6*Math.random()|0);k.events.Listenable.addImplementation=function(){k.events.EventTarget.prototype[k.events.Listenable.IMPLEMENTED_BY_PROP]=!0};k.events.Listenable.isImplementedBy=function(a){try{return!(!a||!a[k.events.Listenable.IMPLEMENTED_BY_PROP])}catch(c){return!1}};k.events.ListenableKey=function(){};k.events.ListenableKey.counter_=0;k.events.ListenableKey.reserveKey=function(){return++k.events.ListenableKey.counter_};k.events.Listener=function(a,c,d,e,f,g){this.listener=a;this.proxy=c;this.src=d;this.type=e;this.capture=!!f;this.handler=g;this.key=k.events.ListenableKey.reserveKey();this.removed=this.callOnce=!1};k.events.Listener.ENABLE_MONITORING=!1;var J=function(a){a.removed=!0;a.listener=null;a.proxy=null;a.src=null;a.handler=null};k.events.ListenerMap=function(a){this.src=a;this.listeners={};this.typeCount_=0};k.events.ListenerMap.prototype.add=function(a,c,d,e,f){var g=this.listeners[a];g||(g=this.listeners[a]=[],this.typeCount_++);var h=k.events.ListenerMap.findListenerIndex_(g,c,e,f);-1<h?(a=g[h],d||(a.callOnce=!1)):(a=new k.events.Listener(c,null,this.src,a,!!e,f),a.callOnce=d,g.push(a));return a};
k.events.ListenerMap.prototype.remove=function(a,c,d,e){if(!(a in this.listeners))return!1;var f=this.listeners[a];c=k.events.ListenerMap.findListenerIndex_(f,c,d,e);return-1<c?(J(f[c]),k.array.removeAt(f,c),0==f.length&&(delete this.listeners[a],this.typeCount_--),!0):!1};var L=function(a,c){var d=c.type;if(!(d in a.listeners))return!1;var e=k.array.remove(a.listeners[d],c);e&&(J(c),0==a.listeners[d].length&&(delete a.listeners[d],a.typeCount_--));return e};
k.events.ListenerMap.prototype.removeAll=function(a){var c=0,d;for(d in this.listeners)if(!a||d==a){for(var e=this.listeners[d],f=0;f<e.length;f++)++c,J(e[f]);delete this.listeners[d];this.typeCount_--}return c};k.events.ListenerMap.prototype.getListeners=function(a,c){var d=this.listeners[a],e=[];if(d)for(var f=0;f<d.length;++f){var g=d[f];g.capture==c&&e.push(g)}return e};
k.events.ListenerMap.prototype.getListener=function(a,c,d,e){a=this.listeners[a];var f=-1;a&&(f=k.events.ListenerMap.findListenerIndex_(a,c,d,e));return-1<f?a[f]:null};k.events.ListenerMap.prototype.hasListener=function(a,c){var d=k.isDef(a),e=k.isDef(c);return k.object.some(this.listeners,function(f){for(var g=0;g<f.length;++g)if(!(d&&f[g].type!=a||e&&f[g].capture!=c))return!0;return!1})};
k.events.ListenerMap.findListenerIndex_=function(a,c,d,e){for(var f=0;f<a.length;++f){var g=a[f];if(!g.removed&&g.listener==c&&g.capture==!!d&&g.handler==e)return f}return-1};k.events.listeners_={};k.events.LISTENER_MAP_PROP_="closure_lm_"+(1E6*Math.random()|0);k.events.onString_="on";k.events.onStringMap_={};k.events.CaptureSimulationMode={OFF_AND_FAIL:0,OFF_AND_SILENT:1,ON:2};k.events.CAPTURE_SIMULATION_MODE=2;k.events.listenerCountEstimate_=0;
k.events.listen=function(a,c,d,e,f){if(k.isArray(c)){for(var g=0;g<c.length;g++)k.events.listen(a,c[g],d,e,f);return null}d=k.events.wrapListener(d);return k.events.Listenable.isImplementedBy(a)?a.listen(c,d,e,f):k.events.listen_(a,c,d,!1,e,f)};
k.events.listen_=function(a,c,d,e,f,g){if(!c)throw Error("Invalid event type");var h=!!f;if(h&&!k.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT){if(k.events.CAPTURE_SIMULATION_MODE==k.events.CaptureSimulationMode.OFF_AND_FAIL)return k.asserts.fail("Can not register capture listener in IE8-."),null;if(k.events.CAPTURE_SIMULATION_MODE==k.events.CaptureSimulationMode.OFF_AND_SILENT)return null}var l=k.events.getListenerMap_(a);l||(a[k.events.LISTENER_MAP_PROP_]=l=new k.events.ListenerMap(a));d=l.add(c,
d,e,f,g);if(d.proxy)return d;e=k.events.getProxy();d.proxy=e;e.src=a;e.listener=d;a.addEventListener?a.addEventListener(c,e,h):a.attachEvent(k.events.getOnString_(c),e);k.events.listenerCountEstimate_++;return d};k.events.getProxy=function(){var a=k.events.handleBrowserEvent_,c=k.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT?function(d){return a.call(c.src,c.listener,d)}:function(d){d=a.call(c.src,c.listener,d);if(!d)return d};return c};
k.events.listenOnce=function(a,c,d,e,f){if(k.isArray(c)){for(var g=0;g<c.length;g++)k.events.listenOnce(a,c[g],d,e,f);return null}d=k.events.wrapListener(d);return k.events.Listenable.isImplementedBy(a)?a.listenOnce(c,d,e,f):k.events.listen_(a,c,d,!0,e,f)};k.events.listenWithWrapper=function(a,c,d,e,f){c.listen(a,d,e,f)};
k.events.unlisten=function(a,c,d,e,f){if(k.isArray(c)){for(var g=0;g<c.length;g++)k.events.unlisten(a,c[g],d,e,f);return null}d=k.events.wrapListener(d);if(k.events.Listenable.isImplementedBy(a))return a.unlisten(c,d,e,f);if(!a)return!1;if(a=k.events.getListenerMap_(a))if(c=a.getListener(c,d,!!e,f))return k.events.unlistenByKey(c);return!1};
k.events.unlistenByKey=function(a){if(k.isNumber(a)||!a||a.removed)return!1;var c=a.src;if(k.events.Listenable.isImplementedBy(c))return c.unlistenByKey(a);var d=a.type,e=a.proxy;c.removeEventListener?c.removeEventListener(d,e,a.capture):c.detachEvent&&c.detachEvent(k.events.getOnString_(d),e);k.events.listenerCountEstimate_--;(d=k.events.getListenerMap_(c))?(L(d,a),0==d.typeCount_&&(d.src=null,c[k.events.LISTENER_MAP_PROP_]=null)):J(a);return!0};
k.events.unlistenWithWrapper=function(a,c,d,e,f){c.unlisten(a,d,e,f)};k.events.removeAll=function(a,c){if(!a)return 0;if(k.events.Listenable.isImplementedBy(a))return a.eventTargetListeners_?a.eventTargetListeners_.removeAll(c):0;var d=k.events.getListenerMap_(a);if(!d)return 0;var e=0,f;for(f in d.listeners)if(!c||f==c)for(var g=k.array.clone(d.listeners[f]),h=0;h<g.length;++h)k.events.unlistenByKey(g[h])&&++e;return e};
k.events.removeAllNativeListeners=function(){return k.events.listenerCountEstimate_=0};k.events.getListeners=function(a,c,d){return k.events.Listenable.isImplementedBy(a)?a.getListeners(c,d):a?(a=k.events.getListenerMap_(a))?a.getListeners(c,d):[]:[]};k.events.getListener=function(a,c,d,e,f){d=k.events.wrapListener(d);e=!!e;return k.events.Listenable.isImplementedBy(a)?a.getListener(c,d,e,f):a?(a=k.events.getListenerMap_(a))?a.getListener(c,d,e,f):null:null};
k.events.hasListener=function(a,c,d){if(k.events.Listenable.isImplementedBy(a))return a.hasListener(c,d);a=k.events.getListenerMap_(a);return!!a&&a.hasListener(c,d)};k.events.expose=function(a){var c=[],d;for(d in a)a[d]&&a[d].id?c.push(d+" = "+a[d]+" ("+a[d].id+")"):c.push(d+" = "+a[d]);return c.join("\n")};k.events.getOnString_=function(a){return a in k.events.onStringMap_?k.events.onStringMap_[a]:k.events.onStringMap_[a]=k.events.onString_+a};
k.events.fireListeners=function(a,c,d,e){return k.events.Listenable.isImplementedBy(a)?a.fireListeners(c,d,e):k.events.fireListeners_(a,c,d,e)};k.events.fireListeners_=function(a,c,d,e){var f=1;if(a=k.events.getListenerMap_(a))if(c=a.listeners[c])for(c=k.array.clone(c),a=0;a<c.length;a++){var g=c[a];g&&g.capture==d&&!g.removed&&(f&=!1!==k.events.fireListener(g,e))}return Boolean(f)};
k.events.fireListener=function(a,c){var d=a.listener,e=a.handler||a.src;a.callOnce&&k.events.unlistenByKey(a);return d.call(e,c)};k.events.getTotalListenerCount=function(){return k.events.listenerCountEstimate_};k.events.dispatchEvent=function(a,c){k.asserts.assert(k.events.Listenable.isImplementedBy(a),"Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance.");return a.dispatchEvent(c)};k.events.protectBrowserEventEntryPoint=function(a){k.events.handleBrowserEvent_=a.protectEntryPoint(k.events.handleBrowserEvent_)};
k.events.handleBrowserEvent_=function(a,c){if(a.removed)return!0;if(!k.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT){var d=c||k.getObjectByName("window.event"),e=new k.events.BrowserEvent(d,this),f=!0;if(k.events.CAPTURE_SIMULATION_MODE==k.events.CaptureSimulationMode.ON){if(!k.events.isMarkedIeEvent_(d)){k.events.markIeEvent_(d);for(var d=[],g=e.currentTarget;g;g=g.parentNode)d.push(g);for(var g=a.type,h=d.length-1;!e.propagationStopped_&&0<=h;h--)e.currentTarget=d[h],f&=k.events.fireListeners_(d[h],
g,!0,e);for(h=0;!e.propagationStopped_&&h<d.length;h++)e.currentTarget=d[h],f&=k.events.fireListeners_(d[h],g,!1,e)}}else f=k.events.fireListener(a,e);return f}return k.events.fireListener(a,new k.events.BrowserEvent(c,this))};k.events.markIeEvent_=function(a){var c=!1;if(0==a.keyCode)try{a.keyCode=-1;return}catch(d){c=!0}if(c||void 0==a.returnValue)a.returnValue=!0};k.events.isMarkedIeEvent_=function(a){return 0>a.keyCode||void 0!=a.returnValue};k.events.uniqueIdCounter_=0;
k.events.getUniqueId=function(a){return a+"_"+k.events.uniqueIdCounter_++};k.events.getListenerMap_=function(a){a=a[k.events.LISTENER_MAP_PROP_];return a instanceof k.events.ListenerMap?a:null};k.events.LISTENER_WRAPPER_PROP_="__closure_events_fn_"+(1E9*Math.random()>>>0);
k.events.wrapListener=function(a){k.asserts.assert(a,"Listener can not be null.");if(k.isFunction(a))return a;k.asserts.assert(a.handleEvent,"An object listener must have handleEvent method.");return a[k.events.LISTENER_WRAPPER_PROP_]||(a[k.events.LISTENER_WRAPPER_PROP_]=function(c){return a.handleEvent(c)})};k.debug.entryPointRegistry.register(function(a){k.events.handleBrowserEvent_=a(k.events.handleBrowserEvent_)});k.events.EventTarget=function(){k.Disposable.call(this);this.eventTargetListeners_=new k.events.ListenerMap(this);this.actualEventTarget_=this};k.inherits(k.events.EventTarget,k.Disposable);k.events.Listenable.addImplementation();k.events.EventTarget.MAX_ANCESTORS_=1E3;b=k.events.EventTarget.prototype;b.parentEventTarget_=null;b.addEventListener=function(a,c,d,e){k.events.listen(this,a,c,d,e)};b.removeEventListener=function(a,c,d,e){k.events.unlisten(this,a,c,d,e)};
b.dispatchEvent=function(a){M(this);var c,d=this.parentEventTarget_;if(d){c=[];for(var e=1;d;d=d.parentEventTarget_)c.push(d),k.asserts.assert(++e<k.events.EventTarget.MAX_ANCESTORS_,"infinite loop")}return k.events.EventTarget.dispatchEventInternal_(this.actualEventTarget_,a,c)};b.disposeInternal=function(){k.events.EventTarget.superClass_.disposeInternal.call(this);this.eventTargetListeners_&&this.eventTargetListeners_.removeAll(void 0);this.parentEventTarget_=null};
b.listen=function(a,c,d,e){M(this);return this.eventTargetListeners_.add(String(a),c,!1,d,e)};b.listenOnce=function(a,c,d,e){return this.eventTargetListeners_.add(String(a),c,!0,d,e)};b.unlisten=function(a,c,d,e){return this.eventTargetListeners_.remove(String(a),c,d,e)};b.unlistenByKey=function(a){return L(this.eventTargetListeners_,a)};
b.fireListeners=function(a,c,d){a=this.eventTargetListeners_.listeners[String(a)];if(!a)return!0;a=k.array.clone(a);for(var e=!0,f=0;f<a.length;++f){var g=a[f];if(g&&!g.removed&&g.capture==c){var h=g.listener,l=g.handler||g.src;g.callOnce&&this.unlistenByKey(g);e=!1!==h.call(l,d)&&e}}return e&&!1!=d.returnValue_};b.getListeners=function(a,c){return this.eventTargetListeners_.getListeners(String(a),c)};b.getListener=function(a,c,d,e){return this.eventTargetListeners_.getListener(String(a),c,d,e)};
b.hasListener=function(a,c){return this.eventTargetListeners_.hasListener(k.isDef(a)?String(a):void 0,c)};var M=function(a){k.asserts.assert(a.eventTargetListeners_,"Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?")};
k.events.EventTarget.dispatchEventInternal_=function(a,c,d){var e=c.type||c;if(k.isString(c))c=new k.events.Event(c,a);else if(c instanceof k.events.Event)c.target=c.target||a;else{var f=c;c=new k.events.Event(e,a);k.object.extend(c,f)}var f=!0,g;if(d)for(var h=d.length-1;!c.propagationStopped_&&0<=h;h--)g=c.currentTarget=d[h],f=g.fireListeners(e,!0,c)&&f;c.propagationStopped_||(g=c.currentTarget=a,f=g.fireListeners(e,!0,c)&&f,c.propagationStopped_||(f=g.fireListeners(e,!1,c)&&f));if(d)for(h=0;!c.propagationStopped_&&
h<d.length;h++)g=c.currentTarget=d[h],f=g.fireListeners(e,!1,c)&&f;return f};k.json={};k.json.USE_NATIVE_JSON=!1;k.json.isValid_=function(a){return/^\s*$/.test(a)?!1:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,""))};k.json.parse=k.json.USE_NATIVE_JSON?k.global.JSON.parse:function(a){a=String(a);if(k.json.isValid_(a))try{return eval("("+a+")")}catch(c){}throw Error("Invalid JSON string: "+a);};
k.json.unsafeParse=k.json.USE_NATIVE_JSON?k.global.JSON.parse:function(a){return eval("("+a+")")};k.json.serialize=k.json.USE_NATIVE_JSON?k.global.JSON.stringify:function(a,c){return(new k.json.Serializer(c)).serialize(a)};k.json.Serializer=function(a){this.replacer_=a};k.json.Serializer.prototype.serialize=function(a){var c=[];N(this,a,c);return c.join("")};
var N=function(a,c,d){switch(typeof c){case "string":O(c,d);break;case "number":d.push(isFinite(c)&&!isNaN(c)?c:"null");break;case "boolean":d.push(c);break;case "undefined":d.push("null");break;case "object":if(null==c){d.push("null");break}if(k.isArray(c)){var e=c.length;d.push("[");for(var f="",g=0;g<e;g++)d.push(f),f=c[g],N(a,a.replacer_?a.replacer_.call(c,String(g),f):f,d),f=",";d.push("]");break}d.push("{");e="";for(g in c)Object.prototype.hasOwnProperty.call(c,g)&&(f=c[g],"function"!=typeof f&&
(d.push(e),O(g,d),d.push(":"),N(a,a.replacer_?a.replacer_.call(c,g,f):f,d),e=","));d.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof c);}};k.json.Serializer.charToJsonCharCache_={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"};k.json.Serializer.charsToReplace_=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
var O=function(a,c){c.push('"',a.replace(k.json.Serializer.charsToReplace_,function(a){if(a in k.json.Serializer.charToJsonCharCache_)return k.json.Serializer.charToJsonCharCache_[a];var c=a.charCodeAt(0),f="\\u";16>c?f+="000":256>c?f+="00":4096>c&&(f+="0");return k.json.Serializer.charToJsonCharCache_[a]=f+c.toString(16)}),'"')};k.structs.Collection=function(){};k.structs.Set=function(a){this.map_=new k.structs.Map;a&&this.addAll(a)};k.structs.Set.getKey_=function(a){var c=typeof a;return"object"==c&&a||"function"==c?"o"+k.getUid(a):c.substr(0,1)+a};b=k.structs.Set.prototype;b.getCount=function(){return this.map_.getCount()};b.add=function(a){this.map_.set(k.structs.Set.getKey_(a),a)};b.addAll=function(a){a=k.structs.getValues(a);for(var c=a.length,d=0;d<c;d++)this.add(a[d])};b.removeAll=function(a){a=k.structs.getValues(a);for(var c=a.length,d=0;d<c;d++)this.remove(a[d])};
b.remove=function(a){return this.map_.remove(k.structs.Set.getKey_(a))};b.clear=function(){this.map_.clear()};b.isEmpty=function(){return this.map_.isEmpty()};b.contains=function(a){return this.map_.containsKey(k.structs.Set.getKey_(a))};b.difference=function(a){var c=this.clone();c.removeAll(a);return c};b.getValues=function(){return this.map_.getValues()};b.clone=function(){return new k.structs.Set(this)};b.equals=function(a){return this.getCount()==k.structs.getCount(a)&&ba(this,a)};
var ba=function(a,c){var d=k.structs.getCount(c);if(a.getCount()>d)return!1;!(c instanceof k.structs.Set)&&5<d&&(c=new k.structs.Set(c));return k.structs.every(a,function(a){return k.structs.contains(c,a)})};k.structs.Set.prototype.__iterator__=function(){return this.map_.__iterator__(!1)};k.debug.LOGGING_ENABLED=k.DEBUG;k.debug.catchErrors=function(a,c,d){d=d||k.global;var e=d.onerror,f=!!c;k.userAgent.WEBKIT&&!k.userAgent.isVersionOrHigher("535.3")&&(f=!f);d.onerror=function(c,d,l,m,p){e&&e(c,d,l,m,p);a({message:c,fileName:d,line:l,col:m,error:p});return f}};k.debug.expose=function(a,c){if("undefined"==typeof a)return"undefined";if(null==a)return"NULL";var d=[],e;for(e in a)if(c||!k.isFunction(a[e])){var f=e+" = ";try{f+=a[e]}catch(g){f+="*** "+g+" ***"}d.push(f)}return d.join("\n")};
k.debug.deepExpose=function(a,c){var d=[],e=function(a,g,h){var l=g+"  ";h=new k.structs.Set(h);try{if(k.isDef(a))if(k.isNull(a))d.push("NULL");else if(k.isString(a))d.push('"'+a.replace(/\n/g,"\n"+g)+'"');else if(k.isFunction(a))d.push(String(a).replace(/\n/g,"\n"+g));else if(k.isObject(a))if(h.contains(a))d.push("*** reference loop detected ***");else{h.add(a);d.push("{");for(var m in a)if(c||!k.isFunction(a[m]))d.push("\n"),d.push(l),d.push(m+" = "),e(a[m],l,h);d.push("\n"+g+"}")}else d.push(a);
else d.push("undefined")}catch(p){d.push("*** "+p+" ***")}};e(a,"",new k.structs.Set);return d.join("")};k.debug.exposeArray=function(a){for(var c=[],d=0;d<a.length;d++)k.isArray(a[d])?c.push(k.debug.exposeArray(a[d])):c.push(a[d]);return"[ "+c.join(", ")+" ]"};
k.debug.exposeException=function(a,c){try{var d=k.debug.normalizeErrorObject(a);return"Message: "+k.string.htmlEscape(d.message)+'\nUrl: <a href="view-source:'+d.fileName+'" target="_new">'+d.fileName+"</a>\nLine: "+d.lineNumber+"\n\nBrowser stack:\n"+k.string.htmlEscape(d.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+k.string.htmlEscape(k.debug.getStacktrace(c)+"-> ")}catch(e){return"Exception trying to expose exception! You win, we lose. "+e}};
k.debug.normalizeErrorObject=function(a){var c=k.getObjectByName("window.location.href");if(k.isString(a))return{message:a,name:"Unknown error",lineNumber:"Not available",fileName:c,stack:"Not available"};var d,e,f=!1;try{d=a.lineNumber||a.line||"Not available"}catch(g){d="Not available",f=!0}try{e=a.fileName||a.filename||a.sourceURL||k.global.$googDebugFname||c}catch(h){e="Not available",f=!0}return!f&&a.lineNumber&&a.fileName&&a.stack&&a.message&&a.name?a:{message:a.message||"Not available",name:a.name||
"UnknownError",lineNumber:d,fileName:e,stack:a.stack||"Not available"}};k.debug.enhanceError=function(a,c){var d="string"==typeof a?Error(a):a;d.stack||(d.stack=k.debug.getStacktrace(arguments.callee.caller));if(c){for(var e=0;d["message"+e];)++e;d["message"+e]=String(c)}return d};
k.debug.getStacktraceSimple=function(a){for(var c=[],d=arguments.callee.caller,e=0;d&&(!a||e<a);){c.push(k.debug.getFunctionName(d));c.push("()\n");try{d=d.caller}catch(f){c.push("[exception trying to get caller]\n");break}e++;if(e>=k.debug.MAX_STACK_DEPTH){c.push("[...long stack...]");break}}a&&e>=a?c.push("[...reached max depth limit...]"):c.push("[end]");return c.join("")};k.debug.MAX_STACK_DEPTH=50;
k.debug.getStacktrace=function(a){return k.debug.getStacktraceHelper_(a||arguments.callee.caller,[])};
k.debug.getStacktraceHelper_=function(a,c){var d=[];if(k.array.contains(c,a))d.push("[...circular reference...]");else if(a&&c.length<k.debug.MAX_STACK_DEPTH){d.push(k.debug.getFunctionName(a)+"(");for(var e=a.arguments,f=0;e&&f<e.length;f++){0<f&&d.push(", ");var g;g=e[f];switch(typeof g){case "object":g=g?"object":"null";break;case "string":break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=k.debug.getFunctionName(g))?g:"[fn]";break;default:g=typeof g}40<
g.length&&(g=g.substr(0,40)+"...");d.push(g)}c.push(a);d.push(")\n");try{d.push(k.debug.getStacktraceHelper_(a.caller,c))}catch(h){d.push("[exception trying to get caller]\n")}}else a?d.push("[...long stack...]"):d.push("[end]");return d.join("")};k.debug.setFunctionResolver=function(a){k.debug.fnNameResolver_=a};
k.debug.getFunctionName=function(a){if(k.debug.fnNameCache_[a])return k.debug.fnNameCache_[a];if(k.debug.fnNameResolver_){var c=k.debug.fnNameResolver_(a);if(c)return k.debug.fnNameCache_[a]=c}a=String(a);k.debug.fnNameCache_[a]||(c=/function ([^\(]+)/.exec(a),k.debug.fnNameCache_[a]=c?c[1]:"[Anonymous]");return k.debug.fnNameCache_[a]};k.debug.makeWhitespaceVisible=function(a){return a.replace(/ /g,"[_]").replace(/\f/g,"[f]").replace(/\n/g,"[n]\n").replace(/\r/g,"[r]").replace(/\t/g,"[t]")};
k.debug.fnNameCache_={};k.debug.LogRecord=function(a,c,d,e,f){this.reset(a,c,d,e,f)};k.debug.LogRecord.prototype.exception_=null;k.debug.LogRecord.prototype.exceptionText_=null;k.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS=!0;k.debug.LogRecord.nextSequenceNumber_=0;k.debug.LogRecord.prototype.reset=function(a,c,d,e,f){k.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS&&("number"==typeof f||k.debug.LogRecord.nextSequenceNumber_++);e||k.now();this.level_=a;this.msg_=c;delete this.exception_;delete this.exceptionText_};
k.debug.LogRecord.prototype.setLevel=function(a){this.level_=a};k.debug.LogRecord.prototype.getMessage=function(){return this.msg_};k.debug.LogBuffer=function(){k.asserts.assert(k.debug.LogBuffer.isBufferingEnabled(),"Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY.");this.clear()};k.debug.LogBuffer.getInstance=function(){k.debug.LogBuffer.instance_||(k.debug.LogBuffer.instance_=new k.debug.LogBuffer);return k.debug.LogBuffer.instance_};k.debug.LogBuffer.CAPACITY=0;k.debug.LogBuffer.isBufferingEnabled=function(){return 0<k.debug.LogBuffer.CAPACITY};
k.debug.LogBuffer.prototype.clear=function(){this.buffer_=Array(k.debug.LogBuffer.CAPACITY);this.curIndex_=-1;this.isFull_=!1};k.debug.Logger=function(a){this.name_=a;this.handlers_=this.children_=this.level_=this.parent_=null};k.debug.Logger.ENABLE_HIERARCHY=!0;k.debug.Logger.ENABLE_HIERARCHY||(k.debug.Logger.rootHandlers_=[]);k.debug.Logger.Level=function(a,c){this.name=a;this.value=c};k.debug.Logger.Level.prototype.toString=function(){return this.name};k.debug.Logger.Level.OFF=new k.debug.Logger.Level("OFF",Infinity);k.debug.Logger.Level.SHOUT=new k.debug.Logger.Level("SHOUT",1200);
k.debug.Logger.Level.SEVERE=new k.debug.Logger.Level("SEVERE",1E3);k.debug.Logger.Level.WARNING=new k.debug.Logger.Level("WARNING",900);k.debug.Logger.Level.INFO=new k.debug.Logger.Level("INFO",800);k.debug.Logger.Level.CONFIG=new k.debug.Logger.Level("CONFIG",700);k.debug.Logger.Level.FINE=new k.debug.Logger.Level("FINE",500);k.debug.Logger.Level.FINER=new k.debug.Logger.Level("FINER",400);k.debug.Logger.Level.FINEST=new k.debug.Logger.Level("FINEST",300);
k.debug.Logger.Level.ALL=new k.debug.Logger.Level("ALL",0);k.debug.Logger.Level.PREDEFINED_LEVELS=[k.debug.Logger.Level.OFF,k.debug.Logger.Level.SHOUT,k.debug.Logger.Level.SEVERE,k.debug.Logger.Level.WARNING,k.debug.Logger.Level.INFO,k.debug.Logger.Level.CONFIG,k.debug.Logger.Level.FINE,k.debug.Logger.Level.FINER,k.debug.Logger.Level.FINEST,k.debug.Logger.Level.ALL];k.debug.Logger.Level.predefinedLevelsCache_=null;
k.debug.Logger.Level.createPredefinedLevelsCache_=function(){k.debug.Logger.Level.predefinedLevelsCache_={};for(var a=0,c;c=k.debug.Logger.Level.PREDEFINED_LEVELS[a];a++)k.debug.Logger.Level.predefinedLevelsCache_[c.value]=c,k.debug.Logger.Level.predefinedLevelsCache_[c.name]=c};k.debug.Logger.Level.getPredefinedLevel=function(a){k.debug.Logger.Level.predefinedLevelsCache_||k.debug.Logger.Level.createPredefinedLevelsCache_();return k.debug.Logger.Level.predefinedLevelsCache_[a]||null};
k.debug.Logger.Level.getPredefinedLevelByValue=function(a){k.debug.Logger.Level.predefinedLevelsCache_||k.debug.Logger.Level.createPredefinedLevelsCache_();if(a in k.debug.Logger.Level.predefinedLevelsCache_)return k.debug.Logger.Level.predefinedLevelsCache_[a];for(var c=0;c<k.debug.Logger.Level.PREDEFINED_LEVELS.length;++c){var d=k.debug.Logger.Level.PREDEFINED_LEVELS[c];if(d.value<=a)return d}return null};k.debug.Logger.getLogger=function(a){return k.debug.LogManager.getLogger(a)};
k.debug.Logger.logToProfilers=function(a){k.global.console&&(k.global.console.timeStamp?k.global.console.timeStamp(a):k.global.console.markTimeline&&k.global.console.markTimeline(a));k.global.msWriteProfilerMark&&k.global.msWriteProfilerMark(a)};b=k.debug.Logger.prototype;
b.addHandler=function(a){k.debug.LOGGING_ENABLED&&(k.debug.Logger.ENABLE_HIERARCHY?(this.handlers_||(this.handlers_=[]),this.handlers_.push(a)):(k.asserts.assert(!this.name_,"Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),k.debug.Logger.rootHandlers_.push(a)))};b.removeHandler=function(a){if(k.debug.LOGGING_ENABLED){var c=k.debug.Logger.ENABLE_HIERARCHY?this.handlers_:k.debug.Logger.rootHandlers_;return!!c&&k.array.remove(c,a)}return!1};
b.getParent=function(){return this.parent_};b.getChildren=function(){this.children_||(this.children_={});return this.children_};b.setLevel=function(a){k.debug.LOGGING_ENABLED&&(k.debug.Logger.ENABLE_HIERARCHY?this.level_=a:(k.asserts.assert(!this.name_,"Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."),k.debug.Logger.rootLevel_=a))};
var P=function(a){if(!k.debug.LOGGING_ENABLED)return k.debug.Logger.Level.OFF;if(!k.debug.Logger.ENABLE_HIERARCHY)return k.debug.Logger.rootLevel_;if(a.level_)return a.level_;if(a.parent_)return P(a.parent_);k.asserts.fail("Root logger has no level set.");return null};b=k.debug.Logger.prototype;
b.log=function(a,c,d){if(k.debug.LOGGING_ENABLED&&k.debug.LOGGING_ENABLED&&a.value>=P(this).value)if(k.isFunction(c)&&(c=c()),a=this.getLogRecord(a,c,d),k.debug.Logger.logToProfilers("log:"+a.getMessage()),k.debug.Logger.ENABLE_HIERARCHY)for(c=this;c;){d=c;var e=a;if(d.handlers_)for(var f=0,g=void 0;g=d.handlers_[f];f++)g(e);c=c.getParent()}else for(c=0;d=k.debug.Logger.rootHandlers_[c++];)d(a)};
b.getLogRecord=function(a,c,d){var e;if(k.debug.LogBuffer.isBufferingEnabled()){var f=k.debug.LogBuffer.getInstance();e=this.name_;var g=(f.curIndex_+1)%k.debug.LogBuffer.CAPACITY;f.curIndex_=g;f.isFull_?(f=f.buffer_[g],f.reset(a,c,e),e=f):(f.isFull_=g==k.debug.LogBuffer.CAPACITY-1,e=f.buffer_[g]=new k.debug.LogRecord(a,c,e))}else e=new k.debug.LogRecord(a,String(c),this.name_);d&&(e.exception_=d,f=k.debug.exposeException(d,arguments.callee.caller),e.exceptionText_=f);return e};
b.warning=function(a,c){k.debug.LOGGING_ENABLED&&this.log(k.debug.Logger.Level.WARNING,a,c)};b.info=function(a,c){k.debug.LOGGING_ENABLED&&this.log(k.debug.Logger.Level.INFO,a,c)};b.fine=function(a,c){k.debug.LOGGING_ENABLED&&this.log(k.debug.Logger.Level.FINE,a,c)};k.debug.LogManager={};k.debug.LogManager.loggers_={};k.debug.LogManager.rootLogger_=null;
k.debug.LogManager.initialize=function(){k.debug.LogManager.rootLogger_||(k.debug.LogManager.rootLogger_=new k.debug.Logger(""),k.debug.LogManager.loggers_[""]=k.debug.LogManager.rootLogger_,k.debug.LogManager.rootLogger_.setLevel(k.debug.Logger.Level.CONFIG))};k.debug.LogManager.getLoggers=function(){return k.debug.LogManager.loggers_};k.debug.LogManager.getRoot=function(){k.debug.LogManager.initialize();return k.debug.LogManager.rootLogger_};
k.debug.LogManager.getLogger=function(a){k.debug.LogManager.initialize();return k.debug.LogManager.loggers_[a]||k.debug.LogManager.createLogger_(a)};k.debug.LogManager.createFunctionForCatchErrors=function(a){return function(c){var d=a||k.debug.LogManager.getRoot();k.debug.LOGGING_ENABLED&&d.log(k.debug.Logger.Level.SEVERE,"Error: "+c.message+" ("+c.fileName+" @ Line: "+c.line+")",void 0)}};
k.debug.LogManager.createLogger_=function(a){var c=new k.debug.Logger(a);if(k.debug.Logger.ENABLE_HIERARCHY){var d=a.lastIndexOf("."),e=a.substr(d+1),d=k.debug.LogManager.getLogger(a.substr(0,d));d.getChildren()[e]=c;c.parent_=d}return k.debug.LogManager.loggers_[a]=c};k.log={};k.log.ENABLED=k.debug.LOGGING_ENABLED;k.log.Logger=k.debug.Logger;k.log.Level=k.debug.Logger.Level;k.log.LogRecord=k.debug.LogRecord;k.log.getLogger=function(a,c){if(k.log.ENABLED){var d=k.debug.LogManager.getLogger(a);c&&d&&d.setLevel(c);return d}return null};k.log.addHandler=function(a,c){k.log.ENABLED&&a&&a.addHandler(c)};k.log.removeHandler=function(a,c){return k.log.ENABLED&&a?a.removeHandler(c):!1};k.log.log=function(a,c,d,e){k.log.ENABLED&&a&&a.log(c,d,e)};
k.log.error=function(a,c,d){k.log.ENABLED&&a&&k.debug.LOGGING_ENABLED&&a.log(k.debug.Logger.Level.SEVERE,c,d)};k.log.warning=function(a,c,d){k.log.ENABLED&&a&&a.warning(c,d)};k.log.info=function(a,c,d){k.log.ENABLED&&a&&a.info(c,d)};k.log.fine=function(a,c,d){k.log.ENABLED&&a&&a.fine(c,d)};k.Timer=function(a,c){k.events.EventTarget.call(this);this.interval_=a||1;this.timerObject_=c||k.Timer.defaultTimerObject;this.boundTick_=k.bind(this.tick_,this);this.last_=k.now()};k.inherits(k.Timer,k.events.EventTarget);k.Timer.MAX_TIMEOUT_=2147483647;k.Timer.prototype.enabled=!1;k.Timer.defaultTimerObject=k.global;k.Timer.intervalScale=0.8;k.Timer.prototype.timer_=null;
k.Timer.prototype.tick_=function(){if(this.enabled){var a=k.now()-this.last_;0<a&&a<this.interval_*k.Timer.intervalScale?this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_-a):(this.timer_&&(this.timerObject_.clearTimeout(this.timer_),this.timer_=null),this.dispatchEvent(k.Timer.TICK),this.enabled&&(this.timer_=this.timerObject_.setTimeout(this.boundTick_,this.interval_),this.last_=k.now()))}};
k.Timer.prototype.stop=function(){this.enabled=!1;this.timer_&&(this.timerObject_.clearTimeout(this.timer_),this.timer_=null)};k.Timer.prototype.disposeInternal=function(){k.Timer.superClass_.disposeInternal.call(this);this.stop();delete this.timerObject_};k.Timer.TICK="tick";
k.Timer.callOnce=function(a,c,d){if(k.isFunction(a))d&&(a=k.bind(a,d));else if(a&&"function"==typeof a.handleEvent)a=k.bind(a.handleEvent,a);else throw Error("Invalid listener argument");return c>k.Timer.MAX_TIMEOUT_?-1:k.Timer.defaultTimerObject.setTimeout(a,c||0)};k.Timer.clear=function(a){k.Timer.defaultTimerObject.clearTimeout(a)};k.net={};k.net.ErrorCode={NO_ERROR:0,ACCESS_DENIED:1,FILE_NOT_FOUND:2,FF_SILENT_ERROR:3,CUSTOM_ERROR:4,EXCEPTION:5,HTTP_ERROR:6,ABORT:7,TIMEOUT:8,OFFLINE:9};
k.net.ErrorCode.getDebugMessage=function(a){switch(a){case k.net.ErrorCode.NO_ERROR:return"No Error";case k.net.ErrorCode.ACCESS_DENIED:return"Access denied to content document";case k.net.ErrorCode.FILE_NOT_FOUND:return"File not found";case k.net.ErrorCode.FF_SILENT_ERROR:return"Firefox silently errored";case k.net.ErrorCode.CUSTOM_ERROR:return"Application custom error";case k.net.ErrorCode.EXCEPTION:return"An exception occurred";case k.net.ErrorCode.HTTP_ERROR:return"Http response at 400 or 500 level";
case k.net.ErrorCode.ABORT:return"Request was aborted";case k.net.ErrorCode.TIMEOUT:return"Request timed out";case k.net.ErrorCode.OFFLINE:return"The resource is not available offline";default:return"Unrecognized error code"}};k.net.EventType={COMPLETE:"complete",SUCCESS:"success",ERROR:"error",ABORT:"abort",READY:"ready",READY_STATE_CHANGE:"readystatechange",TIMEOUT:"timeout",INCREMENTAL_DATA:"incrementaldata",PROGRESS:"progress"};k.net.HttpStatus={CONTINUE:100,SWITCHING_PROTOCOLS:101,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,
PRECONDITION_FAILED:412,REQUEST_ENTITY_TOO_LARGE:413,REQUEST_URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,REQUEST_RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,QUIRK_IE_NO_CONTENT:1223};
k.net.HttpStatus.isSuccess=function(a){switch(a){case k.net.HttpStatus.OK:case k.net.HttpStatus.CREATED:case k.net.HttpStatus.ACCEPTED:case k.net.HttpStatus.NO_CONTENT:case k.net.HttpStatus.PARTIAL_CONTENT:case k.net.HttpStatus.NOT_MODIFIED:case k.net.HttpStatus.QUIRK_IE_NO_CONTENT:return!0;default:return!1}};k.net.XhrLike=function(){};k.net.XhrLike.prototype.open=function(){};k.net.XhrLike.prototype.send=function(){};k.net.XhrLike.prototype.abort=function(){};k.net.XhrLike.prototype.setRequestHeader=function(){};k.net.XmlHttpFactory=function(){};k.net.XmlHttpFactory.prototype.cachedOptions_=null;k.net.XmlHttpFactory.prototype.getOptions=function(){var a;(a=this.cachedOptions_)||(a={},R(this)&&(a[k.net.XmlHttp.OptionType.USE_NULL_FUNCTION]=!0,a[k.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]=!0),a=this.cachedOptions_=a);return a};k.net.WrapperXmlHttpFactory=function(a,c){this.xhrFactory_=a;this.optionsFactory_=c};k.inherits(k.net.WrapperXmlHttpFactory,k.net.XmlHttpFactory);k.net.WrapperXmlHttpFactory.prototype.createInstance=function(){return this.xhrFactory_()};k.net.WrapperXmlHttpFactory.prototype.getOptions=function(){return this.optionsFactory_()};k.net.XmlHttp=function(){return k.net.XmlHttp.factory_.createInstance()};k.net.XmlHttp.ASSUME_NATIVE_XHR=!1;k.net.XmlHttpDefines={};k.net.XmlHttpDefines.ASSUME_NATIVE_XHR=!1;k.net.XmlHttp.getOptions=function(){return k.net.XmlHttp.factory_.getOptions()};k.net.XmlHttp.OptionType={USE_NULL_FUNCTION:0,LOCAL_REQUEST_ERROR:1};k.net.XmlHttp.ReadyState={UNINITIALIZED:0,LOADING:1,LOADED:2,INTERACTIVE:3,COMPLETE:4};
k.net.XmlHttp.setFactory=function(a,c){k.net.XmlHttp.setGlobalFactory(new k.net.WrapperXmlHttpFactory(k.asserts.assert(a),k.asserts.assert(c)))};k.net.XmlHttp.setGlobalFactory=function(a){k.net.XmlHttp.factory_=a};k.net.DefaultXmlHttpFactory=function(){};k.inherits(k.net.DefaultXmlHttpFactory,k.net.XmlHttpFactory);k.net.DefaultXmlHttpFactory.prototype.createInstance=function(){var a=R(this);return a?new ActiveXObject(a):new XMLHttpRequest};
var R=function(a){if(k.net.XmlHttp.ASSUME_NATIVE_XHR||k.net.XmlHttpDefines.ASSUME_NATIVE_XHR)return"";if(!a.ieProgId_&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var c=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],d=0;d<c.length;d++){var e=c[d];try{return new ActiveXObject(e),a.ieProgId_=e}catch(f){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.ieProgId_};k.net.XmlHttp.setGlobalFactory(new k.net.DefaultXmlHttpFactory);k.net.XhrIo=function(a){k.events.EventTarget.call(this);this.headers=new k.structs.Map;this.xmlHttpFactory_=a||null;this.active_=!1;this.xhrOptions_=this.xhr_=null;this.lastError_=this.lastMethod_=this.lastUri_="";this.inAbort_=this.inOpen_=this.inSend_=this.errorDispatched_=!1;this.timeoutInterval_=0;this.timeoutId_=null;this.responseType_=k.net.XhrIo.ResponseType.DEFAULT;this.useXhr2Timeout_=this.withCredentials_=!1};k.inherits(k.net.XhrIo,k.events.EventTarget);
k.net.XhrIo.ResponseType={DEFAULT:"",TEXT:"text",DOCUMENT:"document",BLOB:"blob",ARRAY_BUFFER:"arraybuffer"};k.net.XhrIo.prototype.logger_=k.log.getLogger("goog.net.XhrIo");k.net.XhrIo.CONTENT_TYPE_HEADER="Content-Type";k.net.XhrIo.HTTP_SCHEME_PATTERN=/^https?$/i;k.net.XhrIo.METHODS_WITH_FORM_DATA=["POST","PUT"];k.net.XhrIo.FORM_CONTENT_TYPE="application/x-www-form-urlencoded;charset=utf-8";k.net.XhrIo.XHR2_TIMEOUT_="timeout";k.net.XhrIo.XHR2_ON_TIMEOUT_="ontimeout";k.net.XhrIo.sendInstances_=[];
k.net.XhrIo.send=function(a,c,d,e,f,g,h){var l=new k.net.XhrIo;k.net.XhrIo.sendInstances_.push(l);c&&l.listen(k.net.EventType.COMPLETE,c);l.listenOnce(k.net.EventType.READY,l.cleanupSend_);g&&(l.timeoutInterval_=Math.max(0,g));h&&(l.withCredentials_=h);l.send(a,d,e,f)};k.net.XhrIo.cleanup=function(){for(var a=k.net.XhrIo.sendInstances_;a.length;)a.pop().dispose()};k.net.XhrIo.protectEntryPoints=function(a){k.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a.protectEntryPoint(k.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)};
k.net.XhrIo.prototype.cleanupSend_=function(){this.dispose();k.array.remove(k.net.XhrIo.sendInstances_,this)};
k.net.XhrIo.prototype.send=function(a,c,d,e){if(this.xhr_)throw Error("[goog.net.XhrIo] Object is active with another request="+this.lastUri_+"; newUri="+a);c=c?c.toUpperCase():"GET";this.lastUri_=a;this.lastError_="";this.lastMethod_=c;this.errorDispatched_=!1;this.active_=!0;this.xhr_=this.xmlHttpFactory_?this.xmlHttpFactory_.createInstance():k.net.XmlHttp();this.xhrOptions_=this.xmlHttpFactory_?this.xmlHttpFactory_.getOptions():k.net.XmlHttp.getOptions();this.xhr_.onreadystatechange=k.bind(this.onReadyStateChange_,
this);try{k.log.fine(this.logger_,S(this,"Opening Xhr")),this.inOpen_=!0,this.xhr_.open(c,String(a),!0),this.inOpen_=!1}catch(f){k.log.fine(this.logger_,S(this,"Error opening Xhr: "+f.message));T(this,f);return}a=d||"";var g=this.headers.clone();e&&k.structs.forEach(e,function(a,c){g.set(c,a)});e=k.array.find(g.getKeys(),k.net.XhrIo.isContentTypeHeader_);d=k.global.FormData&&a instanceof k.global.FormData;!k.array.contains(k.net.XhrIo.METHODS_WITH_FORM_DATA,c)||e||d||g.set(k.net.XhrIo.CONTENT_TYPE_HEADER,
k.net.XhrIo.FORM_CONTENT_TYPE);k.structs.forEach(g,function(a,c){this.xhr_.setRequestHeader(c,a)},this);this.responseType_&&(this.xhr_.responseType=this.responseType_);k.object.containsKey(this.xhr_,"withCredentials")&&(this.xhr_.withCredentials=this.withCredentials_);try{U(this),0<this.timeoutInterval_&&(this.useXhr2Timeout_=k.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_),k.log.fine(this.logger_,S(this,"Will abort after "+this.timeoutInterval_+"ms if incomplete, xhr2 "+this.useXhr2Timeout_)),this.useXhr2Timeout_?
(this.xhr_[k.net.XhrIo.XHR2_TIMEOUT_]=this.timeoutInterval_,this.xhr_[k.net.XhrIo.XHR2_ON_TIMEOUT_]=k.bind(this.timeout_,this)):this.timeoutId_=k.Timer.callOnce(this.timeout_,this.timeoutInterval_,this)),k.log.fine(this.logger_,S(this,"Sending request")),this.inSend_=!0,this.xhr_.send(a),this.inSend_=!1}catch(h){k.log.fine(this.logger_,S(this,"Send error: "+h.message)),T(this,h)}};
k.net.XhrIo.shouldUseXhr2Timeout_=function(a){return k.userAgent.IE&&k.userAgent.isVersionOrHigher(9)&&k.isNumber(a[k.net.XhrIo.XHR2_TIMEOUT_])&&k.isDef(a[k.net.XhrIo.XHR2_ON_TIMEOUT_])};k.net.XhrIo.isContentTypeHeader_=function(a){return k.string.caseInsensitiveEquals(a)};
k.net.XhrIo.prototype.timeout_=function(){"undefined"!=typeof k&&this.xhr_&&(this.lastError_="Timed out after "+this.timeoutInterval_+"ms, aborting",k.log.fine(this.logger_,S(this,this.lastError_)),this.dispatchEvent(k.net.EventType.TIMEOUT),this.abort(k.net.ErrorCode.TIMEOUT))};var T=function(a,c){a.active_=!1;a.xhr_&&(a.inAbort_=!0,a.xhr_.abort(),a.inAbort_=!1);a.lastError_=c;V(a);W(a)},V=function(a){a.errorDispatched_||(a.errorDispatched_=!0,a.dispatchEvent(k.net.EventType.COMPLETE),a.dispatchEvent(k.net.EventType.ERROR))};
k.net.XhrIo.prototype.abort=function(){this.xhr_&&this.active_&&(k.log.fine(this.logger_,S(this,"Aborting")),this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1,this.dispatchEvent(k.net.EventType.COMPLETE),this.dispatchEvent(k.net.EventType.ABORT),W(this))};k.net.XhrIo.prototype.disposeInternal=function(){this.xhr_&&(this.active_&&(this.active_=!1,this.inAbort_=!0,this.xhr_.abort(),this.inAbort_=!1),W(this,!0));k.net.XhrIo.superClass_.disposeInternal.call(this)};
k.net.XhrIo.prototype.onReadyStateChange_=function(){if(!this.isDisposed())if(this.inOpen_||this.inSend_||this.inAbort_)X(this);else this.onReadyStateChangeEntryPoint_()};k.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=function(){X(this)};
var X=function(a){if(a.active_&&"undefined"!=typeof k)if(a.xhrOptions_[k.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR]&&Y(a)==k.net.XmlHttp.ReadyState.COMPLETE&&2==Z(a))k.log.fine(a.logger_,S(a,"Local request error detected and ignored"));else if(a.inSend_&&Y(a)==k.net.XmlHttp.ReadyState.COMPLETE)k.Timer.callOnce(a.onReadyStateChange_,0,a);else if(a.dispatchEvent(k.net.EventType.READY_STATE_CHANGE),Y(a)==k.net.XmlHttp.ReadyState.COMPLETE){k.log.fine(a.logger_,S(a,"Request complete"));a.active_=!1;try{if(a.isSuccess())a.dispatchEvent(k.net.EventType.COMPLETE),
a.dispatchEvent(k.net.EventType.SUCCESS);else{var c;try{c=Y(a)>k.net.XmlHttp.ReadyState.LOADED?a.xhr_.statusText:""}catch(d){k.log.fine(a.logger_,"Can not get status: "+d.message),c=""}a.lastError_=c+" ["+Z(a)+"]";V(a)}}finally{W(a)}}},W=function(a,c){if(a.xhr_){U(a);var d=a.xhr_,e=a.xhrOptions_[k.net.XmlHttp.OptionType.USE_NULL_FUNCTION]?k.nullFunction:null;a.xhr_=null;a.xhrOptions_=null;c||a.dispatchEvent(k.net.EventType.READY);try{d.onreadystatechange=e}catch(f){k.log.error(a.logger_,"Problem encountered resetting onreadystatechange: "+
f.message)}}},U=function(a){a.xhr_&&a.useXhr2Timeout_&&(a.xhr_[k.net.XhrIo.XHR2_ON_TIMEOUT_]=null);k.isNumber(a.timeoutId_)&&(k.Timer.clear(a.timeoutId_),a.timeoutId_=null)};k.net.XhrIo.prototype.isSuccess=function(){var a=Z(this),c;if(!(c=k.net.HttpStatus.isSuccess(a))){if(a=0===a)a=k.uri.utils.getEffectiveScheme(String(this.lastUri_)),a=!k.net.XhrIo.HTTP_SCHEME_PATTERN.test(a);c=a}return c};
var Y=function(a){return a.xhr_?a.xhr_.readyState:k.net.XmlHttp.ReadyState.UNINITIALIZED},Z=function(a){try{return Y(a)>k.net.XmlHttp.ReadyState.LOADED?a.xhr_.status:-1}catch(c){return-1}},S=function(a,c){return c+" ["+a.lastMethod_+" "+a.lastUri_+" "+Z(a)+"]"};k.debug.entryPointRegistry.register(function(a){k.net.XhrIo.prototype.onReadyStateChangeEntryPoint_=a(k.net.XhrIo.prototype.onReadyStateChangeEntryPoint_)});k.craw.AppAuthenticator=function(a,c,d){this.appUrl_=a;this.authCompletedCallback_=c;this.authFailedCallback_=d||k.functions.NULL;this.uberTokenAttempts_=0};k.craw.AppAuthenticator.UBERAUTH_URL_="https://www.google.com/accounts/OAuthLogin?issueuberauth=1";
k.craw.AppAuthenticator.prototype.onAuthTokenReceived_=function(a){if(k.isDef(a)){var c=k.bind(this.onUberAuthResponse_,this),d="source="+chrome.runtime.getManifest().oauth2.client_id,e={Authorization:"Bearer "+a,"Content-Type":"application/x-www-form-urlencoded"},f=k.bind(function(){0===this.uberTokenAttempts_?(++this.uberTokenAttempts_,chrome.identity.removeCachedAuthToken({token:a},k.bind(this.authenticate,this))):this.authFailedCallback_()},this);k.net.XhrIo.send(k.craw.AppAuthenticator.UBERAUTH_URL_,
function(){if(this.isSuccess()){var a;try{a=this.xhr_?this.xhr_.responseText:""}catch(d){k.log.fine(this.logger_,"Can not get responseText: "+d.message),a=""}c(a)}else f()},"POST",d,e)}else this.authFailedCallback_()};k.craw.AppAuthenticator.prototype.onUberAuthResponse_=function(a){var c=k.Uri.parse("https://accounts.google.com/MergeSession");C(c,"source","appsv2");C(c,"uberauth",a);C(c,"continue",this.appUrl_);this.authCompletedCallback_(c.toString())};
k.craw.AppAuthenticator.prototype.authenticate=function(){chrome.identity.getAuthToken({interactive:!0},k.bind(this.onAuthTokenReceived_,this))};k.craw.WindowConfig=function(a,c){this.url_=a;this.useAuth_=c};k.craw.WindowConfig.prototype.getUrl=function(){return this.url_};k.craw.WindowConfig.prototype.getUseAuth=function(){return this.useAuth_};k.craw.AppWindow=function(a){this.config_=a;this.authenticator_=new k.craw.AppAuthenticator(a.getUrl(),k.bind(this.navigateToUrl_,this),k.bind(this.showOfflineWarning,this));this.webview_=k.dom.getDocument().querySelector("webview");this.hasLaunched_=!1;this.loadingOverlay_=k.dom.getElement("loading_overlay");this.offlineOverlay_=k.dom.getElement("offline_overlay");this.customStatus_=null;this.delegate_=k.craw.AppWindowDelegate.createDefaultImpl(this);this.webview_.addEventListener("contentload",
k.bind(this.onContentLoad_,this),!1);this.webview_.addEventListener("newwindow",k.bind(this.onNewWindow_,this),!1);this.delegate_.onWindowReady();this.pollOnlineStatus_()};k.craw.AppWindow.REQUEST_FILTER_URL_PATTERN_="https://*.google.com/*";k.craw.AppWindow.REQUEST_FILTER_TYPE_="main_frame";k.craw.AppWindow.QUERY_NOCACHE_PARAMETER_="nocache";k.craw.AppWindow.NETWORK_TEST_URLS_=["https://www.google.com/images/cleardot.gif","https://www.google.com/images/dot2.gif","https://www.google.com/images/x2.gif"];
k.craw.AppWindow.prototype.navigateToUrl_=function(a){this.webview_.src="about:blank";this.webview_.src=a;this.hasLaunched_=!0};k.craw.AppWindow.prototype.onContentLoad_=function(){};k.craw.AppWindow.prototype.onNewWindow_=function(){};var $=function(a){a.hasLaunched_=!1;a.config_.getUseAuth()?a.authenticator_.authenticate():a.navigateToUrl_(a.config_.getUrl())};b=k.craw.AppWindow.prototype;
b.hideVisibleOverlays_=function(){this.loadingOverlay_.style.display="none";this.offlineOverlay_.style.display="none"};b.fadeInOfflineOverlay_=function(){this.offlineOverlay_.style.opacity="1"};
b.showOfflineWarning=function(){k.dom.getElement("app_unavailable").innerText=this.delegate_.getAppUnavailableMessage();k.dom.getElement("connect_to_network").innerText=this.customStatus_||chrome.i18n.getMessage("craw_connect_to_network");this.offlineOverlay_.style.display="-webkit-flex";this.offlineOverlay_.style.pointerEvents="all";k.Timer.callOnce(k.bind(this.fadeInOfflineOverlay_,this),0)};
b.setOnlineStatus_=function(a){k.Timer.callOnce(k.bind(this.pollOnlineStatus_,this),1E3);a?this.hasLaunched_?this.delegate_.finishedLaunch()&&(this.offlineOverlay_.style.opacity="0",this.offlineOverlay_.style.pointerEvents="none",this.loadingOverlay_.style.opacity="0",this.loadingOverlay_.style.pointerEvents="none",k.Timer.callOnce(k.bind(this.hideVisibleOverlays_,this),250)):$(this):this.showOfflineWarning()};
b.pollOnlineStatus_=function(){if(this.customStatus_=this.delegate_.pollOnlineStatus())this.setOnlineStatus_(!1);else{var a=k.bind(this.setOnlineStatus_,this),c=new k.Uri(k.craw.AppWindow.NETWORK_TEST_URLS_[k.math.randomInt()]);C(c,k.craw.AppWindow.QUERY_NOCACHE_PARAMETER_,Date.now().toString());k.net.XhrIo.send(c.toString(),function(){a(this.isSuccess())})}};window.onload=function(){$(new k.craw.AppWindow(k.dom.getWindow().crawConfig_))};
