var COMPILED=true;var goog=goog||{};goog.global=this;goog.global.CLOSURE_UNCOMPILED_DEFINES;goog.global.CLOSURE_DEFINES;goog.isDef=function(val){return val!==void 0;};goog.exportPath_=function(name,opt_object,opt_objectToExportTo){var parts=name.split('.');var cur=opt_objectToExportTo||goog.global;if(!(parts[0]in cur)&&cur.execScript){cur.execScript('var '+parts[0]);}
for(var part;parts.length&&(part=parts.shift());){if(!parts.length&&goog.isDef(opt_object)){cur[part]=opt_object;}else if(cur[part]){cur=cur[part];}else{cur=cur[part]={};}}};goog.define=function(name,defaultValue){var value=defaultValue;if(!COMPILED){if(goog.global.CLOSURE_UNCOMPILED_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES,name)){value=goog.global.CLOSURE_UNCOMPILED_DEFINES[name];}else if(goog.global.CLOSURE_DEFINES&&Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES,name)){value=goog.global.CLOSURE_DEFINES[name];}}
goog.exportPath_(name,value);};goog.DEBUG=true;goog.define('goog.LOCALE','en');goog.define('goog.TRUSTED_SITE',true);goog.define('goog.STRICT_MODE_COMPATIBLE',false);goog.provide=function(name){if(!COMPILED){if(goog.isProvided_(name)){throw Error('Namespace "'+name+'" already declared.');}
delete goog.implicitNamespaces_[name];var namespace=name;while((namespace=namespace.substring(0,namespace.lastIndexOf('.')))){if(goog.getObjectByName(namespace)){break;}
goog.implicitNamespaces_[namespace]=true;}}
goog.exportPath_(name);};goog.setTestOnly=function(opt_message){if(COMPILED&&!goog.DEBUG){opt_message=opt_message||'';throw Error('Importing test-only code into non-debug environment'+
opt_message?': '+opt_message:'.');}};goog.forwardDeclare=function(name){};if(!COMPILED){goog.isProvided_=function(name){return!goog.implicitNamespaces_[name]&&goog.isDefAndNotNull(goog.getObjectByName(name));};goog.implicitNamespaces_={};}
goog.getObjectByName=function(name,opt_obj){var parts=name.split('.');var cur=opt_obj||goog.global;for(var part;part=parts.shift();){if(goog.isDefAndNotNull(cur[part])){cur=cur[part];}else{return null;}}
return cur;};goog.globalize=function(obj,opt_global){var global=opt_global||goog.global;for(var x in obj){global[x]=obj[x];}};goog.addDependency=function(relPath,provides,requires){if(goog.DEPENDENCIES_ENABLED){var provide,require;var path=relPath.replace(/\\/g,'/');var deps=goog.dependencies_;for(var i=0;provide=provides[i];i++){deps.nameToPath[provide]=path;if(!(path in deps.pathToNames)){deps.pathToNames[path]={};}
deps.pathToNames[path][provide]=true;}
for(var j=0;require=requires[j];j++){if(!(path in deps.requires)){deps.requires[path]={};}
deps.requires[path][require]=true;}}};goog.define('goog.ENABLE_DEBUG_LOADER',true);goog.require=function(name){if(!COMPILED){if(goog.isProvided_(name)){return;}
if(goog.ENABLE_DEBUG_LOADER){var path=goog.getPathFromDeps_(name);if(path){goog.included_[path]=true;goog.writeScripts_();return;}}
var errorMessage='goog.require could not find: '+name;if(goog.global.console){goog.global.console['error'](errorMessage);}
throw Error(errorMessage);}};goog.basePath='';goog.global.CLOSURE_BASE_PATH;goog.global.CLOSURE_NO_DEPS=true;goog.global.CLOSURE_IMPORT_SCRIPT;goog.nullFunction=function(){};goog.identityFunction=function(opt_returnValue,var_args){return opt_returnValue;};goog.abstractMethod=function(){throw Error('unimplemented abstract method');};goog.addSingletonGetter=function(ctor){ctor.getInstance=function(){if(ctor.instance_){return ctor.instance_;}
if(goog.DEBUG){goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=ctor;}
return ctor.instance_=new ctor;};};goog.instantiatedSingletons_=[];goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;if(goog.DEPENDENCIES_ENABLED){goog.included_={};goog.dependencies_={pathToNames:{},nameToPath:{},requires:{},visited:{},written:{}};goog.inHtmlDocument_=function(){var doc=goog.global.document;return typeof doc!='undefined'&&'write'in doc;};goog.findBasePath_=function(){if(goog.global.CLOSURE_BASE_PATH){goog.basePath=goog.global.CLOSURE_BASE_PATH;return;}else if(!goog.inHtmlDocument_()){return;}
var doc=goog.global.document;var scripts=doc.getElementsByTagName('script');for(var i=scripts.length-1;i>=0;--i){var src=scripts[i].src;var qmark=src.lastIndexOf('?');var l=qmark==-1?src.length:qmark;if(src.substr(l-7,7)=='base.js'){goog.basePath=src.substr(0,l-7);return;}}};goog.importScript_=function(src){var importScript=goog.global.CLOSURE_IMPORT_SCRIPT||goog.writeScriptTag_;if(!goog.dependencies_.written[src]&&importScript(src)){goog.dependencies_.written[src]=true;}};goog.writeScriptTag_=function(src){if(goog.inHtmlDocument_()){var doc=goog.global.document;if(doc.readyState=='complete'){var isDeps=/\bdeps.js$/.test(src);if(isDeps){return false;}else{throw Error('Cannot write "'+src+'" after document load');}}
doc.write('<script type="text/javascript" src="'+src+'"></'+'script>');return true;}else{return false;}};goog.writeScripts_=function(){var scripts=[];var seenScript={};var deps=goog.dependencies_;function visitNode(path){if(path in deps.written){return;}
if(path in deps.visited){if(!(path in seenScript)){seenScript[path]=true;scripts.push(path);}
return;}
deps.visited[path]=true;if(path in deps.requires){for(var requireName in deps.requires[path]){if(!goog.isProvided_(requireName)){if(requireName in deps.nameToPath){visitNode(deps.nameToPath[requireName]);}else{throw Error('Undefined nameToPath for '+requireName);}}}}
if(!(path in seenScript)){seenScript[path]=true;scripts.push(path);}}
for(var path in goog.included_){if(!deps.written[path]){visitNode(path);}}
for(var i=0;i<scripts.length;i++){if(scripts[i]){goog.importScript_(goog.basePath+scripts[i]);}else{throw Error('Undefined script input');}}};goog.getPathFromDeps_=function(rule){if(rule in goog.dependencies_.nameToPath){return goog.dependencies_.nameToPath[rule];}else{return null;}};goog.findBasePath_();if(!goog.global.CLOSURE_NO_DEPS){goog.importScript_(goog.basePath+'deps.js');}}
goog.typeOf=function(value){var s=typeof value;if(s=='object'){if(value){if(value instanceof Array){return'array';}else if(value instanceof Object){return s;}
var className=Object.prototype.toString.call((value));if(className=='[object Window]'){return'object';}
if((className=='[object Array]'||typeof value.length=='number'&&typeof value.splice!='undefined'&&typeof value.propertyIsEnumerable!='undefined'&&!value.propertyIsEnumerable('splice'))){return'array';}
if((className=='[object Function]'||typeof value.call!='undefined'&&typeof value.propertyIsEnumerable!='undefined'&&!value.propertyIsEnumerable('call'))){return'function';}}else{return'null';}}else if(s=='function'&&typeof value.call=='undefined'){return'object';}
return s;};goog.isNull=function(val){return val===null;};goog.isDefAndNotNull=function(val){return val!=null;};goog.isArray=function(val){return goog.typeOf(val)=='array';};goog.isArrayLike=function(val){var type=goog.typeOf(val);return type=='array'||type=='object'&&typeof val.length=='number';};goog.isDateLike=function(val){return goog.isObject(val)&&typeof val.getFullYear=='function';};goog.isString=function(val){return typeof val=='string';};goog.isBoolean=function(val){return typeof val=='boolean';};goog.isNumber=function(val){return typeof val=='number';};goog.isFunction=function(val){return goog.typeOf(val)=='function';};goog.isObject=function(val){var type=typeof val;return type=='object'&&val!=null||type=='function';};goog.getUid=function(obj){return obj[goog.UID_PROPERTY_]||(obj[goog.UID_PROPERTY_]=++goog.uidCounter_);};goog.hasUid=function(obj){return!!obj[goog.UID_PROPERTY_];};goog.removeUid=function(obj){if('removeAttribute'in obj){obj.removeAttribute(goog.UID_PROPERTY_);}
try{delete obj[goog.UID_PROPERTY_];}catch(ex){}};goog.UID_PROPERTY_='closure_uid_'+((Math.random()*1e9)>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function(obj){var type=goog.typeOf(obj);if(type=='object'||type=='array'){if(obj.clone){return obj.clone();}
var clone=type=='array'?[]:{};for(var key in obj){clone[key]=goog.cloneObject(obj[key]);}
return clone;}
return obj;};goog.bindNative_=function(fn,selfObj,var_args){return(fn.call.apply(fn.bind,arguments));};goog.bindJs_=function(fn,selfObj,var_args){if(!fn){throw new Error();}
if(arguments.length>2){var boundArgs=Array.prototype.slice.call(arguments,2);return function(){var newArgs=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(newArgs,boundArgs);return fn.apply(selfObj,newArgs);};}else{return function(){return fn.apply(selfObj,arguments);};}};goog.bind=function(fn,selfObj,var_args){if(Function.prototype.bind&&Function.prototype.bind.toString().indexOf('native code')!=-1){goog.bind=goog.bindNative_;}else{goog.bind=goog.bindJs_;}
return goog.bind.apply(null,arguments);};goog.partial=function(fn,var_args){var args=Array.prototype.slice.call(arguments,1);return function(){var newArgs=args.slice();newArgs.push.apply(newArgs,arguments);return fn.apply(this,newArgs);};};goog.mixin=function(target,source){for(var x in source){target[x]=source[x];}};goog.now=(goog.TRUSTED_SITE&&Date.now)||(function(){return+new Date();});goog.globalEval=function(script){if(goog.global.execScript){goog.global.execScript(script,'JavaScript');}else if(goog.global.eval){if(goog.evalWorksForGlobals_==null){goog.global.eval('var _et_ = 1;');if(typeof goog.global['_et_']!='undefined'){delete goog.global['_et_'];goog.evalWorksForGlobals_=true;}else{goog.evalWorksForGlobals_=false;}}
if(goog.evalWorksForGlobals_){goog.global.eval(script);}else{var doc=goog.global.document;var scriptElt=doc.createElement('script');scriptElt.type='text/javascript';scriptElt.defer=false;scriptElt.appendChild(doc.createTextNode(script));doc.body.appendChild(scriptElt);doc.body.removeChild(scriptElt);}}else{throw Error('goog.globalEval not available');}};goog.evalWorksForGlobals_=null;goog.cssNameMapping_;goog.cssNameMappingStyle_;goog.getCssName=function(className,opt_modifier){var getMapping=function(cssName){return goog.cssNameMapping_[cssName]||cssName;};var renameByParts=function(cssName){var parts=cssName.split('-');var mapped=[];for(var i=0;i<parts.length;i++){mapped.push(getMapping(parts[i]));}
return mapped.join('-');};var rename;if(goog.cssNameMapping_){rename=goog.cssNameMappingStyle_=='BY_WHOLE'?getMapping:renameByParts;}else{rename=function(a){return a;};}
if(opt_modifier){return className+'-'+rename(opt_modifier);}else{return rename(className);}};goog.setCssNameMapping=function(mapping,opt_style){goog.cssNameMapping_=mapping;goog.cssNameMappingStyle_=opt_style;};goog.global.CLOSURE_CSS_NAME_MAPPING;if(!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING){goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING;}
goog.getMsg=function(str,opt_values){var values=opt_values||{};for(var key in values){var value=(''+values[key]).replace(/\$/g,'$$$$');str=str.replace(new RegExp('\\{\\$'+key+'\\}','gi'),value);}
return str;};goog.getMsgWithFallback=function(a,b){return a;};goog.exportSymbol=function(publicPath,object,opt_objectToExportTo){goog.exportPath_(publicPath,object,opt_objectToExportTo);};goog.exportProperty=function(object,publicName,symbol){object[publicName]=symbol;};goog.inherits=function(childCtor,parentCtor){function tempCtor(){};tempCtor.prototype=parentCtor.prototype;childCtor.superClass_=parentCtor.prototype;childCtor.prototype=new tempCtor();childCtor.prototype.constructor=childCtor;childCtor.base=function(me,methodName,var_args){var args=Array.prototype.slice.call(arguments,2);return parentCtor.prototype[methodName].apply(me,args);};};goog.base=function(me,opt_methodName,var_args){var caller=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||(goog.DEBUG&&!caller)){throw Error('arguments.caller not defined.  goog.base() cannot be used '+'with strict mode code. See '+'http://www.ecma-international.org/ecma-262/5.1/#sec-C');}
if(caller.superClass_){return caller.superClass_.constructor.apply(me,Array.prototype.slice.call(arguments,1));}
var args=Array.prototype.slice.call(arguments,2);var foundCaller=false;for(var ctor=me.constructor;ctor;ctor=ctor.superClass_&&ctor.superClass_.constructor){if(ctor.prototype[opt_methodName]===caller){foundCaller=true;}else if(foundCaller){return ctor.prototype[opt_methodName].apply(me,args);}}
if(me[opt_methodName]===caller){return me.constructor.prototype[opt_methodName].apply(me,args);}else{throw Error('goog.base called from a method of one name '+'to a method of a different name');}};goog.scope=function(fn){fn.call(goog.global);};if(!COMPILED){goog.global['COMPILED']=COMPILED;}
goog.provide('cvox.AbstractEarcons');goog.provide('cvox.Earcon');cvox.Earcon={ALERT_MODAL:'alert_modal',ALERT_NONMODAL:'alert_nonmodal',BUTTON:'button',CHECK_OFF:'check_off',CHECK_ON:'check_on',EDITABLE_TEXT:'editable_text',INVALID_KEYPRESS:'invalid_keypress',LINK:'link',LISTBOX:'listbox',LIST_ITEM:'list_item',LONG_DESC:'long_desc',MATH:'math',OBJECT_CLOSE:'object_close',OBJECT_ENTER:'object_enter',OBJECT_EXIT:'object_exit',OBJECT_OPEN:'object_open',OBJECT_SELECT:'object_select',PAGE_FINISH_LOADING:'page_finish_loading',PAGE_START_LOADING:'page_start_loading',POP_UP_BUTTON:'pop_up_button',RECOVER_FOCUS:'recover_focus',SELECTION:'selection',SELECTION_REVERSE:'selection_reverse',SKIP:'skip',SLIDER:'slider',WRAP:'wrap',WRAP_EDGE:'wrap_edge',};cvox.AbstractEarcons=function(){};cvox.AbstractEarcons.enabled=true;cvox.AbstractEarcons.prototype.playEarcon=function(earcon){};cvox.AbstractEarcons.prototype.cancelEarcon=function(earcon){};cvox.AbstractEarcons.prototype.earconsAvailable=function(){return true;};cvox.AbstractEarcons.prototype.toggle=function(){cvox.AbstractEarcons.enabled=!cvox.AbstractEarcons.enabled;return cvox.AbstractEarcons.enabled;};goog.provide('Spannable');goog.scope(function(){Spannable=function(opt_string,opt_annotation){this.string_=opt_string instanceof Spannable?'':opt_string||'';this.spans_=[];if(opt_string instanceof Spannable)
this.append(opt_string);if(goog.isDef(opt_annotation)){var len=this.string_.length;this.spans_.push({value:opt_annotation,start:0,end:len});}};Spannable.prototype={toString:function(){return this.string_;},get length(){return this.string_.length;},setSpan:function(value,start,end){this.removeSpan(value);if(0<=start&&start<=end&&end<=this.string_.length){this.spans_.push({value:value,start:start,end:end});this.spans_.sort(function(a,b){var ret=a.start-b.start;if(ret==0)
ret=a.end-b.end;return ret;});}else{throw new RangeError('span out of range (start='+start+', end='+end+', len='+this.string_.length+')');}},removeSpan:function(value){for(var i=this.spans_.length-1;i>=0;i--){if(this.spans_[i].value===value){this.spans_.splice(i,1);}}},append:function(other){if(other instanceof Spannable){var otherSpannable=(other);var originalLength=this.length;this.string_+=otherSpannable.string_;other.spans_.forEach(function(span){this.setSpan(span.value,span.start+originalLength,span.end+originalLength);}.bind(this));}else if(typeof other==='string'){this.string_+=(other);}},getSpan:function(position){return valueOfSpan(this.spans_.find(spanCoversPosition(position)));},getSpanInstanceOf:function(constructor){return valueOfSpan(this.spans_.find(spanInstanceOf(constructor)));},getSpansInstanceOf:function(constructor){return(this.spans_.filter(spanInstanceOf(constructor)).map(valueOfSpan));},getSpans:function(position){return(this.spans_.filter(spanCoversPosition(position)).map(valueOfSpan));},hasSpan:function(value){return this.spans_.some(spanValueIs(value));},getSpanStart:function(value){return this.getSpanByValueOrThrow_(value).start;},getSpanEnd:function(value){return this.getSpanByValueOrThrow_(value).end;},getSpanLength:function(value){var span=this.getSpanByValueOrThrow_(value);return span.end-span.start;},getSpanByValueOrThrow_:function(value){var span=this.spans_.find(spanValueIs(value));if(span)
return span;throw new Error('Span '+value+' doesn\'t exist in spannable');},substring:function(start,opt_end){var end=goog.isDef(opt_end)?opt_end:this.string_.length;if(start<0||end>this.string_.length||start>end){throw new RangeError('substring indices out of range');}
var result=new Spannable(this.string_.substring(start,end));this.spans_.forEach(function(span){if(span.start<=end&&span.end>=start){var newStart=Math.max(0,span.start-start);var newEnd=Math.min(end-start,span.end-start);result.spans_.push({value:span.value,start:newStart,end:newEnd});}});return result;},trimLeft:function(){return this.trim_(true,false);},trimRight:function(){return this.trim_(false,true);},trim:function(){return this.trim_(true,true);},trim_:function(trimStart,trimEnd){if(!trimStart&&!trimEnd){return this;}
if(/^\s*$/.test(this.string_)){return this.substring(0,0);}
var trimmedStart=trimStart?this.string_.match(/^\s*/)[0].length:0;var trimmedEnd=trimEnd?this.string_.match(/\s*$/).index:this.string_.length;return this.substring(trimmedStart,trimmedEnd);},toJson:function(){var result={};result.string=this.string_;result.spans=[];this.spans_.forEach(function(span){var serializeInfo=serializableSpansByConstructor.get(span.value.constructor);if(serializeInfo){var spanObj={type:serializeInfo.name,start:span.start,end:span.end};if(serializeInfo.toJson){spanObj.value=serializeInfo.toJson.apply(span.value);}
result.spans.push(spanObj);}});return result;}};Spannable.fromJson=function(obj){if(typeof obj.string!=='string'){throw new Error('Invalid spannable json object: string field not a string');}
if(!(obj.spans instanceof Array)){throw new Error('Invalid spannable json object: no spans array');}
var result=new Spannable(obj.string);result.spans_=obj.spans.map(function(span){if(typeof span.type!=='string'){throw new Error('Invalid span in spannable json object: type not a string');}
if(typeof span.start!=='number'||typeof span.end!=='number'){throw new Error('Invalid span in spannable json object: start or end not a number');}
var serializeInfo=serializableSpansByName.get(span.type);var value=serializeInfo.fromJson(span.value);return{value:value,start:span.start,end:span.end};});return result;};Spannable.registerSerializableSpan=function(constructor,name,fromJson,toJson){var obj={name:name,fromJson:fromJson,toJson:toJson};serializableSpansByName.set(name,obj);serializableSpansByConstructor.set(constructor,obj);};Spannable.registerStatelessSerializableSpan=function(constructor,name){var obj={name:name,toJson:undefined};obj.fromJson=function(obj){return new constructor();};serializableSpansByName.set(name,obj);serializableSpansByConstructor.set(constructor,obj);};var SpanStruct;var SerializeInfo;var SerializedSpannable;var SerializedSpan;var serializableSpansByName=new Map();var serializableSpansByConstructor=new Map();function spanInstanceOf(constructor){return function(span){return span.value instanceof constructor;}}
function spanCoversPosition(position){return function(span){return span.start<=position&&position<span.end;}}
function spanValueIs(value){return function(span){return span.value===value;}}
function valueOfSpan(span){return span?span.value:undefined;}});goog.provide('goog.dom.NodeType');goog.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};goog.provide('goog.debug.Error');goog.debug.Error=function(opt_msg){if(Error.captureStackTrace){Error.captureStackTrace(this,goog.debug.Error);}else{var stack=new Error().stack;if(stack){this.stack=stack;}}
if(opt_msg){this.message=String(opt_msg);}};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name='CustomError';goog.provide('goog.string');goog.string.subs=function(str,var_args){var splitParts=str.split('%s');var returnString='';var subsArguments=Array.prototype.slice.call(arguments,1);while(subsArguments.length&&splitParts.length>1){returnString+=splitParts.shift()+subsArguments.shift();}
return returnString+splitParts.join('%s');};goog.provide('goog.asserts');goog.provide('goog.asserts.AssertionError');goog.require('goog.debug.Error');goog.require('goog.dom.NodeType');goog.require('goog.string');goog.define('goog.asserts.ENABLE_ASSERTS',goog.DEBUG);goog.asserts.AssertionError=function(messagePattern,messageArgs){messageArgs.unshift(messagePattern);goog.debug.Error.call(this,goog.string.subs.apply(null,messageArgs));messageArgs.shift();this.messagePattern=messagePattern;};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name='AssertionError';goog.asserts.doAssertFailure_=function(defaultMessage,defaultArgs,givenMessage,givenArgs){var message='Assertion failed';if(givenMessage){message+=': '+givenMessage;var args=givenArgs;}else if(defaultMessage){message+=': '+defaultMessage;args=defaultArgs;}
throw new goog.asserts.AssertionError(''+message,args||[]);};goog.asserts.assert=function(condition,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!condition){goog.asserts.doAssertFailure_('',null,opt_message,Array.prototype.slice.call(arguments,2));}
return condition;};goog.asserts.fail=function(opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS){throw new goog.asserts.AssertionError('Failure'+(opt_message?': '+opt_message:''),Array.prototype.slice.call(arguments,1));}};goog.asserts.assertNumber=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(value)){goog.asserts.doAssertFailure_('Expected number but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertString=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isString(value)){goog.asserts.doAssertFailure_('Expected string but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertFunction=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(value)){goog.asserts.doAssertFailure_('Expected function but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertObject=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isObject(value)){goog.asserts.doAssertFailure_('Expected object but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertArray=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isArray(value)){goog.asserts.doAssertFailure_('Expected array but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertBoolean=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(value)){goog.asserts.doAssertFailure_('Expected boolean but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertElement=function(value,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&(!goog.isObject(value)||value.nodeType!=goog.dom.NodeType.ELEMENT)){goog.asserts.doAssertFailure_('Expected Element but got %s: %s.',[goog.typeOf(value),value],opt_message,Array.prototype.slice.call(arguments,2));}
return(value);};goog.asserts.assertInstanceof=function(value,type,opt_message,var_args){if(goog.asserts.ENABLE_ASSERTS&&!(value instanceof type)){goog.asserts.doAssertFailure_('instanceof check failed.',null,opt_message,Array.prototype.slice.call(arguments,3));}
return value;};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var key in Object.prototype){goog.asserts.fail(key+' should not be enumerable in Object.prototype.');}};goog.provide('goog.i18n.pluralRules');goog.i18n.pluralRules.Keyword={ZERO:'zero',ONE:'one',TWO:'two',FEW:'few',MANY:'many',OTHER:'other'};goog.i18n.pluralRules.defaultSelect_=function(n,opt_precision){return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.decimals_=function(n){var str=n+'';var result=str.indexOf('.');return(result==-1)?0:str.length-result-1;};goog.i18n.pluralRules.get_vf_=function(n,opt_precision){var DEFAULT_DIGITS=3;if(undefined===opt_precision){var v=Math.min(goog.i18n.pluralRules.decimals_(n),DEFAULT_DIGITS);}else{var v=opt_precision;}
var base=Math.pow(10,v);var f=((n*base)|0)%base;return{v:v,f:f};};goog.i18n.pluralRules.get_wt_=function(v,f){if(f===0){return{w:0,t:0};}
while((f%10)===0){f/=10;v--;}
return{w:v,t:f};};goog.i18n.pluralRules.gaSelect_=function(n,opt_precision){if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==2){return goog.i18n.pluralRules.Keyword.TWO;}
if(n>=3&&n<=6){return goog.i18n.pluralRules.Keyword.FEW;}
if(n>=7&&n<=10){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.roSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(i==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v!=0||n==0||n!=1&&n%100>=1&&n%100<=19){return goog.i18n.pluralRules.Keyword.FEW;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.filSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&(i==1||i==2||i==3)||vf.v==0&&i%10!=4&&i%10!=6&&i%10!=9||vf.v!=0&&vf.f%10!=4&&vf.f%10!=6&&vf.f%10!=9){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.frSelect_=function(n,opt_precision){var i=n|0;if(i==0||i==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.enSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(i==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.mtSelect_=function(n,opt_precision){if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==0||n%100>=2&&n%100<=10){return goog.i18n.pluralRules.Keyword.FEW;}
if(n%100>=11&&n%100<=19){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.daSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);var wt=goog.i18n.pluralRules.get_wt_(vf.v,vf.f);if(n==1||wt.t!=0&&(i==0||i==1)){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.gvSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&i%10==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v==0&&i%10==2){return goog.i18n.pluralRules.Keyword.TWO;}
if(vf.v==0&&(i%100==0||i%100==20||i%100==40||i%100==60||i%100==80)){return goog.i18n.pluralRules.Keyword.FEW;}
if(vf.v!=0){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.cySelect_=function(n,opt_precision){if(n==0){return goog.i18n.pluralRules.Keyword.ZERO;}
if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==2){return goog.i18n.pluralRules.Keyword.TWO;}
if(n==3){return goog.i18n.pluralRules.Keyword.FEW;}
if(n==6){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.brSelect_=function(n,opt_precision){if(n%10==1&&n%100!=11&&n%100!=71&&n%100!=91){return goog.i18n.pluralRules.Keyword.ONE;}
if(n%10==2&&n%100!=12&&n%100!=72&&n%100!=92){return goog.i18n.pluralRules.Keyword.TWO;}
if((n%10>=3&&n%10<=4||n%10==9)&&(n%100<10||n%100>19)&&(n%100<70||n%100>79)&&(n%100<90||n%100>99)){return goog.i18n.pluralRules.Keyword.FEW;}
if(n!=0&&n%1000000==0){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.esSelect_=function(n,opt_precision){if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.siSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if((n==0||n==1)||i==0&&vf.f==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.slSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&i%100==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v==0&&i%100==2){return goog.i18n.pluralRules.Keyword.TWO;}
if(vf.v==0&&i%100>=3&&i%100<=4||vf.v!=0){return goog.i18n.pluralRules.Keyword.FEW;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.tzmSelect_=function(n,opt_precision){if(n>=0&&n<=1||n>=11&&n<=99){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.srSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&i%10==1&&i%100!=11||vf.f%10==1&&vf.f%100!=11){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v==0&&i%10>=2&&i%10<=4&&(i%100<12||i%100>14)||vf.f%10>=2&&vf.f%10<=4&&(vf.f%100<12||vf.f%100>14)){return goog.i18n.pluralRules.Keyword.FEW;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.hiSelect_=function(n,opt_precision){var i=n|0;if(i==0||n==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.mkSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&i%10==1||vf.f%10==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.arSelect_=function(n,opt_precision){if(n==0){return goog.i18n.pluralRules.Keyword.ZERO;}
if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==2){return goog.i18n.pluralRules.Keyword.TWO;}
if(n%100>=3&&n%100<=10){return goog.i18n.pluralRules.Keyword.FEW;}
if(n%100>=11&&n%100<=99){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.iuSelect_=function(n,opt_precision){if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==2){return goog.i18n.pluralRules.Keyword.TWO;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.csSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(i==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
if(i>=2&&i<=4&&vf.v==0){return goog.i18n.pluralRules.Keyword.FEW;}
if(vf.v!=0){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.pt_PTSelect_=function(n,opt_precision){var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(n==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.beSelect_=function(n,opt_precision){if(n%10==1&&n%100!=11){return goog.i18n.pluralRules.Keyword.ONE;}
if(n%10>=2&&n%10<=4&&(n%100<12||n%100>14)){return goog.i18n.pluralRules.Keyword.FEW;}
if(n%10==0||n%10>=5&&n%10<=9||n%100>=11&&n%100<=14){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.akSelect_=function(n,opt_precision){if(n>=0&&n<=1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.ptSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);var wt=goog.i18n.pluralRules.get_wt_(vf.v,vf.f);if(i==1&&vf.v==0||i==0&&wt.t==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.plSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(i==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v==0&&i%10>=2&&i%10<=4&&(i%100<12||i%100>14)){return goog.i18n.pluralRules.Keyword.FEW;}
if(vf.v==0&&i!=1&&i%10>=0&&i%10<=1||vf.v==0&&i%10>=5&&i%10<=9||vf.v==0&&i%100>=12&&i%100<=14){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.ruSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(vf.v==0&&i%10==1&&i%100!=11){return goog.i18n.pluralRules.Keyword.ONE;}
if(vf.v==0&&i%10>=2&&i%10<=4&&(i%100<12||i%100>14)){return goog.i18n.pluralRules.Keyword.FEW;}
if(vf.v==0&&i%10==0||vf.v==0&&i%10>=5&&i%10<=9||vf.v==0&&i%100>=11&&i%100<=14){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.lagSelect_=function(n,opt_precision){var i=n|0;if(n==0){return goog.i18n.pluralRules.Keyword.ZERO;}
if((i==0||i==1)&&n!=0){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.shiSelect_=function(n,opt_precision){var i=n|0;if(i==0||n==1){return goog.i18n.pluralRules.Keyword.ONE;}
if(n>=2&&n<=10){return goog.i18n.pluralRules.Keyword.FEW;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.heSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(i==1&&vf.v==0){return goog.i18n.pluralRules.Keyword.ONE;}
if(i==2&&vf.v==0){return goog.i18n.pluralRules.Keyword.TWO;}
if(vf.v==0&&(n<0||n>10)&&n%10==0){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.isSelect_=function(n,opt_precision){var i=n|0;var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);var wt=goog.i18n.pluralRules.get_wt_(vf.v,vf.f);if(wt.t==0&&i%10==1&&i%100!=11||wt.t!=0){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.ltSelect_=function(n,opt_precision){var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(n%10==1&&(n%100<11||n%100>19)){return goog.i18n.pluralRules.Keyword.ONE;}
if(n%10>=2&&n%10<=9&&(n%100<11||n%100>19)){return goog.i18n.pluralRules.Keyword.FEW;}
if(vf.f!=0){return goog.i18n.pluralRules.Keyword.MANY;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.gdSelect_=function(n,opt_precision){if(n==1||n==11){return goog.i18n.pluralRules.Keyword.ONE;}
if(n==2||n==12){return goog.i18n.pluralRules.Keyword.TWO;}
if(n>=3&&n<=10||n>=13&&n<=19){return goog.i18n.pluralRules.Keyword.FEW;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.lvSelect_=function(n,opt_precision){var vf=goog.i18n.pluralRules.get_vf_(n,opt_precision);if(n%10==0||n%100>=11&&n%100<=19||vf.v==2&&vf.f%100>=11&&vf.f%100<=19){return goog.i18n.pluralRules.Keyword.ZERO;}
if(n%10==1&&n%100!=11||vf.v==2&&vf.f%10==1&&vf.f%100!=11||vf.v!=2&&vf.f%10==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.kshSelect_=function(n,opt_precision){if(n==0){return goog.i18n.pluralRules.Keyword.ZERO;}
if(n==1){return goog.i18n.pluralRules.Keyword.ONE;}
return goog.i18n.pluralRules.Keyword.OTHER;};goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;if(goog.LOCALE=='af'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='am'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='ar'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.arSelect_;}
if(goog.LOCALE=='az'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='bg'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='bn'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='br'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.brSelect_;}
if(goog.LOCALE=='ca'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='chr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='cs'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.csSelect_;}
if(goog.LOCALE=='cy'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.cySelect_;}
if(goog.LOCALE=='da'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.daSelect_;}
if(goog.LOCALE=='de'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='de_AT'||goog.LOCALE=='de-AT'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='de_CH'||goog.LOCALE=='de-CH'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='el'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='en'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_AU'||goog.LOCALE=='en-AU'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_GB'||goog.LOCALE=='en-GB'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_IE'||goog.LOCALE=='en-IE'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_IN'||goog.LOCALE=='en-IN'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_ISO'||goog.LOCALE=='en-ISO'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_SG'||goog.LOCALE=='en-SG'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_US'||goog.LOCALE=='en-US'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='en_ZA'||goog.LOCALE=='en-ZA'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='es'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='es_419'||goog.LOCALE=='es-419'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='es_ES'||goog.LOCALE=='es-ES'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='et'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='eu'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='fa'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='fi'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='fil'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.filSelect_;}
if(goog.LOCALE=='fr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.frSelect_;}
if(goog.LOCALE=='fr_CA'||goog.LOCALE=='fr-CA'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.frSelect_;}
if(goog.LOCALE=='gl'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='gsw'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='gu'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='haw'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='he'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.heSelect_;}
if(goog.LOCALE=='hi'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='hr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.srSelect_;}
if(goog.LOCALE=='hu'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='hy'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.frSelect_;}
if(goog.LOCALE=='id'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='in'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='is'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.isSelect_;}
if(goog.LOCALE=='it'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='iw'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.heSelect_;}
if(goog.LOCALE=='ja'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='ka'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='kk'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='km'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='kn'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='ko'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='ky'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='ln'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.akSelect_;}
if(goog.LOCALE=='lo'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='lt'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.ltSelect_;}
if(goog.LOCALE=='lv'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.lvSelect_;}
if(goog.LOCALE=='mk'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.mkSelect_;}
if(goog.LOCALE=='ml'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='mn'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='mo'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.roSelect_;}
if(goog.LOCALE=='mr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
if(goog.LOCALE=='ms'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='mt'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.mtSelect_;}
if(goog.LOCALE=='my'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='nb'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='ne'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='nl'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='no'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='no_NO'||goog.LOCALE=='no-NO'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='or'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='pa'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.akSelect_;}
if(goog.LOCALE=='pl'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.plSelect_;}
if(goog.LOCALE=='pt'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.ptSelect_;}
if(goog.LOCALE=='pt_BR'||goog.LOCALE=='pt-BR'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.ptSelect_;}
if(goog.LOCALE=='pt_PT'||goog.LOCALE=='pt-PT'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.pt_PTSelect_;}
if(goog.LOCALE=='ro'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.roSelect_;}
if(goog.LOCALE=='ru'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.ruSelect_;}
if(goog.LOCALE=='sh'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.srSelect_;}
if(goog.LOCALE=='si'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.siSelect_;}
if(goog.LOCALE=='sk'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.csSelect_;}
if(goog.LOCALE=='sl'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.slSelect_;}
if(goog.LOCALE=='sq'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='sr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.srSelect_;}
if(goog.LOCALE=='sv'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='sw'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='ta'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='te'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='th'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='tl'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.filSelect_;}
if(goog.LOCALE=='tr'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='uk'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.ruSelect_;}
if(goog.LOCALE=='ur'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.enSelect_;}
if(goog.LOCALE=='uz'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.esSelect_;}
if(goog.LOCALE=='vi'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='zh'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='zh_CN'||goog.LOCALE=='zh-CN'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='zh_HK'||goog.LOCALE=='zh-HK'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='zh_TW'||goog.LOCALE=='zh-TW'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.defaultSelect_;}
if(goog.LOCALE=='zu'){goog.i18n.pluralRules.select=goog.i18n.pluralRules.hiSelect_;}
goog.provide('goog.i18n.ordinalRules');goog.i18n.ordinalRules.Keyword={ZERO:'zero',ONE:'one',TWO:'two',FEW:'few',MANY:'many',OTHER:'other'};goog.i18n.ordinalRules.defaultSelect_=function(n,opt_precision){return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.decimals_=function(n){var str=n+'';var result=str.indexOf('.');return(result==-1)?0:str.length-result-1;};goog.i18n.ordinalRules.get_vf_=function(n,opt_precision){var DEFAULT_DIGITS=3;if(undefined===opt_precision){var v=Math.min(goog.i18n.ordinalRules.decimals_(n),DEFAULT_DIGITS);}else{var v=opt_precision;}
var base=Math.pow(10,v);var f=((n*base)|0)%base;return{v:v,f:f};};goog.i18n.ordinalRules.get_wt_=function(v,f){if(f===0){return{w:0,t:0};}
while((f%10)===0){f/=10;v--;}
return{w:v,t:f};};goog.i18n.ordinalRules.enSelect_=function(n,opt_precision){if(n%10==1&&n%100!=11){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n%10==2&&n%100!=12){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n%10==3&&n%100!=13){return goog.i18n.ordinalRules.Keyword.FEW;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.svSelect_=function(n,opt_precision){if((n%10==1||n%10==2)&&n%100!=11&&n%100!=12){return goog.i18n.ordinalRules.Keyword.ONE;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.huSelect_=function(n,opt_precision){if(n==1||n==5){return goog.i18n.ordinalRules.Keyword.ONE;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.kkSelect_=function(n,opt_precision){if(n%10==6||n%10==9||n%10==0&&n!=0){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.mrSelect_=function(n,opt_precision){if(n==1){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n==2||n==3){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n==4){return goog.i18n.ordinalRules.Keyword.FEW;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.sqSelect_=function(n,opt_precision){if(n==1){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n%10==4&&n%100!=14){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.bnSelect_=function(n,opt_precision){if(n==1||n==5||n==7||n==8||n==9||n==10){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n==2||n==3){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n==4){return goog.i18n.ordinalRules.Keyword.FEW;}
if(n==6){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.guSelect_=function(n,opt_precision){if(n==1){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n==2||n==3){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n==4){return goog.i18n.ordinalRules.Keyword.FEW;}
if(n==6){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.kaSelect_=function(n,opt_precision){var i=n|0;if(i==1){return goog.i18n.ordinalRules.Keyword.ONE;}
if(i==0||(i%100>=2&&i%100<=20||i%100==40||i%100==60||i%100==80)){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.frSelect_=function(n,opt_precision){if(n==1){return goog.i18n.ordinalRules.Keyword.ONE;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.neSelect_=function(n,opt_precision){if(n>=1&&n<=4){return goog.i18n.ordinalRules.Keyword.ONE;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.cySelect_=function(n,opt_precision){if(n==0||n==7||n==8||n==9){return goog.i18n.ordinalRules.Keyword.ZERO;}
if(n==1){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n==2){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n==3||n==4){return goog.i18n.ordinalRules.Keyword.FEW;}
if(n==5||n==6){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.azSelect_=function(n,opt_precision){var i=n|0;if((i%10==1||i%10==2||i%10==5||i%10==7||i%10==8)||(i%100==20||i%100==50||i%100==70||i%100==80)){return goog.i18n.ordinalRules.Keyword.ONE;}
if((i%10==3||i%10==4)||(i%1000==100||i%1000==200||i%1000==300||i%1000==400||i%1000==500||i%1000==600||i%1000==700||i%1000==800||i%1000==900)){return goog.i18n.ordinalRules.Keyword.FEW;}
if(i==0||i%10==6||(i%100==40||i%100==60||i%100==90)){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.caSelect_=function(n,opt_precision){if(n==1||n==3){return goog.i18n.ordinalRules.Keyword.ONE;}
if(n==2){return goog.i18n.ordinalRules.Keyword.TWO;}
if(n==4){return goog.i18n.ordinalRules.Keyword.FEW;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.itSelect_=function(n,opt_precision){if(n==11||n==8||n==80||n==800){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.mkSelect_=function(n,opt_precision){var i=n|0;if(i%10==1&&i%100!=11){return goog.i18n.ordinalRules.Keyword.ONE;}
if(i%10==2&&i%100!=12){return goog.i18n.ordinalRules.Keyword.TWO;}
if((i%10==7||i%10==8)&&i%100!=17&&i%100!=18){return goog.i18n.ordinalRules.Keyword.MANY;}
return goog.i18n.ordinalRules.Keyword.OTHER;};goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;if(goog.LOCALE=='af'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='am'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ar'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='az'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.azSelect_;}
if(goog.LOCALE=='bg'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='bn'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.bnSelect_;}
if(goog.LOCALE=='br'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ca'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.caSelect_;}
if(goog.LOCALE=='chr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='cs'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='cy'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.cySelect_;}
if(goog.LOCALE=='da'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='de'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='de_AT'||goog.LOCALE=='de-AT'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='de_CH'||goog.LOCALE=='de-CH'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='el'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='en'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_AU'||goog.LOCALE=='en-AU'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_GB'||goog.LOCALE=='en-GB'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_IE'||goog.LOCALE=='en-IE'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_IN'||goog.LOCALE=='en-IN'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_ISO'||goog.LOCALE=='en-ISO'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_SG'||goog.LOCALE=='en-SG'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_US'||goog.LOCALE=='en-US'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='en_ZA'||goog.LOCALE=='en-ZA'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.enSelect_;}
if(goog.LOCALE=='es'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='es_419'||goog.LOCALE=='es-419'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='es_ES'||goog.LOCALE=='es-ES'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='et'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='eu'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='fa'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='fi'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='fil'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='fr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='fr_CA'||goog.LOCALE=='fr-CA'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='gl'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='gsw'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='gu'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.guSelect_;}
if(goog.LOCALE=='haw'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='he'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='hi'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.guSelect_;}
if(goog.LOCALE=='hr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='hu'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.huSelect_;}
if(goog.LOCALE=='hy'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='id'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='in'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='is'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='it'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.itSelect_;}
if(goog.LOCALE=='iw'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ja'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ka'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.kaSelect_;}
if(goog.LOCALE=='kk'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.kkSelect_;}
if(goog.LOCALE=='km'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='kn'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ko'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ky'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ln'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='lo'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='lt'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='lv'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='mk'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.mkSelect_;}
if(goog.LOCALE=='ml'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='mn'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='mo'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='mr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.mrSelect_;}
if(goog.LOCALE=='ms'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='mt'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='my'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='nb'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ne'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.neSelect_;}
if(goog.LOCALE=='nl'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='no'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='no_NO'||goog.LOCALE=='no-NO'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='or'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='pa'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='pl'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='pt'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='pt_BR'||goog.LOCALE=='pt-BR'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='pt_PT'||goog.LOCALE=='pt-PT'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ro'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='ru'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='sh'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='si'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='sk'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='sl'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='sq'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.sqSelect_;}
if(goog.LOCALE=='sr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='sv'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.svSelect_;}
if(goog.LOCALE=='sw'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ta'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='te'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='th'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='tl'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='tr'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='uk'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='ur'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='uz'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='vi'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.frSelect_;}
if(goog.LOCALE=='zh'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='zh_CN'||goog.LOCALE=='zh-CN'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='zh_HK'||goog.LOCALE=='zh-HK'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='zh_TW'||goog.LOCALE=='zh-TW'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
if(goog.LOCALE=='zu'){goog.i18n.ordinalRules.select=goog.i18n.ordinalRules.defaultSelect_;}
goog.provide('goog.i18n.MessageFormat');goog.require('goog.asserts');goog.require('goog.i18n.ordinalRules');goog.require('goog.i18n.pluralRules');goog.i18n.MessageFormat=function(pattern){this.literals_=[];this.parsedPattern_=[];this.parsePattern_(pattern);};goog.i18n.MessageFormat.LITERAL_PLACEHOLDER_='\uFDDF_';goog.i18n.MessageFormat.Element_={STRING:0,BLOCK:1};goog.i18n.MessageFormat.BlockType_={PLURAL:0,ORDINAL:1,SELECT:2,SIMPLE:3,STRING:4,UNKNOWN:5};goog.i18n.MessageFormat.OTHER_='other';goog.i18n.MessageFormat.REGEX_LITERAL_=new RegExp("'([{}#].*?)'",'g');goog.i18n.MessageFormat.REGEX_DOUBLE_APOSTROPHE_=new RegExp("''",'g');goog.i18n.MessageFormat.prototype.format=function(namedParameters){return this.format_(namedParameters,false);};goog.i18n.MessageFormat.prototype.formatIgnoringPound=function(namedParameters){return this.format_(namedParameters,true);};goog.i18n.MessageFormat.prototype.format_=function(namedParameters,ignorePound){if(this.parsedPattern_.length==0){return'';}
var result=[];this.formatBlock_(this.parsedPattern_,namedParameters,ignorePound,result);var message=result.join('');if(!ignorePound){goog.asserts.assert(message.search('#')==-1,'Not all # were replaced.');}
while(this.literals_.length>0){message=message.replace(this.buildPlaceholder_(this.literals_),this.literals_.pop());}
return message;};goog.i18n.MessageFormat.prototype.formatBlock_=function(parsedPattern,namedParameters,ignorePound,result){for(var i=0;i<parsedPattern.length;i++){switch(parsedPattern[i].type){case goog.i18n.MessageFormat.BlockType_.STRING:result.push(parsedPattern[i].value);break;case goog.i18n.MessageFormat.BlockType_.SIMPLE:var pattern=parsedPattern[i].value;this.formatSimplePlaceholder_(pattern,namedParameters,result);break;case goog.i18n.MessageFormat.BlockType_.SELECT:var pattern=parsedPattern[i].value;this.formatSelectBlock_(pattern,namedParameters,ignorePound,result);break;case goog.i18n.MessageFormat.BlockType_.PLURAL:var pattern=parsedPattern[i].value;this.formatPluralOrdinalBlock_(pattern,namedParameters,goog.i18n.pluralRules.select,ignorePound,result);break;case goog.i18n.MessageFormat.BlockType_.ORDINAL:var pattern=parsedPattern[i].value;this.formatPluralOrdinalBlock_(pattern,namedParameters,goog.i18n.ordinalRules.select,ignorePound,result);break;default:goog.asserts.fail('Unrecognized block type.');}}};goog.i18n.MessageFormat.prototype.formatSimplePlaceholder_=function(parsedPattern,namedParameters,result){var value=namedParameters[parsedPattern];if(!goog.isDef(value)){result.push('Undefined parameter - '+parsedPattern);return;}
this.literals_.push(value);result.push(this.buildPlaceholder_(this.literals_));};goog.i18n.MessageFormat.prototype.formatSelectBlock_=function(parsedPattern,namedParameters,ignorePound,result){var argumentIndex=parsedPattern.argumentIndex;if(!goog.isDef(namedParameters[argumentIndex])){result.push('Undefined parameter - '+argumentIndex);return;}
var option=parsedPattern[namedParameters[argumentIndex]];if(!goog.isDef(option)){option=parsedPattern[goog.i18n.MessageFormat.OTHER_];goog.asserts.assertArray(option,'Invalid option or missing other option for select block.');}
this.formatBlock_(option,namedParameters,ignorePound,result);};goog.i18n.MessageFormat.prototype.formatPluralOrdinalBlock_=function(parsedPattern,namedParameters,pluralSelector,ignorePound,result){var argumentIndex=parsedPattern.argumentIndex;var argumentOffset=parsedPattern.argumentOffset;var pluralValue=+namedParameters[argumentIndex];if(isNaN(pluralValue)){result.push('Undefined or invalid parameter - '+argumentIndex);return;}
var diff=pluralValue-argumentOffset;var option=parsedPattern[namedParameters[argumentIndex]];if(!goog.isDef(option)){goog.asserts.assert(diff>=0,'Argument index smaller than offset.');var item;item=pluralSelector(diff);goog.asserts.assertString(item,'Invalid plural key.');option=parsedPattern[item];if(!goog.isDef(option)){option=parsedPattern[goog.i18n.MessageFormat.OTHER_];}
goog.asserts.assertArray(option,'Invalid option or missing other option for plural block.');}
var pluralResult=[];this.formatBlock_(option,namedParameters,ignorePound,pluralResult);var plural=pluralResult.join('');goog.asserts.assertString(plural,'Empty block in plural.');if(ignorePound){result.push(plural);}else{var localeAwareDiff=diff.toLocaleString();result.push(plural.replace(/#/g,localeAwareDiff));}};goog.i18n.MessageFormat.prototype.parsePattern_=function(pattern){if(pattern){pattern=this.insertPlaceholders_(pattern);this.parsedPattern_=this.parseBlock_(pattern);}};goog.i18n.MessageFormat.prototype.insertPlaceholders_=function(pattern){var literals=this.literals_;var buildPlaceholder=goog.bind(this.buildPlaceholder_,this);pattern=pattern.replace(goog.i18n.MessageFormat.REGEX_DOUBLE_APOSTROPHE_,function(){literals.push("'");return buildPlaceholder(literals);});pattern=pattern.replace(goog.i18n.MessageFormat.REGEX_LITERAL_,function(match,text){literals.push(text);return buildPlaceholder(literals);});return pattern;};goog.i18n.MessageFormat.prototype.extractParts_=function(pattern){var prevPos=0;var inBlock=false;var braceStack=[];var results=[];var braces=/[{}]/g;braces.lastIndex=0;var match;while(match=braces.exec(pattern)){var pos=match.index;if(match[0]=='}'){var brace=braceStack.pop();goog.asserts.assert(goog.isDef(brace)&&brace=='{','No matching { for }.');if(braceStack.length==0){var part={};part.type=goog.i18n.MessageFormat.Element_.BLOCK;part.value=pattern.substring(prevPos,pos);results.push(part);prevPos=pos+1;inBlock=false;}}else{if(braceStack.length==0){inBlock=true;var substring=pattern.substring(prevPos,pos);if(substring!=''){results.push({type:goog.i18n.MessageFormat.Element_.STRING,value:substring});}
prevPos=pos+1;}
braceStack.push('{');}}
goog.asserts.assert(braceStack.length==0,'There are mismatched { or } in the pattern.');var substring=pattern.substring(prevPos);if(substring!=''){results.push({type:goog.i18n.MessageFormat.Element_.STRING,value:substring});}
return results;};goog.i18n.MessageFormat.PLURAL_BLOCK_RE_=/^\s*(\w+)\s*,\s*plural\s*,(?:\s*offset:(\d+))?/;goog.i18n.MessageFormat.ORDINAL_BLOCK_RE_=/^\s*(\w+)\s*,\s*selectordinal\s*,/;goog.i18n.MessageFormat.SELECT_BLOCK_RE_=/^\s*(\w+)\s*,\s*select\s*,/;goog.i18n.MessageFormat.prototype.parseBlockType_=function(pattern){if(goog.i18n.MessageFormat.PLURAL_BLOCK_RE_.test(pattern)){return goog.i18n.MessageFormat.BlockType_.PLURAL;}
if(goog.i18n.MessageFormat.ORDINAL_BLOCK_RE_.test(pattern)){return goog.i18n.MessageFormat.BlockType_.ORDINAL;}
if(goog.i18n.MessageFormat.SELECT_BLOCK_RE_.test(pattern)){return goog.i18n.MessageFormat.BlockType_.SELECT;}
if(/^\s*\w+\s*/.test(pattern)){return goog.i18n.MessageFormat.BlockType_.SIMPLE;}
return goog.i18n.MessageFormat.BlockType_.UNKNOWN;};goog.i18n.MessageFormat.prototype.parseBlock_=function(pattern){var result=[];var parts=this.extractParts_(pattern);for(var i=0;i<parts.length;i++){var block={};if(goog.i18n.MessageFormat.Element_.STRING==parts[i].type){block.type=goog.i18n.MessageFormat.BlockType_.STRING;block.value=parts[i].value;}else if(goog.i18n.MessageFormat.Element_.BLOCK==parts[i].type){var blockType=this.parseBlockType_(parts[i].value);switch(blockType){case goog.i18n.MessageFormat.BlockType_.SELECT:block.type=goog.i18n.MessageFormat.BlockType_.SELECT;block.value=this.parseSelectBlock_(parts[i].value);break;case goog.i18n.MessageFormat.BlockType_.PLURAL:block.type=goog.i18n.MessageFormat.BlockType_.PLURAL;block.value=this.parsePluralBlock_(parts[i].value);break;case goog.i18n.MessageFormat.BlockType_.ORDINAL:block.type=goog.i18n.MessageFormat.BlockType_.ORDINAL;block.value=this.parseOrdinalBlock_(parts[i].value);break;case goog.i18n.MessageFormat.BlockType_.SIMPLE:block.type=goog.i18n.MessageFormat.BlockType_.SIMPLE;block.value=parts[i].value;break;default:goog.asserts.fail('Unknown block type.');}}else{goog.asserts.fail('Unknown part of the pattern.');}
result.push(block);}
return result;};goog.i18n.MessageFormat.prototype.parseSelectBlock_=function(pattern){var argumentIndex='';var replaceRegex=goog.i18n.MessageFormat.SELECT_BLOCK_RE_;pattern=pattern.replace(replaceRegex,function(string,name){argumentIndex=name;return'';});var result={};result.argumentIndex=argumentIndex;var parts=this.extractParts_(pattern);var pos=0;while(pos<parts.length){var key=parts[pos].value;goog.asserts.assertString(key,'Missing select key element.');pos++;goog.asserts.assert(pos<parts.length,'Missing or invalid select value element.');if(goog.i18n.MessageFormat.Element_.BLOCK==parts[pos].type){var value=this.parseBlock_(parts[pos].value);}else{goog.asserts.fail('Expected block type.');}
result[key.replace(/\s/g,'')]=value;pos++;}
goog.asserts.assertArray(result[goog.i18n.MessageFormat.OTHER_],'Missing other key in select statement.');return result;};goog.i18n.MessageFormat.prototype.parsePluralBlock_=function(pattern){var argumentIndex='';var argumentOffset=0;var replaceRegex=goog.i18n.MessageFormat.PLURAL_BLOCK_RE_;pattern=pattern.replace(replaceRegex,function(string,name,offset){argumentIndex=name;if(offset){argumentOffset=parseInt(offset,10);}
return'';});var result={};result.argumentIndex=argumentIndex;result.argumentOffset=argumentOffset;var parts=this.extractParts_(pattern);var pos=0;while(pos<parts.length){var key=parts[pos].value;goog.asserts.assertString(key,'Missing plural key element.');pos++;goog.asserts.assert(pos<parts.length,'Missing or invalid plural value element.');if(goog.i18n.MessageFormat.Element_.BLOCK==parts[pos].type){var value=this.parseBlock_(parts[pos].value);}else{goog.asserts.fail('Expected block type.');}
result[key.replace(/\s*(?:=)?(\w+)\s*/,'$1')]=value;pos++;}
goog.asserts.assertArray(result[goog.i18n.MessageFormat.OTHER_],'Missing other key in plural statement.');return result;};goog.i18n.MessageFormat.prototype.parseOrdinalBlock_=function(pattern){var argumentIndex='';var replaceRegex=goog.i18n.MessageFormat.ORDINAL_BLOCK_RE_;pattern=pattern.replace(replaceRegex,function(string,name){argumentIndex=name;return'';});var result={};result.argumentIndex=argumentIndex;result.argumentOffset=0;var parts=this.extractParts_(pattern);var pos=0;while(pos<parts.length){var key=parts[pos].value;goog.asserts.assertString(key,'Missing ordinal key element.');pos++;goog.asserts.assert(pos<parts.length,'Missing or invalid ordinal value element.');if(goog.i18n.MessageFormat.Element_.BLOCK==parts[pos].type){var value=this.parseBlock_(parts[pos].value);}else{goog.asserts.fail('Expected block type.');}
result[key.replace(/\s*(?:=)?(\w+)\s*/,'$1')]=value;pos++;}
goog.asserts.assertArray(result[goog.i18n.MessageFormat.OTHER_],'Missing other key in selectordinal statement.');return result;};goog.i18n.MessageFormat.prototype.buildPlaceholder_=function(literals){goog.asserts.assert(literals.length>0,'Literal array is empty.');var index=(literals.length-1).toString(10);return goog.i18n.MessageFormat.LITERAL_PLACEHOLDER_+index+'_';};goog.provide('constants');constants.Dir={FORWARD:'forward',BACKWARD:'backward'};goog.provide('AutomationTreeWalker');goog.provide('AutomationTreeWalkerPhase');goog.provide('AutomationTreeWalkerRestriction');goog.require('constants');AutomationTreeWalkerPhase={INITIAL:'initial',ANCESTOR:'ancestor',DESCENDANT:'descendant',OTHER:'other'};var AutomationTreeWalkerRestriction;AutomationTreeWalker=function(node,dir,opt_restrictions){this.node_=node;this.phase_=AutomationTreeWalkerPhase.INITIAL;this.dir_=dir;this.initialNode_=node;this.backwardAncestor_=node.parent;var restrictions=opt_restrictions||{};this.visitPred_=function(node){if(this.skipInitialAncestry_&&this.phase_==AutomationTreeWalkerPhase.ANCESTOR)
return false;if(this.skipInitialSubtree_&&this.phase!=AutomationTreeWalkerPhase.ANCESTOR&&this.phase!=AutomationTreeWalkerPhase.OTHER)
return false;if(restrictions.visit)
return restrictions.visit(node);return true;};this.leafPred_=restrictions.leaf?restrictions.leaf:AutomationTreeWalker.falsePredicate_;this.rootPred_=restrictions.root?restrictions.root:AutomationTreeWalker.falsePredicate_;this.skipInitialAncestry_=restrictions.skipInitialAncestry||false;this.skipInitialSubtree_=restrictions.skipInitialSubtree||false;};AutomationTreeWalker.falsePredicate_=function(node){return false;};AutomationTreeWalker.prototype={get node(){return this.node_;},get phase(){return this.phase_;},next:function(){if(!this.node_)
return this;do{if(this.rootPred_(this.node_)&&this.dir_==constants.Dir.BACKWARD){this.node_=null;return this;}
if(this.dir_==constants.Dir.FORWARD)
this.forward_(this.node_);else
this.backward_(this.node_);}while(this.node_&&!this.visitPred_(this.node_));return this;},forward_:function(node){if(!this.leafPred_(node)&&node.firstChild){if(this.phase_==AutomationTreeWalkerPhase.INITIAL)
this.phase_=AutomationTreeWalkerPhase.DESCENDANT;if(!this.skipInitialSubtree_||this.phase!=AutomationTreeWalkerPhase.DESCENDANT){this.node_=node.firstChild;return;}}
var searchNode=node;while(searchNode){if(searchNode==this.initialNode_)
this.phase_=AutomationTreeWalkerPhase.OTHER;if(searchNode.nextSibling){this.node_=searchNode.nextSibling;return;}
if(searchNode.parent&&this.rootPred_(searchNode.parent))
break;searchNode=searchNode.parent;}
this.node_=null;},backward_:function(node){if(node.previousSibling){this.phase_=AutomationTreeWalkerPhase.OTHER;node=node.previousSibling;while(!this.leafPred_(node)&&node.lastChild)
node=node.lastChild;this.node_=node;return;}
if(node.parent&&this.backwardAncestor_==node.parent){this.phase_=AutomationTreeWalkerPhase.ANCESTOR;this.backwardAncestor_=node.parent.parent;}
this.node_=node.parent;}};goog.provide('AutomationPredicate');goog.provide('AutomationPredicate.Binary');goog.provide('AutomationPredicate.Unary');goog.require('constants');goog.scope(function(){var AutomationNode=chrome.automation.AutomationNode;var Dir=constants.Dir;var Role=chrome.automation.RoleType;AutomationPredicate=function(){};AutomationPredicate.Unary;AutomationPredicate.Binary;AutomationPredicate.roles=function(roles){return AutomationPredicate.match({anyRole:roles});};AutomationPredicate.match=function(params){var anyRole=params.anyRole||[];var anyPredicate=params.anyPredicate||[];return function(node){return anyRole.some(function(role){return role==node.role;})||anyPredicate.some(function(p){return p(node);});};};AutomationPredicate.checkBox=AutomationPredicate.roles([Role.checkBox]);AutomationPredicate.comboBox=AutomationPredicate.roles([Role.comboBox,Role.popUpButton,Role.menuListPopup]);AutomationPredicate.heading=AutomationPredicate.roles([Role.heading]);AutomationPredicate.inlineTextBox=AutomationPredicate.roles([Role.inlineTextBox]);AutomationPredicate.link=AutomationPredicate.roles([Role.link]);AutomationPredicate.row=AutomationPredicate.roles([Role.row]);AutomationPredicate.table=AutomationPredicate.roles([Role.grid,Role.table]);AutomationPredicate.button=function(node){return/button/i.test(node.role);};AutomationPredicate.editText=function(node){return node.state.editable&&node.parent&&!node.parent.state.editable;};AutomationPredicate.formField=AutomationPredicate.match({anyPredicate:[AutomationPredicate.button,AutomationPredicate.comboBox,AutomationPredicate.editText],anyRole:[Role.checkBox,Role.listBox,Role.slider,Role.tab,Role.tree]});AutomationPredicate.landmark=AutomationPredicate.roles([Role.application,Role.banner,Role.complementary,Role.contentInfo,Role.form,Role.main,Role.navigation,Role.region,Role.search]);AutomationPredicate.visitedLink=function(node){return node.state.visited;};AutomationPredicate.focused=function(node){return node.state.focused;};AutomationPredicate.leaf=function(node){return!node.firstChild||node.role==Role.button||node.role==Role.buttonDropDown||node.role==Role.popUpButton||node.role==Role.slider||node.role==Role.textField||node.state.invisible||node.children.every(function(n){return n.state.invisible;});};AutomationPredicate.leafWithText=function(node){return AutomationPredicate.leaf(node)&&!!(node.name||node.value);};AutomationPredicate.leafOrStaticText=function(node){return AutomationPredicate.leaf(node)||node.role==Role.staticText;};AutomationPredicate.object=function(node){if(node.parent&&node.parent.state.editable)
return false;return node.state.focusable||(AutomationPredicate.leafOrStaticText(node)&&(/\S+/.test(node.name)||(node.role!=Role.lineBreak&&node.role!=Role.staticText&&node.role!=Role.inlineTextBox)));};AutomationPredicate.group=AutomationPredicate.match({anyRole:[Role.heading,Role.list,Role.paragraph],anyPredicate:[AutomationPredicate.editText,AutomationPredicate.formField,AutomationPredicate.object,AutomationPredicate.table]});AutomationPredicate.linebreak=function(first,second){var fl=first.location;var sl=second.location;return fl.top!=sl.top||(fl.top+fl.height!=sl.top+sl.height);};AutomationPredicate.container=function(node){return AutomationPredicate.structuralContainer(node)||node.role==Role.div||node.role==Role.document||node.role==Role.group||node.role==Role.listItem||node.role==Role.toolbar||node.role==Role.window||(node.role==Role.textField&&node.state.readOnly)||(node.state.editable&&node.parent&&!node.parent.state.editable);};AutomationPredicate.structuralContainer=AutomationPredicate.roles([Role.rootWebArea,Role.embeddedObject,Role.iframe,Role.iframePresentational]);AutomationPredicate.root=function(node){switch(node.role){case Role.dialog:case Role.window:return true;case Role.toolbar:return node.root.role==Role.desktop;case Role.rootWebArea:return!node.parent||node.parent.root.role==Role.desktop;default:return false;}};AutomationPredicate.shouldIgnoreNode=function(node){if(node.state.invisible||(node.location.height==0&&node.location.width==0))
return true;if(AutomationPredicate.structuralContainer(node))
return true;if(node.role==Role.listMarker)
return true;if(node.name||node.value||node.description)
return false;return AutomationPredicate.leaf(node)&&(AutomationPredicate.roles([Role.client,Role.column,Role.div,Role.group,Role.image,Role.staticText,Role.svgRoot,Role.tableHeaderContainer])(node));};AutomationPredicate.checkable=AutomationPredicate.roles([Role.checkBox,Role.radioButton,Role.menuItemCheckBox,Role.menuItemRadio,Role.treeItem]);AutomationPredicate.cellLike=AutomationPredicate.roles([Role.cell,Role.rowHeader,Role.columnHeader]);AutomationPredicate.makeTableCellPredicate=function(start,opts){if(!opts.row&&!opts.col)
throw new Error('You must set either row or col to true');var dir=opts.dir||Dir.FORWARD;var rowIndex=0,colIndex=0;var tableNode=start;while(tableNode){if(AutomationPredicate.table(tableNode))
break;if(AutomationPredicate.cellLike(tableNode)){rowIndex=tableNode.tableCellRowIndex;colIndex=tableNode.tableCellColumnIndex;}
tableNode=tableNode.parent;}
if(!tableNode)
return null;if(opts.end){if(!opts.col)
throw'Unsupported option.';if(dir==Dir.FORWARD){return function(node){return AutomationPredicate.cellLike(node)&&node.tableCellColumnIndex==colIndex&&node.tableCellRowIndex>=0;};}else{return function(node){return AutomationPredicate.cellLike(node)&&node.tableCellColumnIndex==colIndex&&node.tableCellRowIndex<tableNode.tableRowCount;};}}
if(opts.row)
rowIndex=dir==Dir.FORWARD?rowIndex+1:rowIndex-1;if(opts.col)
colIndex=dir==Dir.FORWARD?colIndex+1:colIndex-1;return function(node){return AutomationPredicate.cellLike(node)&&node.tableCellColumnIndex==colIndex&&node.tableCellRowIndex==rowIndex;};};AutomationPredicate.makeHeadingPredicate=function(level){return function(node){return node.role==Role.heading&&node.hierarchicalLevel==level;};};});goog.provide('AutomationUtil');goog.require('AutomationPredicate');goog.require('AutomationTreeWalker');goog.require('constants');AutomationUtil=function(){};goog.scope(function(){var AutomationNode=chrome.automation.AutomationNode;var Dir=constants.Dir;var RoleType=chrome.automation.RoleType;AutomationUtil.findNodePre=function(cur,dir,pred){if(!cur)
return null;if(pred(cur)&&!AutomationPredicate.shouldIgnoreNode(cur))
return cur;var child=dir==Dir.BACKWARD?cur.lastChild:cur.firstChild;while(child){var ret=AutomationUtil.findNodePre(child,dir,pred);if(ret)
return ret;child=dir==Dir.BACKWARD?child.previousSibling:child.nextSibling;}
return null;};AutomationUtil.findNodePost=function(cur,dir,pred){if(!cur)
return null;var child=dir==Dir.BACKWARD?cur.lastChild:cur.firstChild;while(child){var ret=AutomationUtil.findNodePost(child,dir,pred);if(ret)
return ret;child=dir==Dir.BACKWARD?child.previousSibling:child.nextSibling;}
if(pred(cur)&&!AutomationPredicate.shouldIgnoreNode(cur))
return cur;return null;};AutomationUtil.findNextNode=function(cur,dir,pred,opt_restrictions){var restrictions={};opt_restrictions=opt_restrictions||{leaf:undefined,root:undefined,visit:undefined,skipInitialSubtree:!AutomationPredicate.container(cur)&&pred(cur)};restrictions.root=opt_restrictions.root||AutomationPredicate.root;restrictions.leaf=opt_restrictions.leaf||function(node){return!AutomationPredicate.container(node)&&pred(node);};restrictions.skipInitialSubtree=opt_restrictions.skipInitialSubtree;restrictions.skipInitialAncestry=opt_restrictions.skipInitialAncestry;restrictions.visit=function(node){return pred(node)&&!AutomationPredicate.shouldIgnoreNode(node);};var walker=new AutomationTreeWalker(cur,dir,restrictions);return walker.next().node;};AutomationUtil.findNodeUntil=function(cur,dir,pred,opt_before){var before=cur;var after=before;do{before=after;after=AutomationUtil.findNextNode(before,dir,AutomationPredicate.leaf);}while(after&&!pred(before,after));return opt_before?before:after;};AutomationUtil.getAncestors=function(node){var ret=[];var candidate=node;while(candidate){ret.push(candidate);candidate=candidate.parent;}
return ret.reverse();};AutomationUtil.getDivergence=function(ancestorsA,ancestorsB){for(var i=0;i<ancestorsA.length;i++){if(ancestorsA[i]!==ancestorsB[i])
return i;}
if(ancestorsA.length==ancestorsB.length)
return-1;return ancestorsA.length;};AutomationUtil.getUniqueAncestors=function(prevNode,node){var prevAncestors=AutomationUtil.getAncestors(prevNode);var ancestors=AutomationUtil.getAncestors(node);var divergence=AutomationUtil.getDivergence(prevAncestors,ancestors);return ancestors.slice(divergence);};AutomationUtil.getDirection=function(nodeA,nodeB){var ancestorsA=AutomationUtil.getAncestors(nodeA);var ancestorsB=AutomationUtil.getAncestors(nodeB);var divergence=AutomationUtil.getDivergence(ancestorsA,ancestorsB);if(divergence==-1)
return Dir.FORWARD;var divA=ancestorsA[divergence];var divB=ancestorsB[divergence];if(!divA)
return Dir.FORWARD;if(!divB)
return Dir.BACKWARD;if(divA.parent===nodeB)
return Dir.BACKWARD;if(divB.parent===nodeA)
return Dir.FORWARD;return divA.indexInParent<=divB.indexInParent?Dir.FORWARD:Dir.BACKWARD;};AutomationUtil.isInSameTree=function(a,b){if(!a||!b)
return true;return a.root===b.root||(a.root.role==b.root.role&&a.root.role==RoleType.rootWebArea);};AutomationUtil.isDescendantOf=function(node,ancestor){var testNode=node;while(testNode&&testNode!==ancestor)
testNode=testNode.parent;return testNode===ancestor;};AutomationUtil.hitTest=function(node,point){var loc=node.location;var child=node.firstChild;while(child){var hit=AutomationUtil.hitTest(child,point);if(hit)
return hit;child=child.nextSibling;}
if(point.x<=(loc.left+loc.width)&&point.x>=loc.left&&point.y<=(loc.top+loc.height)&&point.y>=loc.top)
return node;return null;};AutomationUtil.getTopLevelRoot=function(node){var root=node.root;if(!root||root.role==RoleType.desktop)
return null;while(root&&root.parent&&root.parent.root&&root.parent.root.role!=RoleType.desktop){root=root.parent.root;}
return root;};});goog.provide('StringUtil');StringUtil=function(){};StringUtil.longestCommonPrefixLength=function(first,second){var limit=Math.min(first.length,second.length);var i;for(i=0;i<limit;++i){if(first.charAt(i)!=second.charAt(i)){break;}}
return i;};StringUtil.MAX_BMP_CODEPOINT=65535;StringUtil.nextCodePointOffset=function(str,offset){if(offset>=str.length)
return str.length;if(str.codePointAt(offset)>StringUtil.MAX_BMP_CODEPOINT)
return offset+2;return offset+1;};StringUtil.previousCodePointOffset=function(str,offset){if(offset<=0)
return-1;if(offset>1&&str.codePointAt(offset-2)>StringUtil.MAX_BMP_CODEPOINT)
return offset-2;return offset-1;};goog.provide('cursors.Cursor');goog.provide('cursors.Movement');goog.provide('cursors.Range');goog.provide('cursors.Unit');goog.require('AutomationPredicate');goog.require('AutomationUtil');goog.require('StringUtil');goog.require('constants');cursors.NODE_INDEX=-1;cursors.Unit={CHARACTER:'character',WORD:'word',NODE:'node',LINE:'line'};cursors.Movement={BOUND:'bound',DIRECTIONAL:'directional'};goog.scope(function(){var AutomationNode=chrome.automation.AutomationNode;var Dir=constants.Dir;var Movement=cursors.Movement;var RoleType=chrome.automation.RoleType;var Unit=cursors.Unit;cursors.Cursor=function(node,index){this.index_=index;this.ancestry_=[];var nodeWalker=node;while(nodeWalker){this.ancestry_.push(nodeWalker);nodeWalker=nodeWalker.parent;if(nodeWalker&&AutomationPredicate.root(nodeWalker))
break;}};cursors.Cursor.fromNode=function(node){return new cursors.Cursor(node,cursors.NODE_INDEX);};cursors.Cursor.prototype={equals:function(rhs){return this.node===rhs.node&&this.index===rhs.index;},contentEquals:function(rhs){var lNode=this.node;var rNode=rhs.node;while(lNode&&(lNode.role==RoleType.inlineTextBox||lNode.role==RoleType.staticText))
lNode=lNode.parent;while(rNode&&(rNode.role==RoleType.inlineTextBox||rNode.role==RoleType.staticText))
rNode=rNode.parent;return lNode===rNode&&lNode!=undefined;},get node(){for(var i=0;i<this.ancestry_.length;i++){var firstValidNode=this.ancestry_[i];if(firstValidNode!=null&&firstValidNode.role!==undefined&&firstValidNode.root!==undefined){return firstValidNode;}
this.index_=cursors.NODE_INDEX;}
return null;},get index(){return this.index_;},get selectionNode_(){var adjustedNode=this.node;if(!adjustedNode)
return null;var parent=adjustedNode.parent;var grandparent=parent&&parent.parent;if(parent.role==RoleType.lineBreak){adjustedNode=grandparent;}else if(grandparent.role==RoleType.lineBreak){adjustedNode=grandparent.parent;}else if(this.index_==cursors.NODE_INDEX||adjustedNode.role==RoleType.inlineTextBox||chrome.automation.NameFromType[adjustedNode.nameFrom]!='contents'){adjustedNode=parent;}else{adjustedNode=adjustedNode.find({role:RoleType.staticText})||adjustedNode;}
return adjustedNode;},get selectionIndex_(){var adjustedIndex=this.index_;if(this.node.role==RoleType.inlineTextBox&&this.node.parent&&this.node.parent.role!=RoleType.lineBreak){if(adjustedIndex==cursors.NODE_INDEX)
adjustedIndex=0;var sibling=this.node.previousSibling;while(sibling){adjustedIndex+=sibling.name.length;sibling=sibling.previousSibling;}}else if(this.index_==cursors.NODE_INDEX||chrome.automation.NameFromType[this.node.nameFrom]!='contents'){var childOfSelection=this.node;do{adjustedIndex=childOfSelection.indexInParent;childOfSelection=childOfSelection.parent;}while(childOfSelection&&childOfSelection!=this.selectionNode_);}
return adjustedIndex;},getText:function(opt_node){var node=opt_node||this.node;if(node.role===RoleType.textField)
return node.value;return node.name||'';},move:function(unit,movement,dir){var originalNode=this.node;if(!originalNode)
return this;var newNode=originalNode;var newIndex=this.index_;if(unit!=Unit.NODE&&newIndex===cursors.NODE_INDEX)
newIndex=0;switch(unit){case Unit.CHARACTER:var text=this.getText();newIndex=dir==Dir.FORWARD?StringUtil.nextCodePointOffset(text,newIndex):StringUtil.previousCodePointOffset(text,newIndex);if(newIndex<0||newIndex>=text.length){newNode=AutomationUtil.findNextNode(newNode,dir,AutomationPredicate.leafWithText);if(newNode){var newText=this.getText(newNode);newIndex=dir==Dir.FORWARD?0:StringUtil.previousCodePointOffset(newText,newText.length);newIndex=Math.max(newIndex,0);}else{newIndex=this.index_;}}
break;case Unit.WORD:if(newNode.role!=RoleType.inlineTextBox){newNode=AutomationUtil.findNextNode(newNode,Dir.FORWARD,AutomationPredicate.inlineTextBox,{skipInitialSubtree:false})||newNode;}
switch(movement){case Movement.BOUND:if(newNode.role==RoleType.inlineTextBox){var start,end;for(var i=0;i<newNode.wordStarts.length;i++){if(newIndex>=newNode.wordStarts[i]&&newIndex<=newNode.wordEnds[i]){start=newNode.wordStarts[i];end=newNode.wordEnds[i];break;}}
if(goog.isDef(start)&&goog.isDef(end))
newIndex=dir==Dir.FORWARD?end:start;}else{}
break;case Movement.DIRECTIONAL:if(newNode.role==RoleType.inlineTextBox){var start,end;for(var i=0;i<newNode.wordStarts.length;i++){if(newIndex>=newNode.wordStarts[i]&&newIndex<=newNode.wordEnds[i]){var nextIndex=dir==Dir.FORWARD?i+1:i-1;start=newNode.wordStarts[nextIndex];end=newNode.wordEnds[nextIndex];break;}}
if(goog.isDef(start)){newIndex=start;}else{if(dir==Dir.BACKWARD&&newIndex!=0){newIndex=0;}else{newNode=AutomationUtil.findNextNode(newNode,dir,AutomationPredicate.leaf);if(newNode){newIndex=0;if(dir==Dir.BACKWARD&&newNode.role==RoleType.inlineTextBox){var starts=newNode.wordStarts;newIndex=starts[starts.length-1]||0;}else{}}}}}else{}}
break;case Unit.NODE:switch(movement){case Movement.BOUND:newIndex=dir==Dir.FORWARD?this.getText().length-1:0;break;case Movement.DIRECTIONAL:newNode=AutomationUtil.findNextNode(newNode,dir,AutomationPredicate.object)||originalNode;newIndex=cursors.NODE_INDEX;break;}
break;case Unit.LINE:newIndex=0;switch(movement){case Movement.BOUND:newNode=AutomationUtil.findNodeUntil(newNode,dir,AutomationPredicate.linebreak,true);newNode=newNode||originalNode;newIndex=dir==Dir.FORWARD?this.getText(newNode).length:0;break;case Movement.DIRECTIONAL:newNode=AutomationUtil.findNodeUntil(newNode,dir,AutomationPredicate.linebreak);break;}
break;default:throw Error('Unrecognized unit: '+unit);}
newNode=newNode||originalNode;newIndex=goog.isDef(newIndex)?newIndex:this.index_;return new cursors.Cursor(newNode,newIndex);},isValid:function(){return this.node!=null;}};cursors.WrappingCursor=function(node,index){cursors.Cursor.call(this,node,index);};cursors.WrappingCursor.fromNode=function(node){return new cursors.WrappingCursor(node,cursors.NODE_INDEX);};cursors.WrappingCursor.prototype={__proto__:cursors.Cursor.prototype,move:function(unit,movement,dir){var result=this;if(!result.node)
return this;if(!AutomationPredicate.root(this.node)||dir==Dir.FORWARD||movement==Movement.BOUND)
result=cursors.Cursor.prototype.move.call(this,unit,movement,dir);if(movement==Movement.BOUND)
return new cursors.WrappingCursor(result.node,result.index);if(movement==Movement.DIRECTIONAL&&result.equals(this)){var pred=unit==Unit.NODE?AutomationPredicate.object:AutomationPredicate.leaf;var endpoint=this.node;if(!endpoint)
return this;while(!AutomationPredicate.root(endpoint)&&endpoint.parent)
endpoint=endpoint.parent;var playEarcon=dir==Dir.FORWARD;if(dir==Dir.BACKWARD&&endpoint==this.node){playEarcon=true;endpoint=AutomationUtil.findNodePre(endpoint,dir,function(n){return pred(n)&&!AutomationPredicate.shouldIgnoreNode(n);})||endpoint;}
if(playEarcon)
cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP);return new cursors.WrappingCursor(endpoint,cursors.NODE_INDEX);}
return new cursors.WrappingCursor(result.node,result.index);}};cursors.Range=function(start,end){this.start_=start;this.end_=end;};cursors.Range.fromNode=function(node){var cursor=cursors.WrappingCursor.fromNode(node);return new cursors.Range(cursor,cursor);};cursors.Range.getDirection=function(rangeA,rangeB){if(!rangeA||!rangeB)
return Dir.FORWARD;if(!rangeA.start.node||!rangeA.end.node||!rangeB.start.node||!rangeB.end.node)
return Dir.FORWARD;if(rangeA.start.node===rangeB.start.node&&rangeB.end.node===rangeA.end.node)
return Dir.FORWARD;var testDirA=AutomationUtil.getDirection(rangeA.start.node,rangeB.end.node);var testDirB=AutomationUtil.getDirection(rangeB.start.node,rangeA.end.node);if(testDirA==Dir.FORWARD&&testDirB==Dir.BACKWARD)
return Dir.FORWARD;else if(testDirA==Dir.BACKWARD&&testDirB==Dir.FORWARD)
return Dir.BACKWARD;else
return testDirA;};cursors.Range.prototype={equals:function(rhs){return this.start_.equals(rhs.start)&&this.end_.equals(rhs.end);},contentEquals:function(rhs){return this.start_.contentEquals(rhs.start)&&this.end_.contentEquals(rhs.end);},getBound:function(dir,opt_reverse){if(opt_reverse)
return dir==Dir.BACKWARD?this.end_:this.start_;return dir==Dir.FORWARD?this.end_:this.start_;},get start(){return this.start_;},get end(){return this.end_;},isSubNode:function(){return this.start.node===this.end.node&&this.start.index>-1&&this.end.index>-1;},move:function(unit,dir){var newStart=this.start_;if(!newStart.node)
return this;var newEnd;switch(unit){case Unit.CHARACTER:newStart=newStart.move(unit,Movement.DIRECTIONAL,dir);newEnd=newStart.move(unit,Movement.DIRECTIONAL,Dir.FORWARD);if(newStart.node!==newEnd.node)
newEnd=new cursors.Cursor(newStart.node,newStart.index+1);break;case Unit.WORD:case Unit.LINE:newStart=newStart.move(unit,Movement.DIRECTIONAL,dir);newStart=newStart.move(unit,Movement.BOUND,Dir.BACKWARD);newEnd=newStart.move(unit,Movement.BOUND,Dir.FORWARD);break;case Unit.NODE:newStart=newStart.move(unit,Movement.DIRECTIONAL,dir);newEnd=newStart;break;default:throw Error('Invalid unit: '+unit);}
return new cursors.Range(newStart,newEnd);},select:function(){var startNode=this.start.selectionNode_;var endNode=this.end.selectionNode_;if(!startNode||!endNode)
return;if(startNode.root&&startNode.root.role==RoleType.rootWebArea&&startNode.root==endNode.root){var startIndex=this.start.selectionIndex_;var endIndex=this.end.index_==cursors.NODE_INDEX?this.end.selectionIndex_+1:this.end.selectionIndex_;chrome.automation.setDocumentSelection({anchorObject:startNode,anchorOffset:startIndex,focusObject:endNode,focusOffset:endIndex});}},isWebRange:function(){return this.isValid()&&(this.start.node.root.role!=RoleType.desktop||this.end.node.root.role!=RoleType.desktop);},isValid:function(){return this.start.isValid()&&this.end.isValid();}};});goog.provide('cvox.ChromeVox');goog.addDependency('../host/interface/abstract_host.js',['cvox.AbstractHost'],[]);goog.addDependency('../host/interface/tts_interface.js',['cvox.TtsInterface'],[]);goog.addDependency('../host/interface/braille_interface.js',['cvox.BrailleInterface'],[]);goog.addDependency('../host/interface/mathjax_interface.js',['cvox.MathJaxInterface'],[]);goog.addDependency('../chromevox/messages/msgs.js',['Msgs'],[]);goog.addDependency('../host/interface/abstract_earcons.js',['cvox.AbstractEarcons'],[]);goog.addDependency('../chromevox/common/key_sequence.js',['cvox.KeySequence'],[]);goog.addDependency('../chromevox/injected/navigation_manager.js',['cvox.NavigationManager'],[]);goog.addDependency('../chromevox/injected/serializer.js',['cvox.Serializer'],[]);cvox.VERBOSITY_VERBOSE=0;cvox.VERBOSITY_BRIEF=1;cvox.ChromeVox=function(){};cvox.ChromeVox.host=null;cvox.ChromeVox.tts;cvox.ChromeVox.braille;cvox.ChromeVox.mathJax;cvox.ChromeVox.isActive=true;cvox.ChromeVox.version=null;cvox.ChromeVox.earcons=null;cvox.ChromeVox.navigationManager=null;cvox.ChromeVox.serializer=null;cvox.ChromeVox.isStickyPrefOn=false;cvox.ChromeVox.stickyOverride=null;cvox.ChromeVox.keyPrefixOn=false;cvox.ChromeVox.verbosity=cvox.VERBOSITY_VERBOSE;cvox.ChromeVox.typingEcho=0;cvox.ChromeVox.keyEcho={};cvox.Point;cvox.ChromeVox.position={};cvox.ChromeVox.isChromeOS=navigator.userAgent.indexOf('CrOS')!=-1;cvox.ChromeVox.isMac=navigator.platform.indexOf('Mac')!=-1;cvox.ChromeVox.modKeyStr;if(cvox.ChromeVox.isChromeOS){cvox.ChromeVox.modKeyStr='Shift+Search';}else if(cvox.ChromeVox.isMac){cvox.ChromeVox.modKeyStr='Ctrl+Cmd';}else{cvox.ChromeVox.modKeyStr='Shift+Alt';}
cvox.ChromeVox.sequenceSwitchKeyCodes=[];cvox.ChromeVox.visitedUrls={};cvox.ChromeVox.markInUserCommand=function(){};cvox.ChromeVox.syncToNode=function(targetNode,speakNode,opt_queueMode){};cvox.ChromeVox.speakNode=function(targetNode,queueMode,properties){};cvox.ChromeVox.executeUserCommand=function(commandName){};cvox.ChromeVox.entireDocumentIsHidden=false;cvox.ChromeVox.storeOn=function(store){store['isStickyPrefOn']=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.navigationManager.storeOn(store);};cvox.ChromeVox.readFrom=function(store){cvox.ChromeVox.isStickyPrefOn=store['isStickyPrefOn'];cvox.ChromeVox.navigationManager.readFrom(store);};cvox.ChromeVox.isStickyModeOn=function(){if(cvox.ChromeVox.stickyOverride!==null){return cvox.ChromeVox.stickyOverride;}else{return cvox.ChromeVox.isStickyPrefOn;}};function $(id){return document.getElementById(id);}
cvox.ChromeVox.injectChromeVoxIntoTabs=function(tabs){};cvox.ChromeVox.documentHasFocus=function(){if(!document.hasFocus()||document.hidden){return false;}
if(document.activeElement.tagName=='IFRAME'||document.activeElement.tagName=='WEBVIEW'){return false;}
return true;};goog.provide('Stubs');goog.require('cvox.ChromeVox');Stubs.init=function(){if(!cvox.ChromeVox.isChromeOS){chrome.accessibilityPrivate.onAccessibilityGesture={};chrome.accessibilityPrivate.onAccessibilityGesture.addListener=function(){};chrome.accessibilityPrivate.setFocusRing=function(){};chrome.accessibilityPrivate.setKeyboardListener=function(){};}
if(cvox.ChromeVox.isMac){chrome.automation.getDesktop=function(){};}
if(!chrome.automation.NameFromType){chrome.automation['NameFromType']={};chrome.automation['DescriptionFromType']={};}};Stubs.init();goog.provide('EarconEngine');EarconEngine=function(){this.masterVolume=1.0;this.masterPitch=-4;this.clickVolume=0.4;this.staticVolume=0.2;this.baseDelay=0.045;this.masterPan=0;this.masterReverb=0.4;this.reverbSound='small_room_2';this.wrapPitch=0;this.alertPitch=0;this.controlSound='control';this.sweepDelay=0.045;this.sweepEchoDelay=0.15;this.sweepEchoCount=3;this.sweepPitch=-7;this.progressFinalGain=0.05;this.progressGain_Decay=0.7;this.context_=new AudioContext();this.reverbConvolver_=null;this.buffers_={};this.progressSources_=[];this.progressGain_=1.0;this.progressTime_=this.context_.currentTime;this.progressIntervalID_=null;var allSoundFilesToLoad=EarconEngine.SOUNDS.concat(EarconEngine.REVERBS);allSoundFilesToLoad.forEach((function(sound){var url=EarconEngine.BASE_URL+sound+'.wav';this.loadSound(sound,url);}).bind(this));};EarconEngine.SOUNDS=['control','selection','selection_reverse','skim','static'];EarconEngine.REVERBS=['small_room_2'];EarconEngine.HALF_STEP=Math.pow(2.0,1.0/12.0);EarconEngine.BASE_URL=chrome.extension.getURL('cvox2/background/earcons/');EarconEngine.prototype.loadSound=function(name,url){var request=new XMLHttpRequest();request.open('GET',url,true);request.responseType='arraybuffer';request.onload=(function(){this.context_.decodeAudioData((request.response),(function(buffer){this.buffers_[name]=buffer;}).bind(this));}).bind(this);request.send();};EarconEngine.prototype.createCommonFilters=function(properties){var gain=this.masterVolume;if(properties.gain){gain*=properties.gain;}
var gainNode=this.context_.createGain();gainNode.gain.value=gain;var first=gainNode;var last=gainNode;var pan=this.masterPan;if(properties.pan!==undefined){pan=properties.pan;}
if(pan!=0){var panNode=this.context_.createPanner();panNode.setPosition(pan,0,-1);panNode.setOrientation(0,0,1);last.connect(panNode);last=panNode;}
var reverb=this.masterReverb;if(properties.reverb!==undefined){reverb=properties.reverb;}
if(reverb){if(!this.reverbConvolver_){this.reverbConvolver_=this.context_.createConvolver();this.reverbConvolver_.buffer=this.buffers_[this.reverbSound];this.reverbConvolver_.connect(this.context_.destination);}
last.connect(this.context_.destination);var reverbGainNode=this.context_.createGain();reverbGainNode.gain.value=reverb;last.connect(reverbGainNode);reverbGainNode.connect(this.reverbConvolver_);}else{last.connect(this.context_.destination);}
return first;};EarconEngine.prototype.play=function(sound,opt_properties){var source=this.context_.createBufferSource();source.buffer=this.buffers_[sound];if(!opt_properties){opt_properties=({});}
var pitch=this.masterPitch;if(opt_properties.pitch){pitch+=opt_properties.pitch;}
if(pitch!=0){source.playbackRate.value=Math.pow(EarconEngine.HALF_STEP,pitch);}
var destination=this.createCommonFilters(opt_properties);source.connect(destination);if(opt_properties.time){source.start(this.context_.currentTime+opt_properties.time);}else{source.start(this.context_.currentTime);}
return source;};EarconEngine.prototype.onStatic=function(){this.play('static',{gain:this.staticVolume});};EarconEngine.prototype.onLink=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound,{pitch:12});};EarconEngine.prototype.onButton=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound);};EarconEngine.prototype.onTextField=function(){this.play('static',{gain:this.clickVolume});this.play('static',{time:this.baseDelay*1.5,gain:this.clickVolume*0.5});this.play(this.controlSound,{pitch:4});this.play(this.controlSound,{pitch:4,time:this.baseDelay*1.5,gain:0.5});};EarconEngine.prototype.onPopUpButton=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound);this.play(this.controlSound,{time:this.baseDelay*3,gain:0.2,pitch:12});this.play(this.controlSound,{time:this.baseDelay*4.5,gain:0.2,pitch:12});};EarconEngine.prototype.onCheckOn=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound,{pitch:-5});this.play(this.controlSound,{pitch:7,time:this.baseDelay*2});};EarconEngine.prototype.onCheckOff=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound,{pitch:7});this.play(this.controlSound,{pitch:-5,time:this.baseDelay*2});};EarconEngine.prototype.onSelect=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound);this.play(this.controlSound,{time:this.baseDelay});this.play(this.controlSound,{time:this.baseDelay*2});};EarconEngine.prototype.onSlider=function(){this.play('static',{gain:this.clickVolume});this.play(this.controlSound);this.play(this.controlSound,{time:this.baseDelay,gain:0.5,pitch:2});this.play(this.controlSound,{time:this.baseDelay*2,gain:0.25,pitch:4});this.play(this.controlSound,{time:this.baseDelay*3,gain:0.125,pitch:6});this.play(this.controlSound,{time:this.baseDelay*4,gain:0.0625,pitch:8});};EarconEngine.prototype.onSkim=function(){this.play('skim');};EarconEngine.prototype.onSelection=function(){this.play('selection');};EarconEngine.prototype.onSelectionReverse=function(){this.play('selection_reverse');};EarconEngine.prototype.generateSinusoidal=function(properties){var envelopeNode=this.context_.createGain();envelopeNode.connect(this.context_.destination);var time=properties.time;if(time===undefined){time=0;}
var gain=properties.gain;for(var i=0;i<properties.overtones;i++){var osc=this.context_.createOscillator();osc.frequency.value=properties.freq*(i+1);if(properties.endFreq){osc.frequency.setValueAtTime(properties.freq*(i+1),this.context_.currentTime+time);osc.frequency.exponentialRampToValueAtTime(properties.endFreq*(i+1),this.context_.currentTime+properties.dur);}
osc.start(this.context_.currentTime+time);osc.stop(this.context_.currentTime+time+properties.dur);var gainNode=this.context_.createGain();gainNode.gain.value=gain;osc.connect(gainNode);gainNode.connect(envelopeNode);gain*=properties.overtoneFactor;}
envelopeNode.gain.setValueAtTime(0,this.context_.currentTime+time);envelopeNode.gain.linearRampToValueAtTime(1,this.context_.currentTime+time+properties.attack);envelopeNode.gain.setValueAtTime(1,this.context_.currentTime+time+
properties.dur-properties.decay);envelopeNode.gain.linearRampToValueAtTime(0,this.context_.currentTime+time+properties.dur);var destination=this.createCommonFilters({});envelopeNode.connect(destination);};EarconEngine.prototype.onChromeVoxSweep=function(reverse){var pitches=[-7,-5,0,5,7,12,17,19,24];if(reverse){pitches.reverse();}
var attack=0.015;var dur=pitches.length*this.sweepDelay;var destination=this.createCommonFilters({reverb:2.0});for(var k=0;k<this.sweepEchoCount;k++){var envelopeNode=this.context_.createGain();var startTime=this.context_.currentTime+this.sweepEchoDelay*k;var sweepGain=Math.pow(0.3,k);var overtones=2;var overtoneGain=sweepGain;for(var i=0;i<overtones;i++){var osc=this.context_.createOscillator();osc.start(startTime);osc.stop(startTime+dur);var gainNode=this.context_.createGain();osc.connect(gainNode);gainNode.connect(envelopeNode);for(var j=0;j<pitches.length;j++){var freqDecay;if(reverse){freqDecay=Math.pow(0.75,pitches.length-j);}else{freqDecay=Math.pow(0.75,j);}
var gain=overtoneGain*freqDecay;var freq=(i+1)*220*Math.pow(EarconEngine.HALF_STEP,pitches[j]+this.sweepPitch);if(j==0){osc.frequency.setValueAtTime(freq,startTime);gainNode.gain.setValueAtTime(gain,startTime);}else{osc.frequency.exponentialRampToValueAtTime(freq,startTime+j*this.sweepDelay);gainNode.gain.linearRampToValueAtTime(gain,startTime+j*this.sweepDelay);}
osc.frequency.setValueAtTime(freq,startTime+j*this.sweepDelay+this.sweepDelay-attack);}
overtoneGain*=0.1+0.2*k;}
envelopeNode.gain.setValueAtTime(0,startTime);envelopeNode.gain.linearRampToValueAtTime(1,startTime+this.sweepDelay);envelopeNode.gain.setValueAtTime(1,startTime+dur-attack*2);envelopeNode.gain.linearRampToValueAtTime(0,startTime+dur);envelopeNode.connect(destination);}};EarconEngine.prototype.onChromeVoxOn=function(){this.onChromeVoxSweep(false);};EarconEngine.prototype.onChromeVoxOff=function(){this.onChromeVoxSweep(true);};EarconEngine.prototype.onAlert=function(){var freq1=220*Math.pow(EarconEngine.HALF_STEP,this.alertPitch-2);var freq2=220*Math.pow(EarconEngine.HALF_STEP,this.alertPitch-3);this.generateSinusoidal({attack:0.02,decay:0.07,dur:0.15,gain:0.3,freq:freq1,overtones:3,overtoneFactor:0.1});this.generateSinusoidal({attack:0.02,decay:0.07,dur:0.15,gain:0.3,freq:freq2,overtones:3,overtoneFactor:0.1});};EarconEngine.prototype.onWrap=function(){this.play('static',{gain:this.clickVolume*0.3});var freq1=220*Math.pow(EarconEngine.HALF_STEP,this.wrapPitch-8);var freq2=220*Math.pow(EarconEngine.HALF_STEP,this.wrapPitch+8);this.generateSinusoidal({attack:0.01,decay:0.1,dur:0.15,gain:0.3,freq:freq1,endFreq:freq2,overtones:1,overtoneFactor:0.1});};EarconEngine.prototype.generateProgressTickTocks_=function(){while(this.progressTime_<this.context_.currentTime+3.0){var t=this.progressTime_-this.context_.currentTime;this.progressSources_.push([this.progressTime_,this.play('static',{gain:0.5*this.progressGain_,time:t})]);this.progressSources_.push([this.progressTime_,this.play(this.controlSound,{pitch:20,time:t,gain:this.progressGain_})]);if(this.progressGain_>this.progressFinalGain){this.progressGain_*=this.progressGain_Decay;}
t+=0.5;this.progressSources_.push([this.progressTime_,this.play('static',{gain:0.5*this.progressGain_,time:t})]);this.progressSources_.push([this.progressTime_,this.play(this.controlSound,{pitch:8,time:t,gain:this.progressGain_})]);if(this.progressGain_>this.progressFinalGain){this.progressGain_*=this.progressGain_Decay;}
this.progressTime_+=1.0;}
var removeCount=0;while(removeCount<this.progressSources_.length&&this.progressSources_[removeCount][0]<this.context_.currentTime-0.2){removeCount++;}
this.progressSources_.splice(0,removeCount);};EarconEngine.prototype.startProgress=function(){if(this.progressIntervalID_){this.cancelProgress();}
this.progressSources_=[];this.progressGain_=0.5;this.progressTime_=this.context_.currentTime;this.generateProgressTickTocks_();this.progressIntervalID_=window.setInterval(this.generateProgressTickTocks_.bind(this),1000);};EarconEngine.prototype.cancelProgress=function(){if(!this.progressIntervalID_){return;}
for(var i=0;i<this.progressSources_.length;i++){this.progressSources_[i][1].stop();}
this.progressSources_=[];window.clearInterval(this.progressIntervalID_);this.progressIntervalID_=null;};goog.provide('cvox.ExtraCellsSpan');goog.provide('cvox.ValueSelectionSpan');goog.provide('cvox.ValueSpan');goog.require('Spannable');cvox.ValueSpan=function(offset){this.offset=offset;};cvox.ValueSpan.fromJson=function(obj){return new cvox.ValueSpan(obj.offset);};cvox.ValueSpan.prototype.toJson=function(){return this;};Spannable.registerSerializableSpan(cvox.ValueSpan,'cvox.ValueSpan',cvox.ValueSpan.fromJson,cvox.ValueSpan.prototype.toJson);cvox.ValueSelectionSpan=function(){};Spannable.registerStatelessSerializableSpan(cvox.ValueSelectionSpan,'cvox.ValueSelectionSpan');cvox.ExtraCellsSpan=function(){this.cells=new Uint8Array(0).buffer;};goog.provide('cvox.NavBraille');goog.require('Spannable');cvox.NavBraille=function(kwargs){this.text=(kwargs.text instanceof Spannable)?kwargs.text:new Spannable(kwargs.text);this.startIndex=goog.isDef(kwargs.startIndex)?kwargs.startIndex:-1;this.endIndex=goog.isDef(kwargs.endIndex)?kwargs.endIndex:this.startIndex;};cvox.NavBraille.fromText=function(text){return new cvox.NavBraille({'text':text});};cvox.NavBraille.fromJson=function(json){if(typeof json.startIndex!=='number'||typeof json.endIndex!=='number'){throw'Invalid start or end index in serialized NavBraille: '+json;}
return new cvox.NavBraille({text:Spannable.fromJson(json.spannable),startIndex:json.startIndex,endIndex:json.endIndex});};cvox.NavBraille.prototype.isEmpty=function(){return this.text.length==0;};cvox.NavBraille.prototype.toString=function(){return'NavBraille(text="'+this.text.toString()+'" '+' startIndex="'+this.startIndex+'" '+' endIndex="'+this.endIndex+'")';};cvox.NavBraille.prototype.toJson=function(){return{spannable:this.text.toJson(),startIndex:this.startIndex,endIndex:this.endIndex};};goog.provide('cvox.QueueMode');goog.provide('cvox.TtsCapturingEventListener');goog.provide('cvox.TtsCategory');goog.provide('cvox.TtsInterface');cvox.TtsCategory={LIVE:'live',NAV:'nav'};cvox.QueueMode={FLUSH:0,QUEUE:1,CATEGORY_FLUSH:2};cvox.TtsCapturingEventListener=function(){};cvox.TtsCapturingEventListener.prototype.onTtsStart=function(){};cvox.TtsCapturingEventListener.prototype.onTtsEnd=function(){};cvox.TtsInterface=function(){};cvox.TtsInterface.prototype.speak=function(textString,queueMode,properties){};cvox.TtsInterface.prototype.isSpeaking=function(){};cvox.TtsInterface.prototype.stop=function(){};cvox.TtsInterface.prototype.addCapturingEventListener=function(listener){};cvox.TtsInterface.prototype.increaseOrDecreaseProperty=function(propertyName,increase){};cvox.TtsInterface.prototype.propertyToPercentage=function(property){};cvox.TtsInterface.prototype.getDefaultProperty=function(property){};goog.provide('Output');goog.provide('Output.EventType');goog.require('AutomationTreeWalker');goog.require('EarconEngine');goog.require('Spannable');goog.require('Stubs');goog.require('constants');goog.require('cursors.Cursor');goog.require('cursors.Range');goog.require('cursors.Unit');goog.require('cvox.AbstractEarcons');goog.require('cvox.ChromeVox');goog.require('cvox.NavBraille');goog.require('cvox.TtsCategory');goog.require('cvox.ValueSelectionSpan');goog.require('cvox.ValueSpan');goog.require('goog.i18n.MessageFormat');goog.scope(function(){var AutomationNode=chrome.automation.AutomationNode;var Dir=constants.Dir;var EventType=chrome.automation.EventType;var RoleType=chrome.automation.RoleType;Output=function(){this.speechBuffer_=[];this.brailleBuffer_=[];this.locations_=[];this.speechEndCallback_;this.formatOptions_={speech:true,braille:false,auralStyle:false};this.speechCategory_=cvox.TtsCategory.NAV;this.queueMode_=cvox.QueueMode.QUEUE;this.outputContextFirst_=false;};Output.SPACE=' ';Output.ROLE_INFO_={alert:{msgId:'role_alert',earconId:'ALERT_NONMODAL'},alertDialog:{msgId:'role_alertdialog',outputContextFirst:true},article:{msgId:'role_article',inherits:'abstractContainer'},application:{msgId:'role_application',inherits:'abstractContainer'},banner:{msgId:'role_banner',inherits:'abstractContainer'},button:{msgId:'role_button',earconId:'BUTTON'},buttonDropDown:{msgId:'role_button',earconId:'BUTTON'},checkBox:{msgId:'role_checkbox'},columnHeader:{msgId:'role_columnheader',inherits:'cell'},comboBox:{msgId:'role_combobox',earconId:'LISTBOX'},complementary:{msgId:'role_complementary',inherits:'abstractContainer'},contentInfo:{msgId:'role_contentinfo',inherits:'abstractContainer'},date:{msgId:'input_type_date',inherits:'abstractContainer'},definition:{msgId:'role_definition',inherits:'abstractContainer'},dialog:{msgId:'role_dialog',outputContextFirst:true},directory:{msgId:'role_directory',inherits:'abstractContainer'},document:{msgId:'role_document',inherits:'abstractContainer'},form:{msgId:'role_form',inherits:'abstractContainer'},grid:{msgId:'role_grid'},group:{msgId:'role_group',inherits:'abstractContainer'},heading:{msgId:'role_heading',},image:{msgId:'role_img',},inputTime:{msgId:'input_type_time',inherits:'abstractContainer'},link:{msgId:'role_link',earconId:'LINK'},listBox:{msgId:'role_listbox',earconId:'LISTBOX'},listBoxOption:{msgId:'role_listitem',earconId:'LIST_ITEM'},listItem:{msgId:'role_listitem',earconId:'LIST_ITEM'},log:{msgId:'role_log',},main:{msgId:'role_main',inherits:'abstractContainer'},marquee:{msgId:'role_marquee',},math:{msgId:'role_math',inherits:'abstractContainer'},menu:{msgId:'role_menu',outputContextFirst:true},menuBar:{msgId:'role_menubar',},menuItem:{msgId:'role_menuitem'},menuItemCheckBox:{msgId:'role_menuitemcheckbox'},menuItemRadio:{msgId:'role_menuitemradio'},menuListOption:{msgId:'role_menuitem'},menuListPopup:{msgId:'role_menu'},navigation:{msgId:'role_navigation',inherits:'abstractContainer'},note:{msgId:'role_note',inherits:'abstractContainer'},popUpButton:{msgId:'role_button',earconId:'POP_UP_BUTTON'},radioButton:{msgId:'role_radio'},radioGroup:{msgId:'role_radiogroup',},rootWebArea:{outputContextFirst:true},row:{msgId:'role_row',inherits:'abstractContainer'},rowHeader:{msgId:'role_rowheader',inherits:'cell'},scrollBar:{msgId:'role_scrollbar',},search:{msgId:'role_search',inherits:'abstractContainer'},separator:{msgId:'role_separator',inherits:'abstractContainer'},spinButton:{msgId:'role_spinbutton',earconId:'LISTBOX'},status:{msgId:'role_status'},tab:{msgId:'role_tab'},tabList:{msgId:'role_tablist'},tabPanel:{msgId:'role_tabpanel'},textBox:{msgId:'input_type_text',earconId:'EDITABLE_TEXT'},textField:{msgId:'input_type_text',earconId:'EDITABLE_TEXT'},time:{msgId:'tag_time',inherits:'abstractContainer'},timer:{msgId:'role_timer'},toolbar:{msgId:'role_toolbar'},toggleButton:{msgId:'role_button',inherits:'checkBox'},tree:{msgId:'role_tree'},treeItem:{msgId:'role_treeitem'}};Output.STATE_INFO_={checked:{on:{msgId:'checkbox_checked_state'},off:{msgId:'checkbox_unchecked_state'},omitted:{msgId:'checkbox_unchecked_state'}},collapsed:{on:{msgId:'aria_expanded_false'},off:{msgId:'aria_expanded_true'}},disabled:{on:{msgId:'aria_disabled_true'}},expanded:{on:{msgId:'aria_expanded_true'},off:{msgId:'aria_expanded_false'}},visited:{on:{msgId:'visited_state'}}};Output.INPUT_TYPE_MESSAGE_IDS_={'email':'input_type_email','number':'input_type_number','password':'input_type_password','search':'input_type_search','tel':'input_type_number','text':'input_type_text','url':'input_type_url',};Output.RULES={navigate:{'default':{speak:'$name $value $state $role $description',braille:''},abstractContainer:{enter:'$nameFromNode $role $state $description',leave:'@exited_container($role)'},alert:{speak:'!doNotInterrupt $role $descendants $state'},alertDialog:{enter:'$nameFromNode $role $description',speak:'$name $role $descendants $state'},cell:{enter:'@cell_summary($tableCellRowIndex, $tableCellColumnIndex) '+'$node(tableColumnHeader)',speak:'@cell_summary($tableCellRowIndex, $tableCellColumnIndex) '+'$node(tableColumnHeader) $state'},checkBox:{speak:'$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) '+'$name $role $checked $description $state'},client:{speak:'$name'},date:{enter:'$nameFromNode $role $description'},dialog:{enter:'$nameFromNode $role $description'},div:{enter:'$nameFromNode',speak:'$nameOrTextContent $description'},embeddedObject:{speak:'$name'},grid:{enter:'$nameFromNode $role $description'},group:{enter:'$nameFromNode $state $description',speak:'$nameOrDescendants $value $state $description',leave:''},heading:{enter:'!relativePitch(hierarchicalLevel) '+'$nameFromNode= '+'$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state',speak:'!relativePitch(hierarchicalLevel) '+'$nameOrDescendants= '+'$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state'},inlineTextBox:{speak:'$name='},inputTime:{enter:'$nameFromNode $role $description'},link:{enter:'$nameFromNode= $role $state'},list:{enter:'$role @@list_with_items($countChildren(listItem))',speak:'$descendants $role @@list_with_items($countChildren(listItem))'},listBox:{enter:'$nameFromNode '+'$role @@list_with_items($countChildren(listBoxOption)) '+'$description'},listBoxOption:{speak:'$name $role @describe_index($indexInParent, $parentChildCount) '+'$description $state'},listItem:{enter:'$role'},menu:{enter:'$name $role',speak:'$name $role @@list_with_items($countChildren(menuItem)) $state'},menuItem:{speak:'$name $role $if($haspopup, @has_submenu) '+'@describe_index($indexInParent, $parentChildCount) '+'$description $state'},menuItemCheckBox:{speak:'$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) '+'$name $role $checked $description '+'@describe_index($indexInParent, $parentChildCount) '},menuItemRadio:{speak:'$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) '+'$if($checked, @describe_radio_selected($name), '+'@describe_radio_unselected($name)) $description '+'@describe_index($indexInParent, $parentChildCount) '},menuListOption:{speak:'$name @role_menuitem '+'@describe_index($indexInParent, $parentChildCount) $description'},paragraph:{speak:'$descendants'},popUpButton:{speak:'$value $name $role @aria_has_popup '+'$state $description'},radioButton:{speak:'$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) '+'$if($checked, @describe_radio_selected($name), '+'@describe_radio_unselected($name)) $description'},radioGroup:{enter:'$name $role $description'},rootWebArea:{enter:'$name',speak:'$if($name, $name, $docUrl)'},region:{speak:'$nameOrTextContent'},row:{enter:'$node(tableRowHeader)'},rowHeader:{speak:'$descendants $state'},slider:{speak:'$earcon(SLIDER) @describe_slider($value, $name) $description '+'$state'},staticText:{speak:'$name='},tab:{speak:'@describe_tab($name) $state $description'},table:{enter:'@table_summary($name, $tableRowCount, $tableColumnCount) '+'$node(tableHeader)'},tableHeaderContainer:{speak:'$descendants $state $description'},textField:{speak:'$name $value $if($multiline, @tag_textarea, $if('+'$inputType, $inputType, $role)) $description $state',braille:''},timer:{speak:'$nameFromNode $descendants $value $state $description'},toggleButton:{speak:'$if($pressed, $earcon(CHECK_ON), $earcon(CHECK_OFF)) '+'$name $role '+'$if($pressed, @aria_pressed_true, @aria_pressed_false) '+'$description $state'},toolbar:{enter:'$name $role $description'},tree:{enter:'$name $role @@list_with_items($countChildren(treeItem))'},treeItem:{enter:'$role $expanded $collapsed '+'@describe_index($indexInParent, $parentChildCount) '+'@describe_depth($hierarchicalLevel)',speak:'$name '+'$role $state '+'@describe_index($indexInParent, $parentChildCount) '+'@describe_depth($hierarchicalLevel)'},window:{enter:'@describe_window($name)',speak:'@describe_window($name) $earcon(OBJECT_OPEN)'}},menuStart:{'default':{speak:'@chrome_menu_opened($name)  $earcon(OBJECT_OPEN)'}},menuEnd:{'default':{speak:'@chrome_menu_closed $earcon(OBJECT_CLOSE)'}},menuListValueChanged:{'default':{speak:'$value $name '+'$find({"state": {"selected": true, "invisible": false}}, '+'@describe_index($indexInParent, $parentChildCount)) '}},alert:{default:{speak:'!doNotInterrupt @role_alert '+'$if($name, $name, $descendants) $earcon(ALERT_NONMODAL) $description'}}};Output.SpeechProperties=function(){};Output.Action=function(){};Output.Action.prototype={run:function(){}};Output.EarconAction=function(earconId){Output.Action.call(this);this.earconId=earconId;};Output.EarconAction.prototype={__proto__:Output.Action.prototype,run:function(){cvox.ChromeVox.earcons.playEarcon(cvox.Earcon[this.earconId]);}};Output.SelectionSpan=function(startIndex,endIndex,opt_offset){this.startIndex=startIndex<endIndex?startIndex:endIndex;this.endIndex=endIndex>startIndex?endIndex:startIndex;this.offset=opt_offset||0;};Output.NodeSpan=function(node){this.node=node;};Output.EventType={NAVIGATE:'navigate'};Output.forceModeForNextSpeechUtterance_;Output.forceModeForNextSpeechUtterance=function(mode){Output.forceModeForNextSpeechUtterance_=mode;};Output.prototype={get hasSpeech(){for(var i=0;i<this.speechBuffer_.length;i++){if(this.speechBuffer_[i].trim().length)
return true;}
return false;},withSpeech:function(range,prevRange,type){this.formatOptions_={speech:true,braille:false,auralStyle:false};this.render_(range,prevRange,type,this.speechBuffer_);return this;},withRichSpeech:function(range,prevRange,type){this.formatOptions_={speech:true,braille:false,auralStyle:true};this.render_(range,prevRange,type,this.speechBuffer_);return this;},withBraille:function(range,prevRange,type){this.formatOptions_={speech:false,braille:true,auralStyle:false};this.render_(range,prevRange,type,this.brailleBuffer_);return this;},withLocation:function(range,prevRange,type){this.formatOptions_={speech:false,braille:false,auralStyle:false};this.render_(range,prevRange,type,[]);return this;},withSpeechAndBraille:function(range,prevRange,type){this.withSpeech(range,prevRange,type);this.withBraille(range,prevRange,type);return this;},withRichSpeechAndBraille:function(range,prevRange,type){this.withRichSpeech(range,prevRange,type);this.withBraille(range,prevRange,type);return this;},withSpeechCategory:function(category){this.speechCategory_=category;return this;},withQueueMode:function(queueMode){this.queueMode_=queueMode;return this;},withString:function(value){this.append_(this.speechBuffer_,value);this.append_(this.brailleBuffer_,value);return this;},withContextFirst:function(){this.outputContextFirst_=true;return this;},format:function(formatStr,opt_node){return this.formatForSpeech(formatStr,opt_node).formatForBraille(formatStr,opt_node);},formatForSpeech:function(formatStr,opt_node){var node=opt_node||null;this.formatOptions_={speech:true,braille:false,auralStyle:false};this.format_(node,formatStr,this.speechBuffer_);return this;},formatForBraille:function(formatStr,opt_node){var node=opt_node||null;this.formatOptions_={speech:false,braille:true,auralStyle:false};this.format_(node,formatStr,this.brailleBuffer_);return this;},onSpeechEnd:function(callback){this.speechEndCallback_=function(opt_cleanupOnly){if(!opt_cleanupOnly)
callback();}.bind(this);return this;},go:function(){var queueMode=cvox.QueueMode.FLUSH;if(Output.forceModeForNextSpeechUtterance_!==undefined)
queueMode=Output.forceModeForNextSpeechUtterance_;else if(this.queueMode_!==undefined)
queueMode=this.queueMode_;if(this.speechBuffer_.length>0)
Output.forceModeForNextSpeechUtterance_=undefined;for(var i=0;i<this.speechBuffer_.length;i++){var buff=this.speechBuffer_[i];var speechProps=(buff.getSpanInstanceOf(Output.SpeechProperties))||{};speechProps.category=this.speechCategory_;(function(){var scopedBuff=buff;speechProps['startCallback']=function(){var actions=scopedBuff.getSpansInstanceOf(Output.Action);if(actions){actions.forEach(function(a){a.run();});}};}());if(i==this.speechBuffer_.length-1)
speechProps['endCallback']=this.speechEndCallback_;cvox.ChromeVox.tts.speak(buff.toString(),queueMode,speechProps);queueMode=cvox.QueueMode.QUEUE;}
if(this.brailleBuffer_.length){var buff=this.createBrailleOutput_();var selSpan=buff.getSpanInstanceOf(Output.SelectionSpan);var startIndex=-1,endIndex=-1;if(selSpan){var valueStart=buff.getSpanStart(selSpan);var valueEnd=buff.getSpanEnd(selSpan);startIndex=valueStart+selSpan.startIndex;endIndex=valueStart+selSpan.endIndex;buff.setSpan(new cvox.ValueSpan(selSpan.offset),valueStart,valueEnd);buff.setSpan(new cvox.ValueSelectionSpan(),startIndex,endIndex);}
var output=new cvox.NavBraille({text:buff,startIndex:startIndex,endIndex:endIndex});cvox.ChromeVox.braille.write(output);}
if(this.speechCategory_!=cvox.TtsCategory.LIVE)
chrome.accessibilityPrivate.setFocusRing(this.locations_);},render_:function(range,prevRange,type,buff){if(prevRange&&!prevRange.isValid())
prevRange=null;var parent=range.start.node;var prevParent=prevRange?prevRange.start.node:parent;if(!parent||!prevParent)
return;var uniqueAncestors=AutomationUtil.getUniqueAncestors(prevParent,parent);for(var i=0;parent=uniqueAncestors[i];i++){if(Output.ROLE_INFO_[parent.role]&&Output.ROLE_INFO_[parent.role].outputContextFirst){this.outputContextFirst_=true;break;}}
if(range.isSubNode())
this.subNode_(range,prevRange,type,buff);else
this.range_(range,prevRange,type,buff);},format_:function(node,format,buff,opt_prevNode){var tokens=[];var args=null;if(typeof(format)=='string'){format=format.replace(/([,:])\W/g,'$1');tokens=format.split(' ');}else{tokens=[format];}
var speechProps=null;tokens.forEach(function(token){if(!token)
return;var tree;if(typeof(token)=='string')
tree=this.createParseTree_(token);else
tree=token;token=tree.value;var options={};options.annotation=[];options.isUnique=token[token.length-1]=='=';if(options.isUnique)
token=token.substring(0,token.length-1);if(node&&this.formatOptions_.braille)
options.annotation.push(new Output.NodeSpan(node));var prefix=token[0];token=token.slice(1);if(prefix=='$'){if(token=='value'){var text=node.value;if(!node.state.editable&&node.name==text)
return;if(text!==undefined){if(node.textSelStart!==undefined){options.annotation.push(new Output.SelectionSpan(node.textSelStart,node.textSelEnd));}}
options.annotation.push(token);this.append_(buff,text,options);}else if(token=='name'){options.annotation.push(token);var earcon=node?this.findEarcon_(node,opt_prevNode):null;if(earcon)
options.annotation.push(earcon);this.append_(buff,node.name,options);}else if(token=='nameFromNode'){if(chrome.automation.NameFromType[node.nameFrom]=='contents')
return;options.annotation.push('name');this.append_(buff,node.name,options);}else if(token=='nameOrDescendants'){options.annotation.push(token);if(node.name)
this.append_(buff,node.name,options);else
this.format_(node,'$descendants',buff);}else if(token=='description'){if(node.name==node.description||node.value==node.description)
return;options.annotation.push(token);this.append_(buff,node.description,options);}else if(token=='indexInParent'){if(node.parent){options.annotation.push(token);var count=0;for(var i=0,child;child=node.parent.children[i];i++){if(node.role==child.role)
count++;if(node===child)
break;}
this.append_(buff,String(count));}}else if(token=='parentChildCount'){if(node.parent){options.annotation.push(token);var count=node.parent.children.filter(function(child){return node.role==child.role;}).length;this.append_(buff,String(count));}}else if(token=='state'){Object.getOwnPropertyNames(node.state).forEach(function(s){var stateInfo=Output.STATE_INFO_[s];if(stateInfo&&stateInfo.on)
this.format_(node,'@'+stateInfo.on.msgId,buff);}.bind(this));}else if(token=='find'){if(tree.firstChild){var jsonQuery=tree.firstChild.value;node=node.find((JSON.parse(jsonQuery)));var formatString=tree.firstChild.nextSibling;if(node)
this.format_(node,formatString,buff);}}else if(token=='descendants'){if(!node||AutomationPredicate.leafOrStaticText(node))
return;var leftmost=AutomationUtil.findNodePre(node,Dir.FORWARD,AutomationPredicate.leafOrStaticText);var rightmost=AutomationUtil.findNodePre(node,Dir.BACKWARD,AutomationPredicate.leafOrStaticText);if(!leftmost||!rightmost)
return;var subrange=new cursors.Range(new cursors.Cursor(leftmost,cursors.NODE_INDEX),new cursors.Cursor(rightmost,cursors.NODE_INDEX));var prev=null;if(node)
prev=cursors.Range.fromNode(node);this.render_(subrange,prev,Output.EventType.NAVIGATE,buff);}else if(token=='joinedDescendants'){var unjoined=[];this.format_(node,'$descendants',unjoined);this.append_(buff,unjoined.join(' '),options);}else if(token=='role'){if(localStorage['useVerboseMode']=='false')
return;if(this.formatOptions_.auralStyle){speechProps=new Output.SpeechProperties();speechProps['relativePitch']=-0.3;}
options.annotation.push(token);var msg=node.role;var info=Output.ROLE_INFO_[node.role];if(info){if(this.formatOptions_.braille)
msg=Msgs.getMsg(info.msgId+'_brl');else
msg=Msgs.getMsg(info.msgId);}else{console.error('Missing role info for '+node.role);}
this.append_(buff,msg,options);}else if(token=='inputType'){if(!node.inputType)
return;options.annotation.push(token);var msgId=Output.INPUT_TYPE_MESSAGE_IDS_[node.inputType]||'input_type_text';if(this.formatOptions_.braille)
msgId=msgId+'_brl';this.append_(buff,Msgs.getMsg(msgId),options);}else if(token=='tableCellRowIndex'||token=='tableCellColumnIndex'){var value=node[token];if(value==undefined)
return;value=String(value+1);options.annotation.push(token);this.append_(buff,value,options);}else if(token=='node'){if(!tree.firstChild||!node[tree.firstChild.value])
return;var related=node[tree.firstChild.value];this.node_(related,related,Output.EventType.NAVIGATE,buff);}else if(token=='nameOrTextContent'){if(node.name){this.format_(node,'$name',buff);}else{var walker=new AutomationTreeWalker(node,Dir.FORWARD,{visit:AutomationPredicate.leafOrStaticText,leaf:AutomationPredicate.leafOrStaticText});while(walker.next().node&&walker.phase==AutomationTreeWalkerPhase.DESCENDANT){if(walker.node.name)
this.append_(buff,walker.node.name,options);}}}else if(node[token]!==undefined){options.annotation.push(token);var value=node[token];if(typeof value=='number')
value=String(value);this.append_(buff,value,options);}else if(Output.STATE_INFO_[token]){options.annotation.push('state');var stateInfo=Output.STATE_INFO_[token];var resolvedInfo={};if(node.state[token]===undefined)
resolvedInfo=stateInfo.omitted;else
resolvedInfo=node.state[token]?stateInfo.on:stateInfo.off;if(!resolvedInfo)
return;if(this.formatOptions_.speech&&resolvedInfo.earconId){options.annotation.push(new Output.EarconAction(resolvedInfo.earconId));}
var msgId=this.formatOptions_.braille?resolvedInfo.msgId+'_brl':resolvedInfo.msgId;var msg=Msgs.getMsg(msgId);this.append_(buff,msg,options);}else if(tree.firstChild){if(token=='if'){var cond=tree.firstChild;var attrib=cond.value.slice(1);if(node[attrib]||node.state[attrib])
this.format_(node,cond.nextSibling,buff);else
this.format_(node,cond.nextSibling.nextSibling,buff);}else if(token=='earcon'){if(!this.formatOptions_.speech)
return;options.annotation.push(new Output.EarconAction(tree.firstChild.value));this.append_(buff,'',options);}else if(token=='countChildren'){var role=tree.firstChild.value;var count=node.children.filter(function(e){return e.role==role;}).length;this.append_(buff,String(count));}}}else if(prefix=='@'){if(this.formatOptions_.auralStyle){speechProps=new Output.SpeechProperties();speechProps['relativePitch']=-0.2;}
var isPluralized=(token[0]=='@');if(isPluralized)
token=token.slice(1);var pieces=token.split('+');token=pieces.reduce(function(prev,cur){var lookup=cur;if(cur[0]=='$')
lookup=node[cur.slice(1)];return prev+lookup;}.bind(this),'');var msgId=token;var msgArgs=[];if(!isPluralized){var curArg=tree.firstChild;while(curArg){if(curArg.value[0]!='$'){console.error('Unexpected value: '+curArg.value);return;}
var msgBuff=[];this.format_(node,curArg,msgBuff);if(!msgBuff.length)
msgBuff=[''];msgArgs=msgArgs.concat(msgBuff);curArg=curArg.nextSibling;}}
var msg=Msgs.getMsg(msgId,msgArgs);try{if(this.formatOptions_.braille)
msg=Msgs.getMsg(msgId+'_brl',msgArgs)||msg;}catch(e){}
if(!msg){console.error('Could not get message '+msgId);return;}
if(isPluralized){var arg=tree.firstChild;if(!arg||arg.nextSibling){console.error('Pluralized messages take exactly one argument');return;}
if(arg.value[0]!='$'){console.error('Unexpected value: '+arg.value);return;}
var argBuff=[];this.format_(node,arg,argBuff);var namedArgs={COUNT:Number(argBuff[0])};msg=new goog.i18n.MessageFormat(msg).format(namedArgs);}
this.append_(buff,msg,options);}else if(prefix=='!'){speechProps=new Output.SpeechProperties();speechProps[token]=true;if(tree.firstChild){if(!this.formatOptions_.auralStyle){speechProps=undefined;return;}
var value=tree.firstChild.value;var float=0;if(float=parseFloat(value))
value=float;else
value=parseFloat(node[value])/-10.0;speechProps[token]=value;return;}}
if(speechProps){if(buff.length>0){buff[buff.length-1].setSpan(speechProps,0,0);speechProps=null;}}}.bind(this));},range_:function(range,prevRange,type,rangeBuff){if(!range.start.node||!range.end.node)
return;if(!prevRange&&range.start.node.root)
prevRange=cursors.Range.fromNode(range.start.node.root);var cursor=cursors.Cursor.fromNode(range.start.node);var prevNode=prevRange.start.node;var formatNodeAndAncestors=function(node,prevNode){var buff=[];if(this.outputContextFirst_)
this.ancestry_(node,prevNode,type,buff);this.node_(node,prevNode,type,buff);if(!this.outputContextFirst_)
this.ancestry_(node,prevNode,type,buff);if(node.location)
this.locations_.push(node.location);return buff;}.bind(this);while(cursor.node&&range.end.node&&AutomationUtil.getDirection(cursor.node,range.end.node)==Dir.FORWARD){var node=cursor.node;rangeBuff.push.apply(rangeBuff,formatNodeAndAncestors(node,prevNode));prevNode=node;cursor=cursor.move(cursors.Unit.NODE,cursors.Movement.DIRECTIONAL,Dir.FORWARD);if(cursor.node==prevNode)
break;}},ancestry_:function(node,prevNode,type,buff){function byContextFirst(ancestors){var contextFirst=[];var rest=[];for(i=0;i<ancestors.length-1;i++){var node=ancestors[i];if(node.role==RoleType.window){contextFirst=[];rest=[];}
if((Output.ROLE_INFO_[node.role]||{}).outputContextFirst)
contextFirst.push(node);else
rest.push(node);}
return rest.concat(contextFirst.reverse());}
var prevUniqueAncestors=byContextFirst(AutomationUtil.getUniqueAncestors(node,prevNode));var uniqueAncestors=byContextFirst(AutomationUtil.getUniqueAncestors(prevNode,node));var eventBlock=Output.RULES[type]||Output.RULES['navigate'];var getMergedRoleBlock=function(role){var parentRole=(Output.ROLE_INFO_[role]||{}).inherits;var roleBlock=eventBlock[role]||eventBlock['default'];var parentRoleBlock=parentRole?eventBlock[parentRole]:{};var mergedRoleBlock={};for(var key in parentRoleBlock)
mergedRoleBlock[key]=parentRoleBlock[key];for(var key in roleBlock)
mergedRoleBlock[key]=roleBlock[key];return mergedRoleBlock;};var enteredRoleSet={};for(var j=uniqueAncestors.length-1,hashNode;(hashNode=uniqueAncestors[j]);j--)
enteredRoleSet[hashNode.role]=true;for(var i=0,formatPrevNode;(formatPrevNode=prevUniqueAncestors[i]);i++){if(enteredRoleSet[formatPrevNode.role]||node.role==formatPrevNode.role||localStorage['useVerboseMode']=='false')
continue;var roleBlock=getMergedRoleBlock(formatPrevNode.role);if(roleBlock.leave&&localStorage['useVerboseMode']=='true')
this.format_(formatPrevNode,roleBlock.leave,buff,prevNode);}
var enterOutputs=[];var enterRole={};for(var j=uniqueAncestors.length-1,formatNode;(formatNode=uniqueAncestors[j]);j--){var roleBlock=getMergedRoleBlock(formatNode.role);if(roleBlock.enter){if(enterRole[formatNode.role])
continue;enterRole[formatNode.role]=true;this.format_(formatNode,roleBlock.enter,buff,prevNode);}}},node_:function(node,prevNode,type,buff){var eventBlock=Output.RULES[type]||Output.RULES['navigate'];var roleBlock=eventBlock[node.role]||{};var parentRole=(Output.ROLE_INFO_[node.role]||{}).inherits;var parentRoleBlock=eventBlock[parentRole||'']||{};var speakFormat=roleBlock.speak||parentRoleBlock.speak||eventBlock['default'].speak;this.format_(node,speakFormat,buff,prevNode);},subNode_:function(range,prevRange,type,buff){if(!prevRange)
prevRange=range;var dir=cursors.Range.getDirection(prevRange,range);var node=range.start.node;var prevNode=prevRange.getBound(dir).node;if(!node||!prevNode)
return;var options={annotation:['name'],isUnique:true};var startIndex=range.start.index;var endIndex=range.end.index;if(this.formatOptions_.braille){options.annotation.push(new Output.NodeSpan(node));var selStart=node.textSelStart;var selEnd=node.textSelEnd;if(selStart!==undefined&&(selEnd>=startIndex&&selStart<=endIndex)){options.annotation.push(new Output.SelectionSpan(selStart-startIndex,selEnd-startIndex,startIndex));}}
if(this.outputContextFirst_)
this.ancestry_(node,prevNode,type,buff);var earcon=this.findEarcon_(node,prevNode);if(earcon)
options.annotation.push(earcon);this.append_(buff,range.start.getText().substring(startIndex,endIndex),options);if(!this.outputContextFirst_)
this.ancestry_(node,prevNode,type,buff);var loc=range.start.node.boundsForRange(startIndex,endIndex);if(loc)
this.locations_.push(loc);},append_:function(buff,value,opt_options){opt_options=opt_options||{isUnique:false,annotation:[]};if((!value||value.length==0)&&opt_options.annotation.every(function(a){return!(a instanceof Output.Action)&&!(a instanceof Output.SelectionSpan);}))
return;var spannableToAdd=new Spannable(value);opt_options.annotation.forEach(function(a){spannableToAdd.setSpan(a,0,spannableToAdd.length);});if(opt_options.isUnique){var annotationSansNodes=opt_options.annotation.filter(function(annotation){return!(annotation instanceof Output.NodeSpan);});var alreadyAnnotated=buff.some(function(s){return annotationSansNodes.some(function(annotation){if(!s.hasSpan(annotation))
return false;var start=s.getSpanStart(annotation);var end=s.getSpanEnd(annotation);var substr=s.substring(start,end);if(substr&&value)
return substr.toString()==value.toString();else
return false;});});if(alreadyAnnotated)
return;}
buff.push(spannableToAdd);},createParseTree_:function(inputStr){var root={value:''};var currentNode=root;var index=0;var braceNesting=0;while(index<inputStr.length){if(inputStr[index]=='('){currentNode.firstChild={value:''};currentNode.firstChild.parent=currentNode;currentNode=currentNode.firstChild;}else if(inputStr[index]==')'){currentNode=currentNode.parent;}else if(inputStr[index]=='{'){braceNesting++;currentNode.value+=inputStr[index];}else if(inputStr[index]=='}'){braceNesting--;currentNode.value+=inputStr[index];}else if(inputStr[index]==','&&braceNesting===0){currentNode.nextSibling={value:''};currentNode.nextSibling.parent=currentNode.parent;currentNode=currentNode.nextSibling;}else{currentNode.value+=inputStr[index];}
index++;}
if(currentNode!=root)
throw'Unbalanced parenthesis: '+inputStr;return root;},createBrailleOutput_:function(){var result=new Spannable();var separator='';this.brailleBuffer_.forEach(function(cur){if(cur.length==0&&!cur.getSpanInstanceOf(Output.SelectionSpan))
return;var spansToExtend=[];var spansToRemove=[];result.getSpansInstanceOf(Output.NodeSpan).forEach(function(leftSpan){if(result.getSpanEnd(leftSpan)<result.length)
return;var newEnd=result.length;cur.getSpansInstanceOf(Output.NodeSpan).forEach(function(rightSpan){if(cur.getSpanStart(rightSpan)==0&&leftSpan.node===rightSpan.node){newEnd=Math.max(newEnd,result.length+separator.length+
cur.getSpanEnd(rightSpan));spansToRemove.push(rightSpan);}});if(newEnd>result.length)
spansToExtend.push({span:leftSpan,end:newEnd});});result.append(separator);result.append(cur);spansToExtend.forEach(function(elem){result.setSpan(elem.span,result.getSpanStart(elem.span),elem.end);});spansToRemove.forEach(result.removeSpan.bind(result));separator=Output.SPACE;});return result;},findEarcon_:function(node,opt_prevNode){if(node===opt_prevNode)
return null;if(this.formatOptions_.speech){var earconFinder=node;var ancestors;if(opt_prevNode)
ancestors=AutomationUtil.getUniqueAncestors(opt_prevNode,node);else
ancestors=AutomationUtil.getAncestors(node);while(earconFinder=ancestors.pop()){var info=Output.ROLE_INFO_[earconFinder.role];if(info&&info.earconId){return new Output.EarconAction(info.earconId);break;}
earconFinder=earconFinder.parent;}}
return null;},toString:function(){return this.speechBuffer_.reduce(function(prev,cur){if(prev===null)
return cur.toString();prev+=' '+cur.toString();return prev;},null);},get speechOutputForTest(){return this.speechBuffer_.reduce(function(prev,cur){if(prev===null)
return cur;prev.append('|');prev.append(cur);return prev;},null);},get brailleOutputForTest(){return this.createBrailleOutput_();}};});goog.provide('PanelMenuItem');PanelMenuItem=function(menuItemTitle,menuItemShortcut,callback){this.callback=callback;this.element=document.createElement('tr');this.element.className='menu-item';this.element.tabIndex=-1;this.element.setAttribute('role','menuitem');this.element.addEventListener('mouseover',(function(evt){this.element.focus();}).bind(this),false);var title=document.createElement('td');title.className='menu-item-title';title.textContent=menuItemTitle;this.element.appendChild(title);var shortcut=document.createElement('td');shortcut.className='menu-item-shortcut';shortcut.textContent=menuItemShortcut;this.element.appendChild(shortcut);};PanelMenuItem.prototype={get text(){return this.element.textContent;}};goog.provide('PanelMenu');goog.provide('PanelNodeMenu');goog.require('Output');goog.require('PanelMenuItem');goog.require('constants');goog.require('cursors.Range');PanelMenu=function(menuMsg){this.menuMsg=menuMsg;this.menuBarItemElement=document.createElement('div');this.menuBarItemElement.className='menu-bar-item';this.menuBarItemElement.setAttribute('role','menu');var menuTitle=Msgs.getMsg(menuMsg);this.menuBarItemElement.textContent=menuTitle;this.menuContainerElement=document.createElement('div');this.menuContainerElement.className='menu-container';this.menuContainerElement.style.visibility='hidden';this.menuElement=document.createElement('table');this.menuElement.className='menu';this.menuElement.setAttribute('role','menu');this.menuElement.setAttribute('aria-label',menuTitle);this.menuContainerElement.appendChild(this.menuElement);this.items_=[];this.updateScrollbarsTimeout_=null;this.activeIndex_=-1;this.menuElement.addEventListener('keypress',this.onKeyPress_.bind(this),true);};PanelMenu.prototype={addMenuItem:function(menuItemTitle,menuItemShortcut,callback){var menuItem=new PanelMenuItem(menuItemTitle,menuItemShortcut,callback);this.items_.push(menuItem);this.menuElement.appendChild(menuItem.element);menuItem.element.addEventListener('focus',(function(index,event){this.activeIndex_=index;}).bind(this,this.items_.length-1),false);if(!this.updateScrollbarsTimeout_){this.updateScrollbarsTimeout_=window.setTimeout((function(){var menuBounds=this.menuElement.getBoundingClientRect();var maxHeight=window.innerHeight-menuBounds.top;this.menuContainerElement.style.maxHeight=maxHeight+'px';this.updateScrollbarsTimeout_=null;}).bind(this),0);}
return menuItem;},activate:function(){this.menuContainerElement.style.visibility='visible';this.menuContainerElement.style.opacity=1;this.menuBarItemElement.classList.add('active');var barBounds=this.menuBarItemElement.parentElement.getBoundingClientRect();var titleBounds=this.menuBarItemElement.getBoundingClientRect();var menuBounds=this.menuElement.getBoundingClientRect();this.menuElement.style.minWidth=titleBounds.width+'px';this.menuContainerElement.style.minWidth=titleBounds.width+'px';if(titleBounds.left+menuBounds.width<barBounds.width){this.menuContainerElement.style.left=titleBounds.left+'px';}else{this.menuContainerElement.style.left=(titleBounds.right-menuBounds.width)+'px';}
this.activateItem(0);},deactivate:function(){this.menuContainerElement.style.opacity=0.001;this.menuBarItemElement.classList.remove('active');this.activeIndex_=-1;window.setTimeout((function(){this.menuContainerElement.style.visibility='hidden';}).bind(this),0);},activateItem:function(itemIndex){this.activeIndex_=itemIndex;if(this.activeIndex_>=0&&this.activeIndex_<this.items_.length)
this.items_[this.activeIndex_].element.focus();},advanceItemBy:function(delta){if(this.activeIndex_>=0){this.activeIndex_+=delta;this.activeIndex_=(this.activeIndex_+this.items_.length)%this.items_.length;}else{if(delta>=0)
this.activeIndex_=0;else
this.activeIndex_=this.menus_.length-1;}
this.items_[this.activeIndex_].element.focus();},scrollToTop:function(){this.activeIndex_=0;this.items_[this.activeIndex_].element.focus();},scrollToBottom:function(){this.activeIndex_=this.items_.length-1;this.items_[this.activeIndex_].element.focus();},getCallbackForCurrentItem:function(){if(this.activeIndex_>=0&&this.activeIndex_<this.items_.length){return this.items_[this.activeIndex_].callback;}
return null;},getCallbackForElement:function(element){for(var i=0;i<this.items_.length;i++){if(element==this.items_[i].element)
return this.items_[i].callback;}
return null;},onKeyPress_:function(evt){var query=String.fromCharCode(evt.charCode).toLowerCase();for(var i=this.activeIndex_+1;i<this.items_.length;i++){if(this.items_[i].text.toLowerCase().indexOf(query)==0){this.activateItem(i);break;}}}};PanelNodeMenu=function(menuMsg,node,pred){PanelMenu.call(this,menuMsg);var nodes=[];var selectNext=false;var activeIndex=-1;AutomationUtil.findNodePre(node.root,constants.Dir.FORWARD,(function(n){if(n===node)
selectNext=true;if(pred(n)){var output=new Output();var range=cursors.Range.fromNode(n);output.withSpeech(range,range,Output.EventType.NAVIGATE);var label=output.toString();this.addMenuItem(label,'',function(){chrome.extension.getBackgroundPage().ChromeVoxState.instance['navigateToRange'](cursors.Range.fromNode(n));});if(selectNext){activeIndex=this.items_.length-1;selectNext=false;}}}).bind(this));if(!this.items_.length){this.addMenuItem(Msgs.getMsg('panel_menu_item_none'),'',function(){});this.activateItem(0);}
if(activeIndex>=0)
this.activateItem(activeIndex);};PanelNodeMenu.prototype={__proto__:PanelMenu.prototype,activate:function(){var activeItem=this.activeIndex_;PanelMenu.prototype.activate.call(this);this.activateItem(activeItem);}};goog.provide('Msgs');Msgs=function(){};Msgs.NAMESPACE_='chromevox_';Msgs.localeNameDict_=null;Msgs.getLocale=function(){return chrome.i18n.getMessage('locale');};Msgs.getMsg=function(messageId,opt_subs){var message=Msgs.Untranslated[messageId.toUpperCase()];if(message!==undefined)
return Msgs.applySubstitutions_(message,opt_subs);message=chrome.i18n.getMessage(Msgs.NAMESPACE_+messageId,opt_subs);if(message==undefined||message==''){throw new Error('Invalid ChromeVox message id: '+messageId);}
return message;};Msgs.addTranslatedMessagesToDom=function(root){var elts=root.querySelectorAll('.i18n');for(var i=0;i<elts.length;i++){var msgid=elts[i].getAttribute('msgid');if(!msgid){throw new Error('Element has no msgid attribute: '+elts[i]);}
var val=this.getMsg(msgid);if(elts[i].tagName=='INPUT'){elts[i].setAttribute('placeholder',val);}else{elts[i].textContent=val;}
elts[i].classList.add('i18n-processed');}};Msgs.getNumber=function(num){return''+num;};Msgs.getLocaleDisplayName=function(locale){if(!Msgs.localeNameDict_){Msgs.localeNameDict_=(JSON.parse(this.getMsg('locale_dict')));}
var name=Msgs.localeNameDict_[locale];if(!name){throw Error('Unsupported locale identifier: '+locale);}
return name;};Msgs.applySubstitutions_=function(message,opt_subs){if(opt_subs){for(var i=0;i<opt_subs.length;i++){message=message.replace('$'+(i+1),opt_subs[i]);}}
return message;};Msgs.Untranslated={CHECKBOX_UNCHECKED_STATE_BRL:'( )',CHECKBOX_CHECKED_STATE_BRL:'(x)',RADIO_UNSELECTED_STATE_BRL:'( )',RADIO_SELECTED_STATE_BRL:'(x)',ARIA_HAS_SUBMENU_BRL:'->',ROLE_OPTION:' ',ROLE_OPTION_BRL:' ',ARIA_CHECKED_TRUE_BRL:'(x)',ARIA_CHECKED_FALSE_BRL:'( )',ARIA_CHECKED_MIXED_BRL:'(-)',ARIA_DISABLED_TRUE_BRL:'xx',ARIA_EXPANDED_TRUE_BRL:'-',ARIA_EXPANDED_FALSE_BRL:'+',ARIA_INVALID_TRUE_BRL:'!',ARIA_PRESSED_TRUE_BRL:'=',ARIA_PRESSED_FALSE_BRL:' ',ARIA_PRESSED_MIXED_BRL:'-',ARIA_SELECTED_TRUE_BRL:'(x)',ARIA_SELECTED_FALSE_BRL:'( )',HAS_SUBMENU_BRL:'->',TAG_TIME_BRL:' ',ARIA_VALUE_NOW:'$1',ARIA_VALUE_NOW_BRL:'$1',ARIA_VALUE_TEXT:'$1',ARIA_VALUE_TEXT_BRL:'$1',};goog.provide('PanelCommand');goog.provide('PanelCommandType');PanelCommand=function(type,opt_data){this.type=type;this.data=opt_data;};PanelCommand.prototype.send=function(){var views=chrome.extension.getViews();for(var i=0;i<views.length;i++){if(views[i].location.href.indexOf('background/panel.html')>0){views[i].postMessage(JSON.stringify(this),window.location.origin);}}};PanelCommandType={CLEAR_SPEECH:'clear_speech',ADD_NORMAL_SPEECH:'add_normal_speech',ADD_ANNOTATION_SPEECH:'add_annotation_speech',UPDATE_BRAILLE:'update_braille',OPEN_MENUS:'open_menus',ENABLE_MENUS:'enable_menus',DISABLE_MENUS:'disable_menus',SEARCH:'search',TUTORIAL:'tutorial',};goog.provide('ChromeVoxMode');goog.provide('ChromeVoxState');goog.require('cursors.Cursor');ChromeVoxMode={CLASSIC:'classic',CLASSIC_COMPAT:'classic_compat',NEXT:'next',NEXT_COMPAT:'next_compat',FORCE_NEXT:'force_next'};ChromeVoxState=function(){if(ChromeVoxState.instance)
throw'Trying to create two instances of singleton ChromeVoxState.';ChromeVoxState.instance=this;};ChromeVoxState.instance;ChromeVoxState.backgroundTts;ChromeVoxState.isReadingContinuously;ChromeVoxState.prototype={get mode(){return this.getMode();},getMode:function(){return ChromeVoxMode.NEXT;},get currentRange(){return this.getCurrentRange();},getCurrentRange:function(){return null;},setCurrentRange:goog.abstractMethod,};goog.provide('ISearch');goog.provide('ISearchHandler');goog.provide('ISearchUI');goog.require('AutomationUtil');goog.require('ChromeVoxState');goog.require('Output');goog.require('constants');goog.require('cursors.Cursor');goog.scope(function(){var AutomationNode=chrome.automation.AutomationNode;var Dir=constants.Dir;ISearchHandler=function(){};ISearchHandler.prototype={onSearchReachedBoundary:function(boundaryNode){},onSearchResultChanged:function(node){}};ISearch=function(initialNode){var leaf=AutomationUtil.findNodePre(initialNode,Dir.FORWARD,AutomationPredicate.leaf)||initialNode;this.node_=leaf;this.pendingSearchId_=0;cvox.ChromeVox=chrome.extension.getBackgroundPage()['cvox']['ChromeVox'];};ISearch.prototype={set handler(handler){this.handler_=handler;},search:function(searchStr,dir){searchStr=searchStr.toLocaleLowerCase();var currentSearchId=++this.pendingSearchId_;var move=function(curNode){var cur=cursors.Cursor.fromNode(curNode);var prev=cur;cur=cur.move(cursors.Unit.NODE,cursors.Movement.DIRECTIONAL,dir);if(prev.equals(cur)){this.handler_.onSearchReachedBoundary(this.node_);return;}
if(cur.getText().toLocaleLowerCase().indexOf(searchStr)!=-1){this.node_=cur.node;this.handler_.onSearchResultChanged(this.node_);return;}
if(this.pendingSearchId_==currentSearchId)
window.setTimeout(move.bind(this,cur.node),0);};window.setTimeout(move.bind(this,this.node_),0);}};ISearchUI=function(input){this.background_=chrome.extension.getBackgroundPage()['ChromeVoxState']['instance'];this.iSearch_=new ISearch(this.background_.currentRange.start.node);this.input_=input;this.dir_=Dir.FORWARD;this.iSearch_.handler=this;this.onKeyDown=this.onKeyDown.bind(this);this.onTextInput=this.onTextInput.bind(this);input.addEventListener('keydown',this.onKeyDown,true);input.addEventListener('textInput',this.onTextInput,true);};ISearchUI.get=function(input){if(ISearchUI.instance_)
ISearchUI.instance_.destroy();ISearchUI.instance_=new ISearchUI(input);input.focus();return ISearchUI.instance_;};ISearchUI.prototype={onKeyDown:function(evt){switch(evt.key){case'ArrowUp':this.dir_=Dir.BACKWARD;break;case'ArrowDown':this.dir_=Dir.FORWARD;break;case'Escape':this.pendingSearchId_=0;Panel.closeMenusAndRestoreFocus();return false;case'Enter':this.pendingSearchId_=0;Panel.closeMenusAndRestoreFocus();return false;default:this.pendingSearchId_=0;return false;}
this.iSearch_.search(this.input_.value,this.dir_);evt.preventDefault();evt.stopPropagation();return false;},onTextInput:function(evt){this.iSearch_.search(this.input_.value,this.dir_);return true;},onSearchReachedBoundary:function(boundaryNode){this.output_(boundaryNode);cvox.ChromeVox.earcons.playEarcon(cvox.Earcon.WRAP);},onSearchResultChanged:function(node){this.output_(node);},output_:function(node){Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);var o=new Output().withRichSpeechAndBraille(cursors.Range.fromNode(node),null,Output.EventType.NAVIGATE).go();this.background_.setCurrentRange(cursors.Range.fromNode(node));},destroy:function(){this.iSearch_.handler_=null;this.iSearch_=null;var input=this.input_;this.input_=null;input.removeEventListener('keydown',this.onKeyDown,true);input.removeEventListener('textInput',this.onTextInput,true);}};});goog.provide('cvox.PlatformFilter');goog.provide('cvox.PlatformUtil');goog.require('cvox.ChromeVox');cvox.PlatformFilter={NONE:0,WINDOWS:1,MAC:2,LINUX:4,WML:7,CHROMEOS:8,ANDROID:16};cvox.PlatformUtil.matchesPlatform=function(filter){var uA=navigator.userAgent;if(filter==undefined){return true;}else if(uA.indexOf('Android')!=-1){return(filter&cvox.PlatformFilter.ANDROID)!=0;}else if(uA.indexOf('Win')!=-1){return(filter&cvox.PlatformFilter.WINDOWS)!=0;}else if(uA.indexOf('Mac')!=-1){return(filter&cvox.PlatformFilter.MAC)!=0;}else if(uA.indexOf('Linux')!=-1){return(filter&cvox.PlatformFilter.LINUX)!=0;}else if(uA.indexOf('CrOS')!=-1){return(filter&cvox.PlatformFilter.CHROMEOS)!=0;}
return false;};goog.provide('cvox.KeySequence');goog.require('cvox.ChromeVox');goog.require('cvox.PlatformFilter');cvox.KeySequence=function(originalEvent,opt_cvoxModifier,opt_doubleTap,opt_skipStripping,opt_requireStickyMode){this.doubleTap=!!opt_doubleTap;this.requireStickyMode=!!opt_requireStickyMode;this.platformFilter;this.skipStripping=!!opt_skipStripping;if(opt_cvoxModifier==undefined){this.cvoxModifier=this.isCVoxModifierActive(originalEvent);}else{this.cvoxModifier=opt_cvoxModifier;}
this.stickyMode=!!originalEvent['stickyMode'];this.prefixKey=!!originalEvent['keyPrefix'];if(this.stickyMode&&this.prefixKey){throw'Prefix key and sticky mode cannot both be enabled: '+originalEvent;}
var event=this.resolveChromeOSSpecialKeys_(originalEvent);this.keys={ctrlKey:[],searchKeyHeld:[],altKey:[],altGraphKey:[],shiftKey:[],metaKey:[],keyCode:[]};this.extractKey_(event);};cvox.KeySequence.KEY_PRESS_CODE={39:222,44:188,45:189,46:190,47:191,59:186,91:219,92:220,93:221};cvox.KeySequence.doubleTapCache=[];cvox.KeySequence.prototype.addKeyEvent=function(additionalKeyEvent){if(this.keys.keyCode.length>1){return false;}
this.extractKey_(additionalKeyEvent);return true;};cvox.KeySequence.prototype.equals=function(rhs){if(!this.checkKeyEquality_(rhs)){return false;}
if(this.doubleTap!=rhs.doubleTap){return false;}
if(this.requireStickyMode||rhs.requireStickyMode){return(this.stickyMode||rhs.stickyMode)&&!this.cvoxModifier&&!rhs.cvoxModifier;}
if(this.cvoxModifier===rhs.cvoxModifier){return true;}
var unmodified=this.cvoxModifier?rhs:this;return unmodified.stickyMode||unmodified.prefixKey;};cvox.KeySequence.prototype.extractKey_=function(keyEvent){for(var prop in this.keys){if(prop=='keyCode'){var keyCode;if(keyEvent.type=='keypress'&&keyEvent[prop]>=97&&keyEvent[prop]<=122){keyCode=keyEvent[prop]-32;}else if(keyEvent.type=='keypress'){keyCode=cvox.KeySequence.KEY_PRESS_CODE[keyEvent[prop]];}
this.keys[prop].push(keyCode||keyEvent[prop]);}else{if(this.isKeyModifierActive(keyEvent,prop)){this.keys[prop].push(true);}else{this.keys[prop].push(false);}}}
if(this.cvoxModifier){this.rationalizeKeys_();}};cvox.KeySequence.prototype.rationalizeKeys_=function(){if(this.skipStripping){return;}
var modifierKeyCombo=cvox.ChromeVox.modKeyStr.split(/\+/g);var index=this.keys.keyCode.length-1;if(modifierKeyCombo.indexOf('Ctrl')!=-1){this.keys.ctrlKey[index]=false;}
if(modifierKeyCombo.indexOf('Alt')!=-1){this.keys.altKey[index]=false;}
if(modifierKeyCombo.indexOf('Shift')!=-1){this.keys.shiftKey[index]=false;}
var metaKeyName=this.getMetaKeyName_();if(modifierKeyCombo.indexOf(metaKeyName)!=-1){if(metaKeyName=='Search'){this.keys.searchKeyHeld[index]=false;this.keys.metaKey[index]=false;}else if(metaKeyName=='Cmd'||metaKeyName=='Win'){this.keys.metaKey[index]=false;}}};cvox.KeySequence.prototype.getMetaKeyName_=function(){if(cvox.ChromeVox.isChromeOS){return'Search';}else if(cvox.ChromeVox.isMac){return'Cmd';}else{return'Win';}};cvox.KeySequence.prototype.checkKeyEquality_=function(rhs){for(var i in this.keys){for(var j=this.keys[i].length;j--;){if(this.keys[i][j]!==rhs.keys[i][j])
return false;}}
return true;};cvox.KeySequence.prototype.getFirstKeyCode=function(){return this.keys.keyCode[0];};cvox.KeySequence.prototype.length=function(){return this.keys.keyCode.length;};cvox.KeySequence.prototype.isModifierKey=function(keyCode){return keyCode==16||keyCode==17||keyCode==18||keyCode==91||keyCode==93;};cvox.KeySequence.prototype.isCVoxModifierActive=function(keyEvent){var modifierKeyCombo=cvox.ChromeVox.modKeyStr.split(/\+/g);if(this.isKeyModifierActive(keyEvent,'ctrlKey')){modifierKeyCombo=modifierKeyCombo.filter(function(modifier){return modifier!='Ctrl';});}
if(this.isKeyModifierActive(keyEvent,'altKey')){modifierKeyCombo=modifierKeyCombo.filter(function(modifier){return modifier!='Alt';});}
if(this.isKeyModifierActive(keyEvent,'shiftKey')){modifierKeyCombo=modifierKeyCombo.filter(function(modifier){return modifier!='Shift';});}
if(this.isKeyModifierActive(keyEvent,'metaKey')||this.isKeyModifierActive(keyEvent,'searchKeyHeld')){var metaKeyName=this.getMetaKeyName_();modifierKeyCombo=modifierKeyCombo.filter(function(modifier){return modifier!=metaKeyName;});}
return(modifierKeyCombo.length==0);};cvox.KeySequence.prototype.isKeyModifierActive=function(keyEvent,modifier){switch(modifier){case'ctrlKey':return(keyEvent.ctrlKey||keyEvent.keyCode==17);break;case'altKey':return(keyEvent.altKey||(keyEvent.keyCode==18));break;case'shiftKey':return(keyEvent.shiftKey||(keyEvent.keyCode==16));break;case'metaKey':return(keyEvent.metaKey||(keyEvent.keyCode==91));break;case'searchKeyHeld':return((cvox.ChromeVox.isChromeOS&&keyEvent.keyCode==91)||keyEvent['searchKeyHeld']);break;}
return false;};cvox.KeySequence.prototype.isAnyModifierActive=function(){for(var modifierType in this.keys){for(var i=0;i<this.length();i++){if(this.keys[modifierType][i]&&modifierType!='keyCode'){return true;}}}
return false;};cvox.KeySequence.deserialize=function(sequenceObject){var firstSequenceEvent={};firstSequenceEvent['stickyMode']=(sequenceObject.stickyMode==undefined)?false:sequenceObject.stickyMode;firstSequenceEvent['prefixKey']=(sequenceObject.prefixKey==undefined)?false:sequenceObject.prefixKey;var secondKeyPressed=sequenceObject.keys.keyCode.length>1;var secondSequenceEvent={};for(var keyPressed in sequenceObject.keys){firstSequenceEvent[keyPressed]=sequenceObject.keys[keyPressed][0];if(secondKeyPressed){secondSequenceEvent[keyPressed]=sequenceObject.keys[keyPressed][1];}}
var skipStripping=sequenceObject.skipStripping!==undefined?sequenceObject.skipStripping:true;var keySeq=new cvox.KeySequence(firstSequenceEvent,sequenceObject.cvoxModifier,sequenceObject.doubleTap,skipStripping,sequenceObject.requireStickyMode);if(secondKeyPressed){cvox.ChromeVox.sequenceSwitchKeyCodes.push(new cvox.KeySequence(firstSequenceEvent,sequenceObject.cvoxModifier));keySeq.addKeyEvent(secondSequenceEvent);}
if(sequenceObject.doubleTap){cvox.KeySequence.doubleTapCache.push(keySeq);}
return keySeq;};cvox.KeySequence.fromStr=function(keyStr){var sequenceEvent={};var secondSequenceEvent={};var secondKeyPressed;if(keyStr.indexOf('>')==-1){secondKeyPressed=false;}else{secondKeyPressed=true;}
var cvoxPressed=false;sequenceEvent['stickyMode']=false;sequenceEvent['prefixKey']=false;var tokens=keyStr.split('+');for(var i=0;i<tokens.length;i++){var seqs=tokens[i].split('>');for(var j=0;j<seqs.length;j++){if(seqs[j].charAt(0)=='#'){var keyCode=parseInt(seqs[j].substr(1),10);if(j>0){secondSequenceEvent['keyCode']=keyCode;}else{sequenceEvent['keyCode']=keyCode;}}
var keyName=seqs[j];if(seqs[j].length==1){if(j>0){secondSequenceEvent['keyCode']=seqs[j].charCodeAt(0);}else{sequenceEvent['keyCode']=seqs[j].charCodeAt(0);}}else{if(j>0){cvox.KeySequence.setModifiersOnEvent_(keyName,secondSequenceEvent);if(keyName=='Cvox'){cvoxPressed=true;}}else{cvox.KeySequence.setModifiersOnEvent_(keyName,sequenceEvent);if(keyName=='Cvox'){cvoxPressed=true;}}}}}
var keySeq=new cvox.KeySequence(sequenceEvent,cvoxPressed);if(secondKeyPressed){keySeq.addKeyEvent(secondSequenceEvent);}
return keySeq;};cvox.KeySequence.setModifiersOnEvent_=function(keyName,seqEvent){if(keyName=='Ctrl'){seqEvent['ctrlKey']=true;seqEvent['keyCode']=17;}else if(keyName=='Alt'){seqEvent['altKey']=true;seqEvent['keyCode']=18;}else if(keyName=='Shift'){seqEvent['shiftKey']=true;seqEvent['keyCode']=16;}else if(keyName=='Search'){seqEvent['searchKeyHeld']=true;seqEvent['keyCode']=91;}else if(keyName=='Cmd'){seqEvent['metaKey']=true;seqEvent['keyCode']=91;}else if(keyName=='Win'){seqEvent['metaKey']=true;seqEvent['keyCode']=91;}else if(keyName=='Insert'){seqEvent['keyCode']=45;}};cvox.KeySequence.prototype.resolveChromeOSSpecialKeys_=function(originalEvent){if(!this.cvoxModifier||this.stickyMode||this.prefixKey||!cvox.ChromeVox.isChromeOS){return originalEvent;}
var evt={};for(var key in originalEvent){evt[key]=originalEvent[key];}
switch(evt['keyCode']){case 33:evt['keyCode']=38;break;case 34:evt['keyCode']=40;break;case 35:evt['keyCode']=39;break;case 36:evt['keyCode']=37;break;case 45:evt['keyCode']=190;break;case 46:evt['keyCode']=8;break;case 112:evt['keyCode']=49;break;case 113:evt['keyCode']=50;break;case 114:evt['keyCode']=51;break;case 115:evt['keyCode']=52;break;case 116:evt['keyCode']=53;break;case 117:evt['keyCode']=54;break;case 118:evt['keyCode']=55;break;case 119:evt['keyCode']=56;break;case 120:evt['keyCode']=57;break;case 121:evt['keyCode']=48;break;case 122:evt['keyCode']=189;break;case 123:evt['keyCode']=187;break;}
return evt;};goog.provide('cvox.KeyUtil');goog.provide('cvox.SimpleKeyEvent');goog.require('Msgs');goog.require('cvox.ChromeVox');goog.require('cvox.KeySequence');cvox.SimpleKeyEvent;cvox.KeyUtil=function(){};cvox.KeyUtil.modeKeyPressTime=0;cvox.KeyUtil.sequencing=false;cvox.KeyUtil.prevKeySequence=null;cvox.KeyUtil.stickyKeySequence=null;cvox.KeyUtil.maxSeqLength=2;cvox.KeyUtil.keyEventToKeySequence=function(keyEvent){var util=cvox.KeyUtil;if(util.prevKeySequence&&(util.maxSeqLength==util.prevKeySequence.length())){util.sequencing=false;util.prevKeySequence=null;}
var keyIsPrefixed=util.sequencing||keyEvent['keyPrefix']||keyEvent['stickyMode'];var keySequence=new cvox.KeySequence(keyEvent);var keyWasCvox=keySequence.cvoxModifier;if(keyIsPrefixed||keyWasCvox){if(!util.sequencing&&util.isSequenceSwitchKeyCode(keySequence)){util.sequencing=true;util.prevKeySequence=keySequence;return keySequence;}else if(util.sequencing){if(util.prevKeySequence.addKeyEvent(keyEvent)){keySequence=util.prevKeySequence;util.prevKeySequence=null;util.sequencing=false;return keySequence;}else{throw'Think sequencing is enabled, yet util.prevKeySequence already'+'has two key codes'+util.prevKeySequence;}}}else{util.sequencing=false;}
var currTime=new Date().getTime();if(cvox.KeyUtil.isDoubleTapKey(keySequence)&&util.prevKeySequence&&keySequence.equals(util.prevKeySequence)){var prevTime=util.modeKeyPressTime;var delta=currTime-prevTime;if(prevTime>0&&delta>100&&delta<300){keySequence=util.prevKeySequence;keySequence.doubleTap=true;util.prevKeySequence=null;util.sequencing=false;if(cvox.ChromeVox.isChromeOS&&keyEvent.keyCode==cvox.KeyUtil.getStickyKeyCode()){cvox.ChromeVox.searchKeyHeld=false;}
return keySequence;}}
util.prevKeySequence=keySequence;util.modeKeyPressTime=currTime;return keySequence;};cvox.KeyUtil.keyCodeToString=function(keyCode){if(keyCode==17){return'Ctrl';}
if(keyCode==18){return'Alt';}
if(keyCode==16){return'Shift';}
if((keyCode==91)||(keyCode==93)){if(cvox.ChromeVox.isChromeOS){return'Search';}else if(cvox.ChromeVox.isMac){return'Cmd';}else{return'Win';}}
if(keyCode==45){return'Insert';}
if(keyCode>=65&&keyCode<=90){return String.fromCharCode(keyCode);}else if(keyCode>=48&&keyCode<=57){return String.fromCharCode(keyCode);}else{return'#'+keyCode;}};cvox.KeyUtil.modStringToKeyCode=function(keyString){switch(keyString){case'Ctrl':return 17;case'Alt':return 18;case'Shift':return 16;case'Cmd':case'Win':return 91;}
return-1;};cvox.KeyUtil.cvoxModKeyCodes=function(){var modKeyCombo=cvox.ChromeVox.modKeyStr.split(/\+/g);var modKeyCodes=modKeyCombo.map(function(keyString){return cvox.KeyUtil.modStringToKeyCode(keyString);});return modKeyCodes;};cvox.KeyUtil.isSequenceSwitchKeyCode=function(rhKeySeq){for(var i=0;i<cvox.ChromeVox.sequenceSwitchKeyCodes.length;i++){var lhKeySeq=cvox.ChromeVox.sequenceSwitchKeyCodes[i];if(lhKeySeq.equals(rhKeySeq)){return true;}}
return false;};cvox.KeyUtil.getReadableNameForKeyCode=function(keyCode){var msg=Msgs.getMsg.bind(Msgs);var cros=cvox.ChromeVox.isChromeOS;if(keyCode==0){return'Power button';}else if(keyCode==17){return'Control';}else if(keyCode==18){return'Alt';}else if(keyCode==16){return'Shift';}else if(keyCode==9){return'Tab';}else if((keyCode==91)||(keyCode==93)){if(cros){return'Search';}else if(cvox.ChromeVox.isMac){return'Cmd';}else{return'Win';}}else if(keyCode==8){return'Backspace';}else if(keyCode==32){return'Space';}else if(keyCode==35){return'end';}else if(keyCode==36){return'home';}else if(keyCode==37){return'Left arrow';}else if(keyCode==38){return'Up arrow';}else if(keyCode==39){return'Right arrow';}else if(keyCode==40){return'Down arrow';}else if(keyCode==45){return'Insert';}else if(keyCode==13){return'Enter';}else if(keyCode==27){return'Escape';}else if(keyCode==112){return cros?msg('back_key'):'F1';}else if(keyCode==113){return cros?msg('forward_key'):'F2';}else if(keyCode==114){return cros?msg('refresh_key'):'F3';}else if(keyCode==115){return cros?msg('toggle_full_screen_key'):'F4';}else if(keyCode==116){return cros?msg('window_overview_key'):'F5';}else if(keyCode==117){return cros?msg('brightness_down_key'):'F6';}else if(keyCode==118){return cros?msg('brightness_up_key'):'F7';}else if(keyCode==119){return cros?msg('volume_mute_key'):'F8';}else if(keyCode==120){return cros?msg('volume_down_key'):'F9';}else if(keyCode==121){return cros?msg('volume_up_key'):'F10';}else if(keyCode==122){return'F11';}else if(keyCode==123){return'F12';}else if(keyCode==186){return'Semicolon';}else if(keyCode==187){return'Equal sign';}else if(keyCode==188){return'Comma';}else if(keyCode==189){return'Dash';}else if(keyCode==190){return'Period';}else if(keyCode==191){return'Forward slash';}else if(keyCode==192){return'Grave accent';}else if(keyCode==219){return'Open bracket';}else if(keyCode==220){return'Back slash';}else if(keyCode==221){return'Close bracket';}else if(keyCode==222){return'Single quote';}else if(keyCode==115){return'Toggle full screen';}else if(keyCode>=48&&keyCode<=90){return String.fromCharCode(keyCode);}
return'';};cvox.KeyUtil.getStickyKeyCode=function(){var stickyKeyCode=45;if(cvox.ChromeVox.isChromeOS||cvox.ChromeVox.isMac){stickyKeyCode=91;}
return stickyKeyCode;};cvox.KeyUtil.getReadableNameForStr=function(keyStr){return null;};cvox.KeyUtil.keySequenceToString=function(keySequence,opt_readableKeyCode,opt_modifiers){var str='';var numKeys=keySequence.length();for(var index=0;index<numKeys;index++){if(str!=''&&!opt_modifiers){str+='>';}else if(str!=''){str+='+';}
var tempStr='';for(var keyPressed in keySequence.keys){if(!keySequence.keys[keyPressed][index]){continue;}
var modifier='';switch(keyPressed){case'ctrlKey':modifier='Ctrl';break;case'searchKeyHeld':var searchKey=cvox.KeyUtil.getReadableNameForKeyCode(91);modifier=searchKey;break;case'altKey':modifier='Alt';break;case'altGraphKey':modifier='AltGraph';break;case'shiftKey':modifier='Shift';break;case'metaKey':var metaKey=cvox.KeyUtil.getReadableNameForKeyCode(91);modifier=metaKey;break;case'keyCode':var keyCode=keySequence.keys[keyPressed][index];if(!keySequence.isModifierKey(keyCode)&&!opt_modifiers){if(opt_readableKeyCode){tempStr+=cvox.KeyUtil.getReadableNameForKeyCode(keyCode);}else{tempStr+=cvox.KeyUtil.keyCodeToString(keyCode);}}}
if(str.indexOf(modifier)==-1){tempStr+=modifier+'+';}}
str+=tempStr;if(str[str.length-1]=='+'){str=str.slice(0,-1);}}
if(keySequence.cvoxModifier||keySequence.prefixKey){if(str!=''){str='ChromeVox+'+str;}else{str='Cvox';}}else if(keySequence.stickyMode){if(str[str.length-1]=='>'){str=str.slice(0,-1);}
str=str+'+'+str;}
return str;};cvox.KeyUtil.isDoubleTapKey=function(key){var isSet=false;var originalState=key.doubleTap;key.doubleTap=true;for(var i=0,keySeq;keySeq=cvox.KeySequence.doubleTapCache[i];i++){if(keySeq.equals(key)){isSet=true;break;}}
key.doubleTap=originalState;return isSet;};goog.provide('cvox.KeyMap');goog.require('cvox.KeyUtil');goog.require('cvox.PlatformUtil');cvox.KeyMap=function(commandsAndKeySequences){this.bindings_=commandsAndKeySequences;this.commandToKey_={};this.buildCommandToKey_();};cvox.KeyMap.KEYMAP_PATH='chromevox/background/keymaps/';cvox.KeyMap.AVAILABLE_MAP_INFO={'keymap_classic':{'file':'classic_keymap.json'},'keymap_flat':{'file':'flat_keymap.json'},'keymap_next':{'file':'next_keymap.json'},'keymap_experimental':{'file':'experimental.json'}};cvox.KeyMap.DEFAULT_KEYMAP=0;cvox.KeyMap.prototype.length=function(){return this.bindings_.length;};cvox.KeyMap.prototype.keys=function(){return this.bindings_.map(function(binding){return binding.sequence;});};cvox.KeyMap.prototype.bindings=function(){return this.bindings_;};cvox.KeyMap.prototype.toJSON=function(){return JSON.stringify({bindings:this.bindings_});};cvox.KeyMap.prototype.toLocalStorage=function(){localStorage['keyBindings']=this.toJSON();};cvox.KeyMap.prototype.hasBinding=function(command,sequence){if(this.commandToKey_!=null){return this.commandToKey_[command]==sequence;}else{for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.command==command&&binding.sequence==sequence){return true;}}}
return false;};cvox.KeyMap.prototype.hasCommand=function(command){if(this.commandToKey_!=null){return this.commandToKey_[command]!=undefined;}else{for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.command==command){return true;}}}
return false;};cvox.KeyMap.prototype.hasKey=function(key){for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.sequence.equals(key)){return true;}}
return false;};cvox.KeyMap.prototype.commandForKey=function(key){if(key!=null){for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.sequence.equals(key)){return binding.command;}}}
return null;};cvox.KeyMap.prototype.keyForCommand=function(command){if(this.commandToKey_!=null){return[this.commandToKey_[command]];}else{var keySequenceArray=[];for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.command==command){keySequenceArray.push(binding.sequence);}}}
return(keySequenceArray.length>0)?keySequenceArray:[];};cvox.KeyMap.prototype.merge=function(inputMap){var keys=inputMap.keys();var cleanMerge=true;for(var i=0;i<keys.length;++i){var key=keys[i];var command=inputMap.commandForKey(key);if(command=='toggleStickyMode'){continue;}else if(key&&command&&!this.hasKey(key)&&!this.hasCommand(command)){this.bind_(command,key);}else{cleanMerge=false;}}
return cleanMerge;};cvox.KeyMap.prototype.rebind=function(command,newKey){if(this.hasCommand(command)&&!this.hasKey(newKey)){this.bind_(command,newKey);return true;}
return false;};cvox.KeyMap.prototype.bind_=function(command,newKey){var bound=false;for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(binding.command==command){delete binding.sequence;binding.sequence=newKey;if(this.commandToKey_!=null){this.commandToKey_[binding.command]=newKey;}
bound=true;}}
if(!bound){var binding={'command':command,'sequence':newKey};this.bindings_.push(binding);this.commandToKey_[binding.command]=binding.sequence;}};cvox.KeyMap.fromDefaults=function(){return(cvox.KeyMap.fromPath(cvox.KeyMap.KEYMAP_PATH+
cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_classic'].file));};cvox.KeyMap.fromNext=function(){return cvox.KeyMap.fromPath(cvox.KeyMap.KEYMAP_PATH+
cvox.KeyMap.AVAILABLE_MAP_INFO['keymap_next'].file);};cvox.KeyMap.fromJSON=function(json){try{var commandsAndKeySequences=(JSON.parse(json).bindings);commandsAndKeySequences=commandsAndKeySequences.filter(function(value){return value.sequence.platformFilter===undefined||cvox.PlatformUtil.matchesPlatform(value.sequence.platformFilter);});}catch(e){console.error('Failed to load key map from JSON');console.error(e);return null;}
if(typeof(commandsAndKeySequences)!='object'){return null;}
for(var i=0;i<commandsAndKeySequences.length;i++){if(commandsAndKeySequences[i].command==undefined||commandsAndKeySequences[i].sequence==undefined){return null;}else{commandsAndKeySequences[i].sequence=(cvox.KeySequence.deserialize(commandsAndKeySequences[i].sequence));}}
return new cvox.KeyMap(commandsAndKeySequences);};cvox.KeyMap.fromLocalStorage=function(){if(localStorage['keyBindings']){return cvox.KeyMap.fromJSON(localStorage['keyBindings']);}
return null;};cvox.KeyMap.fromPath=function(path){return cvox.KeyMap.fromJSON(cvox.KeyMap.readJSON_(path));};cvox.KeyMap.fromCurrentKeyMap=function(){var map=localStorage['currentKeyMap'];if(map&&cvox.KeyMap.AVAILABLE_MAP_INFO[map]){return(cvox.KeyMap.fromPath(cvox.KeyMap.KEYMAP_PATH+cvox.KeyMap.AVAILABLE_MAP_INFO[map].file));}else{return cvox.KeyMap.fromDefaults();}};cvox.KeyMap.readJSON_=function(path){var url=chrome.extension.getURL(path);if(!url){throw'Invalid path: '+path;}
var xhr=new XMLHttpRequest();xhr.open('GET',url,false);xhr.send();return xhr.responseText;};cvox.KeyMap.prototype.resetModifier=function(){localStorage['cvoxKey']=cvox.ChromeVox.modKeyStr;};cvox.KeyMap.prototype.buildCommandToKey_=function(){for(var i=0;i<this.bindings_.length;i++){var binding=this.bindings_[i];if(this.commandToKey_[binding.command]!=undefined){continue;}
this.commandToKey_[binding.command]=binding.sequence;}};goog.provide('cvox.ChromeVoxKbHandler');goog.require('cvox.ChromeVox');goog.require('cvox.KeyMap');goog.require('cvox.KeySequence');goog.require('cvox.KeyUtil');cvox.ChromeVoxKbHandler={};cvox.ChromeVoxKbHandler.handlerKeyMap;cvox.ChromeVoxKbHandler.commandHandler;cvox.ChromeVoxKbHandler.loadKeyToFunctionsTable=function(keyToFunctionsTable){if(!window.JSON){return;}
cvox.ChromeVoxKbHandler.handlerKeyMap=cvox.KeyMap.fromJSON(keyToFunctionsTable);};cvox.ChromeVoxKbHandler.sortKeyToFunctionsTable_=function(keyToFunctionsTable){var sortingArray=[];for(var keySeqStr in keyToFunctionsTable){sortingArray.push([keySeqStr,keyToFunctionsTable[keySeqStr]]);}
function compareKeyStr(a,b){if(a[0].length<b[0].length){return-1;}else if(b[0].length<a[0].length){return 1;}else{return a[0].localeCompare(b[0]);}};sortingArray.sort(compareKeyStr);return sortingArray;};cvox.ChromeVoxKbHandler.basicKeyDownActionsListener=function(evt){var keySequence=cvox.KeyUtil.keyEventToKeySequence(evt);var functionName;if(cvox.ChromeVoxKbHandler.handlerKeyMap!=undefined){functionName=cvox.ChromeVoxKbHandler.handlerKeyMap.commandForKey(keySequence);}else{functionName=null;}
if(!functionName){return!cvox.KeyUtil.sequencing;}
if(!cvox.ChromeVox.isActive&&functionName!='toggleChromeVox'){return true;}
var returnValue=true;var commandResult=cvox.ChromeVoxKbHandler.commandHandler(functionName);if(commandResult!==undefined){returnValue=commandResult;}else if(keySequence.cvoxModifier){returnValue=false;}
if(cvox.ChromeVox.entireDocumentIsHidden){returnValue=true;}
return returnValue;};goog.provide('cvox.CommandStore');goog.require('cvox.PlatformFilter');cvox.CommandStore.categories=function(){var categorySet={};for(var cmd in cvox.CommandStore.CMD_WHITELIST){var struct=cvox.CommandStore.CMD_WHITELIST[cmd];if(struct.category){categorySet[struct.category]=true;}}
var ret=[];for(var category in categorySet){ret.push(category);}
return ret;};cvox.CommandStore.messageForCommand=function(command){return(cvox.CommandStore.CMD_WHITELIST[command]||{}).msgId;};cvox.CommandStore.categoryForCommand=function(command){return(cvox.CommandStore.CMD_WHITELIST[command]||{}).category;};cvox.CommandStore.commandsForCategory=function(category){var ret=[];for(var cmd in cvox.CommandStore.CMD_WHITELIST){var struct=cvox.CommandStore.CMD_WHITELIST[cmd];if(category==struct.category){ret.push(cmd);}}
return ret;};cvox.CommandStore.CMD_WHITELIST={'toggleStickyMode':{announce:false,msgId:'toggle_sticky_mode','disallowOOBE':true,category:'modifier_keys'},'toggleKeyPrefix':{announce:false,skipInput:true,msgId:'prefix_key','disallowOOBE':true,category:'modifier_keys'},'passThroughMode':{announce:false,msgId:'pass_through_key_description',category:'modifier_keys'},'stopSpeech':{announce:false,disallowContinuation:true,doDefault:true,msgId:'stop_speech_key',category:'controlling_speech'},'toggleChromeVox':{announce:false,platformFilter:cvox.PlatformFilter.WML,msgId:'toggle_chromevox_active',category:'modifier_keys'},'toggleChromeVoxVersion':{announce:false},'showNextUpdatePage':{msgId:'show_next_update_description',announce:false,'category':'help_commands'},'openChromeVoxMenus':{announce:false,msgId:'menus_title'},'decreaseTtsRate':{announce:false,msgId:'decrease_tts_rate',category:'controlling_speech'},'increaseTtsRate':{announce:false,msgId:'increase_tts_rate',category:'controlling_speech'},'decreaseTtsPitch':{announce:false,msgId:'decrease_tts_pitch',category:'controlling_speech'},'increaseTtsPitch':{announce:false,msgId:'increase_tts_pitch',category:'controlling_speech'},'decreaseTtsVolume':{announce:false,msgId:'decrease_tts_volume',category:'controlling_speech'},'increaseTtsVolume':{announce:false,msgId:'increase_tts_volume',category:'controlling_speech'},'cyclePunctuationEcho':{announce:false,msgId:'cycle_punctuation_echo',category:'controlling_speech'},'cycleTypingEcho':{announce:false,msgId:'cycle_typing_echo',category:'controlling_speech'},'toggleEarcons':{announce:true,msgId:'toggle_earcons',category:'controlling_speech'},'handleTab':{allowEvents:true,msgId:'handle_tab_next',disallowContinuation:true,category:'navigation'},'handleTabPrev':{allowEvents:true,msgId:'handle_tab_prev',disallowContinuation:true,category:'navigation'},'forward':{forward:true,announce:true,msgId:'forward',category:'navigation'},'backward':{backward:true,announce:true,msgId:'backward',category:'navigation'},'right':{forward:true,announce:true,msgId:'right',category:'navigation'},'left':{backward:true,announce:true,msgId:'left',category:'navigation'},'previousGranularity':{announce:true,msgId:'previous_granularity',category:'navigation'},'nextGranularity':{announce:true,msgId:'next_granularity',category:'navigation'},'previousCharacter':{backward:true,announce:true,msgId:'previous_character',skipInput:true,category:'navigation'},'nextCharacter':{forward:true,announce:true,msgId:'next_character',skipInput:true,category:'navigation'},'previousWord':{backward:true,announce:true,msgId:'previous_word',skipInput:true,category:'navigation'},'nextWord':{forward:true,announce:true,msgId:'next_word',skipInput:true,category:'navigation'},'previousLine':{backward:true,announce:true,msgId:'previous_line',category:'navigation'},'nextLine':{forward:true,announce:true,msgId:'next_line',category:'navigation'},'previousSentence':{backward:true,announce:true,msgId:'previous_sentence',skipInput:true,category:'navigation'},'nextSentence':{forward:true,announce:true,msgId:'next_sentence',skipInput:true,category:'navigation'},'previousObject':{backward:true,announce:true,msgId:'previous_object',skipInput:true,category:'navigation'},'nextObject':{forward:true,announce:true,msgId:'next_object',skipInput:true,category:'navigation'},'previousGroup':{backward:true,announce:true,msgId:'previous_group',skipInput:true,category:'navigation'},'nextGroup':{forward:true,announce:true,msgId:'next_group',skipInput:true,category:'navigation'},'jumpToTop':{forward:true,announce:true,msgId:'jump_to_top',category:'navigation'},'jumpToBottom':{backward:true,announce:true,msgId:'jump_to_bottom',category:'navigation'},'moveToStartOfLine':{forward:true,announce:true},'moveToEndOfLine':{backward:true,announce:true},'readFromHere':{forward:true,announce:false,msgId:'read_from_here',category:'navigation'},'performDefaultAction':{disallowContinuation:true,msgId:'perform_default_action',doDefault:true,skipInput:true,category:'navigation'},'forceClickOnCurrentItem':{announce:true,disallowContinuation:true,allowEvents:true,msgId:'force_click_on_current_item',category:'navigation'},'forceDoubleClickOnCurrentItem':{announce:true,allowEvents:true,disallowContinuation:true},'readLinkURL':{announce:false,msgId:'read_link_url',category:'information'},'readCurrentTitle':{announce:false,msgId:'read_current_title',category:'information'},'readCurrentURL':{announce:false,msgId:'read_current_url',category:'information'},'fullyDescribe':{announce:false,msgId:'fully_describe',category:'information'},'speakTimeAndDate':{announce:false,msgId:'speak_time_and_date',category:'information'},'toggleSelection':{announce:true,msgId:'toggle_selection',category:'information'},'toggleSearchWidget':{announce:false,disallowContinuation:true,msgId:'toggle_search_widget',category:'information'},'toggleKeyboardHelp':{announce:false,disallowContinuation:true,msgId:'show_power_key',category:'help_commands'},'help':{announce:false,msgId:'help','disallowOOBE':true,disallowContinuation:true,category:'help_commands'},'contextMenu':{announce:false,msgId:'show_context_menu',disallowContinuation:true},'showOptionsPage':{announce:false,disallowContinuation:true,msgId:'show_options_page','disallowOOBE':true,category:'help_commands'},'showKbExplorerPage':{announce:false,disallowContinuation:true,msgId:'show_kb_explorer_page','disallowOOBE':true,category:'help_commands'},'toggleBrailleCaptions':{announce:false,msgId:'braille_captions',category:'help_commands'},'showFormsList':{announce:false,disallowContinuation:true,nodeList:'formField',msgId:'show_forms_list',category:'overview'},'showHeadingsList':{announce:false,nodeList:'heading',disallowContinuation:true,msgId:'show_headings_list',category:'overview'},'showLandmarksList':{announce:false,nodeList:'landmark',disallowContinuation:true,msgId:'show_landmarks_list',category:'overview'},'showLinksList':{announce:false,nodeList:'link',disallowContinuation:true,msgId:'show_links_list',category:'overview'},'showTablesList':{announce:false,nodeList:'table',disallowContinuation:true,msgId:'show_tables_list',category:'overview'},'nextArticle':{forward:true,findNext:'article'},'nextButton':{forward:true,findNext:'button',msgId:'next_button',category:'jump_commands'},'nextCheckbox':{forward:true,findNext:'checkbox',msgId:'next_checkbox',category:'jump_commands'},'nextComboBox':{forward:true,findNext:'combobox',msgId:'next_combo_box',category:'jump_commands'},'nextControl':{forward:true,findNext:'control'},'nextEditText':{forward:true,findNext:'editText',msgId:'next_edit_text',category:'jump_commands'},'nextFormField':{forward:true,findNext:'formField',msgId:'next_form_field',category:'jump_commands'},'nextGraphic':{forward:true,findNext:'graphic',msgId:'next_graphic',category:'jump_commands'},'nextHeading':{forward:true,findNext:'heading',msgId:'next_heading',category:'jump_commands'},'nextHeading1':{forward:true,findNext:'heading1',msgId:'next_heading1',category:'jump_commands'},'nextHeading2':{forward:true,findNext:'heading2',msgId:'next_heading2',category:'jump_commands'},'nextHeading3':{forward:true,findNext:'heading3',msgId:'next_heading3',category:'jump_commands'},'nextHeading4':{forward:true,findNext:'heading4',msgId:'next_heading4',category:'jump_commands'},'nextHeading5':{forward:true,findNext:'heading5',msgId:'next_heading5',category:'jump_commands'},'nextHeading6':{forward:true,findNext:'heading6',msgId:'next_heading6',category:'jump_commands'},'nextLandmark':{forward:true,findNext:'landmark',msgId:'next_landmark',category:'jump_commands'},'nextLink':{forward:true,findNext:'link',msgId:'next_link',category:'jump_commands'},'nextList':{forward:true,findNext:'list',msgId:'next_list',category:'jump_commands'},'nextListItem':{forward:true,findNext:'listItem',msgId:'next_list_item',category:'jump_commands'},'nextMath':{forward:true,findNext:'math',msgId:'next_math',category:'jump_commands'},'nextMedia':{forward:true,findNext:'media',msgId:'next_media',category:'jump_commands'},'nextRadio':{forward:true,findNext:'radio',msgId:'next_radio',category:'jump_commands'},'nextSection':{forward:true,findNext:'section'},'nextSlider':{forward:true,findNext:'slider'},'nextTable':{forward:true,findNext:'table',msgId:'next_table',category:'jump_commands'},'nextVisitedLink':{forward:true,findNext:'visitedLink',msgId:'next_visited_link',category:'jump_commands'},'previousArticle':{backward:true,findNext:'article'},'previousButton':{backward:true,findNext:'button',msgId:'previous_button',category:'jump_commands'},'previousCheckbox':{backward:true,findNext:'checkbox',msgId:'previous_checkbox',category:'jump_commands'},'previousComboBox':{backward:true,findNext:'combobox',msgId:'previous_combo_box',category:'jump_commands'},'previousControl':{backward:true,findNext:'control'},'previousEditText':{backward:true,findNext:'editText',msgId:'previous_edit_text',category:'jump_commands'},'previousFormField':{backward:true,findNext:'formField',msgId:'previous_form_field',category:'jump_commands'},'previousGraphic':{backward:true,findNext:'graphic',msgId:'previous_graphic',category:'jump_commands'},'previousHeading':{backward:true,findNext:'heading',msgId:'previous_heading',category:'jump_commands'},'previousHeading1':{backward:true,findNext:'heading1',msgId:'previous_heading1',category:'jump_commands'},'previousHeading2':{backward:true,findNext:'heading2',msgId:'previous_heading2',category:'jump_commands'},'previousHeading3':{backward:true,findNext:'heading3',msgId:'previous_heading3',category:'jump_commands'},'previousHeading4':{backward:true,findNext:'heading4',msgId:'previous_heading4',category:'jump_commands'},'previousHeading5':{backward:true,findNext:'heading5',msgId:'previous_heading5',category:'jump_commands'},'previousHeading6':{backward:true,findNext:'heading6',msgId:'previous_heading6',category:'jump_commands'},'previousLandmark':{backward:true,findNext:'landmark',msgId:'previous_landmark',category:'jump_commands'},'previousLink':{backward:true,findNext:'link',msgId:'previous_link',category:'jump_commands'},'previousList':{backward:true,findNext:'list',msgId:'previous_list',category:'jump_commands'},'previousListItem':{backward:true,findNext:'listItem',msgId:'previous_list_item',category:'jump_commands'},'previousMath':{backward:true,findNext:'math',msgId:'previous_math',category:'jump_commands'},'previousMedia':{backward:true,findNext:'media',msgId:'previous_media',category:'jump_commands'},'previousRadio':{backward:true,findNext:'radio',msgId:'previous_radio',category:'jump_commands'},'previousSection':{backward:true,findNext:'section'},'previousSlider':{backward:true,findNext:'slider'},'previousTable':{backward:true,findNext:'table',msgId:'previous_table',category:'jump_commands'},'previousVisitedLink':{backward:true,findNext:'visitedLink',msgId:'previous_visited_link',category:'jump_commands'},'announceHeaders':{announce:false,msgId:'announce_headers',category:'tables'},'speakTableLocation':{announce:false,msgId:'speak_table_location',category:'tables'},'goToFirstCell':{announce:true,msgId:'skip_to_beginning',category:'tables'},'goToLastCell':{announce:true,msgId:'skip_to_end',category:'tables'},'goToRowFirstCell':{announce:true,msgId:'skip_to_row_beginning',category:'tables'},'goToRowLastCell':{announce:true,msgId:'skip_to_row_end',category:'tables'},'goToColFirstCell':{announce:true,msgId:'skip_to_col_beginning',category:'tables'},'goToColLastCell':{announce:true,msgId:'skip_to_col_end',category:'tables'},'previousRow':{backward:true,announce:true,skipInput:true},'previousCol':{backward:true,announce:true,skipInput:true},'nextRow':{forward:true,announce:true,skipInput:true},'nextCol':{forward:true,announce:true,skipInput:true},'enterShifter':{announce:true,msgId:'enter_content',category:'navigation'},'exitShifter':{announce:true,msgId:'exit_content',category:'navigation'},'exitShifterContent':{announce:true},'openLongDesc':{announce:false,msgId:'open_long_desc',category:'information'},'pauseAllMedia':{announce:false,msgId:'pause_all_media',category:'information'},'toggleSemantics':{announce:false,msgId:'toggle_semantics',category:'information'},'routing':{announce:false,allowEvents:true,msgId:'braille_routing',category:'braille'},'pan_left':{backward:true,announce:true,msgId:'braille_pan_left',category:'braille'},'pan_right':{forward:true,announce:true,msgId:'braille_pan_right',category:'braille'},'line_up':{backward:true,announce:true,msgId:'braille_line_up',category:'braille'},'line_down':{forward:true,announce:true,msgId:'braille_line_down',category:'braille'},'top':{forward:true,announce:true,msgId:'braille_top',category:'braille'},'bottom':{backward:true,announce:true,msgId:'braille_bottom',category:'braille'},'enableConsoleTts':{announce:false,msgId:'enable_tts_log',category:'developer'},'startHistoryRecording':{announce:false},'stopHistoryRecording':{announce:false},'autorunner':{announce:false},'debug':{announce:false},'nop':{announce:false}};cvox.CommandStore.NODE_INFO_MAP={'checkbox':{predicate:'checkboxPredicate',forwardError:'no_next_checkbox',backwardError:'no_previous_checkbox',typeMsg:'role_checkbox'},'radio':{predicate:'radioPredicate',forwardError:'no_next_radio_button',backwardError:'no_previous_radio_button',typeMsg:'role_radio'},'slider':{predicate:'sliderPredicate',forwardError:'no_next_slider',backwardError:'no_previous_slider',typeMsg:'role_slider'},'graphic':{predicate:'graphicPredicate',forwardError:'no_next_graphic',backwardError:'no_previous_graphic',typeMsg:'UNUSED'},'article':{predicate:'articlePredicate',forwardError:'no_next_ARTICLE',backwardError:'no_previous_ARTICLE',typeMsg:'TAG_ARTICLE'},'button':{predicate:'buttonPredicate',forwardError:'no_next_button',backwardError:'no_previous_button',typeMsg:'role_button'},'combobox':{predicate:'comboBoxPredicate',forwardError:'no_next_combo_box',backwardError:'no_previous_combo_box',typeMsg:'role_combobox'},'editText':{predicate:'editTextPredicate',forwardError:'no_next_edit_text',backwardError:'no_previous_edit_text',typeMsg:'input_type_text'},'heading':{predicate:'headingPredicate',forwardError:'no_next_heading',backwardError:'no_previous_heading',typeMsg:'role_heading'},'heading1':{predicate:'heading1Predicate',forwardError:'no_next_heading_1',backwardError:'no_previous_heading_1'},'heading2':{predicate:'heading2Predicate',forwardError:'no_next_heading_2',backwardError:'no_previous_heading_2'},'heading3':{predicate:'heading3Predicate',forwardError:'no_next_heading_3',backwardError:'no_previous_heading_3'},'heading4':{predicate:'heading4Predicate',forwardError:'no_next_heading_4',backwardError:'no_previous_heading_4'},'heading5':{predicate:'heading5Predicate',forwardError:'no_next_heading_5',backwardError:'no_previous_heading_5'},'heading6':{predicate:'heading6Predicate',forwardError:'no_next_heading_6',backwardError:'no_previous_heading_6'},'link':{predicate:'linkPredicate',forwardError:'no_next_link',backwardError:'no_previous_link',typeMsg:'role_link'},'table':{predicate:'tablePredicate',forwardError:'no_next_table',backwardError:'no_previous_table',typeMsg:'table_strategy'},'visitedLink':{predicate:'visitedLinkPredicate',forwardError:'no_next_visited_link',backwardError:'no_previous_visited_link',typeMsg:'role_link'},'list':{predicate:'listPredicate',forwardError:'no_next_list',backwardError:'no_previous_list',typeMsg:'role_list'},'listItem':{predicate:'listItemPredicate',forwardError:'no_next_list_item',backwardError:'no_previous_list_item',typeMsg:'role_listitem'},'formField':{predicate:'formFieldPredicate',forwardError:'no_next_form_field',backwardError:'no_previous_form_field',typeMsg:'role_form'},'landmark':{predicate:'landmarkPredicate',forwardError:'no_next_landmark',backwardError:'no_previous_landmark',typeMsg:'role_landmark'},'math':{predicate:'mathPredicate',forwardError:'no_next_math',backwardError:'no_previous_math',typeMsg:'math_expr'},'media':{predicate:'mediaPredicate',forwardError:'no_next_media_widget',backwardError:'no_previous_media_widget'},'section':{predicate:'sectionPredicate',forwardError:'no_next_section',backwardError:'no_previous_section'},'control':{predicate:'controlPredicate',forwardError:'no_next_control',backwardError:'no_previous_control'}};goog.provide('Tutorial');goog.require('Msgs');Tutorial=function(){this.page_=0;};Tutorial.PAGES=[[{msgid:'tutorial_welcome_heading',heading:true},{msgid:'tutorial_welcome_text'},{msgid:'tutorial_enter_to_advance',repeat:true},],[{msgid:'tutorial_on_off_heading',heading:true},{msgid:'tutorial_control'},{msgid:'tutorial_on_off'},{msgid:'tutorial_enter_to_advance',repeat:true},],[{msgid:'tutorial_modifier_heading',heading:true},{msgid:'tutorial_modifier'},{msgid:'tutorial_chromebook_search',chromebookOnly:true},{msgid:'tutorial_any_key'},{msgid:'tutorial_enter_to_advance',repeat:true},],[{msgid:'tutorial_basic_navigation_heading',heading:true},{msgid:'tutorial_basic_navigation'},{msgid:'tutorial_click_next'},],[{msgid:'tutorial_jump_heading',heading:true},{msgid:'tutorial_jump'},{msgid:'tutorial_click_next'},],[{msgid:'tutorial_menus_heading',heading:true},{msgid:'tutorial_menus'},{msgid:'tutorial_click_next'},],[{msgid:'tutorial_chrome_shortcuts_heading',heading:true},{msgid:'tutorial_chrome_shortcuts'},{msgid:'tutorial_chromebook_ctrl_forward',chromebookOnly:true},{msgid:'tutorial_chromeos_ctrl_f2',chromebookOnly:false},],[{msgid:'tutorial_learn_more_heading',heading:true},{msgid:'tutorial_learn_more'},{msgid:'next_command_reference',link:'http://www.chromevox.com/next_keyboard_shortcuts.html'},{msgid:'chrome_keyboard_shortcuts',link:'https://support.google.com/chromebook/answer/183101?hl=en'},{msgid:'touchscreen_accessibility',link:'https://support.google.com/chromebook/answer/6103702?hl=en'},],];Tutorial.prototype={firstPage:function(){this.page_=0;this.showPage_();},nextPage:function(){if(this.page_<Tutorial.PAGES.length-1){this.page_++;this.showPage_();}},previousPage:function(){if(this.page_>0){this.page_--;this.showPage_();}},showPage_:function(){var tutorialContainer=$('tutorial_main');tutorialContainer.innerHTML='';var pageElements=Tutorial.PAGES[this.page_];for(var i=0;i<pageElements.length;++i){var pageElement=pageElements[i];var msgid=pageElement.msgid;var text=Msgs.getMsg(msgid);var element;if(pageElement.heading){element=document.createElement('h2');}else if(pageElement.link){element=document.createElement('a');element.href=pageElement.link;element.target='_blank';}else{element=document.createElement('p');}
element.innerText=text;tutorialContainer.appendChild(element);}}};goog.provide('Panel');goog.require('ISearchUI');goog.require('Msgs');goog.require('PanelCommand');goog.require('PanelMenu');goog.require('PanelMenuItem');goog.require('Tutorial');goog.require('cvox.ChromeVoxKbHandler');goog.require('cvox.CommandStore');Panel=function(){};Panel.init=function(){this.speechContainer_=$('speech-container');this.speechElement_=$('speech');this.brailleContainer_=$('braille-container');this.searchContainer_=$('search-container');this.searchInput_=$('search');this.brailleTableElement_=$('braille-table');this.menus_=[];this.activeMenu_=null;this.menusEnabled_=localStorage['useNext']=='true';this.pendingCallback_=null;this.searching_=false;this.tutorial_=new Tutorial();Panel.updateFromPrefs();Msgs.addTranslatedMessagesToDom(document);window.addEventListener('storage',function(event){if(event.key=='brailleCaptions'){Panel.updateFromPrefs();}},false);window.addEventListener('message',function(message){var command=JSON.parse(message.data);Panel.exec((command));},false);$('menus_button').addEventListener('mousedown',Panel.onOpenMenus,false);$('options').addEventListener('click',Panel.onOptions,false);$('close').addEventListener('click',Panel.onClose,false);$('tutorial_next').addEventListener('click',Panel.onTutorialNext,false);$('tutorial_previous').addEventListener('click',Panel.onTutorialPrevious,false);$('close_tutorial').addEventListener('click',Panel.onCloseTutorial,false);document.addEventListener('keydown',Panel.onKeyDown,false);document.addEventListener('mouseup',Panel.onMouseUp,false);Panel.searchInput_.addEventListener('blur',Panel.onSearchInputBlur,false);};Panel.updateFromPrefs=function(){if(Panel.searching_){this.speechContainer_.style.display='none';this.brailleContainer_.style.display='none';this.searchContainer_.style.display='block';return;}
this.speechContainer_.style.display='block';this.brailleContainer_.style.display='block';this.searchContainer_.style.display='none';if(localStorage['brailleCaptions']===String(true)){this.speechContainer_.style.visibility='hidden';this.brailleContainer_.style.visibility='visible';}else{this.speechContainer_.style.visibility='visible';this.brailleContainer_.style.visibility='hidden';}};Panel.exec=function(command){function escapeForHtml(str){return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/\>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/\//g,'&#x2F;');}
switch(command.type){case PanelCommandType.CLEAR_SPEECH:this.speechElement_.innerHTML='';break;case PanelCommandType.ADD_NORMAL_SPEECH:if(this.speechElement_.innerHTML!=''){this.speechElement_.innerHTML+='&nbsp;&nbsp;';}
this.speechElement_.innerHTML+='<span class="usertext">'+
escapeForHtml(command.data)+'</span>';break;case PanelCommandType.ADD_ANNOTATION_SPEECH:if(this.speechElement_.innerHTML!=''){this.speechElement_.innerHTML+='&nbsp;&nbsp;';}
this.speechElement_.innerHTML+=escapeForHtml(command.data);break;case PanelCommandType.UPDATE_BRAILLE:var groups=command.data.groups;this.brailleTableElement_.deleteRow(0);this.brailleTableElement_.deleteRow(0);var row1=this.brailleTableElement_.insertRow(-1);var row2=this.brailleTableElement_.insertRow(-1);for(var i=0;i<groups.length;i++){var topCell=row1.insertCell(-1);var bottomCell=row2.insertCell(-1);topCell.innerHTML=groups[i][0];bottomCell.innerHTML=groups[i][1];}
break;case PanelCommandType.ENABLE_MENUS:Panel.onEnableMenus();break;case PanelCommandType.DISABLE_MENUS:Panel.onDisableMenus();break;case PanelCommandType.OPEN_MENUS:Panel.onOpenMenus(undefined,command.data);break;case PanelCommandType.SEARCH:Panel.onSearch();break;case PanelCommandType.TUTORIAL:Panel.onTutorial();break;}};Panel.onEnableMenus=function(){Panel.menusEnabled_=true;$('menus_button').disabled=false;$('triangle').style.display='';};Panel.onDisableMenus=function(){Panel.menusEnabled_=false;$('menus_button').disabled=true;$('triangle').style.display='none';};Panel.onOpenMenus=function(opt_event,opt_activateMenuTitle){if(!Panel.menusEnabled_)
return;if(opt_event){opt_event.stopPropagation();opt_event.preventDefault();}
window.location='#fullscreen';Panel.clearMenus();Panel.pendingCallback_=null;var jumpMenu=Panel.addMenu('panel_menu_jump');var speechMenu=Panel.addMenu('panel_menu_speech');var tabsMenu=Panel.addMenu('panel_menu_tabs');var chromevoxMenu=Panel.addMenu('panel_menu_chromevox');var categoryToMenu={'navigation':jumpMenu,'jump_commands':jumpMenu,'overview':jumpMenu,'tables':jumpMenu,'controlling_speech':speechMenu,'information':speechMenu,'modifier_keys':chromevoxMenu,'help_commands':chromevoxMenu,'braille':null,'developer':null};var bkgnd=chrome.extension.getBackgroundPage();var keymap=bkgnd['cvox']['KeyMap']['fromCurrentKeyMap']();var sortedBindings=keymap.bindings().slice();sortedBindings.forEach(goog.bind(function(binding){var command=binding.command;var keySeq=binding.sequence;binding.keySeq=cvox.KeyUtil.keySequenceToString(keySeq,true);var titleMsgId=cvox.CommandStore.messageForCommand(command);if(!titleMsgId){console.error('No localization for: '+command);binding.title='';return;}
var title=Msgs.getMsg(titleMsgId);title=title.replace(/\w\S*/g,function(word){return word.charAt(0).toUpperCase()+word.substr(1);});binding.title=title;},this));sortedBindings.sort(function(binding1,binding2){return binding1.title.localeCompare(binding2.title);});var sawBindingSet={};sortedBindings.forEach(goog.bind(function(binding){var command=binding.command;if(sawBindingSet[command])
return;sawBindingSet[command]=true;var category=cvox.CommandStore.categoryForCommand(binding.command);var menu=category?categoryToMenu[category]:null;if(binding.title&&menu){menu.addMenuItem(binding.title,binding.keySeq,function(){var CommandHandler=chrome.extension.getBackgroundPage()['CommandHandler'];CommandHandler['onCommand'](binding.command);});}},this));bkgnd.chrome.windows.getLastFocused(function(lastFocusedWindow){bkgnd.chrome.windows.getAll({'populate':true},function(windows){for(var i=0;i<windows.length;i++){var tabs=windows[i].tabs;for(var j=0;j<tabs.length;j++){var title=tabs[j].title;if(tabs[j].active&&windows[i].id==lastFocusedWindow.id)
title+=' '+Msgs.getMsg('active_tab');tabsMenu.addMenuItem(title,'',(function(win,tab){bkgnd.chrome.windows.update(win.id,{focused:true},function(){bkgnd.chrome.tabs.update(tab.id,{active:true});});}).bind(this,windows[i],tabs[j]));}}});});chromevoxMenu.addMenuItem(Msgs.getMsg('disable_chromevox'),'Ctrl+Alt+Z',function(){Panel.onClose();});var node=bkgnd.ChromeVoxState.instance.getCurrentRange().start.node;Panel.addNodeMenu('role_heading',node,AutomationPredicate.heading);Panel.addNodeMenu('role_landmark',node,AutomationPredicate.landmark);Panel.addNodeMenu('role_link',node,AutomationPredicate.link);Panel.addNodeMenu('role_form',node,AutomationPredicate.formField);Panel.addNodeMenu('role_table',node,AutomationPredicate.table);var selectedMenu=Panel.menus_[0];for(var i=0;i<Panel.menus_.length;i++){if(this.menus_[i].menuMsg==opt_activateMenuTitle)
selectedMenu=this.menus_[i];}
Panel.activateMenu(selectedMenu);};Panel.onSearch=function(){Panel.clearMenus();Panel.pendingCallback_=null;Panel.searching_=true;Panel.updateFromPrefs();window.location='#focus';ISearchUI.get(Panel.searchInput_);};Panel.clearMenus=function(){while(this.menus_.length){var menu=this.menus_.pop();$('menu-bar').removeChild(menu.menuBarItemElement);$('menus_background').removeChild(menu.menuContainerElement);}
this.activeMenu_=null;};Panel.addMenu=function(menuMsg){var menu=new PanelMenu(menuMsg);$('menu-bar').appendChild(menu.menuBarItemElement);menu.menuBarItemElement.addEventListener('mouseover',function(){Panel.activateMenu(menu);},false);$('menus_background').appendChild(menu.menuContainerElement);this.menus_.push(menu);return menu;};Panel.addNodeMenu=function(menuMsg,node,pred){var menu=new PanelNodeMenu(menuMsg,node,pred);$('menu-bar').appendChild(menu.menuBarItemElement);menu.menuBarItemElement.addEventListener('mouseover',function(){Panel.activateMenu(menu);},false);$('menus_background').appendChild(menu.menuContainerElement);this.menus_.push(menu);return menu;};Panel.activateMenu=function(menu){if(menu==this.activeMenu_)
return;if(this.activeMenu_){this.activeMenu_.deactivate();this.activeMenu_=null;}
this.activeMenu_=menu;this.pendingCallback_=null;if(this.activeMenu_){this.activeMenu_.activate();}};Panel.scrollToTop=function(){this.activeMenu_.scrollToTop();};Panel.scrollToBottom=function(){this.activeMenu_.scrollToBottom();};Panel.advanceActiveMenuBy=function(delta){var activeIndex=-1;for(var i=0;i<this.menus_.length;i++){if(this.activeMenu_==this.menus_[i]){activeIndex=i;break;}}
if(activeIndex>=0){activeIndex+=delta;activeIndex=(activeIndex+this.menus_.length)%this.menus_.length;}else{if(delta>=0)
activeIndex=0;else
activeIndex=this.menus_.length-1;}
Panel.activateMenu(this.menus_[activeIndex]);};Panel.advanceItemBy=function(delta){if(this.activeMenu_)
this.activeMenu_.advanceItemBy(delta);};Panel.onMouseUp=function(event){if(!Panel.activeMenu_)
return;var target=event.target;while(target&&!target.classList.contains('menu-item')){if(target.id=='menus_button')
return;target=target.parentElement;}
if(target&&Panel.activeMenu_)
Panel.pendingCallback_=Panel.activeMenu_.getCallbackForElement(target);Panel.closeMenusAndRestoreFocus();};Panel.onKeyDown=function(event){if(!Panel.activeMenu_)
return;if(event.altKey||event.ctrlKey||event.metaKey||event.shiftKey)
return;switch(event.key){case'ArrowLeft':Panel.advanceActiveMenuBy(-1);break;case'ArrowRight':Panel.advanceActiveMenuBy(1);break;case'ArrowUp':Panel.advanceItemBy(-1);break;case'ArrowDown':Panel.advanceItemBy(1);break;case'Escape':Panel.closeMenusAndRestoreFocus();break;case'PageUp':Panel.advanceItemBy(10);break;case'PageDown':Panel.advanceItemBy(-10);break;case'Home':Panel.scrollToTop();break;case'End':Panel.scrollToBottom();break;case'Enter':case' ':Panel.pendingCallback_=Panel.getCallbackForCurrentItem();Panel.closeMenusAndRestoreFocus();break;default:return;}
event.preventDefault();event.stopPropagation();};Panel.onSearchInputBlur=function(){if(Panel.searching_){if(document.activeElement!=Panel.searchInput_||!document.hasFocus()){Panel.searching_=false;if(window.location=='#focus')
window.location='#';Panel.updateFromPrefs();Panel.searchInput_.value='';}}};Panel.onOptions=function(){var bkgnd=chrome.extension.getBackgroundPage()['ChromeVoxState']['instance'];bkgnd['showOptionsPage']();window.location='#';};Panel.onClose=function(){window.location='#close';};Panel.getCallbackForCurrentItem=function(){if(this.activeMenu_)
return this.activeMenu_.getCallbackForCurrentItem();return null;};Panel.closeMenusAndRestoreFocus=function(){var onFocus=function(desktop,evt){desktop.removeEventListener(chrome.automation.EventType.focus,onFocus);Panel.pendingCallback_&&Panel.pendingCallback_();}.bind(this);chrome.automation.getDesktop(function(desktop){onFocus=(onFocus.bind(this,desktop));desktop.addEventListener(chrome.automation.EventType.focus,onFocus,true);Panel.clearMenus();window.location='#';this.activeMenu_=null;});};Panel.onTutorial=function(){window.location='#fullscreen';$('main').style.display='none';$('menus_background').style.display='none';$('tutorial').style.display='block';Panel.tutorial_.firstPage();};Panel.onTutorialNext=function(){Panel.tutorial_.nextPage();};Panel.onTutorialPrevious=function(){Panel.tutorial_.previousPage();};Panel.onCloseTutorial=function(){$('main').style.display='block';$('tutorial').style.display='none';Panel.closeMenusAndRestoreFocus();};window.addEventListener('load',function(){Panel.init();},false);window.addEventListener('hashchange',function(){if(location.hash=='#fullscreen'||location.hash=='#focus'){this.originalStickyState_=cvox.ChromeVox.isStickyPrefOn;cvox.ChromeVox.isStickyPrefOn=false;}else{cvox.ChromeVox.isStickyPrefOn=this.originalStickyState_;}},false);goog.require('Panel');
