capybara-accessible 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,32 +2,7 @@ module Capybara::Accessible
2
2
  class InaccessibleError < Capybara::CapybaraError; end
3
3
 
4
4
  class Auditor
5
- class Node < self
6
- def initialize(session)
7
- @driver = session.driver
8
- end
9
-
10
- def audit!
11
- if modal_dialog_present?
12
- puts "Skipping accessibility audit: Modal dialog present"
13
- else
14
- super
15
- end
16
- end
17
-
18
- private
19
- def modal_dialog_present?
20
- Capybara::Accessible.driver_adapter.modal_dialog_present?(driver)
21
- end
22
- end
23
-
24
- class Driver < self
25
- def initialize(driver)
26
- @driver = driver
27
- end
28
- end
29
-
30
- class <<self
5
+ class << self
31
6
  def exclusions=(rules)
32
7
  @exclusions = rules
33
8
  end
@@ -65,32 +40,34 @@ module Capybara::Accessible
65
40
  end
66
41
  end
67
42
 
43
+ def initialize(driver)
44
+ @driver = driver
45
+ end
46
+
68
47
  def audit!
69
48
  return if Auditor.disabled?
70
-
71
49
  if failures?
72
50
  log_level_response[Capybara::Accessible::Auditor.log_level].call(failure_messages)
73
51
  end
74
52
  end
75
53
 
76
54
  private
77
- attr_reader :driver
78
55
 
79
56
  def log_level_response
80
57
  @log_level_response ||= {
81
- warn: ->(messages) { puts messages },
82
- error: ->(messages) { raise Capybara::Accessible::InaccessibleError, failure_messages }
58
+ warn: ->(messages) { puts messages },
59
+ error: ->(messages) { raise Capybara::Accessible::InaccessibleError, failure_messages }
83
60
  }
84
61
  end
85
62
 
86
63
  def failures?
87
- failures = run_script(perform_audit_script + driver_adaptor.failures_script)
64
+ failures = run_script(perform_audit_script + @driver.accessible.failures_script)
88
65
 
89
66
  Array(failures).any?
90
67
  end
91
68
 
92
69
  def failure_messages
93
- result = run_script(perform_audit_script + driver_adaptor.create_report_script)
70
+ result = run_script(perform_audit_script + @driver.accessible.create_report_script)
94
71
  "Found at #{page_url} \n\n#{result}"
95
72
  end
96
73
 
@@ -109,7 +86,7 @@ module Capybara::Accessible
109
86
  config.setSeverity(severe_rules[rule], axs.constants.Severity.SEVERE);
110
87
  }
111
88
  config.auditRulesToIgnore = #{excluded_rules.to_json};
112
-
89
+ config.showUnsupportedRulesWarning = false
113
90
  var results = axs.Audit.run(config);
114
91
  JAVASCRIPT
115
92
  end
@@ -126,34 +103,30 @@ module Capybara::Accessible
126
103
 
127
104
  def mapping
128
105
  @mapping ||= {
129
- 'AX_ARIA_01' => 'badAriaRole',
130
- 'AX_ARIA_02' => 'nonExistentAriaLabelledbyElement',
131
- 'AX_ARIA_03' => 'requiredAriaAttributeMissing',
132
- 'AX_ARIA_04' => 'badAriaAttributeValue',
133
- 'AX_TEXT_01' => 'controlsWithoutLabel',
134
- 'AX_TEXT_02' => 'imagesWithoutAltText',
135
- 'AX_TITLE_01' => 'pageWithoutTitle',
136
- 'AX_IMAGE_01' => 'elementsWithMeaningfulBackgroundImage',
137
- 'AX_FOCUS_01' => 'focusableElementNotVisibleAndNotAriaHidden',
138
- 'AX_FOCUS_02' => 'unfocusableElementsWithOnClick',
139
- 'AX_COLOR_01' => 'lowContrastElements',
140
- 'AX_VIDEO_01' => 'videoWithoutCaptions',
141
- 'AX_AUDIO_01' => 'audioWithoutControls'
142
- # 'AX_TITLE_01' => 'linkWithUnclearPurpose', # This has a duplicate name
143
- # 'AX_ARIA_05' => '', # This has no rule associated with it
106
+ 'AX_ARIA_01' => 'badAriaRole',
107
+ 'AX_ARIA_02' => 'nonExistentAriaLabelledbyElement',
108
+ 'AX_ARIA_03' => 'requiredAriaAttributeMissing',
109
+ 'AX_ARIA_04' => 'badAriaAttributeValue',
110
+ 'AX_TEXT_01' => 'controlsWithoutLabel',
111
+ 'AX_TEXT_02' => 'imagesWithoutAltText',
112
+ 'AX_TITLE_01' => 'pageWithoutTitle',
113
+ 'AX_IMAGE_01' => 'elementsWithMeaningfulBackgroundImage',
114
+ 'AX_FOCUS_01' => 'focusableElementNotVisibleAndNotAriaHidden',
115
+ 'AX_FOCUS_02' => 'unfocusableElementsWithOnClick',
116
+ 'AX_COLOR_01' => 'lowContrastElements',
117
+ 'AX_VIDEO_01' => 'videoWithoutCaptions',
118
+ 'AX_AUDIO_01' => 'audioWithoutControls'
119
+ # 'AX_TITLE_01' => 'linkWithUnclearPurpose', # This has a duplicate name
120
+ # 'AX_ARIA_05' => '', # This has no rule associated with it
144
121
  }
145
122
  end
146
123
 
147
124
  def page_url
148
- driver.current_url
125
+ @driver.current_url
149
126
  end
150
127
 
151
128
  def run_script(script)
152
- driver_adaptor.run_javascript(driver, script)
153
- end
154
-
155
- def driver_adaptor
156
- Capybara::Accessible.driver_adapter
129
+ @driver.accessible.run_javascript(@driver, script)
157
130
  end
158
131
  end
159
132
  end
@@ -0,0 +1,16 @@
1
+ module Capybara::Accessible
2
+ class Driver
3
+ def self.wrap(underlying_driver)
4
+ Class.new(underlying_driver) { include InstanceMethods }
5
+ end
6
+
7
+ module InstanceMethods
8
+ attr_writer :accessible
9
+
10
+ def visit(path)
11
+ super
12
+ Auditor.audit(self)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,28 @@
1
+ require 'capybara/accessible/auditor'
2
+
3
+ module Capybara::Accessible
4
+ module Extensions
5
+ module Driver
6
+ def self.wrap(underlying_driver)
7
+ Class.new(underlying_driver) do
8
+ include Extensions::Driver
9
+
10
+ def self.name
11
+ "Capybara::Accessible::Extensions::Driver(wrap: #{underlying_driver}"
12
+ end
13
+ class << self
14
+ alias_method :inspect, :name
15
+ alias_method :to_s, :name
16
+ end
17
+ end
18
+ end
19
+
20
+ attr_accessor :accessible
21
+
22
+ def visit(path)
23
+ super
24
+ Auditor.new(self).audit!
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,19 @@
1
+ require 'capybara/accessible/auditor'
2
+
3
+ module Capybara::Accessible
4
+ module Extensions
5
+ module Element
6
+ def click
7
+ super
8
+ driver = @session.driver
9
+ if driver.respond_to?(:accessible)
10
+ Auditor.new(@session.driver).audit!
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ class Capybara::Node::Element
18
+ prepend Capybara::Accessible::Extensions::Element
19
+ end
@@ -3,7 +3,6 @@ require 'rake'
3
3
  require 'capybara/accessible'
4
4
 
5
5
  namespace :capybara_accessible do
6
-
7
6
  desc 'Report total number of integration tests that are accessible/inaccessible'
8
7
  task :report_inaccessible_tests do
9
8
  directories_to_exclude = ['features/support']
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Accessible
3
- VERSION = "0.2.1"
3
+ VERSION = '0.3.0'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2013 Google Inc.
2
+ * Copyright 2016 Google Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,1637 +13,2630 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  *
16
- * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/80f7c9ac87569c23429a7b07de1af980679c9a34
16
+ * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/7d778f7da58af341a47b3a6f6457c2842b24d4d8
17
17
  *
18
18
  * See project README for build steps.
19
19
  */
20
-
20
+
21
21
  // AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details.
22
22
 
23
- var COMPILED = !0, goog = goog || {};
24
- goog.global = this;
25
- goog.exportPath_ = function(a, b, c) {
26
- a = a.split(".");
27
- c = c || goog.global;
28
- a[0] in c || !c.execScript || c.execScript("var " + a[0]);
29
- for(var d;a.length && (d = a.shift());) {
30
- a.length || void 0 === b ? c = c[d] ? c[d] : c[d] = {} : c[d] = b
31
- }
32
- };
33
- goog.define = function(a, b) {
34
- var c = b;
35
- COMPILED || goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]);
36
- goog.exportPath_(a, c)
37
- };
38
- goog.DEBUG = !0;
39
- goog.LOCALE = "en";
40
- goog.TRUSTED_SITE = !0;
41
- goog.provide = function(a) {
42
- if(!COMPILED) {
43
- if(goog.isProvided_(a)) {
23
+ var fn = (function() {
24
+ var COMPILED = !0, goog = goog || {};
25
+ goog.global = this;
26
+ goog.isDef = function(a) {
27
+ return void 0 !== a;
28
+ };
29
+ goog.exportPath_ = function(a, b, c) {
30
+ a = a.split(".");
31
+ c = c || goog.global;
32
+ a[0] in c || !c.execScript || c.execScript("var " + a[0]);
33
+ for (var d;a.length && (d = a.shift());) {
34
+ !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {};
35
+ }
36
+ };
37
+ goog.define = function(a, b) {
38
+ var c = b;
39
+ COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]));
40
+ goog.exportPath_(a, c);
41
+ };
42
+ goog.DEBUG = !0;
43
+ goog.LOCALE = "en";
44
+ goog.TRUSTED_SITE = !0;
45
+ goog.STRICT_MODE_COMPATIBLE = !1;
46
+ goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG;
47
+ goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1;
48
+ goog.provide = function(a) {
49
+ if (goog.isInModuleLoader_()) {
50
+ throw Error("goog.provide can not be used within a goog.module.");
51
+ }
52
+ if (!COMPILED && goog.isProvided_(a)) {
44
53
  throw Error('Namespace "' + a + '" already declared.');
45
54
  }
46
- delete goog.implicitNamespaces_[a];
47
- for(var b = a;(b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) {
48
- goog.implicitNamespaces_[b] = !0
55
+ goog.constructNamespace_(a);
56
+ };
57
+ goog.constructNamespace_ = function(a, b) {
58
+ if (!COMPILED) {
59
+ delete goog.implicitNamespaces_[a];
60
+ for (var c = a;(c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectByName(c);) {
61
+ goog.implicitNamespaces_[c] = !0;
62
+ }
49
63
  }
50
- }
51
- goog.exportPath_(a)
52
- };
53
- goog.setTestOnly = function(a) {
54
- if(COMPILED && !goog.DEBUG) {
55
- throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : ".");
56
- }
57
- };
58
- COMPILED || (goog.isProvided_ = function(a) {
59
- return!goog.implicitNamespaces_[a] && !!goog.getObjectByName(a)
60
- }, goog.implicitNamespaces_ = {});
61
- goog.getObjectByName = function(a, b) {
62
- for(var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
63
- if(goog.isDefAndNotNull(d[e])) {
64
- d = d[e]
65
- }else {
66
- return null
64
+ goog.exportPath_(a, b);
65
+ };
66
+ goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
67
+ goog.module = function(a) {
68
+ if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) {
69
+ throw Error("Invalid module identifier");
67
70
  }
68
- }
69
- return d
70
- };
71
- goog.globalize = function(a, b) {
72
- var c = b || goog.global, d;
73
- for(d in a) {
74
- c[d] = a[d]
75
- }
76
- };
77
- goog.addDependency = function(a, b, c) {
78
- if(goog.DEPENDENCIES_ENABLED) {
79
- var d;
80
- a = a.replace(/\\/g, "/");
81
- for(var e = goog.dependencies_, f = 0;d = b[f];f++) {
82
- e.nameToPath[d] = a, a in e.pathToNames || (e.pathToNames[a] = {}), e.pathToNames[a][d] = !0
71
+ if (!goog.isInModuleLoader_()) {
72
+ throw Error("Module " + a + " has been loaded incorrectly.");
83
73
  }
84
- for(d = 0;b = c[d];d++) {
85
- a in e.requires || (e.requires[a] = {}), e.requires[a][b] = !0
74
+ if (goog.moduleLoaderState_.moduleName) {
75
+ throw Error("goog.module may only be called once per module.");
86
76
  }
87
- }
88
- };
89
- goog.ENABLE_DEBUG_LOADER = !0;
90
- goog.require = function(a) {
91
- if(!COMPILED && !goog.isProvided_(a)) {
92
- if(goog.ENABLE_DEBUG_LOADER) {
93
- var b = goog.getPathFromDeps_(a);
94
- if(b) {
95
- goog.included_[b] = !0;
96
- goog.writeScripts_();
97
- return
98
- }
99
- }
100
- a = "goog.require could not find: " + a;
77
+ goog.moduleLoaderState_.moduleName = a;
78
+ if (!COMPILED) {
79
+ if (goog.isProvided_(a)) {
80
+ throw Error('Namespace "' + a + '" already declared.');
81
+ }
82
+ delete goog.implicitNamespaces_[a];
83
+ }
84
+ };
85
+ goog.module.get = function(a) {
86
+ return goog.module.getInternal_(a);
87
+ };
88
+ goog.module.getInternal_ = function(a) {
89
+ if (!COMPILED) {
90
+ return goog.isProvided_(a) ? a in goog.loadedModules_ ? goog.loadedModules_[a] : goog.getObjectByName(a) : null;
91
+ }
92
+ };
93
+ goog.moduleLoaderState_ = null;
94
+ goog.isInModuleLoader_ = function() {
95
+ return null != goog.moduleLoaderState_;
96
+ };
97
+ goog.module.declareLegacyNamespace = function() {
98
+ if (!COMPILED && !goog.isInModuleLoader_()) {
99
+ throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");
100
+ }
101
+ if (!COMPILED && !goog.moduleLoaderState_.moduleName) {
102
+ throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");
103
+ }
104
+ goog.moduleLoaderState_.declareLegacyNamespace = !0;
105
+ };
106
+ goog.setTestOnly = function(a) {
107
+ if (goog.DISALLOW_TEST_ONLY_CODE) {
108
+ throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : "."));
109
+ }
110
+ };
111
+ goog.forwardDeclare = function(a) {
112
+ };
113
+ COMPILED || (goog.isProvided_ = function(a) {
114
+ return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a));
115
+ }, goog.implicitNamespaces_ = {"goog.module":!0});
116
+ goog.getObjectByName = function(a, b) {
117
+ for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
118
+ if (goog.isDefAndNotNull(d[e])) {
119
+ d = d[e];
120
+ } else {
121
+ return null;
122
+ }
123
+ }
124
+ return d;
125
+ };
126
+ goog.globalize = function(a, b) {
127
+ var c = b || goog.global, d;
128
+ for (d in a) {
129
+ c[d] = a[d];
130
+ }
131
+ };
132
+ goog.addDependency = function(a, b, c, d) {
133
+ if (goog.DEPENDENCIES_ENABLED) {
134
+ var e;
135
+ a = a.replace(/\\/g, "/");
136
+ var f = goog.dependencies_;
137
+ d && "boolean" !== typeof d || (d = d ? {module:"goog"} : {});
138
+ for (var g = 0;e = b[g];g++) {
139
+ f.nameToPath[e] = a, f.loadFlags[a] = d;
140
+ }
141
+ for (d = 0;b = c[d];d++) {
142
+ a in f.requires || (f.requires[a] = {}), f.requires[a][b] = !0;
143
+ }
144
+ }
145
+ };
146
+ goog.ENABLE_DEBUG_LOADER = !0;
147
+ goog.logToConsole_ = function(a) {
101
148
  goog.global.console && goog.global.console.error(a);
102
- throw Error(a);
103
- }
104
- };
105
- goog.basePath = "";
106
- goog.nullFunction = function() {
107
- };
108
- goog.identityFunction = function(a, b) {
109
- return a
110
- };
111
- goog.abstractMethod = function() {
112
- throw Error("unimplemented abstract method");
113
- };
114
- goog.addSingletonGetter = function(a) {
115
- a.getInstance = function() {
116
- if(a.instance_) {
117
- return a.instance_
118
- }
119
- goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a);
120
- return a.instance_ = new a
121
- }
122
- };
123
- goog.instantiatedSingletons_ = [];
124
- goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
125
- goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathToNames:{}, nameToPath:{}, requires:{}, visited:{}, written:{}}, goog.inHtmlDocument_ = function() {
126
- var a = goog.global.document;
127
- return"undefined" != typeof a && "write" in a
128
- }, goog.findBasePath_ = function() {
129
- if(goog.global.CLOSURE_BASE_PATH) {
130
- goog.basePath = goog.global.CLOSURE_BASE_PATH
131
- }else {
132
- if(goog.inHtmlDocument_()) {
133
- for(var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) {
134
- var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
135
- if("base.js" == c.substr(d - 7, 7)) {
136
- goog.basePath = c.substr(0, d - 7);
137
- break
149
+ };
150
+ goog.require = function(a) {
151
+ if (!COMPILED) {
152
+ goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_ && goog.maybeProcessDeferredDep_(a);
153
+ if (goog.isProvided_(a)) {
154
+ return goog.isInModuleLoader_() ? goog.module.getInternal_(a) : null;
155
+ }
156
+ if (goog.ENABLE_DEBUG_LOADER) {
157
+ var b = goog.getPathFromDeps_(a);
158
+ if (b) {
159
+ return goog.writeScripts_(b), null;
138
160
  }
139
161
  }
162
+ a = "goog.require could not find: " + a;
163
+ goog.logToConsole_(a);
164
+ throw Error(a);
140
165
  }
141
- }
142
- }, goog.importScript_ = function(a) {
143
- var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_;
144
- !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0)
145
- }, goog.writeScriptTag_ = function(a) {
146
- if(goog.inHtmlDocument_()) {
147
- var b = goog.global.document;
148
- if("complete" == b.readyState) {
149
- if(/\bdeps.js$/.test(a)) {
150
- return!1
151
- }
152
- throw Error('Cannot write "' + a + '" after document load');
153
- }
154
- b.write('<script type="text/javascript" src="' + a + '">\x3c/script>');
155
- return!0
156
- }
157
- return!1
158
- }, goog.writeScripts_ = function() {
159
- function a(e) {
160
- if(!(e in d.written)) {
161
- if(!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) {
162
- for(var g in d.requires[e]) {
163
- if(!goog.isProvided_(g)) {
164
- if(g in d.nameToPath) {
165
- a(d.nameToPath[g])
166
- }else {
167
- throw Error("Undefined nameToPath for " + g);
168
- }
166
+ };
167
+ goog.basePath = "";
168
+ goog.nullFunction = function() {
169
+ };
170
+ goog.abstractMethod = function() {
171
+ throw Error("unimplemented abstract method");
172
+ };
173
+ goog.addSingletonGetter = function(a) {
174
+ a.getInstance = function() {
175
+ if (a.instance_) {
176
+ return a.instance_;
177
+ }
178
+ goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a);
179
+ return a.instance_ = new a;
180
+ };
181
+ };
182
+ goog.instantiatedSingletons_ = [];
183
+ goog.LOAD_MODULE_USING_EVAL = !0;
184
+ goog.SEAL_MODULE_EXPORTS = goog.DEBUG;
185
+ goog.loadedModules_ = {};
186
+ goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
187
+ goog.ALWAYS_TRANSPILE = !1;
188
+ goog.NEVER_TRANSPILE = !1;
189
+ goog.DEPENDENCIES_ENABLED && (goog.dependencies_ = {loadFlags:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
190
+ var a = goog.global.document;
191
+ return null != a && "write" in a;
192
+ }, goog.findBasePath_ = function() {
193
+ if (goog.isDef(goog.global.CLOSURE_BASE_PATH)) {
194
+ goog.basePath = goog.global.CLOSURE_BASE_PATH;
195
+ } else {
196
+ if (goog.inHtmlDocument_()) {
197
+ for (var a = goog.global.document.getElementsByTagName("SCRIPT"), b = a.length - 1;0 <= b;--b) {
198
+ var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
199
+ if ("base.js" == c.substr(d - 7, 7)) {
200
+ goog.basePath = c.substr(0, d - 7);
201
+ break;
169
202
  }
170
203
  }
171
204
  }
172
- e in c || (c[e] = !0, b.push(e))
173
205
  }
174
- }
175
- var b = [], c = {}, d = goog.dependencies_, e;
176
- for(e in goog.included_) {
177
- d.written[e] || a(e)
178
- }
179
- for(e = 0;e < b.length;e++) {
180
- if(b[e]) {
181
- goog.importScript_(goog.basePath + b[e])
182
- }else {
183
- throw Error("Undefined script input");
206
+ }, goog.importScript_ = function(a, b) {
207
+ (goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dependencies_.written[a] = !0);
208
+ }, goog.IS_OLD_IE_ = !(goog.global.atob || !goog.global.document || !goog.global.document.all), goog.importProcessedScript_ = function(a, b, c) {
209
+ goog.importScript_("", 'goog.retrieveAndExec_("' + a + '", ' + b + ", " + c + ");");
210
+ }, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) {
211
+ return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loadModule(" + goog.global.JSON.stringify(b + "\n//# sourceURL=" + a + "\n") + ");" : 'goog.loadModule(function(exports) {"use strict";' + b + "\n;return exports});\n//# sourceURL=" + a + "\n";
212
+ }, goog.loadQueuedModules_ = function() {
213
+ var a = goog.queuedModules_.length;
214
+ if (0 < a) {
215
+ var b = goog.queuedModules_;
216
+ goog.queuedModules_ = [];
217
+ for (var c = 0;c < a;c++) {
218
+ goog.maybeProcessDeferredPath_(b[c]);
219
+ }
184
220
  }
185
- }
186
- }, goog.getPathFromDeps_ = function(a) {
187
- return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null
188
- }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js"));
189
- goog.typeOf = function(a) {
190
- var b = typeof a;
191
- if("object" == b) {
192
- if(a) {
193
- if(a instanceof Array) {
194
- return"array"
221
+ }, goog.maybeProcessDeferredDep_ = function(a) {
222
+ goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPathFromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a));
223
+ }, goog.isDeferredModule_ = function(a) {
224
+ var b = (a = goog.getPathFromDeps_(a)) && goog.dependencies_.loadFlags[a] || {};
225
+ return a && ("goog" == b.module || goog.needsTranspile_(b.lang)) ? goog.basePath + a in goog.dependencies_.deferred : !1;
226
+ }, goog.allDepsAreAvailable_ = function(a) {
227
+ if ((a = goog.getPathFromDeps_(a)) && a in goog.dependencies_.requires) {
228
+ for (var b in goog.dependencies_.requires[a]) {
229
+ if (!goog.isProvided_(b) && !goog.isDeferredModule_(b)) {
230
+ return !1;
231
+ }
195
232
  }
196
- if(a instanceof Object) {
197
- return b
233
+ }
234
+ return !0;
235
+ }, goog.maybeProcessDeferredPath_ = function(a) {
236
+ if (a in goog.dependencies_.deferred) {
237
+ var b = goog.dependencies_.deferred[a];
238
+ delete goog.dependencies_.deferred[a];
239
+ goog.globalEval(b);
240
+ }
241
+ }, goog.loadModuleFromUrl = function(a) {
242
+ goog.retrieveAndExec_(a, !0, !1);
243
+ }, goog.loadModule = function(a) {
244
+ var b = goog.moduleLoaderState_;
245
+ try {
246
+ goog.moduleLoaderState_ = {moduleName:void 0, declareLegacyNamespace:!1};
247
+ var c;
248
+ if (goog.isFunction(a)) {
249
+ c = a.call(goog.global, {});
250
+ } else {
251
+ if (goog.isString(a)) {
252
+ c = goog.loadModuleFromSource_.call(goog.global, a);
253
+ } else {
254
+ throw Error("Invalid module definition");
255
+ }
198
256
  }
199
- var c = Object.prototype.toString.call(a);
200
- if("[object Window]" == c) {
201
- return"object"
257
+ var d = goog.moduleLoaderState_.moduleName;
258
+ if (!goog.isString(d) || !d) {
259
+ throw Error('Invalid module name "' + d + '"');
202
260
  }
203
- if("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
204
- return"array"
261
+ goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d, c) : goog.SEAL_MODULE_EXPORTS && Object.seal && Object.seal(c);
262
+ goog.loadedModules_[d] = c;
263
+ } finally {
264
+ goog.moduleLoaderState_ = b;
265
+ }
266
+ }, goog.loadModuleFromSource_ = function(a) {
267
+ eval(a);
268
+ return {};
269
+ }, goog.writeScriptSrcNode_ = function(a) {
270
+ goog.global.document.write('<script type="text/javascript" src="' + a + '">\x3c/script>');
271
+ }, goog.appendScriptSrcNode_ = function(a) {
272
+ var b = goog.global.document, c = b.createElement("script");
273
+ c.type = "text/javascript";
274
+ c.src = a;
275
+ c.defer = !1;
276
+ c.async = !1;
277
+ b.head.appendChild(c);
278
+ }, goog.writeScriptTag_ = function(a, b) {
279
+ if (goog.inHtmlDocument_()) {
280
+ var c = goog.global.document;
281
+ if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && "complete" == c.readyState) {
282
+ if (/\bdeps.js$/.test(a)) {
283
+ return !1;
284
+ }
285
+ throw Error('Cannot write "' + a + '" after document load');
205
286
  }
206
- if("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
207
- return"function"
287
+ if (void 0 === b) {
288
+ if (goog.IS_OLD_IE_) {
289
+ var d = " onreadystatechange='goog.onScriptLoad_(this, " + ++goog.lastNonModuleScriptIndex_ + ")' ";
290
+ c.write('<script type="text/javascript" src="' + a + '"' + d + ">\x3c/script>");
291
+ } else {
292
+ goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING ? goog.appendScriptSrcNode_(a) : goog.writeScriptSrcNode_(a);
293
+ }
294
+ } else {
295
+ c.write('<script type="text/javascript">' + b + "\x3c/script>");
208
296
  }
209
- }else {
210
- return"null"
297
+ return !0;
211
298
  }
212
- }else {
213
- if("function" == b && "undefined" == typeof a.call) {
214
- return"object"
299
+ return !1;
300
+ }, goog.needsTranspile_ = function(a) {
301
+ if (goog.ALWAYS_TRANSPILE) {
302
+ return !0;
215
303
  }
216
- }
217
- return b
218
- };
219
- goog.isDef = function(a) {
220
- return void 0 !== a
221
- };
222
- goog.isNull = function(a) {
223
- return null === a
224
- };
225
- goog.isDefAndNotNull = function(a) {
226
- return null != a
227
- };
228
- goog.isArray = function(a) {
229
- return"array" == goog.typeOf(a)
230
- };
231
- goog.isArrayLike = function(a) {
232
- var b = goog.typeOf(a);
233
- return"array" == b || "object" == b && "number" == typeof a.length
234
- };
235
- goog.isDateLike = function(a) {
236
- return goog.isObject(a) && "function" == typeof a.getFullYear
237
- };
238
- goog.isString = function(a) {
239
- return"string" == typeof a
240
- };
241
- goog.isBoolean = function(a) {
242
- return"boolean" == typeof a
243
- };
244
- goog.isNumber = function(a) {
245
- return"number" == typeof a
246
- };
247
- goog.isFunction = function(a) {
248
- return"function" == goog.typeOf(a)
249
- };
250
- goog.isObject = function(a) {
251
- var b = typeof a;
252
- return"object" == b && null != a || "function" == b
253
- };
254
- goog.getUid = function(a) {
255
- return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_)
256
- };
257
- goog.removeUid = function(a) {
258
- "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_);
259
- try {
260
- delete a[goog.UID_PROPERTY_]
261
- }catch(b) {
262
- }
263
- };
264
- goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0);
265
- goog.uidCounter_ = 0;
266
- goog.getHashCode = goog.getUid;
267
- goog.removeHashCode = goog.removeUid;
268
- goog.cloneObject = function(a) {
269
- var b = goog.typeOf(a);
270
- if("object" == b || "array" == b) {
271
- if(a.clone) {
272
- return a.clone()
273
- }
274
- var b = "array" == b ? [] : {}, c;
275
- for(c in a) {
276
- b[c] = goog.cloneObject(a[c])
277
- }
278
- return b
279
- }
280
- return a
281
- };
282
- goog.bindNative_ = function(a, b, c) {
283
- return a.call.apply(a.bind, arguments)
284
- };
285
- goog.bindJs_ = function(a, b, c) {
286
- if(!a) {
287
- throw Error();
288
- }
289
- if(2 < arguments.length) {
290
- var d = Array.prototype.slice.call(arguments, 2);
291
- return function() {
292
- var c = Array.prototype.slice.call(arguments);
293
- Array.prototype.unshift.apply(c, d);
294
- return a.apply(b, c)
304
+ if (goog.NEVER_TRANSPILE) {
305
+ return !1;
295
306
  }
296
- }
297
- return function() {
298
- return a.apply(b, arguments)
299
- }
300
- };
301
- goog.bind = function(a, b, c) {
302
- Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_;
303
- return goog.bind.apply(null, arguments)
304
- };
305
- goog.partial = function(a, b) {
306
- var c = Array.prototype.slice.call(arguments, 1);
307
- return function() {
308
- var b = Array.prototype.slice.call(arguments);
309
- b.unshift.apply(b, c);
310
- return a.apply(this, b)
311
- }
312
- };
313
- goog.mixin = function(a, b) {
314
- for(var c in b) {
315
- a[c] = b[c]
316
- }
317
- };
318
- goog.now = goog.TRUSTED_SITE && Date.now || function() {
319
- return+new Date
320
- };
321
- goog.globalEval = function(a) {
322
- if(goog.global.execScript) {
323
- goog.global.execScript(a, "JavaScript")
324
- }else {
325
- if(goog.global.eval) {
326
- if(null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) {
327
- goog.global.eval(a)
328
- }else {
329
- var b = goog.global.document, c = b.createElement("script");
330
- c.type = "text/javascript";
331
- c.defer = !1;
332
- c.appendChild(b.createTextNode(a));
333
- b.body.appendChild(c);
334
- b.body.removeChild(c)
335
- }
336
- }else {
337
- throw Error("goog.globalEval not available");
307
+ if (!goog.transpiledLanguages_) {
308
+ goog.transpiledLanguages_ = {es5:!0, es6:!0, "es6-impl":!0};
309
+ try {
310
+ goog.transpiledLanguages_.es5 = eval("[1,].length!=1"), eval('(()=>{"use strict";let a={};const X=class{constructor(){}x(z){return new Map([...arguments]).get(z[0])==3}};return new X().x([a,3])})()') && (goog.transpiledLanguages_["es6-impl"] = !1), eval('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()') &&
311
+ (goog.transpiledLanguages_.es6 = !1);
312
+ } catch (b) {
313
+ }
338
314
  }
339
- }
340
- };
341
- goog.evalWorksForGlobals_ = null;
342
- goog.getCssName = function(a, b) {
343
- var c = function(a) {
344
- return goog.cssNameMapping_[a] || a
345
- }, d = function(a) {
346
- a = a.split("-");
347
- for(var b = [], d = 0;d < a.length;d++) {
348
- b.push(c(a[d]))
349
- }
350
- return b.join("-")
351
- }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) {
352
- return a
353
- };
354
- return b ? a + "-" + d(b) : d(a)
355
- };
356
- goog.setCssNameMapping = function(a, b) {
357
- goog.cssNameMapping_ = a;
358
- goog.cssNameMappingStyle_ = b
359
- };
360
- !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING);
361
- goog.getMsg = function(a, b) {
362
- var c = b || {}, d;
363
- for(d in c) {
364
- var e = ("" + c[d]).replace(/\$/g, "$$$$");
365
- a = a.replace(RegExp("\\{\\$" + d + "\\}", "gi"), e)
366
- }
367
- return a
368
- };
369
- goog.getMsgWithFallback = function(a, b) {
370
- return a
371
- };
372
- goog.exportSymbol = function(a, b, c) {
373
- goog.exportPath_(a, b, c)
374
- };
375
- goog.exportProperty = function(a, b, c) {
376
- a[b] = c
377
- };
378
- goog.inherits = function(a, b) {
379
- function c() {
380
- }
381
- c.prototype = b.prototype;
382
- a.superClass_ = b.prototype;
383
- a.prototype = new c;
384
- a.prototype.constructor = a
385
- };
386
- goog.base = function(a, b, c) {
387
- var d = arguments.callee.caller;
388
- if(goog.DEBUG && !d) {
389
- throw Error("arguments.caller not defined. goog.base() expects not to be running in strict mode. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");
390
- }
391
- if(d.superClass_) {
392
- return d.superClass_.constructor.apply(a, Array.prototype.slice.call(arguments, 1))
393
- }
394
- for(var e = Array.prototype.slice.call(arguments, 2), f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) {
395
- if(g.prototype[b] === d) {
396
- f = !0
397
- }else {
398
- if(f) {
399
- return g.prototype[b].apply(a, e)
315
+ return !!goog.transpiledLanguages_[a];
316
+ }, goog.transpiledLanguages_ = null, goog.lastNonModuleScriptIndex_ = 0, goog.onScriptLoad_ = function(a, b) {
317
+ "complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.loadQueuedModules_();
318
+ return !0;
319
+ }, goog.writeScripts_ = function(a) {
320
+ function b(a) {
321
+ if (!(a in e.written || a in e.visited)) {
322
+ e.visited[a] = !0;
323
+ if (a in e.requires) {
324
+ for (var f in e.requires[a]) {
325
+ if (!goog.isProvided_(f)) {
326
+ if (f in e.nameToPath) {
327
+ b(e.nameToPath[f]);
328
+ } else {
329
+ throw Error("Undefined nameToPath for " + f);
330
+ }
331
+ }
332
+ }
333
+ }
334
+ a in d || (d[a] = !0, c.push(a));
400
335
  }
401
336
  }
402
- }
403
- if(a[b] === d) {
404
- return a.constructor.prototype[b].apply(a, e)
405
- }
406
- throw Error("goog.base called from a method of one name to a method of a different name");
407
- };
408
- goog.scope = function(a) {
409
- a.call(goog.global)
410
- };
411
- var axs = {};
412
- axs.browserUtils = {};
413
- axs.browserUtils.matchSelector = function(a, b) {
414
- return a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : !1
415
- };
416
- axs.constants = {};
417
- axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, alertdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, application:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{namefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-pressed"]}, checkbox:{namefrom:["contents",
418
- "author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expanded"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract":!0, namefrom:["author"],
419
- parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, composite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["widget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dialog:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefrom:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], namerequired:!0, parent:["structure"],
420
- properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, parent:["composite", "region"], properties:["aria-level", "aria-multiselectable", "aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, parent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria-selected"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria-activedescendant"]},
421
- heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, img:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["section"]}, input:{"abstract":!0, namefrom:["author"], parent:["widget"]}, landmark:{"abstract":!0, namefrom:["contents", "author"], namerequired:!1, parent:["region"]}, link:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded"]}, list:{mustcontain:["group", "listitem"], namefrom:["author"], parent:["region"]},
422
- listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:["list", "select"], properties:["aria-multiselectable", "aria-required"]}, listitem:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], properties:["aria-level", "aria-posinset", "aria-setsize"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational:!0, namefrom:["author"],
423
- parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "menuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select"]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["contents", "author"], namerequired:!0, parent:["command"]}, menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"]}, menuitemradio:{namefrom:["contents", "author"], namerequired:!0, parent:["menuitemcheckbox", "radio"]}, navigation:{namefrom:["author"],
424
- parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"],
425
- namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ")},
426
- row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents", "author"], parent:["group", "widget"], properties:["aria-level", "aria-selected"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["group"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"]}, search:{namefrom:["author"], parent:["landmark"]}, section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"],
427
- properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstract":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefrom:["author"], namerequired:!1, parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientation",
428
- "aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, slider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orientation"]}, spinbutton:{namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax",
429
- "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abstract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:["sectionhead", "widget"], properties:["aria-selected"]}, tablist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria-level"]}, tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{namefrom:["author"],
430
- namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["select"], properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["row"], namefrom:["author"],
431
- namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "author"], namerequired:!0, parent:["listitem", "option"]}, widget:{"abstract":!0, parent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["roletype"], properties:["aria-expanded"]}};
432
- axs.constants.WIDGET_ROLES = {};
433
- axs.constants.addAllParentRolesToSet_ = function(a, b) {
434
- if(a.parent) {
435
- for(var c = a.parent, d = 0;d < c.length;d++) {
436
- var e = c[d];
437
- b[e] = !0;
438
- axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b)
337
+ var c = [], d = {}, e = goog.dependencies_;
338
+ b(a);
339
+ for (a = 0;a < c.length;a++) {
340
+ var f = c[a];
341
+ goog.dependencies_.written[f] = !0;
439
342
  }
440
- }
441
- };
442
- axs.constants.addAllPropertiesToSet_ = function(a, b, c) {
443
- var d = a[b];
444
- if(d) {
445
- for(var e = 0;e < d.length;e++) {
446
- c[d[e]] = !0
343
+ var g = goog.moduleLoaderState_;
344
+ goog.moduleLoaderState_ = null;
345
+ for (a = 0;a < c.length;a++) {
346
+ if (f = c[a]) {
347
+ var h = e.loadFlags[f] || {}, k = goog.needsTranspile_(h.lang);
348
+ "goog" == h.module || k ? goog.importProcessedScript_(goog.basePath + f, "goog" == h.module, k) : goog.importScript_(goog.basePath + f);
349
+ } else {
350
+ throw goog.moduleLoaderState_ = g, Error("Undefined script input");
351
+ }
447
352
  }
448
- }
449
- if(a.parent) {
450
- for(a = a.parent, d = 0;d < a.length;d++) {
451
- axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c)
353
+ goog.moduleLoaderState_ = g;
354
+ }, goog.getPathFromDeps_ = function(a) {
355
+ return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null;
356
+ }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js"));
357
+ goog.normalizePath_ = function(a) {
358
+ a = a.split("/");
359
+ for (var b = 0;b < a.length;) {
360
+ "." == a[b] ? a.splice(b, 1) : b && ".." == a[b] && a[b - 1] && ".." != a[b - 1] ? a.splice(--b, 2) : b++;
452
361
  }
453
- }
454
- };
455
- for(var roleName in axs.constants.ARIA_ROLES) {
456
- var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {};
457
- axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet);
458
- role.propertiesSet = propertiesSet;
459
- var requiredPropertiesSet = {};
460
- axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPropertiesSet);
461
- role.requiredPropertiesSet = requiredPropertiesSet;
462
- var parentRolesSet = {};
463
- axs.constants.addAllParentRolesToSet_(role, parentRolesSet);
464
- role.allParentRolesSet = parentRolesSet;
465
- "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role)
466
- }
467
- axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"idref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, autocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inline", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueType:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"},
468
- describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"false", type:"state", valueType:"boolean"}, dropeffect:{defaultValue:"none", type:"property", valueType:"token_list", values:"copy move link execute popup none".split(" ")}, expanded:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, flowto:{type:"property", valueType:"idref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false",
469
- "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boolean"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid:{defaultValue:"false", type:"state", valueType:"token", values:["grammar", "false", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledby:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:"integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values:["off", "polite", "assertive"]},
470
- multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multiselectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientation:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizontal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{type:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readonly:{defaultValue:"false",
471
- type:"property", valueType:"boolean"}, relevant:{defaultValue:"additions text", type:"property", valueType:"token_list", values:["additions", "removals", "text", "all"]}, required:{defaultValue:"false", type:"property", valueType:"boolean"}, selected:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, setsize:{type:"property", valueType:"integer"}, sort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending", "descending", "none",
472
- "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"property", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, valuetext:{type:"property", valueType:"string"}};
473
- axs.constants.GLOBAL_PROPERTIES = "aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ");
474
- axs.constants.NO_ROLE_NAME = " ";
475
- axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", columnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_role_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_role_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox",
476
- menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, progressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", slider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_status", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_textbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_role_tooltip", treeitem:"aria_role_treeitem"};
477
- axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application:"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_columnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_contentinfo", definition:"aria_role_definition", directory:"aria_role_directory", document:"aria_role_document", form:"aria_role_form", group:"aria_role_group", heading:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:"aria_role_listitem",
478
- main:"aria_role_main", math:"aria_role_math", navigation:"aria_role_navigation", note:"aria_role_note", region:"aria_role_region", rowheader:"aria_role_rowheader", search:"aria_role_search", separator:"aria_role_separator"};
479
- axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{inline:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autocomplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "false":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", values:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria_expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{"true":"aria_invalid_true",
480
- grammar:"aria_invalid_grammar", spelling:"aria_invalid_spelling"}}, {name:"aria-multiline", values:{"true":"aria_multiline_true"}}, {name:"aria-multiselectable", values:{"true":"aria_multiselectable_true"}}, {name:"aria-pressed", values:{"true":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixed"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria-required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values:{"true":"aria_selected_true",
481
- "false":"aria_selected_false"}}];
482
- axs.constants.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {button:"input_type_button", checkbox:"input_type_checkbox", color:"input_type_color", datetime:"input_type_datetime", "datetime-local":"input_type_datetime_local", date:"input_type_date", email:"input_type_email", file:"input_type_file", image:"input_type_image", month:"input_type_month", number:"input_type_number", password:"input_type_password", radio:"input_type_radio", range:"input_type_range", reset:"input_type_reset", search:"input_type_search",
483
- submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"input_type_url", week:"input_type_week"};
484
- axs.constants.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {A:"tag_link", BUTTON:"tag_button", H1:"tag_h1", H2:"tag_h2", H3:"tag_h3", H4:"tag_h4", H5:"tag_h5", H6:"tag_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", UL:"tag_ul", SECTION:"tag_section", NAV:"tag_nav", ARTICLE:"tag_article", ASIDE:"tag_aside", HGROUP:"tag_hgroup", HEADER:"tag_header", FOOTER:"tag_footer", TIME:"tag_time", MARK:"tag_mark"};
485
- axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:"tag_select", TEXTAREA:"tag_textarea"};
486
- axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0};
487
- (function() {
488
- for(var a in axs.constants.ARIA_PROPERTIES) {
489
- var b = axs.constants.ARIA_PROPERTIES[a];
490
- if(b.values) {
491
- for(var c = {}, d = 0;d < b.values.length;d++) {
492
- c[b.values[d]] = !0
493
- }
494
- b.valuesSet = c
362
+ return a.join("/");
363
+ };
364
+ goog.loadFileSync_ = function(a) {
365
+ if (goog.global.CLOSURE_LOAD_FILE_SYNC) {
366
+ return goog.global.CLOSURE_LOAD_FILE_SYNC(a);
495
367
  }
496
- }
497
- })();
498
- axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"};
499
- axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"};
500
- axs.constants.InlineElements = {TT:!0, I:!0, B:!0, BIG:!0, SMALL:!0, EM:!0, STRONG:!0, DFN:!0, CODE:!0, SAMP:!0, KBD:!0, VAR:!0, CITE:!0, ABBR:!0, ACRONYM:!0, A:!0, IMG:!0, OBJECT:!0, BR:!0, SCRIPT:!0, MAP:!0, Q:!0, SUB:!0, SUP:!0, SPAN:!0, BDO:!0, INPUT:!0, SELECT:!0, TEXTAREA:!0, LABEL:!0, BUTTON:!0};
501
- axs.utils = {};
502
- axs.utils.FOCUSABLE_ELEMENTS_SELECTOR = "input:not([type=hidden]):not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],iframe,[tabindex]";
503
- axs.utils.Color = function(a, b, c, d) {
504
- this.red = a;
505
- this.green = b;
506
- this.blue = c;
507
- this.alpha = d
508
- };
509
- axs.utils.calculateContrastRatio = function(a, b) {
510
- if(!a || !b) {
511
- return null
512
- }
513
- 1 > a.alpha && (a = axs.utils.flattenColors(a, b));
514
- var c = axs.utils.calculateLuminance(a), d = axs.utils.calculateLuminance(b);
515
- return(Math.max(c, d) + 0.05) / (Math.min(c, d) + 0.05)
516
- };
517
- axs.utils.luminanceRatio = function(a, b) {
518
- return(Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05)
519
- };
520
- axs.utils.asElement = function(a) {
521
- switch(a.nodeType) {
522
- case Node.COMMENT_NODE:
368
+ try {
369
+ var b = new goog.global.XMLHttpRequest;
370
+ b.open("get", a, !1);
371
+ b.send();
372
+ return 0 == b.status || 200 == b.status ? b.responseText : null;
373
+ } catch (c) {
523
374
  return null;
524
- case Node.ELEMENT_NODE:
525
- if("script" == a.tagName.toLowerCase()) {
526
- return null
527
- }
528
- break;
529
- case Node.TEXT_NODE:
530
- a = a.parentElement;
531
- break;
532
- default:
533
- return console.warn("Unhandled node type: ", a.nodeType), null
534
- }
535
- return a
536
- };
537
- axs.utils.elementIsTransparent = function(a) {
538
- return"0" == a.style.opacity
539
- };
540
- axs.utils.elementHasZeroArea = function(a) {
541
- a = a.getBoundingClientRect();
542
- var b = a.top - a.bottom;
543
- return a.right - a.left && b ? !1 : !0
544
- };
545
- axs.utils.elementIsOutsideScrollArea = function(a) {
546
- for(var b = a.parentElement, c = a.ownerDocument.defaultView;b != c.document.body;) {
547
- if(axs.utils.isClippedBy(a, b)) {
548
- return!0
549
- }
550
- if(axs.utils.canScrollTo(a, b) && !axs.utils.elementIsOutsideScrollArea(b)) {
551
- return!1
552
- }
553
- b = b.parentElement
554
- }
555
- return!axs.utils.canScrollTo(a, c.document.body)
556
- };
557
- axs.utils.canScrollTo = function(a, b) {
558
- var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top, f = d.left, g = e - b.scrollTop, e = e - b.scrollTop + b.scrollHeight, h = f - b.scrollLeft + b.scrollWidth;
559
- if(c.right < f - b.scrollLeft || c.bottom < g || c.left > h || c.top > e) {
560
- return!1
561
- }
562
- f = a.ownerDocument.defaultView;
563
- g = f.getComputedStyle(b);
564
- return c.left > d.right || c.top > d.bottom ? "scroll" == g.overflow || "auto" == g.overflow || b instanceof f.HTMLBodyElement : !0
565
- };
566
- axs.utils.isClippedBy = function(a, b) {
567
- var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top - b.scrollTop, f = d.left - b.scrollLeft, g = a.ownerDocument.defaultView.getComputedStyle(b);
568
- return(c.right < d.left || c.bottom < d.top || c.left > d.right || c.top > d.bottom) && "hidden" == g.overflow ? !0 : c.right < f || c.bottom < e ? "visible" != g.overflow : !1
569
- };
570
- axs.utils.isAncestor = function(a, b) {
571
- return null == b ? !1 : b === a ? !0 : axs.utils.isAncestor(a, b.parentNode)
572
- };
573
- axs.utils.overlappingElements = function(a) {
574
- if(axs.utils.elementHasZeroArea(a)) {
575
- return null
576
- }
577
- for(var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) {
578
- var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2);
579
- if(null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAncestor(a, e)) {
580
- var f = window.getComputedStyle(e, null);
581
- f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) && b.push(e)
582
375
  }
583
- }
584
- return b
585
- };
586
- axs.utils.elementIsHtmlControl = function(a) {
587
- var b = a.ownerDocument.defaultView;
588
- return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1
589
- };
590
- axs.utils.elementIsAriaWidget = function(a) {
591
- return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.constants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1
592
- };
593
- axs.utils.elementIsVisible = function(a) {
594
- return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).length ? !1 : !0
595
- };
596
- axs.utils.isLargeFont = function(a) {
597
- var b = a.fontSize;
598
- a = "bold" == a.fontWeight;
599
- var c = b.match(/(\d+)px/);
600
- if(c) {
601
- b = parseInt(c[1], 10);
602
- if(c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px/)) {
603
- var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d
604
- }else {
605
- c = 19.2, d = 24
606
- }
607
- return a && b >= c || b >= d
608
- }
609
- if(c = b.match(/(\d+)em/)) {
610
- return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1
611
- }
612
- if(c = b.match(/(\d+)%/)) {
613
- return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1
614
- }
615
- if(c = b.match(/(\d+)pt/)) {
616
- if(b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) {
617
- return!0
376
+ };
377
+ goog.retrieveAndExec_ = function(a, b, c) {
378
+ if (!COMPILED) {
379
+ var d = a;
380
+ a = goog.normalizePath_(a);
381
+ var e = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, f = goog.loadFileSync_(a);
382
+ if (null == f) {
383
+ throw Error('Load of "' + a + '" failed');
384
+ }
385
+ c && (f = goog.transpile_.call(goog.global, f, a));
386
+ f = b ? goog.wrapModule_(a, f) : f + ("\n//# sourceURL=" + a);
387
+ goog.IS_OLD_IE_ ? (goog.dependencies_.deferred[d] = f, goog.queuedModules_.push(d)) : e(a, f);
618
388
  }
619
- }
620
- return!1
621
- };
622
- axs.utils.getBgColor = function(a, b) {
623
- var c = axs.utils.parseColor(a.backgroundColor);
624
- if(!c) {
625
- return null
626
- }
627
- 1 > a.opacity && (c.alpha *= a.opacity);
628
- if(1 > c.alpha) {
629
- var d = axs.utils.getParentBgColor(b);
630
- if(null == d) {
631
- return null
389
+ };
390
+ goog.transpile_ = function(a, b) {
391
+ var c = goog.global.$jscomp;
392
+ c || (goog.global.$jscomp = c = {});
393
+ var d = c.transpile;
394
+ if (!d) {
395
+ var e = goog.basePath + "transpile.js", f = goog.loadFileSync_(e);
396
+ f && (eval(f + "\n//# sourceURL=" + e), c = goog.global.$jscomp, d = c.transpile);
632
397
  }
633
- c = axs.utils.flattenColors(c, d)
634
- }
635
- return c
636
- };
637
- axs.utils.getParentBgColor = function(a) {
638
- var b = a;
639
- a = [];
640
- for(var c = null;b = b.parentElement;) {
641
- var d = window.getComputedStyle(b, null);
642
- if(d) {
643
- var e = axs.utils.parseColor(d.backgroundColor);
644
- if(e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push(e), 1 == e.alpha))) {
645
- c = !0;
646
- break
398
+ d || (d = c.transpile = function(a, b) {
399
+ goog.logToConsole_(b + " requires transpilation but no transpiler was found.");
400
+ return a;
401
+ });
402
+ return d(a, b);
403
+ };
404
+ goog.typeOf = function(a) {
405
+ var b = typeof a;
406
+ if ("object" == b) {
407
+ if (a) {
408
+ if (a instanceof Array) {
409
+ return "array";
410
+ }
411
+ if (a instanceof Object) {
412
+ return b;
413
+ }
414
+ var c = Object.prototype.toString.call(a);
415
+ if ("[object Window]" == c) {
416
+ return "object";
417
+ }
418
+ if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) {
419
+ return "array";
420
+ }
421
+ if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) {
422
+ return "function";
423
+ }
424
+ } else {
425
+ return "null";
426
+ }
427
+ } else {
428
+ if ("function" == b && "undefined" == typeof a.call) {
429
+ return "object";
647
430
  }
648
431
  }
649
- }
650
- c || a.push(new axs.utils.Color(255, 255, 255, 1));
651
- for(b = a.pop();a.length;) {
652
- c = a.pop(), b = axs.utils.flattenColors(c, b)
653
- }
654
- return b
655
- };
656
- axs.utils.getFgColor = function(a, b, c) {
657
- var d = axs.utils.parseColor(a.color);
658
- if(!d) {
659
- return null
660
- }
661
- 1 > d.alpha && (d = axs.utils.flattenColors(d, c));
662
- 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.utils.flattenColors(d, b));
663
- return d
664
- };
665
- axs.utils.parseColor = function(a) {
666
- var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
667
- if(b) {
668
- a = parseInt(b[1], 10);
669
- var c = parseInt(b[2], 10), b = parseInt(b[3], 10), d;
670
- return new axs.utils.Color(a, c, b, 1)
671
- }
672
- return(b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d+(\.\d+)?)\)/)) ? (d = parseInt(b[4], 10), a = parseInt(b[1], 10), c = parseInt(b[2], 10), b = parseInt(b[3], 10), new axs.utils.Color(a, c, b, d)) : null
673
- };
674
- axs.utils.colorChannelToString = function(a) {
675
- a = Math.round(a);
676
- return 15 >= a ? "0" + a.toString(16) : a.toString(16)
677
- };
678
- axs.utils.colorToString = function(a) {
679
- return 1 == a.alpha ? "#" + axs.utils.colorChannelToString(a.red) + axs.utils.colorChannelToString(a.green) + axs.utils.colorChannelToString(a.blue) : "rgba(" + [a.red, a.green, a.blue, a.alpha].join() + ")"
680
- };
681
- axs.utils.luminanceFromContrastRatio = function(a, b, c) {
682
- return c ? (a + 0.05) * b - 0.05 : (a + 0.05) / b - 0.05
683
- };
684
- axs.utils.translateColor = function(a, b) {
685
- var c = a[0], c = (b - c) / ((c > b ? 0 : 1) - c);
686
- return axs.utils.fromYCC([b, a[1] - a[1] * c, a[2] - a[2] * c])
687
- };
688
- axs.utils.suggestColors = function(a, b, c, d) {
689
- if(!axs.utils.isLowContrast(c, d, !0)) {
690
- return null
691
- }
692
- var e = {}, f = axs.utils.calculateLuminance(a), g = axs.utils.calculateLuminance(b), h = axs.utils.isLargeFont(d) ? 3 : 4.5, k = axs.utils.isLargeFont(d) ? 4.5 : 7, m = g > f, l = axs.utils.luminanceFromContrastRatio(f, h + 0.02, m), n = axs.utils.luminanceFromContrastRatio(f, k + 0.02, m), q = axs.utils.toYCC(b);
693
- if(axs.utils.isLowContrast(c, d, !1) && 1 >= l && 0 <= l) {
694
- var p = axs.utils.translateColor(q, l), l = axs.utils.calculateContrastRatio(p, a);
695
- axs.utils.calculateLuminance(p);
696
- f = {};
697
- f.fg = axs.utils.colorToString(p);
698
- f.bg = axs.utils.colorToString(a);
699
- f.contrast = l.toFixed(2);
700
- e.AA = f
701
- }
702
- axs.utils.isLowContrast(c, d, !0) && 1 >= n && 0 <= n && (n = axs.utils.translateColor(q, n), l = axs.utils.calculateContrastRatio(n, a), f = {}, f.fg = axs.utils.colorToString(n), f.bg = axs.utils.colorToString(a), f.contrast = l.toFixed(2), e.AAA = f);
703
- h = axs.utils.luminanceFromContrastRatio(g, h + 0.02, !m);
704
- g = axs.utils.luminanceFromContrastRatio(g, k + 0.02, !m);
705
- a = axs.utils.toYCC(a);
706
- !("AA" in e) && axs.utils.isLowContrast(c, d, !1) && 1 >= h && 0 <= h && (k = axs.utils.translateColor(a, h), l = axs.utils.calculateContrastRatio(b, k), f = {}, f.bg = axs.utils.colorToString(k), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AA = f);
707
- !("AAA" in e) && axs.utils.isLowContrast(c, d, !0) && 1 >= g && 0 <= g && (c = axs.utils.translateColor(a, g), l = axs.utils.calculateContrastRatio(b, c), f = {}, f.bg = axs.utils.colorToString(c), f.fg = axs.utils.colorToString(b), f.contrast = l.toFixed(2), e.AAA = f);
708
- return e
709
- };
710
- axs.utils.flattenColors = function(a, b) {
711
- var c = a.alpha;
712
- return new axs.utils.Color((1 - c) * b.red + c * a.red, (1 - c) * b.green + c * a.green, (1 - c) * b.blue + c * a.blue, a.alpha + b.alpha * (1 - a.alpha))
713
- };
714
- axs.utils.calculateLuminance = function(a) {
715
- return axs.utils.toYCC(a)[0]
716
- };
717
- axs.utils.RGBToYCCMatrix = function(a, b) {
718
- return[[a, 1 - a - b, b], [-a / (2 - 2 * b), (a + b - 1) / (2 - 2 * b), (1 - b) / (2 - 2 * b)], [(1 - a) / (2 - 2 * a), (a + b - 1) / (2 - 2 * a), -b / (2 - 2 * a)]]
719
- };
720
- axs.utils.invert3x3Matrix = function(a) {
721
- var b = a[0][0], c = a[0][1], d = a[0][2], e = a[1][0], f = a[1][1], g = a[1][2], h = a[2][0], k = a[2][1];
722
- a = a[2][2];
723
- return axs.utils.scalarMultiplyMatrix([[f * a - g * k, d * k - c * a, c * g - d * f], [g * h - e * a, b * a - d * h, d * e - b * g], [e * k - f * h, h * c - b * k, b * f - c * e]], 1 / (b * (f * a - g * k) - c * (a * e - g * h) + d * (e * k - f * h)))
724
- };
725
- axs.utils.scalarMultiplyMatrix = function(a, b) {
726
- for(var c = [[], [], []], d = 0;3 > d;d++) {
727
- for(var e = 0;3 > e;e++) {
728
- c[d][e] = a[d][e] * b
432
+ return b;
433
+ };
434
+ goog.isNull = function(a) {
435
+ return null === a;
436
+ };
437
+ goog.isDefAndNotNull = function(a) {
438
+ return null != a;
439
+ };
440
+ goog.isArray = function(a) {
441
+ return "array" == goog.typeOf(a);
442
+ };
443
+ goog.isArrayLike = function(a) {
444
+ var b = goog.typeOf(a);
445
+ return "array" == b || "object" == b && "number" == typeof a.length;
446
+ };
447
+ goog.isDateLike = function(a) {
448
+ return goog.isObject(a) && "function" == typeof a.getFullYear;
449
+ };
450
+ goog.isString = function(a) {
451
+ return "string" == typeof a;
452
+ };
453
+ goog.isBoolean = function(a) {
454
+ return "boolean" == typeof a;
455
+ };
456
+ goog.isNumber = function(a) {
457
+ return "number" == typeof a;
458
+ };
459
+ goog.isFunction = function(a) {
460
+ return "function" == goog.typeOf(a);
461
+ };
462
+ goog.isObject = function(a) {
463
+ var b = typeof a;
464
+ return "object" == b && null != a || "function" == b;
465
+ };
466
+ goog.getUid = function(a) {
467
+ return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_);
468
+ };
469
+ goog.hasUid = function(a) {
470
+ return !!a[goog.UID_PROPERTY_];
471
+ };
472
+ goog.removeUid = function(a) {
473
+ null !== a && "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_);
474
+ try {
475
+ delete a[goog.UID_PROPERTY_];
476
+ } catch (b) {
729
477
  }
730
- }
731
- return c
732
- };
733
- axs.utils.kR = 0.2126;
734
- axs.utils.kB = 0.0722;
735
- axs.utils.YCC_MATRIX = axs.utils.RGBToYCCMatrix(axs.utils.kR, axs.utils.kB);
736
- axs.utils.INVERTED_YCC_MATRIX = axs.utils.invert3x3Matrix(axs.utils.YCC_MATRIX);
737
- axs.utils.convertColor = function(a, b) {
738
- var c = b[0], d = b[1], e = b[2];
739
- return[a[0][0] * c + a[0][1] * d + a[0][2] * e, a[1][0] * c + a[1][1] * d + a[1][2] * e, a[2][0] * c + a[2][1] * d + a[2][2] * e]
740
- };
741
- axs.utils.multiplyMatrices = function(a, b) {
742
- for(var c = [[], [], []], d = 0;3 > d;d++) {
743
- for(var e = 0;3 > e;e++) {
744
- c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e]
478
+ };
479
+ goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0);
480
+ goog.uidCounter_ = 0;
481
+ goog.getHashCode = goog.getUid;
482
+ goog.removeHashCode = goog.removeUid;
483
+ goog.cloneObject = function(a) {
484
+ var b = goog.typeOf(a);
485
+ if ("object" == b || "array" == b) {
486
+ if (a.clone) {
487
+ return a.clone();
488
+ }
489
+ var b = "array" == b ? [] : {}, c;
490
+ for (c in a) {
491
+ b[c] = goog.cloneObject(a[c]);
492
+ }
493
+ return b;
745
494
  }
746
- }
747
- return c
748
- };
749
- axs.utils.toYCC = function(a) {
750
- var b = a.red / 255, c = a.green / 255;
751
- a = a.blue / 255;
752
- b = 0.03928 >= b ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);
753
- c = 0.03928 >= c ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
754
- a = 0.03928 >= a ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
755
- return axs.utils.convertColor(axs.utils.YCC_MATRIX, [b, c, a])
756
- };
757
- axs.utils.fromYCC = function(a) {
758
- var b = axs.utils.convertColor(axs.utils.INVERTED_YCC_MATRIX, a), c = b[0];
759
- a = b[1];
760
- b = b[2];
761
- c = 0.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
762
- a = 0.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - 0.055;
763
- b = 0.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - 0.055;
764
- c = Math.min(Math.max(Math.round(255 * c), 0), 255);
765
- a = Math.min(Math.max(Math.round(255 * a), 0), 255);
766
- b = Math.min(Math.max(Math.round(255 * b), 0), 255);
767
- return new axs.utils.Color(c, a, b, 1)
768
- };
769
- axs.utils.scalarMultiplyMatrix = function(a, b) {
770
- for(var c = [[], [], []], d = 0;3 > d;d++) {
771
- for(var e = 0;3 > e;e++) {
772
- c[d][e] = a[d][e] * b
495
+ return a;
496
+ };
497
+ goog.bindNative_ = function(a, b, c) {
498
+ return a.call.apply(a.bind, arguments);
499
+ };
500
+ goog.bindJs_ = function(a, b, c) {
501
+ if (!a) {
502
+ throw Error();
773
503
  }
774
- }
775
- return c
776
- };
777
- axs.utils.multiplyMatrices = function(a, b) {
778
- for(var c = [[], [], []], d = 0;3 > d;d++) {
779
- for(var e = 0;3 > e;e++) {
780
- c[d][e] = a[d][0] * b[0][e] + a[d][1] * b[1][e] + a[d][2] * b[2][e]
504
+ if (2 < arguments.length) {
505
+ var d = Array.prototype.slice.call(arguments, 2);
506
+ return function() {
507
+ var c = Array.prototype.slice.call(arguments);
508
+ Array.prototype.unshift.apply(c, d);
509
+ return a.apply(b, c);
510
+ };
781
511
  }
782
- }
783
- return c
784
- };
785
- axs.utils.getContrastRatioForElement = function(a) {
786
- var b = window.getComputedStyle(a, null);
787
- return axs.utils.getContrastRatioForElementWithComputedStyle(b, a)
788
- };
789
- axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) {
790
- if(axs.utils.isElementHidden(b)) {
791
- return null
792
- }
793
- var c = axs.utils.getBgColor(a, b);
794
- if(!c) {
795
- return null
796
- }
797
- var d = axs.utils.getFgColor(a, b, c);
798
- return d ? axs.utils.calculateContrastRatio(d, c) : null
799
- };
800
- axs.utils.isNativeTextElement = function(a) {
801
- var b = a.tagName.toLowerCase();
802
- a = a.type ? a.type.toLowerCase() : "";
803
- if("textarea" == b) {
804
- return!0
805
- }
806
- if("input" != b) {
807
- return!1
808
- }
809
- switch(a) {
810
- case "email":
811
- ;
812
- case "number":
813
- ;
814
- case "password":
815
- ;
816
- case "search":
817
- ;
818
- case "text":
819
- ;
820
- case "tel":
821
- ;
822
- case "url":
823
- ;
824
- case "":
825
- return!0;
826
- default:
827
- return!1
828
- }
829
- };
830
- axs.utils.isLowContrast = function(a, b, c) {
831
- a = Math.round(10 * a) / 10;
832
- return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils.isLargeFont(b) && 4.5 > a
833
- };
834
- axs.utils.hasLabel = function(a) {
835
- var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : "";
836
- if(a.hasAttribute("aria-label") || a.hasAttribute("title") || "img" == b && a.hasAttribute("alt") || "input" == b && "image" == c && a.hasAttribute("alt") || "input" == b && ("submit" == c || "reset" == c) || a.hasAttribute("aria-labelledby") || axs.utils.isNativeTextElement(a) && a.hasAttribute("placeholder") || a.hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]').length) {
837
- return!0
838
- }
839
- for(b = a.parentElement;b;) {
840
- if("label" == b.tagName.toLowerCase() && b.control == a) {
841
- return!0
512
+ return function() {
513
+ return a.apply(b, arguments);
514
+ };
515
+ };
516
+ goog.bind = function(a, b, c) {
517
+ Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_;
518
+ return goog.bind.apply(null, arguments);
519
+ };
520
+ goog.partial = function(a, b) {
521
+ var c = Array.prototype.slice.call(arguments, 1);
522
+ return function() {
523
+ var b = c.slice();
524
+ b.push.apply(b, arguments);
525
+ return a.apply(this, b);
526
+ };
527
+ };
528
+ goog.mixin = function(a, b) {
529
+ for (var c in b) {
530
+ a[c] = b[c];
842
531
  }
843
- b = b.parentElement
844
- }
845
- return!1
846
- };
847
- axs.utils.isElementHidden = function(a) {
848
- if(!(a instanceof a.ownerDocument.defaultView.HTMLElement)) {
849
- return!1
850
- }
851
- if(a.hasAttribute("chromevoxignoreariahidden")) {
852
- var b = !0
853
- }
854
- var c = window.getComputedStyle(a, null);
855
- return"none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1
856
- };
857
- axs.utils.isElementOrAncestorHidden = function(a) {
858
- return axs.utils.isElementHidden(a) ? !0 : a.parentElement ? axs.utils.isElementOrAncestorHidden(a.parentElement) : !1
859
- };
860
- axs.utils.isInlineElement = function(a) {
861
- a = a.tagName.toUpperCase();
862
- return axs.constants.InlineElements[a]
863
- };
864
- axs.utils.getRoles = function(a) {
865
- if(!a.hasAttribute("role")) {
866
- return!1
867
- }
868
- a = a.getAttribute("role").split(" ");
869
- for(var b = [], c = !0, d = 0;d < a.length;d++) {
870
- var e = a[d];
871
- axs.constants.ARIA_ROLES[e] ? b.push({name:e, details:axs.constants.ARIA_ROLES[e], valid:!0}) : (b.push({name:e, valid:!1}), c = !1)
872
- }
873
- return{roles:b, valid:c}
874
- };
875
- axs.utils.getAriaPropertyValue = function(a, b, c) {
876
- var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {name:a, rawValue:b};
877
- if(!e) {
878
- return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d
879
- }
880
- e = e.valueType;
881
- if(!e) {
882
- return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d
883
- }
884
- switch(e) {
885
- case "idref":
886
- a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.reason, d.idref = a.idref;
887
- case "idref_list":
888
- a = b.split(/\s+/);
889
- d.valid = !0;
890
- for(b = 0;b < a.length;b++) {
891
- e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.values ? d.values.push(e) : d.values = [e]
892
- }
893
- return d;
894
- case "integer":
895
- ;
896
- case "decimal":
897
- c = axs.utils.isValidNumber(b);
898
- if(!c.valid) {
899
- return d.valid = !1, d.reason = c.reason, d
900
- }
901
- Math.floor(c.value) != c.value ? (d.valid = !1, d.reason = "" + b + " is not a whole integer") : (d.valid = !0, d.value = c.value);
902
- return d;
903
- case "number":
904
- c = axs.utils.isValidNumber(b), c.valid && (d.valid = !0, d.value = c.value);
905
- case "string":
906
- return d.valid = !0, d.value = b, d;
907
- case "token":
908
- return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
909
- case "token_list":
910
- e = b.split(/\s+/);
911
- d.valid = !0;
912
- for(b = 0;b < e.length;b++) {
913
- c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.valid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reason = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c.value) : d.values = [c.value]
914
- }
915
- return d;
916
- case "tristate":
917
- return c = axs.utils.isPossibleValue(b.toLowerCase(), axs.constants.MIXED_VALUES, a), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
918
- case "boolean":
919
- return c = axs.utils.isValidBoolean(b), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d
920
- }
921
- d.valid = !1;
922
- d.reason = "Not a valid ARIA property";
923
- return d
924
- };
925
- axs.utils.isValidTokenValue = function(a, b) {
926
- var c = a.replace(/^aria-/, "");
927
- return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet, a)
928
- };
929
- axs.utils.isPossibleValue = function(a, b, c) {
930
- return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)}
931
- };
932
- axs.utils.isValidBoolean = function(a) {
933
- try {
934
- var b = JSON.parse(a)
935
- }catch(c) {
936
- b = ""
937
- }
938
- return"boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b}
939
- };
940
- axs.utils.isValidIDRefValue = function(a, b) {
941
- return 0 == a.length ? {valid:!0, idref:a} : b.ownerDocument.getElementById(a) ? {valid:!0, idref:a} : {valid:!1, idref:a, reason:'No element with ID "' + a + '"'}
942
- };
943
- axs.utils.isValidNumber = function(a) {
944
- try {
945
- var b = JSON.parse(a)
946
- }catch(c) {
947
- return{valid:!1, value:a, reason:'"' + a + '" is not a number'}
948
- }
949
- return"number" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a number'} : {valid:!0, value:b}
950
- };
951
- axs.utils.isElementImplicitlyFocusable = function(a) {
952
- var b = a.ownerDocument.defaultView;
953
- return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a.hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonElement || a instanceof b.HTMLIFrameElement ? !a.disabled : !1
954
- };
955
- axs.utils.values = function(a) {
956
- var b = [], c;
957
- for(c in a) {
958
- a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c])
959
- }
960
- return b
961
- };
962
- axs.utils.namedValues = function(a) {
963
- var b = {}, c;
964
- for(c in a) {
965
- a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c])
966
- }
967
- return b
968
- };
969
- axs.utils.getQuerySelectorText = function(a) {
970
- if(null == a || "HTML" == a.tagName) {
971
- return"html"
972
- }
973
- if("BODY" == a.tagName) {
974
- return"body"
975
- }
976
- if(a.hasAttribute) {
977
- if(a.id) {
978
- return"#" + a.id
979
- }
980
- if(a.className) {
981
- for(var b = "", c = 0;c < a.classList.length;c++) {
982
- b += "." + a.classList[c]
983
- }
984
- var d = 0;
985
- if(a.parentNode) {
986
- for(c = 0;c < a.parentNode.children.length;c++) {
987
- var e = a.parentNode.children[c];
988
- axs.browserUtils.matchSelector(e, b) && d++;
989
- if(e === a) {
990
- break
532
+ };
533
+ goog.now = goog.TRUSTED_SITE && Date.now || function() {
534
+ return +new Date;
535
+ };
536
+ goog.globalEval = function(a) {
537
+ if (goog.global.execScript) {
538
+ goog.global.execScript(a, "JavaScript");
539
+ } else {
540
+ if (goog.global.eval) {
541
+ if (null == goog.evalWorksForGlobals_) {
542
+ if (goog.global.eval("var _evalTest_ = 1;"), "undefined" != typeof goog.global._evalTest_) {
543
+ try {
544
+ delete goog.global._evalTest_;
545
+ } catch (d) {
546
+ }
547
+ goog.evalWorksForGlobals_ = !0;
548
+ } else {
549
+ goog.evalWorksForGlobals_ = !1;
991
550
  }
992
551
  }
993
- }else {
994
- d = 1
552
+ if (goog.evalWorksForGlobals_) {
553
+ goog.global.eval(a);
554
+ } else {
555
+ var b = goog.global.document, c = b.createElement("SCRIPT");
556
+ c.type = "text/javascript";
557
+ c.defer = !1;
558
+ c.appendChild(b.createTextNode(a));
559
+ b.body.appendChild(c);
560
+ b.body.removeChild(c);
561
+ }
562
+ } else {
563
+ throw Error("goog.globalEval not available");
995
564
  }
996
- return 1 == d ? axs.utils.getQuerySelectorText(a.parentNode) + " > " + b : axs.utils.getQuerySelectorText(a.parentNode) + " > " + b + ":nth-of-type(" + d + ")"
997
565
  }
998
- if(a.parentNode) {
999
- b = a.parentNode.children;
1000
- d = 1;
1001
- for(c = 0;b[c] !== a;) {
1002
- b[c].tagName == a.tagName && d++, c++
566
+ };
567
+ goog.evalWorksForGlobals_ = null;
568
+ goog.getCssName = function(a, b) {
569
+ var c = function(a) {
570
+ return goog.cssNameMapping_[a] || a;
571
+ }, d = function(a) {
572
+ a = a.split("-");
573
+ for (var b = [], d = 0;d < a.length;d++) {
574
+ b.push(c(a[d]));
1003
575
  }
1004
- c = "";
1005
- "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.parentNode) + " > ");
1006
- return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")"
576
+ return b.join("-");
577
+ }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) {
578
+ return a;
579
+ };
580
+ return b ? a + "-" + d(b) : d(a);
581
+ };
582
+ goog.setCssNameMapping = function(a, b) {
583
+ goog.cssNameMapping_ = a;
584
+ goog.cssNameMappingStyle_ = b;
585
+ };
586
+ !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING);
587
+ goog.getMsg = function(a, b) {
588
+ b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) {
589
+ return null != b && d in b ? b[d] : a;
590
+ }));
591
+ return a;
592
+ };
593
+ goog.getMsgWithFallback = function(a, b) {
594
+ return a;
595
+ };
596
+ goog.exportSymbol = function(a, b, c) {
597
+ goog.exportPath_(a, b, c);
598
+ };
599
+ goog.exportProperty = function(a, b, c) {
600
+ a[b] = c;
601
+ };
602
+ goog.inherits = function(a, b) {
603
+ function c() {
1007
604
  }
1008
- }else {
1009
- if(a.selectorText) {
1010
- return a.selectorText
605
+ c.prototype = b.prototype;
606
+ a.superClass_ = b.prototype;
607
+ a.prototype = new c;
608
+ a.prototype.constructor = a;
609
+ a.base = function(a, c, f) {
610
+ for (var g = Array(arguments.length - 2), h = 2;h < arguments.length;h++) {
611
+ g[h - 2] = arguments[h];
612
+ }
613
+ return b.prototype[c].apply(a, g);
614
+ };
615
+ };
616
+ goog.base = function(a, b, c) {
617
+ var d = arguments.callee.caller;
618
+ if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) {
619
+ 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");
1011
620
  }
1012
- }
1013
- return""
1014
- };
1015
- axs.properties = {};
1016
- axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*[name()!="script"]';
1017
- axs.properties.getFocusProperties = function(a) {
1018
- var b = {}, c = a.getAttribute("tabindex");
1019
- void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitlyFocusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0});
1020
- if(0 == Object.keys(b).length) {
1021
- return null
1022
- }
1023
- var d = axs.utils.elementIsTransparent(a), e = axs.utils.elementHasZeroArea(a), f = axs.utils.elementIsOutsideScrollArea(a), g = axs.utils.overlappingElements(a);
1024
- if(d || e || f || 0 < g.length) {
1025
- var c = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:c};
1026
- d && (h.transparent = !0);
1027
- e && (h.zeroArea = !0);
1028
- f && (h.outsideScrollArea = !0);
1029
- g && 0 < g.length && (h.overlappingElements = g);
1030
- d = {value:c, valid:c};
1031
- c && (d.reason = axs.properties.getHiddenReason(a));
1032
- h.hidden = d;
1033
- b.visible = h
1034
- }else {
1035
- b.visible = {value:!0, valid:!0}
1036
- }
1037
- return b
1038
- };
1039
- axs.properties.getHiddenReason = function(a) {
1040
- if(!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) {
1041
- return null
1042
- }
1043
- if(a.hasAttribute("chromevoxignoreariahidden")) {
1044
- var b = !0
1045
- }
1046
- var c = window.getComputedStyle(a, null);
1047
- return"none" == c.display ? {property:"display: none", on:a} : "hidden" == c.visibility ? {property:"visibility: hidden", on:a} : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() && !b ? {property:"aria-hidden", on:a} : axs.properties.getHiddenReason(a.parentElement)
1048
- };
1049
- axs.properties.getColorProperties = function(a) {
1050
- var b = {};
1051
- (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a);
1052
- return 0 == Object.keys(b).length ? null : b
1053
- };
1054
- axs.properties.hasDirectTextDescendant = function(a) {
1055
- for(var b = (a.nodeType == Node.DOCUMENT_NODE ? a : a.ownerDocument).evaluate(axs.properties.TEXT_CONTENT_XPATH, a, null, XPathResult.ANY_TYPE, null), c = !1, d = b.iterateNext();null != d;d = b.iterateNext()) {
1056
- if(d === a) {
1057
- c = !0;
1058
- break
621
+ if (d.superClass_) {
622
+ for (var e = Array(arguments.length - 1), f = 1;f < arguments.length;f++) {
623
+ e[f - 1] = arguments[f];
624
+ }
625
+ return d.superClass_.constructor.apply(a, e);
1059
626
  }
1060
- }
1061
- return c
1062
- };
1063
- axs.properties.getContrastRatioProperties = function(a) {
1064
- if(!axs.properties.hasDirectTextDescendant(a)) {
1065
- return null
1066
- }
1067
- var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a);
1068
- if(!d) {
1069
- return null
1070
- }
1071
- b.backgroundColor = axs.utils.colorToString(d);
1072
- var e = axs.utils.getFgColor(c, a, d);
1073
- b.foregroundColor = axs.utils.colorToString(e);
1074
- a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a);
1075
- if(!a) {
1076
- return null
1077
- }
1078
- b.value = a.toFixed(2);
1079
- axs.utils.isLowContrast(a, c) && (b.alert = !0);
1080
- (c = axs.utils.suggestColors(d, e, a, c)) && Object.keys(c).length && (b.suggestedColors = c);
1081
- return b
1082
- };
1083
- axs.properties.findTextAlternatives = function(a, b, c, d) {
1084
- var e = c || !1;
1085
- c = axs.utils.asElement(a);
1086
- if(!c || !e && !d && axs.utils.isElementOrAncestorHidden(c)) {
1087
- return null
1088
- }
1089
- if(a.nodeType == Node.TEXT_NODE) {
1090
- return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.properties.getLastWord(c.text), b.content = c, a.textContent
1091
- }
1092
- a = null;
1093
- e || (a = axs.properties.getTextFromAriaLabelledby(c, b));
1094
- c.hasAttribute("aria-label") && (d = {type:"text"}, d.text = c.getAttribute("aria-label"), d.lastWord = axs.properties.getLastWord(d.text), a ? d.unused = !0 : e && axs.utils.elementIsHtmlControl(c) || (a = d.text), b.ariaLabel = d);
1095
- c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs.properties.getTextFromHostLanguageAttributes(c, b, a, e));
1096
- if(e && axs.utils.elementIsHtmlControl(c)) {
1097
- d = c.ownerDocument.defaultView;
1098
- if(c instanceof d.HTMLInputElement) {
1099
- var f = c;
1100
- "text" == f.type && f.value && 0 < f.value.length && (b.controlValue = {text:f.value});
1101
- "range" == f.type && (b.controlValue = {text:f.value})
1102
- }
1103
- c instanceof d.HTMLSelectElement && (b.controlValue = {text:c.value});
1104
- b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text)
1105
- }
1106
- if(e && axs.utils.elementIsAriaWidget(c)) {
1107
- e = c.getAttribute("role");
1108
- "textbox" == e && c.textContent && 0 < c.textContent.length && (b.controlValue = {text:c.textContent});
1109
- if("slider" == e || "spinbutton" == e) {
1110
- c.hasAttribute("aria-valuetext") ? b.controlValue = {text:c.getAttribute("aria-valuetext")} : c.hasAttribute("aria-valuenow") && (b.controlValue = {value:c.getAttribute("aria-valuenow"), text:"" + c.getAttribute("aria-valuenow")})
1111
- }
1112
- if("menu" == e) {
1113
- var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]");
1114
- d = [];
1115
- for(f = 0;f < g.length;f++) {
1116
- "true" == g[f].getAttribute("aria-checked") && d.push(g[f])
1117
- }
1118
- if(0 < d.length) {
1119
- g = "";
1120
- for(f = 0;f < d.length;f++) {
1121
- g += axs.properties.findTextAlternatives(d[f], {}, !0), f < d.length - 1 && (g += ", ")
627
+ e = Array(arguments.length - 2);
628
+ for (f = 2;f < arguments.length;f++) {
629
+ e[f - 2] = arguments[f];
630
+ }
631
+ for (var f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) {
632
+ if (g.prototype[b] === d) {
633
+ f = !0;
634
+ } else {
635
+ if (f) {
636
+ return g.prototype[b].apply(a, e);
1122
637
  }
1123
- b.controlValue = {text:g}
1124
638
  }
1125
639
  }
1126
- if("combobox" == e || "select" == e) {
1127
- b.controlValue = {text:"TODO"}
640
+ if (a[b] === d) {
641
+ return a.constructor.prototype[b].apply(a, e);
1128
642
  }
1129
- b.controlValue && (d = b.controlValue, a ? d.unused = !0 : a = d.text)
1130
- }
1131
- d = !0;
1132
- c.hasAttribute("role") && (e = c.getAttribute("role"), (e = axs.constants.ARIA_ROLES[e]) && (!e.namefrom || 0 > e.namefrom.indexOf("contents")) && (d = !1));
1133
- (e = axs.properties.getTextFromDescendantContent(c)) && d && (d = {type:"text"}, d.text = e, d.lastWord = axs.properties.getLastWord(d.text), a ? d.unused = !0 : a = e, b.content = d);
1134
- c.hasAttribute("title") && (e = {type:"string", valid:!0}, e.text = c.getAttribute("title"), e.lastWord = axs.properties.getLastWord(e.lastWord), a ? e.unused = !0 : a = e.text, b.title = e);
1135
- return 0 == Object.keys(b).length && null == a ? null : a
1136
- };
1137
- axs.properties.getTextFromDescendantContent = function(a) {
1138
- var b = a.childNodes;
1139
- a = [];
1140
- for(var c = 0;c < b.length;c++) {
1141
- var d = axs.properties.findTextAlternatives(b[c], {}, !0);
1142
- d && a.push(d.trim())
1143
- }
1144
- if(a.length) {
1145
- b = "";
1146
- for(c = 0;c < a.length;c++) {
1147
- b = [b, a[c]].join(" ").trim()
643
+ throw Error("goog.base called from a method of one name to a method of a different name");
644
+ };
645
+ goog.scope = function(a) {
646
+ if (goog.isInModuleLoader_()) {
647
+ throw Error("goog.scope is not supported within a goog.module.");
1148
648
  }
1149
- return b
1150
- }
1151
- return null
1152
- };
1153
- axs.properties.getTextFromAriaLabelledby = function(a, b) {
1154
- var c = null;
1155
- if(!a.hasAttribute("aria-labelledby")) {
1156
- return c
1157
- }
1158
- for(var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) {
1159
- var k = {type:"element"}, m = d[h];
1160
- k.value = m;
1161
- var l = document.getElementById(m);
1162
- l ? (k.valid = !0, k.text = axs.properties.findTextAlternatives(l, {}, !0), k.lastWord = axs.properties.getLastWord(k.text), f.push(l.textContent.trim()), k.element = l) : (k.valid = !1, e.valid = !1, k.errorMessage = {messageKey:"noElementWithId", args:[m]});
1163
- g.push(k)
1164
- }
1165
- 0 < g.length && (g[g.length - 1].last = !0, e.values = g, e.text = f.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c = e.text, b.ariaLabelledby = e);
1166
- return c
1167
- };
1168
- axs.properties.getTextFromHostLanguageAttributes = function(a, b, c, d) {
1169
- if(axs.browserUtils.matchSelector(a, "img")) {
1170
- if(a.hasAttribute("alt")) {
1171
- var e = {type:"string", valid:!0};
1172
- e.text = a.getAttribute("alt");
1173
- c ? e.unused = !0 : c = e.text;
1174
- b.alt = e
1175
- }else {
1176
- e = {valid:!1, errorMessage:"No alt value provided"}, b.alt = e, e = a.src, "string" == typeof e && (c = e.split("/").pop(), b.filename = {text:c})
649
+ a.call(goog.global);
650
+ };
651
+ COMPILED || (goog.global.COMPILED = COMPILED);
652
+ goog.defineClass = function(a, b) {
653
+ var c = b.constructor, d = b.statics;
654
+ c && c != Object.prototype.constructor || (c = function() {
655
+ throw Error("cannot instantiate an interface (no constructor defined).");
656
+ });
657
+ c = goog.defineClass.createSealingConstructor_(c, a);
658
+ a && goog.inherits(c, a);
659
+ delete b.constructor;
660
+ delete b.statics;
661
+ goog.defineClass.applyProperties_(c.prototype, b);
662
+ null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_(c, d));
663
+ return c;
664
+ };
665
+ goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG;
666
+ goog.defineClass.createSealingConstructor_ = function(a, b) {
667
+ if (!goog.defineClass.SEAL_CLASS_INSTANCES) {
668
+ return a;
1177
669
  }
1178
- }
1179
- if(axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])') && !d) {
1180
- if(a.hasAttribute("id")) {
1181
- d = document.querySelectorAll('label[for="' + a.id + '"]');
1182
- for(var e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1183
- var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternatives(m, {}, !0);
1184
- l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim()));
1185
- k.element = m;
1186
- f.push(k)
1187
- }
1188
- 0 < f.length && (f[f.length - 1].last = !0, e.values = f, e.text = g.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c ? e.unused = !0 : c = e.text, b.labelFor = e)
1189
- }
1190
- d = a.parentElement;
1191
- for(e = {};d;) {
1192
- if("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) {
1193
- e.type = "element";
1194
- e.text = axs.properties.findTextAlternatives(f, {}, !0);
1195
- e.lastWord = axs.properties.getLastWord(e.text);
1196
- e.element = f;
1197
- break
1198
- }
1199
- d = d.parentElement
1200
- }
1201
- e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e);
1202
- Object.keys(b).length || (b.noLabel = !0)
1203
- }
1204
- return c
1205
- };
1206
- axs.properties.getLastWord = function(a) {
1207
- if(!a) {
1208
- return null
1209
- }
1210
- var b = a.lastIndexOf(" ") + 1, c = a.length - 10;
1211
- return a.substring(b > c ? b : c)
1212
- };
1213
- axs.properties.getTextProperties = function(a) {
1214
- var b = {};
1215
- a = axs.properties.findTextAlternatives(a, b, !1, !0);
1216
- if(0 == Object.keys(b).length) {
1217
- if(!a) {
1218
- return null
1219
- }
1220
- b.hasProperties = !1
1221
- }else {
1222
- b.hasProperties = !0
1223
- }
1224
- b.computedText = a;
1225
- b.lastWord = axs.properties.getLastWord(a);
1226
- return b
1227
- };
1228
- axs.properties.getAriaProperties = function(a) {
1229
- var b = {}, c = axs.properties.getGlobalAriaProperties(a), d;
1230
- for(d in axs.constants.ARIA_PROPERTIES) {
1231
- var e = "aria-" + d;
1232
- if(a.hasAttribute(e)) {
1233
- var f = a.getAttribute(e);
1234
- c[e] = axs.utils.getAriaPropertyValue(e, f, a)
670
+ var c = !goog.defineClass.isUnsealable_(b), d = function() {
671
+ var b = a.apply(this, arguments) || this;
672
+ b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_];
673
+ this.constructor === d && c && Object.seal instanceof Function && Object.seal(b);
674
+ return b;
675
+ };
676
+ return d;
677
+ };
678
+ goog.defineClass.isUnsealable_ = function(a) {
679
+ return a && a.prototype && a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_];
680
+ };
681
+ goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
682
+ goog.defineClass.applyProperties_ = function(a, b) {
683
+ for (var c in b) {
684
+ Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]);
1235
685
  }
1236
- }
1237
- 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1238
- f = axs.utils.getRoles(a);
1239
- if(!f) {
1240
- return Object.keys(b).length ? b : null
1241
- }
1242
- b.roles = f;
1243
- if(!f.valid || !f.roles) {
1244
- return b
1245
- }
1246
- for(var e = f.roles, g = 0;g < e.length;g++) {
1247
- var h = e[g];
1248
- if(h.details && h.details.propertiesSet) {
1249
- for(d in h.details.propertiesSet) {
1250
- d in c || (a.hasAttribute(d) ? (f = a.getAttribute(d), c[d] = axs.utils.getAriaPropertyValue(d, f, a), "values" in c[d] && (f = c[d].values, f[f.length - 1].isLast = !0)) : h.details.requiredPropertiesSet[d] && (c[d] = {name:d, valid:!1, reason:"Required property not set"}))
686
+ for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) {
687
+ c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]);
688
+ }
689
+ };
690
+ goog.tagUnsealableClass = function(a) {
691
+ !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0);
692
+ };
693
+ goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable";
694
+ var axs = {};
695
+ axs.browserUtils = {};
696
+ axs.browserUtils.matchSelector = function(a, b) {
697
+ return a.matches ? a.matches(b) : a.webkitMatchesSelector ? a.webkitMatchesSelector(b) : a.mozMatchesSelector ? a.mozMatchesSelector(b) : a.msMatchesSelector ? a.msMatchesSelector(b) : !1;
698
+ };
699
+ axs.constants = {};
700
+ axs.constants.ARIA_ROLES = {alert:{namefrom:["author"], parent:["region"]}, alertdialog:{namefrom:["author"], namerequired:!0, parent:["alert", "dialog"]}, application:{namefrom:["author"], namerequired:!0, parent:["landmark"]}, article:{namefrom:["author"], parent:["document", "region"]}, banner:{namefrom:["author"], parent:["landmark"]}, button:{childpresentational:!0, namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded", "aria-pressed"]}, checkbox:{namefrom:["contents",
701
+ "author"], namerequired:!0, parent:["input"], requiredProperties:["aria-checked"], properties:["aria-checked"]}, columnheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"], scope:["row"]}, combobox:{mustcontain:["listbox", "textbox"], namefrom:["author"], namerequired:!0, parent:["select"], requiredProperties:["aria-expanded"], properties:["aria-expanded", "aria-autocomplete", "aria-required"]}, command:{"abstract":!0, namefrom:["author"],
702
+ parent:["widget"]}, complementary:{namefrom:["author"], parent:["landmark"]}, composite:{"abstract":!0, childpresentational:!1, namefrom:["author"], parent:["widget"], properties:["aria-activedescendant"]}, contentinfo:{namefrom:["author"], parent:["landmark"]}, definition:{namefrom:["author"], parent:["section"]}, dialog:{namefrom:["author"], namerequired:!0, parent:["window"]}, directory:{namefrom:["contents", "author"], parent:["list"]}, document:{namefrom:[" author"], namerequired:!0, parent:["structure"],
703
+ properties:["aria-expanded"]}, form:{namefrom:["author"], parent:["landmark"]}, grid:{mustcontain:["row", "rowgroup"], namefrom:["author"], namerequired:!0, parent:["composite", "region"], properties:["aria-level", "aria-multiselectable", "aria-readonly"]}, gridcell:{namefrom:["contents", "author"], namerequired:!0, parent:["section", "widget"], properties:["aria-readonly", "aria-required", "aria-selected"], scope:["row"]}, group:{namefrom:[" author"], parent:["section"], properties:["aria-activedescendant"]},
704
+ heading:{namerequired:!0, parent:["sectionhead"], properties:["aria-level"]}, img:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["section"]}, input:{"abstract":!0, namefrom:["author"], parent:["widget"]}, landmark:{"abstract":!0, namefrom:["contents", "author"], namerequired:!1, parent:["region"]}, link:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], properties:["aria-expanded"]}, list:{mustcontain:["group", "listitem"], namefrom:["author"], parent:["region"]},
705
+ listbox:{mustcontain:["option"], namefrom:["author"], namerequired:!0, parent:["list", "select"], properties:["aria-multiselectable", "aria-required"]}, listitem:{namefrom:["contents", "author"], namerequired:!0, parent:["section"], properties:["aria-level", "aria-posinset", "aria-setsize"], scope:["list"]}, log:{namefrom:[" author"], namerequired:!0, parent:["region"]}, main:{namefrom:["author"], parent:["landmark"]}, marquee:{namerequired:!0, parent:["section"]}, math:{childpresentational:!0, namefrom:["author"],
706
+ parent:["section"]}, menu:{mustcontain:["group", "menuitemradio", "menuitem", "menuitemcheckbox"], namefrom:["author"], namerequired:!0, parent:["list", "select"]}, menubar:{namefrom:["author"], parent:["menu"]}, menuitem:{namefrom:["contents", "author"], namerequired:!0, parent:["command"], scope:["menu", "menubar"]}, menuitemcheckbox:{namefrom:["contents", "author"], namerequired:!0, parent:["checkbox", "menuitem"], scope:["menu", "menubar"]}, menuitemradio:{namefrom:["contents", "author"], namerequired:!0,
707
+ parent:["menuitemcheckbox", "radio"], scope:["menu", "menubar"]}, navigation:{namefrom:["author"], parent:["landmark"]}, note:{namefrom:["author"], parent:["section"]}, option:{namefrom:["contents", "author"], namerequired:!0, parent:["input"], properties:["aria-checked", "aria-posinset", "aria-selected", "aria-setsize"]}, presentation:{parent:["structure"]}, progressbar:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["range"]}, radio:{namefrom:["contents", "author"], namerequired:!0,
708
+ parent:["checkbox", "option"]}, radiogroup:{mustcontain:["radio"], namefrom:["author"], namerequired:!0, parent:["select"], properties:["aria-required"]}, range:{"abstract":!0, namefrom:["author"], parent:["widget"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"]}, region:{namefrom:[" author"], parent:["section"]}, roletype:{"abstract":!0, properties:"aria-atomic aria-busy aria-controls aria-describedby aria-disabled aria-dropeffect aria-flowto aria-grabbed aria-haspopup aria-hidden aria-invalid aria-label aria-labelledby aria-live aria-owns aria-relevant".split(" ")},
709
+ row:{mustcontain:["columnheader", "gridcell", "rowheader"], namefrom:["contents", "author"], parent:["group", "widget"], properties:["aria-level", "aria-selected"], scope:["grid", "rowgroup", "treegrid"]}, rowgroup:{mustcontain:["row"], namefrom:["contents", "author"], parent:["group"], scope:["grid"]}, rowheader:{namefrom:["contents", "author"], namerequired:!0, parent:["gridcell", "sectionhead", "widget"], properties:["aria-sort"], scope:["row"]}, search:{namefrom:["author"], parent:["landmark"]},
710
+ section:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, sectionhead:{"abstract":!0, namefrom:["contents", "author"], parent:["structure"], properties:["aria-expanded"]}, select:{"abstract":!0, namefrom:["author"], parent:["composite", "group", "input"]}, separator:{childpresentational:!0, namefrom:["author"], parent:["structure"], properties:["aria-expanded", "aria-orientation"]}, scrollbar:{childpresentational:!0, namefrom:["author"], namerequired:!1,
711
+ parent:["input", "range"], requiredProperties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-controls", "aria-orientation", "aria-valuemax", "aria-valuemin", "aria-valuenow"]}, slider:{childpresentational:!0, namefrom:["author"], namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-orientation"]}, spinbutton:{namefrom:["author"],
712
+ namerequired:!0, parent:["input", "range"], requiredProperties:["aria-valuemax", "aria-valuemin", "aria-valuenow"], properties:["aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-required"]}, status:{parent:["region"]}, structure:{"abstract":!0, parent:["roletype"]}, tab:{namefrom:["contents", "author"], parent:["sectionhead", "widget"], properties:["aria-selected"], scope:["tablist"]}, tablist:{mustcontain:["tab"], namefrom:["author"], parent:["composite", "directory"], properties:["aria-level"]},
713
+ tabpanel:{namefrom:["author"], namerequired:!0, parent:["region"]}, textbox:{namefrom:["author"], namerequired:!0, parent:["input"], properties:["aria-activedescendant", "aria-autocomplete", "aria-multiline", "aria-readonly", "aria-required"]}, timer:{namefrom:["author"], namerequired:!0, parent:["status"]}, toolbar:{namefrom:["author"], parent:["group"]}, tooltip:{namerequired:!0, parent:["section"]}, tree:{mustcontain:["group", "treeitem"], namefrom:["author"], namerequired:!0, parent:["select"],
714
+ properties:["aria-multiselectable", "aria-required"]}, treegrid:{mustcontain:["row"], namefrom:["author"], namerequired:!0, parent:["grid", "tree"]}, treeitem:{namefrom:["contents", "author"], namerequired:!0, parent:["listitem", "option"], scope:["group", "tree"]}, widget:{"abstract":!0, parent:["roletype"]}, window:{"abstract":!0, namefrom:[" author"], parent:["roletype"], properties:["aria-expanded"]}};
715
+ axs.constants.WIDGET_ROLES = {};
716
+ axs.constants.addAllParentRolesToSet_ = function(a, b) {
717
+ if (a.parent) {
718
+ for (var c = a.parent, d = 0;d < c.length;d++) {
719
+ var e = c[d];
720
+ b[e] = !0;
721
+ axs.constants.addAllParentRolesToSet_(axs.constants.ARIA_ROLES[e], b);
1251
722
  }
1252
723
  }
1253
- }
1254
- 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1255
- return 0 < Object.keys(b).length ? b : null
1256
- };
1257
- axs.properties.getGlobalAriaProperties = function(a) {
1258
- for(var b = {}, c = 0;c < axs.constants.GLOBAL_PROPERTIES.length;c++) {
1259
- var d = axs.constants.GLOBAL_PROPERTIES[c];
1260
- if(a.hasAttribute(d)) {
1261
- var e = a.getAttribute(d);
1262
- b[d] = axs.utils.getAriaPropertyValue(d, e, a)
724
+ };
725
+ axs.constants.addAllPropertiesToSet_ = function(a, b, c) {
726
+ var d = a[b];
727
+ if (d) {
728
+ for (var e = 0;e < d.length;e++) {
729
+ c[d[e]] = !0;
730
+ }
1263
731
  }
1264
- }
1265
- return b
1266
- };
1267
- axs.properties.getVideoProperties = function(a) {
1268
- if(!axs.browserUtils.matchSelector(a, "video")) {
1269
- return null
1270
- }
1271
- var b = {};
1272
- b.captionTracks = axs.properties.getTrackElements(a, "captions");
1273
- b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions");
1274
- b.chapterTracks = axs.properties.getTrackElements(a, "chapters");
1275
- return b
1276
- };
1277
- axs.properties.getTrackElements = function(a, b) {
1278
- var c = a.querySelectorAll("track[kind=" + b + "]"), d = {};
1279
- if(!c.length) {
1280
- return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d
1281
- }
1282
- d.valid = !0;
1283
- for(var e = [], f = 0;f < c.length;f++) {
1284
- var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label");
1285
- h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrcProvided"});
1286
- h = "";
1287
- m && (h += m, k && (h += " "));
1288
- k && (h += "(" + k + ")");
1289
- "" == h && (h = "[[object Object]]");
1290
- g.name = h;
1291
- e.push(g)
1292
- }
1293
- d.values = e;
1294
- return d
1295
- };
1296
- axs.properties.getAllProperties = function(a) {
1297
- var b = axs.utils.asElement(a);
1298
- if(!b) {
1299
- return{}
1300
- }
1301
- var c = {};
1302
- c.ariaProperties = axs.properties.getAriaProperties(b);
1303
- c.colorProperties = axs.properties.getColorProperties(b);
1304
- c.focusProperties = axs.properties.getFocusProperties(b);
1305
- c.textProperties = axs.properties.getTextProperties(a);
1306
- c.videoProperties = axs.properties.getVideoProperties(b);
1307
- return c
1308
- };
1309
- axs.AuditRule = function(a) {
1310
- for(var b = !0, c = [], d = 0;d < axs.AuditRule.requiredFields.length;d++) {
1311
- var e = axs.AuditRule.requiredFields[d];
1312
- e in a || (b = !1, c.push(e))
1313
- }
1314
- if(!b) {
1315
- throw"Invalid spec; the following fields were not specified: " + c.join(", ") + "\n" + JSON.stringify(a);
1316
- }
1317
- this.name = a.name;
1318
- this.severity = a.severity;
1319
- this.relevantElementMatcher_ = a.relevantElementMatcher;
1320
- this.test_ = a.test;
1321
- this.code = a.code;
1322
- this.heading = a.heading || "";
1323
- this.url = a.url || "";
1324
- this.requiresConsoleAPI = !!a.opt_requiresConsoleAPI
1325
- };
1326
- axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code heading".split(" ");
1327
- axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA};
1328
- axs.AuditRule.prototype.addElement = function(a, b) {
1329
- a.push(b)
1330
- };
1331
- axs.AuditRule.collectMatchingElements = function(a, b, c) {
1332
- if(a.nodeType == Node.ELEMENT_NODE) {
1333
- var d = a
1334
- }
1335
- d && b.call(null, d) && c.push(d);
1336
- for(a = a.firstChild;null != a;) {
1337
- axs.AuditRule.collectMatchingElements(a, b, c), a = a.nextSibling
1338
- }
1339
- };
1340
- axs.AuditRule.prototype.run = function(a) {
1341
- a = a || {};
1342
- var b = "ignoreSelectors" in a ? a.ignoreSelectors : [], c = "maxResults" in a ? a.maxResults : null, d = [];
1343
- axs.AuditRule.collectMatchingElements("scope" in a ? a.scope : document, this.relevantElementMatcher_, d);
1344
- var e = [];
1345
- if(!d.length) {
1346
- return{result:axs.constants.AuditResult.NA}
1347
- }
1348
- for(a = 0;a < d.length && !(null != c && e.length >= c);a++) {
1349
- var f = d[a], g;
1350
- a: {
1351
- g = f;
1352
- for(var h = 0;h < b.length;h++) {
1353
- if(axs.browserUtils.matchSelector(g, b[h])) {
1354
- g = !0;
1355
- break a
732
+ if (a.parent) {
733
+ for (a = a.parent, d = 0;d < a.length;d++) {
734
+ axs.constants.addAllPropertiesToSet_(axs.constants.ARIA_ROLES[a[d]], b, c);
735
+ }
736
+ }
737
+ };
738
+ for (var roleName in axs.constants.ARIA_ROLES) {
739
+ var role = axs.constants.ARIA_ROLES[roleName], propertiesSet = {};
740
+ axs.constants.addAllPropertiesToSet_(role, "properties", propertiesSet);
741
+ role.propertiesSet = propertiesSet;
742
+ var requiredPropertiesSet = {};
743
+ axs.constants.addAllPropertiesToSet_(role, "requiredProperties", requiredPropertiesSet);
744
+ role.requiredPropertiesSet = requiredPropertiesSet;
745
+ var parentRolesSet = {};
746
+ axs.constants.addAllParentRolesToSet_(role, parentRolesSet);
747
+ role.allParentRolesSet = parentRolesSet;
748
+ "widget" in parentRolesSet && (axs.constants.WIDGET_ROLES[roleName] = role);
749
+ }
750
+ axs.constants.ARIA_PROPERTIES = {activedescendant:{type:"property", valueType:"idref"}, atomic:{defaultValue:"false", type:"property", valueType:"boolean"}, autocomplete:{defaultValue:"none", type:"property", valueType:"token", values:["inline", "list", "both", "none"]}, busy:{defaultValue:"false", type:"state", valueType:"boolean"}, checked:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, controls:{type:"property", valueType:"idref_list"},
751
+ describedby:{type:"property", valueType:"idref_list"}, disabled:{defaultValue:"false", type:"state", valueType:"boolean"}, dropeffect:{defaultValue:"none", type:"property", valueType:"token_list", values:"copy move link execute popup none".split(" ")}, expanded:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, flowto:{type:"property", valueType:"idref_list"}, grabbed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false",
752
+ "undefined"]}, haspopup:{defaultValue:"false", type:"property", valueType:"boolean"}, hidden:{defaultValue:"false", type:"state", valueType:"boolean"}, invalid:{defaultValue:"false", type:"state", valueType:"token", values:["grammar", "false", "spelling", "true"]}, label:{type:"property", valueType:"string"}, labelledby:{type:"property", valueType:"idref_list"}, level:{type:"property", valueType:"integer"}, live:{defaultValue:"off", type:"property", valueType:"token", values:["off", "polite", "assertive"]},
753
+ multiline:{defaultValue:"false", type:"property", valueType:"boolean"}, multiselectable:{defaultValue:"false", type:"property", valueType:"boolean"}, orientation:{defaultValue:"vertical", type:"property", valueType:"token", values:["horizontal", "vertical"]}, owns:{type:"property", valueType:"idref_list"}, posinset:{type:"property", valueType:"integer"}, pressed:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "mixed", "undefined"]}, readonly:{defaultValue:"false",
754
+ type:"property", valueType:"boolean"}, relevant:{defaultValue:"additions text", type:"property", valueType:"token_list", values:["additions", "removals", "text", "all"]}, required:{defaultValue:"false", type:"property", valueType:"boolean"}, selected:{defaultValue:"undefined", type:"state", valueType:"token", values:["true", "false", "undefined"]}, setsize:{type:"property", valueType:"integer"}, sort:{defaultValue:"none", type:"property", valueType:"token", values:["ascending", "descending", "none",
755
+ "other"]}, valuemax:{type:"property", valueType:"decimal"}, valuemin:{type:"property", valueType:"decimal"}, valuenow:{type:"property", valueType:"decimal"}, valuetext:{type:"property", valueType:"string"}};
756
+ (function() {
757
+ for (var a in axs.constants.ARIA_PROPERTIES) {
758
+ var b = axs.constants.ARIA_PROPERTIES[a];
759
+ if (b.values) {
760
+ for (var c = {}, d = 0;d < b.values.length;d++) {
761
+ c[b.values[d]] = !0;
1356
762
  }
763
+ b.valuesSet = c;
1357
764
  }
1358
- g = !1
1359
765
  }
1360
- !g && this.test_(f) && this.addElement(e, f)
1361
- }
1362
- b = {result:e.length ? axs.constants.AuditResult.FAIL : axs.constants.AuditResult.PASS, elements:e};
1363
- a < d.length && (b.resultsTruncated = !0);
1364
- return b
1365
- };
1366
- axs.AuditRule.specs = {};
1367
- axs.AuditRules = {};
1368
- axs.AuditRules.getRule = function(a) {
1369
- if(!axs.AuditRules.rules) {
1370
- axs.AuditRules.rules = {};
1371
- for(var b in axs.AuditRule.specs) {
1372
- var c = axs.AuditRule.specs[b], d = new axs.AuditRule(c);
1373
- axs.AuditRules.rules[c.name] = d
766
+ })();
767
+ axs.constants.GLOBAL_PROPERTIES = axs.constants.ARIA_ROLES.roletype.propertiesSet;
768
+ axs.constants.NO_ROLE_NAME = " ";
769
+ axs.constants.WIDGET_ROLE_TO_NAME = {alert:"aria_role_alert", alertdialog:"aria_role_alertdialog", button:"aria_role_button", checkbox:"aria_role_checkbox", columnheader:"aria_role_columnheader", combobox:"aria_role_combobox", dialog:"aria_role_dialog", grid:"aria_role_grid", gridcell:"aria_role_gridcell", link:"aria_role_link", listbox:"aria_role_listbox", log:"aria_role_log", marquee:"aria_role_marquee", menu:"aria_role_menu", menubar:"aria_role_menubar", menuitem:"aria_role_menuitem", menuitemcheckbox:"aria_role_menuitemcheckbox",
770
+ menuitemradio:"aria_role_menuitemradio", option:axs.constants.NO_ROLE_NAME, progressbar:"aria_role_progressbar", radio:"aria_role_radio", radiogroup:"aria_role_radiogroup", rowheader:"aria_role_rowheader", scrollbar:"aria_role_scrollbar", slider:"aria_role_slider", spinbutton:"aria_role_spinbutton", status:"aria_role_status", tab:"aria_role_tab", tabpanel:"aria_role_tabpanel", textbox:"aria_role_textbox", timer:"aria_role_timer", toolbar:"aria_role_toolbar", tooltip:"aria_role_tooltip", treeitem:"aria_role_treeitem"};
771
+ axs.constants.STRUCTURE_ROLE_TO_NAME = {article:"aria_role_article", application:"aria_role_application", banner:"aria_role_banner", columnheader:"aria_role_columnheader", complementary:"aria_role_complementary", contentinfo:"aria_role_contentinfo", definition:"aria_role_definition", directory:"aria_role_directory", document:"aria_role_document", form:"aria_role_form", group:"aria_role_group", heading:"aria_role_heading", img:"aria_role_img", list:"aria_role_list", listitem:"aria_role_listitem",
772
+ main:"aria_role_main", math:"aria_role_math", navigation:"aria_role_navigation", note:"aria_role_note", region:"aria_role_region", rowheader:"aria_role_rowheader", search:"aria_role_search", separator:"aria_role_separator"};
773
+ axs.constants.ATTRIBUTE_VALUE_TO_STATUS = [{name:"aria-autocomplete", values:{inline:"aria_autocomplete_inline", list:"aria_autocomplete_list", both:"aria_autocomplete_both"}}, {name:"aria-checked", values:{"true":"aria_checked_true", "false":"aria_checked_false", mixed:"aria_checked_mixed"}}, {name:"aria-disabled", values:{"true":"aria_disabled_true"}}, {name:"aria-expanded", values:{"true":"aria_expanded_true", "false":"aria_expanded_false"}}, {name:"aria-invalid", values:{"true":"aria_invalid_true",
774
+ grammar:"aria_invalid_grammar", spelling:"aria_invalid_spelling"}}, {name:"aria-multiline", values:{"true":"aria_multiline_true"}}, {name:"aria-multiselectable", values:{"true":"aria_multiselectable_true"}}, {name:"aria-pressed", values:{"true":"aria_pressed_true", "false":"aria_pressed_false", mixed:"aria_pressed_mixed"}}, {name:"aria-readonly", values:{"true":"aria_readonly_true"}}, {name:"aria-required", values:{"true":"aria_required_true"}}, {name:"aria-selected", values:{"true":"aria_selected_true",
775
+ "false":"aria_selected_false"}}];
776
+ axs.constants.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {button:"input_type_button", checkbox:"input_type_checkbox", color:"input_type_color", datetime:"input_type_datetime", "datetime-local":"input_type_datetime_local", date:"input_type_date", email:"input_type_email", file:"input_type_file", image:"input_type_image", month:"input_type_month", number:"input_type_number", password:"input_type_password", radio:"input_type_radio", range:"input_type_range", reset:"input_type_reset", search:"input_type_search",
777
+ submit:"input_type_submit", tel:"input_type_tel", text:"input_type_text", url:"input_type_url", week:"input_type_week"};
778
+ axs.constants.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {A:"tag_link", BUTTON:"tag_button", H1:"tag_h1", H2:"tag_h2", H3:"tag_h3", H4:"tag_h4", H5:"tag_h5", H6:"tag_h6", LI:"tag_li", OL:"tag_ol", SELECT:"tag_select", TEXTAREA:"tag_textarea", UL:"tag_ul", SECTION:"tag_section", NAV:"tag_nav", ARTICLE:"tag_article", ASIDE:"tag_aside", HGROUP:"tag_hgroup", HEADER:"tag_header", FOOTER:"tag_footer", TIME:"tag_time", MARK:"tag_mark"};
779
+ axs.constants.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {BUTTON:"tag_button", SELECT:"tag_select", TEXTAREA:"tag_textarea"};
780
+ axs.constants.MIXED_VALUES = {"true":!0, "false":!0, mixed:!0};
781
+ axs.constants.Severity = {INFO:"Info", WARNING:"Warning", SEVERE:"Severe"};
782
+ axs.constants.AuditResult = {PASS:"PASS", FAIL:"FAIL", NA:"NA"};
783
+ axs.constants.InlineElements = {TT:!0, I:!0, B:!0, BIG:!0, SMALL:!0, EM:!0, STRONG:!0, DFN:!0, CODE:!0, SAMP:!0, KBD:!0, VAR:!0, CITE:!0, ABBR:!0, ACRONYM:!0, A:!0, IMG:!0, OBJECT:!0, BR:!0, SCRIPT:!0, MAP:!0, Q:!0, SUB:!0, SUP:!0, SPAN:!0, BDO:!0, INPUT:!0, SELECT:!0, TEXTAREA:!0, LABEL:!0, BUTTON:!0};
784
+ axs.constants.NATIVELY_DISABLEABLE = {BUTTON:!0, INPUT:!0, SELECT:!0, TEXTAREA:!0, FIELDSET:!0, OPTGROUP:!0, OPTION:!0};
785
+ axs.constants.ARIA_TO_HTML_ATTRIBUTE = {"aria-checked":"checked", "aria-disabled":"disabled", "aria-hidden":"hidden", "aria-expanded":"open", "aria-valuemax":"max", "aria-valuemin":"min", "aria-readonly":"readonly", "aria-required":"required", "aria-selected":"selected", "aria-valuenow":"value"};
786
+ axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO = {A:[{role:"link", allowed:"button checkbox menuitem menuitemcheckbox menuitemradio tab treeitem".split(" "), selector:"a[href]"}], ADDRESS:[{role:"", allowed:["contentinfo", "presentation"]}], AREA:[{role:"link", selector:"area[href]"}], ARTICLE:[{role:"article", allowed:["presentation", "article", "document", "application", "main"]}], ASIDE:[{role:"complementary", allowed:["note", "complementary", "search", "presentation"]}], AUDIO:[{role:"", allowed:["application",
787
+ "presentation"]}], BASE:[{role:"", reserved:!0}], BODY:[{role:"document", allowed:["presentation"]}], BUTTON:[{role:"button", allowed:["link", "menuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'button:not([aria-pressed]):not([type="menu"])'}, {role:"button", allowed:["button"], selector:"button[aria-pressed]"}, {role:"button", attributes:{"aria-haspopup":!0}, allowed:["link", "menuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'button[type="menu"]'}], CAPTION:[{role:"",
788
+ allowed:["presentation"]}], COL:[{role:"", reserved:!0}], COLGROUP:[{role:"", reserved:!0}], DATALIST:[{role:"listbox", attributes:{"aria-multiselectable":!1}, allowed:["presentation"]}], DEL:[{role:"", allowed:["*"]}], DD:[{role:"", allowed:["presentation"]}], DT:[{role:"", allowed:["presentation"]}], DETAILS:[{role:"group", allowed:["group", "presentation"]}], DIALOG:[{role:"dialog", allowed:"dialog alert alertdialog application log marquee status".split(" "), selector:"dialog[open]"}, {role:"dialog",
789
+ attributes:{"aria-hidden":!0}, allowed:"dialog alert alertdialog application log marquee status".split(" "), selector:"dialog:not([open])"}], DIV:[{role:"", allowed:["*"]}], DL:[{role:"list", allowed:["presentation"]}], EMBED:[{role:"", allowed:["application", "document", "img", "presentation"]}], FIGURE:[{role:"", allowed:["*"]}], FOOTER:[{role:"", allowed:["contentinfo", "presentation"]}], FORM:[{role:"form", allowed:["presentation"]}], P:[{role:"", allowed:["*"]}], PRE:[{role:"", allowed:["*"]}],
790
+ BLOCKQUOTE:[{role:"", allowed:["*"]}], H1:[{role:"heading"}], H2:[{role:"heading"}], H3:[{role:"heading"}], H4:[{role:"heading"}], H5:[{role:"heading"}], H6:[{role:"heading"}], HEAD:[{role:"", reserved:!0}], HEADER:[{role:"", allowed:["banner", "presentation"]}], HR:[{role:"separator", allowed:["presentation"]}], HTML:[{role:"", reserved:!0}], IFRAME:[{role:"", allowed:["application", "document", "img", "presentation"], selector:"iframe:not([seamless])"}, {role:"", allowed:["application", "document",
791
+ "img", "presentation", "group"], selector:"iframe[seamless]"}], IMG:[{role:"presentation", reserved:!0, selector:'img[alt=""]'}, {role:"img", allowed:["*"], selector:'img[alt]:not([alt=""])'}], INPUT:[{role:"button", allowed:["link", "menuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'input[type="button"]:not([aria-pressed])'}, {role:"button", allowed:["button"], selector:'input[type="button"][aria-pressed]'}, {role:"checkbox", allowed:["checkbox"], selector:'input[type="checkbox"]'},
792
+ {role:"", selector:'input[type="color"]'}, {role:"", selector:'input[type="date"]'}, {role:"", selector:'input[type="datetime"]'}, {role:"textbox", selector:'input[type="email"]:not([list])'}, {role:"", selector:'input[type="file"]'}, {role:"", reserved:!0, selector:'input[type="hidden"]'}, {role:"button", allowed:["button"], selector:'input[type="image"][aria-pressed]'}, {role:"button", allowed:["link", "menuitem", "menuitemcheckbox", "menuitemradio", "radio"], selector:'input[type="image"]:not([aria-pressed])'},
793
+ {role:"", selector:'input[type="month"]'}, {role:"", selector:'input[type="number"]'}, {role:"textbox", selector:'input[type="password"]'}, {role:"radio", allowed:["menuitemradio"], selector:'input[type="radio"]'}, {role:"slider", selector:'input[type="range"]'}, {role:"button", selector:'input[type="reset"]'}, {role:"combobox", selector:'input[type="search"][list]'}, {role:"textbox", selector:'input[type="search"]:not([list])'}, {role:"button", selector:'input[type="submit"]'}, {role:"combobox",
794
+ selector:'input[type="tel"][list]'}, {role:"textbox", selector:'input[type="tel"]:not([list])'}, {role:"combobox", selector:'input[type="text"][list]'}, {role:"textbox", selector:'input[type="text"]:not([list])'}, {role:"textbox", selector:"input:not([type])"}, {role:"", selector:'input[type="time"]'}, {role:"combobox", selector:'input[type="url"][list]'}, {role:"textbox", selector:'input[type="url"]:not([list])'}, {role:"", selector:'input[type="week"]'}], INS:[{role:"", allowed:["*"]}], KEYGEN:[{role:""}],
795
+ LABEL:[{role:"", allowed:["presentation"]}], LI:[{role:"listitem", allowed:"menuitem menuitemcheckbox menuitemradio option tab treeitem presentation".split(" "), selector:'ol:not([role="presentation"])>li, ul:not([role="presentation"])>li'}, {role:"listitem", allowed:"listitem menuitem menuitemcheckbox menuitemradio option tab treeitem presentation".split(" "), selector:'ol[role="presentation"]>li, ul[role="presentation"]>li'}], LINK:[{role:"link", reserved:!0, selector:"link[href]"}], MAIN:[{role:"",
796
+ allowed:["main", "presentation"]}], MAP:[{role:"", reserved:!0}], MATH:[{role:"", allowed:["presentation"]}], MENU:[{role:"toolbar", selector:'menu[type="toolbar"]'}], MENUITEM:[{role:"menuitem", selector:'menuitem[type="command"]'}, {role:"menuitemcheckbox", selector:'menuitem[type="checkbox"]'}, {role:"menuitemradio", selector:'menuitem[type="radio"]'}], META:[{role:"", reserved:!0}], METER:[{role:"progressbar", allowed:["presentation"]}], NAV:[{role:"navigation", allowed:["navigation", "presentation"]}],
797
+ NOSCRIPT:[{role:"", reserved:!0}], OBJECT:[{role:"", allowed:["application", "document", "img", "presentation"]}], OL:[{role:"list", allowed:"directory group listbox menu menubar tablist toolbar tree presentation".split(" ")}], OPTGROUP:[{role:"", allowed:["presentation"]}], OPTION:[{role:"option"}], OUTPUT:[{role:"status", allowed:["*"]}], PARAM:[{role:"", reserved:!0}], PICTURE:[{role:"", reserved:!0}], PROGRESS:[{role:"progressbar", allowed:["presentation"]}], SCRIPT:[{role:"", reserved:!0}],
798
+ SECTION:[{role:"region", allowed:"alert alertdialog application contentinfo dialog document log marquee search status presentation".split(" ")}], SELECT:[{role:"listbox"}], SOURCE:[{role:"", reserved:!0}], SPAN:[{role:"", allowed:["*"]}], STYLE:[{role:"", reserved:!0}], SVG:[{role:"", allowed:["application", "document", "img", "presentation"]}], SUMMARY:[{role:"", allowed:["presentation"]}], TABLE:[{role:"", allowed:["*"]}], TEMPLATE:[{role:"", reserved:!0}], TEXTAREA:[{role:"textbox"}], TBODY:[{role:"rowgroup",
799
+ allowed:["*"]}], THEAD:[{role:"rowgroup", allowed:["*"]}], TFOOT:[{role:"rowgroup", allowed:["*"]}], TITLE:[{role:"", reserved:!0}], TD:[{role:"", allowed:["*"]}], TH:[{role:"", allowed:["*"]}], TR:[{role:"", allowed:["*"]}], TRACK:[{role:"", reserved:!0}], UL:[{role:"list", allowed:"directory group listbox menu menubar tablist toolbar tree presentation".split(" ")}], VIDEO:[{role:"", allowed:["application", "presentation"]}]};
800
+ axs.color = {};
801
+ axs.color.Color = function(a, b, c, d) {
802
+ this.red = a;
803
+ this.green = b;
804
+ this.blue = c;
805
+ this.alpha = d;
806
+ };
807
+ axs.color.YCbCr = function(a) {
808
+ this.luma = this.z = a[0];
809
+ this.Cb = this.x = a[1];
810
+ this.Cr = this.y = a[2];
811
+ };
812
+ axs.color.YCbCr.prototype = {multiply:function(a) {
813
+ return new axs.color.YCbCr([this.luma * a, this.Cb * a, this.Cr * a]);
814
+ }, add:function(a) {
815
+ return new axs.color.YCbCr([this.luma + a.luma, this.Cb + a.Cb, this.Cr + a.Cr]);
816
+ }, subtract:function(a) {
817
+ return new axs.color.YCbCr([this.luma - a.luma, this.Cb - a.Cb, this.Cr - a.Cr]);
818
+ }};
819
+ axs.color.calculateContrastRatio = function(a, b) {
820
+ 1 > a.alpha && (a = axs.color.flattenColors(a, b));
821
+ var c = axs.color.calculateLuminance(a), d = axs.color.calculateLuminance(b);
822
+ return (Math.max(c, d) + .05) / (Math.min(c, d) + .05);
823
+ };
824
+ axs.color.calculateLuminance = function(a) {
825
+ return axs.color.toYCbCr(a).luma;
826
+ };
827
+ axs.color.luminanceRatio = function(a, b) {
828
+ return (Math.max(a, b) + .05) / (Math.min(a, b) + .05);
829
+ };
830
+ axs.color.parseColor = function(a) {
831
+ if ("transparent" === a) {
832
+ return new axs.color.Color(0, 0, 0, 0);
1374
833
  }
1375
- }
1376
- return axs.AuditRules.rules[a]
1377
- };
1378
- axs.AuditResults = function() {
1379
- this.errors_ = [];
1380
- this.warnings_ = []
1381
- };
1382
- goog.exportSymbol("axs.AuditResults", axs.AuditResults);
1383
- axs.AuditResults.prototype.addError = function(a) {
1384
- "" != a && this.errors_.push(a)
1385
- };
1386
- goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.prototype.addError);
1387
- axs.AuditResults.prototype.addWarning = function(a) {
1388
- "" != a && this.warnings_.push(a)
1389
- };
1390
- goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.prototype.addWarning);
1391
- axs.AuditResults.prototype.numErrors = function() {
1392
- return this.errors_.length
1393
- };
1394
- goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.prototype.numErrors);
1395
- axs.AuditResults.prototype.numWarnings = function() {
1396
- return this.warnings_.length
1397
- };
1398
- goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults.prototype.numWarnings);
1399
- axs.AuditResults.prototype.getErrors = function() {
1400
- return this.errors_
1401
- };
1402
- goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.prototype.getErrors);
1403
- axs.AuditResults.prototype.getWarnings = function() {
1404
- return this.warnings_
1405
- };
1406
- goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults.prototype.getWarnings);
1407
- axs.AuditResults.prototype.toString = function() {
1408
- for(var a = "", b = 0;b < this.errors_.length;b++) {
1409
- 0 == b && (a += "\nErrors:\n");
1410
- var c = this.errors_[b], a = a + (c + "\n\n")
1411
- }
1412
- for(b = 0;b < this.warnings_.length;b++) {
1413
- 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n"
1414
- }
1415
- return a
1416
- };
1417
- goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.prototype.toString);
1418
- axs.Audit = {};
1419
- axs.AuditConfiguration = function() {
1420
- this.rules_ = {};
1421
- this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
1422
- this.withConsoleApi = !1;
1423
- goog.exportProperty(this, "scope", this.scope);
1424
- goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun);
1425
- goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore);
1426
- goog.exportProperty(this, "withConsoleApi", this.withConsoleApi)
1427
- };
1428
- goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration);
1429
- axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) {
1430
- a in this.rules_ || (this.rules_[a] = {});
1431
- "ignore" in this.rules_[a] || (this.rules_[a].ignore = []);
1432
- Array.prototype.push.call(this.rules_[a].ignore, b)
1433
- }, getIgnoreSelectors:function(a) {
1434
- return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : []
1435
- }, setSeverity:function(a, b) {
1436
- a in this.rules_ || (this.rules_[a] = {});
1437
- this.rules_[a].severity = b
1438
- }, getSeverity:function(a) {
1439
- return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].severity : null
1440
- }};
1441
- goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.AuditConfiguration.prototype.ignoreSelectors);
1442
- goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.AuditConfiguration.prototype.getIgnoreSelectors);
1443
- axs.Audit.run = function(a) {
1444
- a = a || new axs.AuditConfiguration;
1445
- var b = a.withConsoleApi, c = [], d;
1446
- d = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : Object.keys(axs.AuditRule.specs);
1447
- if(a.auditRulesToIgnore) {
1448
- for(var e = 0;e < a.auditRulesToIgnore.length;e++) {
1449
- var f = a.auditRulesToIgnore[e];
1450
- 0 > d.indexOf(f) || d.splice(d.indexOf(f), 1)
834
+ var b = a.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
835
+ if (b) {
836
+ a = parseInt(b[1], 10);
837
+ var c = parseInt(b[2], 10), d = parseInt(b[3], 10);
838
+ return new axs.color.Color(a, c, d, 1);
1451
839
  }
1452
- }
1453
- for(e = 0;e < d.length;e++) {
1454
- var f = d[e], g = axs.AuditRules.getRule(f);
1455
- if(g && !g.disabled && (b || !g.requiresConsoleAPI)) {
1456
- var h = {}, k = a.getIgnoreSelectors(g.name);
1457
- if(0 < k.length || a.scope) {
1458
- h.ignoreSelectors = k
1459
- }
1460
- a.scope && (h.scope = a.scope);
1461
- a.maxResults && (h.maxResults = a.maxResults);
1462
- h = g.run.call(g, h);
1463
- g = axs.utils.namedValues(g);
1464
- g.severity = a.getSeverity(f) || g.severity;
1465
- h.rule = g;
1466
- c.push(h)
840
+ return (b = a.match(/^rgba\((\d+), (\d+), (\d+), (\d*(\.\d+)?)\)/)) ? (a = parseInt(b[1], 10), c = parseInt(b[2], 10), d = parseInt(b[3], 10), b = parseFloat(b[4]), new axs.color.Color(a, c, d, b)) : null;
841
+ };
842
+ axs.color.colorChannelToString = function(a) {
843
+ a = Math.round(a);
844
+ return 15 >= a ? "0" + a.toString(16) : a.toString(16);
845
+ };
846
+ axs.color.colorToString = function(a) {
847
+ return 1 == a.alpha ? "#" + axs.color.colorChannelToString(a.red) + axs.color.colorChannelToString(a.green) + axs.color.colorChannelToString(a.blue) : "rgba(" + [a.red, a.green, a.blue, a.alpha].join() + ")";
848
+ };
849
+ axs.color.luminanceFromContrastRatio = function(a, b, c) {
850
+ return c ? (a + .05) * b - .05 : (a + .05) / b - .05;
851
+ };
852
+ axs.color.translateColor = function(a, b) {
853
+ for (var c = b > a.luma ? axs.color.WHITE_YCC : axs.color.BLACK_YCC, d = c == axs.color.WHITE_YCC ? axs.color.YCC_CUBE_FACES_WHITE : axs.color.YCC_CUBE_FACES_BLACK, e = new axs.color.YCbCr([0, a.Cb, a.Cr]), f = new axs.color.YCbCr([1, a.Cb, a.Cr]), f = {a:e, b:f}, e = null, g = 0;g < d.length && !(e = axs.color.findIntersection(f, d[g]), 0 <= e.z && 1 >= e.z);g++) {
1467
854
  }
1468
- }
1469
- return c
1470
- };
1471
- goog.exportSymbol("axs.Audit.run", axs.Audit.run);
1472
- axs.Audit.auditResults = function(a) {
1473
- for(var b = new axs.AuditResults, c = 0;c < a.length;c++) {
1474
- var d = a[c];
1475
- d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.constants.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.addWarning(axs.Audit.accessibilityErrorMessage(d)))
1476
- }
1477
- return b
1478
- };
1479
- goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults);
1480
- axs.Audit.createReport = function(a, b) {
1481
- var c;
1482
- c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString();
1483
- b && (c += "\nFor more information, please see ", c += b);
1484
- return c += "\n*** End accessibility audit results ***"
1485
- };
1486
- goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport);
1487
- axs.Audit.accessibilityErrorMessage = function(a) {
1488
- for(var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "Warning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the following " + (1 == a.elements.length ? "element" : "elements")), b = 1 == a.elements.length ? b + ":" : b + (" (1 - " + Math.min(5, a.elements.length) + " of " + a.elements.length + "):"), c = Math.min(a.elements.length, 5), d = 0;d < c;d++) {
1489
- var e = a.elements[d], b = b + "\n";
1490
- try {
1491
- b += axs.utils.getQuerySelectorText(e)
1492
- }catch(f) {
1493
- b += " tagName:" + e.tagName, b += " id:" + e.id
855
+ if (!e) {
856
+ throw "Couldn't find intersection with YCbCr color cube for Cb=" + a.Cb + ", Cr=" + a.Cr + ".";
1494
857
  }
1495
- }
1496
- "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information.");
1497
- return b
1498
- };
1499
- goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibilityErrorMessage);
1500
- axs.AuditRule.specs.audioWithoutControls = {name:"audioWithoutControls", heading:"Audio elements should have controls", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1501
- return axs.browserUtils.matchSelector(a, "audio[autoplay]")
1502
- }, test:function(a) {
1503
- return!a.querySelectorAll("[controls]").length && 3 < a.duration
1504
- }, code:"AX_AUDIO_01"};
1505
- axs.AuditRule.specs.badAriaAttributeValue = {name:"badAriaAttributeValue", heading:"ARIA state and property values must be valid", url:"", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1506
- var b = "", c;
1507
- for(c in axs.constants.ARIA_PROPERTIES) {
1508
- b += "[aria-" + c + "],"
1509
- }
1510
- b = b.substring(0, b.length - 1);
1511
- return axs.browserUtils.matchSelector(a, b)
1512
- }, test:function(a) {
1513
- for(var b in axs.constants.ARIA_PROPERTIES) {
1514
- var c = "aria-" + b;
1515
- if(a.hasAttribute(c)) {
1516
- var d = a.getAttribute(c);
1517
- if(!axs.utils.getAriaPropertyValue(c, d, a).valid) {
1518
- return!0
858
+ if (e.x != a.x || e.y != a.y) {
859
+ throw "Intersection has wrong Cb/Cr values.";
860
+ }
861
+ if (Math.abs(c.luma - e.luma) < Math.abs(c.luma - b)) {
862
+ return c = [b, a.Cb, a.Cr], axs.color.fromYCbCrArray(c);
863
+ }
864
+ c = (b - e.luma) / (c.luma - e.luma);
865
+ c = [b, e.Cb - e.Cb * c, e.Cr - e.Cr * c];
866
+ return axs.color.fromYCbCrArray(c);
867
+ };
868
+ axs.color.suggestColors = function(a, b, c) {
869
+ var d = {}, e = axs.color.calculateLuminance(a), f = axs.color.calculateLuminance(b), g = f > e, h = axs.color.toYCbCr(b), k = axs.color.toYCbCr(a), m;
870
+ for (m in c) {
871
+ var l = c[m], n = axs.color.luminanceFromContrastRatio(e, l + .02, g);
872
+ if (1 >= n && 0 <= n) {
873
+ var p = axs.color.translateColor(h, n), l = axs.color.calculateContrastRatio(p, a), n = {};
874
+ n.fg = axs.color.colorToString(p);
875
+ n.bg = axs.color.colorToString(a);
876
+ n.contrast = l.toFixed(2);
877
+ d[m] = n;
878
+ } else {
879
+ l = axs.color.luminanceFromContrastRatio(f, l + .02, !g), 1 >= l && 0 <= l && (p = axs.color.translateColor(k, l), l = axs.color.calculateContrastRatio(b, p), n = {}, n.bg = axs.color.colorToString(p), n.fg = axs.color.colorToString(b), n.contrast = l.toFixed(2), d[m] = n);
1519
880
  }
1520
881
  }
1521
- }
1522
- return!1
1523
- }, code:"AX_ARIA_04"};
1524
- axs.AuditRule.specs.badAriaRole = {name:"badAriaRole", heading:"Elements with ARIA roles must use a valid, non-abstract ARIA role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_01--elements-with-aria-roles-must-use-a-valid-non-abstract-aria-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1525
- return axs.browserUtils.matchSelector(a, "[role]")
1526
- }, test:function(a) {
1527
- return!axs.utils.getRoles(a).valid
1528
- }, code:"AX_ARIA_01"};
1529
- axs.AuditRule.specs.controlsWithoutLabel = {name:"controlsWithoutLabel", heading:"Controls and media elements should have labels", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_01--controls-and-media-elements-should-have-labels", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1530
- if(!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])')) {
1531
- return!1
1532
- }
1533
- if(0 <= a.tabIndex) {
1534
- return!0
1535
- }
1536
- for(a = a.parentElement;null != a;a = a.parentElement) {
1537
- if(axs.utils.elementIsAriaWidget(a)) {
1538
- return!1
882
+ return d;
883
+ };
884
+ axs.color.flattenColors = function(a, b) {
885
+ var c = a.alpha;
886
+ return new axs.color.Color((1 - c) * b.red + c * a.red, (1 - c) * b.green + c * a.green, (1 - c) * b.blue + c * a.blue, a.alpha + b.alpha * (1 - a.alpha));
887
+ };
888
+ axs.color.multiplyMatrixVector = function(a, b) {
889
+ var c = b[0], d = b[1], e = b[2];
890
+ return [a[0][0] * c + a[0][1] * d + a[0][2] * e, a[1][0] * c + a[1][1] * d + a[1][2] * e, a[2][0] * c + a[2][1] * d + a[2][2] * e];
891
+ };
892
+ axs.color.toYCbCr = function(a) {
893
+ var b = a.red / 255, c = a.green / 255;
894
+ a = a.blue / 255;
895
+ return new axs.color.YCbCr(axs.color.multiplyMatrixVector(axs.color.YCC_MATRIX, [.03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4), .03928 >= c ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4), .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4)]));
896
+ };
897
+ axs.color.fromYCbCr = function(a) {
898
+ return axs.color.fromYCbCrArray([a.luma, a.Cb, a.Cr]);
899
+ };
900
+ axs.color.fromYCbCrArray = function(a) {
901
+ var b = axs.color.multiplyMatrixVector(axs.color.INVERTED_YCC_MATRIX, a);
902
+ a = b[0];
903
+ var c = b[1], b = b[2];
904
+ return new axs.color.Color(Math.min(Math.max(Math.round(255 * (.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055)), 0), 255), Math.min(Math.max(Math.round(255 * (.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - .055)), 0), 255), Math.min(Math.max(Math.round(255 * (.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - .055)), 0), 255), 1);
905
+ };
906
+ axs.color.RGBToYCbCrMatrix = function(a, b) {
907
+ return [[a, 1 - a - b, b], [-a / (2 - 2 * b), (a + b - 1) / (2 - 2 * b), (1 - b) / (2 - 2 * b)], [(1 - a) / (2 - 2 * a), (a + b - 1) / (2 - 2 * a), -b / (2 - 2 * a)]];
908
+ };
909
+ axs.color.invert3x3Matrix = function(a) {
910
+ var b = a[0][0], c = a[0][1], d = a[0][2], e = a[1][0], f = a[1][1], g = a[1][2], h = a[2][0], k = a[2][1];
911
+ a = a[2][2];
912
+ return axs.color.scalarMultiplyMatrix([[f * a - g * k, d * k - c * a, c * g - d * f], [g * h - e * a, b * a - d * h, d * e - b * g], [e * k - f * h, h * c - b * k, b * f - c * e]], 1 / (b * (f * a - g * k) - c * (a * e - g * h) + d * (e * k - f * h)));
913
+ };
914
+ axs.color.findIntersection = function(a, b) {
915
+ var c = [a.a.x - b.p0.x, a.a.y - b.p0.y, a.a.z - b.p0.z], d = axs.color.invert3x3Matrix([[a.a.x - a.b.x, b.p1.x - b.p0.x, b.p2.x - b.p0.x], [a.a.y - a.b.y, b.p1.y - b.p0.y, b.p2.y - b.p0.y], [a.a.z - a.b.z, b.p1.z - b.p0.z, b.p2.z - b.p0.z]]), c = axs.color.multiplyMatrixVector(d, c)[0];
916
+ return a.a.add(a.b.subtract(a.a).multiply(c));
917
+ };
918
+ axs.color.scalarMultiplyMatrix = function(a, b) {
919
+ for (var c = [], d = 0;3 > d;d++) {
920
+ c[d] = axs.color.scalarMultiplyVector(a[d], b);
1539
921
  }
1540
- }
1541
- return!0
1542
- }, test:function(a) {
1543
- return axs.utils.isElementOrAncestorHidden(a) || "input" == a.tagName.toLowerCase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCase() && a.textContent.replace(/^\s+|\s+$/g, "").length ? !1 : axs.utils.hasLabel(a) ? !1 : !0
1544
- }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"};
1545
- axs.AuditRule.specs.focusableElementNotVisibleAndNotAriaHidden = {name:"focusableElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but either invisible or obscured by another element", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_01--these-elements-are-focusable-but-either-invisible-or-obscured-by-another-element", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1546
- if(!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) {
1547
- return!1
1548
- }
1549
- if(0 <= a.tabIndex) {
1550
- return!0
1551
- }
1552
- for(a = a.parentElement;null != a;a = a.parentElement) {
1553
- if(axs.utils.elementIsAriaWidget(a)) {
1554
- return!1
922
+ return c;
923
+ };
924
+ axs.color.scalarMultiplyVector = function(a, b) {
925
+ for (var c = [], d = 0;d < a.length;d++) {
926
+ c[d] = a[d] * b;
1555
927
  }
1556
- }
1557
- return!0
1558
- }, test:function(a) {
1559
- if(axs.utils.isElementOrAncestorHidden(a)) {
1560
- return!1
1561
- }
1562
- a.focus();
1563
- return!axs.utils.elementIsVisible(a)
1564
- }, code:"AX_FOCUS_01"};
1565
- axs.AuditRule.specs.imagesWithoutAltText = {name:"imagesWithoutAltText", heading:"Images should have an alt attribute", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_02--images-should-have-an-alt-attribute-unless-they-have-an-aria-role-of-presentation", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1566
- return axs.browserUtils.matchSelector(a, "img") && !axs.utils.isElementOrAncestorHidden(a)
1567
- }, test:function(a) {
1568
- return!a.hasAttribute("alt") && "presentation" != a.getAttribute("role")
1569
- }, code:"AX_TEXT_02"};
1570
- axs.AuditRule.specs.linkWithUnclearPurpose = {name:"linkWithUnclearPurpose", heading:"The purpose of each link should be clear from the link text", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1571
- return axs.browserUtils.matchSelector(a, "a")
1572
- }, test:function(a) {
1573
- return/^\s*click\s*here\s*[^a-z]?$/i.test(a.textContent)
1574
- }, code:"AX_TITLE_01"};
1575
- axs.AuditRule.specs.lowContrastElements = {name:"lowContrastElements", heading:"Text elements should have a reasonable contrast ratio", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_color_01--text-elements-should-have-a-reasonable-contrast-ratio", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1576
- return axs.properties.hasDirectTextDescendant(a)
1577
- }, test:function(a) {
1578
- var b = window.getComputedStyle(a, null);
1579
- return(a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs.utils.isLowContrast(a, b)
1580
- }, code:"AX_COLOR_01"};
1581
- axs.AuditRule.specs.mainRoleOnInappropriateElement = {name:"mainRoleOnInappropriateElement", heading:"role=main should only appear on significant elements", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1582
- return axs.browserUtils.matchSelector(a, "[role~=main]")
1583
- }, test:function(a) {
1584
- if(axs.utils.isInlineElement(a)) {
1585
- return!0
1586
- }
1587
- a = axs.properties.getTextFromDescendantContent(a);
1588
- return!a || 50 > a.length ? !0 : !1
1589
- }, code:"AX_ARIA_04"};
1590
- axs.AuditRule.specs.elementsWithMeaningfulBackgroundImage = {name:"elementsWithMeaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1591
- return!axs.utils.isElementOrAncestorHidden(a)
1592
- }, heading:"Meaningful images should not be used in element backgrounds", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_image_01--meaningful-images-should-not-be-used-in-element-backgrounds", test:function(a) {
1593
- if(a.textContent && 0 < a.textContent.length) {
1594
- return!1
1595
- }
1596
- a = window.getComputedStyle(a, null);
1597
- var b = a.backgroundImage;
1598
- if(!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) {
1599
- return!1
1600
- }
1601
- b = parseInt(a.width, 10);
1602
- a = parseInt(a.height, 10);
1603
- return 150 > b && 150 > a
1604
- }, code:"AX_IMAGE_01"};
1605
- axs.AuditRule.specs.nonExistentAriaLabelledbyElement = {name:"nonExistentAriaLabelledbyElement", heading:"aria-labelledby attributes should refer to an element which exists in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_02--aria-labelledby-attributes-should-refer-to-an-element-which-exists-in-the-dom", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1606
- return axs.browserUtils.matchSelector(a, "[aria-labelledby]")
1607
- }, test:function(a) {
1608
- a = a.getAttribute("aria-labelledby").split(/\s+/);
1609
- for(var b = 0;b < a.length;b++) {
1610
- if(!document.getElementById(a[b])) {
1611
- return!0
928
+ return c;
929
+ };
930
+ axs.color.kR = .2126;
931
+ axs.color.kB = .0722;
932
+ axs.color.YCC_MATRIX = axs.color.RGBToYCbCrMatrix(axs.color.kR, axs.color.kB);
933
+ axs.color.INVERTED_YCC_MATRIX = axs.color.invert3x3Matrix(axs.color.YCC_MATRIX);
934
+ axs.color.BLACK = new axs.color.Color(0, 0, 0, 1);
935
+ axs.color.BLACK_YCC = axs.color.toYCbCr(axs.color.BLACK);
936
+ axs.color.WHITE = new axs.color.Color(255, 255, 255, 1);
937
+ axs.color.WHITE_YCC = axs.color.toYCbCr(axs.color.WHITE);
938
+ axs.color.RED = new axs.color.Color(255, 0, 0, 1);
939
+ axs.color.RED_YCC = axs.color.toYCbCr(axs.color.RED);
940
+ axs.color.GREEN = new axs.color.Color(0, 255, 0, 1);
941
+ axs.color.GREEN_YCC = axs.color.toYCbCr(axs.color.GREEN);
942
+ axs.color.BLUE = new axs.color.Color(0, 0, 255, 1);
943
+ axs.color.BLUE_YCC = axs.color.toYCbCr(axs.color.BLUE);
944
+ axs.color.CYAN = new axs.color.Color(0, 255, 255, 1);
945
+ axs.color.CYAN_YCC = axs.color.toYCbCr(axs.color.CYAN);
946
+ axs.color.MAGENTA = new axs.color.Color(255, 0, 255, 1);
947
+ axs.color.MAGENTA_YCC = axs.color.toYCbCr(axs.color.MAGENTA);
948
+ axs.color.YELLOW = new axs.color.Color(255, 255, 0, 1);
949
+ axs.color.YELLOW_YCC = axs.color.toYCbCr(axs.color.YELLOW);
950
+ axs.color.YCC_CUBE_FACES_BLACK = [{p0:axs.color.BLACK_YCC, p1:axs.color.RED_YCC, p2:axs.color.GREEN_YCC}, {p0:axs.color.BLACK_YCC, p1:axs.color.GREEN_YCC, p2:axs.color.BLUE_YCC}, {p0:axs.color.BLACK_YCC, p1:axs.color.BLUE_YCC, p2:axs.color.RED_YCC}];
951
+ axs.color.YCC_CUBE_FACES_WHITE = [{p0:axs.color.WHITE_YCC, p1:axs.color.CYAN_YCC, p2:axs.color.MAGENTA_YCC}, {p0:axs.color.WHITE_YCC, p1:axs.color.MAGENTA_YCC, p2:axs.color.YELLOW_YCC}, {p0:axs.color.WHITE_YCC, p1:axs.color.YELLOW_YCC, p2:axs.color.CYAN_YCC}];
952
+ axs.dom = {};
953
+ axs.dom.parentElement = function(a) {
954
+ if (!a) {
955
+ return null;
1612
956
  }
1613
- }
1614
- return!1
1615
- }, code:"AX_ARIA_02"};
1616
- axs.AuditRule.specs.pageWithoutTitle = {name:"pageWithoutTitle", heading:"The web page should have a title that describes topic or purpose", url:"", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1617
- return"html" == a.tagName.toLowerCase()
1618
- }, test:function(a) {
1619
- a = a.querySelector("head");
1620
- return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0
1621
- }, code:"AX_TITLE_01"};
1622
- axs.AuditRule.specs.requiredAriaAttributeMissing = {name:"requiredAriaAttributeMissing", heading:"Elements with ARIA roles must have all required attributes for that role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_aria_03--elements-with-aria-roles-must-have-all-required-attributes-for-that-role", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
1623
- return axs.browserUtils.matchSelector(a, "[role]")
1624
- }, test:function(a) {
1625
- var b = axs.utils.getRoles(a);
1626
- if(!b.valid) {
1627
- return!1
1628
- }
1629
- for(var c = 0;c < b.roles.length;c++) {
1630
- var d = b.roles[c].details.requiredPropertiesSet, e;
1631
- for(e in d) {
1632
- if(d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PROPERTIES[d] || a.hasAttribute(e))) {
1633
- return!0
957
+ a = axs.dom.composedParentNode(a);
958
+ if (!a) {
959
+ return null;
960
+ }
961
+ switch(a.nodeType) {
962
+ case Node.ELEMENT_NODE:
963
+ return a;
964
+ default:
965
+ return axs.dom.parentElement(a);
966
+ }
967
+ };
968
+ axs.dom.shadowHost = function(a) {
969
+ return "host" in a ? a.host : null;
970
+ };
971
+ axs.dom.composedParentNode = function(a) {
972
+ if (!a) {
973
+ return null;
974
+ }
975
+ if (a.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
976
+ return axs.dom.shadowHost(a);
977
+ }
978
+ var b = a.parentNode;
979
+ if (!b) {
980
+ return null;
981
+ }
982
+ if (b.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
983
+ return axs.dom.shadowHost(b);
984
+ }
985
+ if (!b.shadowRoot) {
986
+ return b;
987
+ }
988
+ a = a.getDestinationInsertionPoints();
989
+ return 0 < a.length ? axs.dom.composedParentNode(a[a.length - 1]) : null;
990
+ };
991
+ axs.dom.asElement = function(a) {
992
+ switch(a.nodeType) {
993
+ case Node.COMMENT_NODE:
994
+ break;
995
+ case Node.ELEMENT_NODE:
996
+ if ("script" == a.localName || "template" == a.localName) {
997
+ break;
998
+ }
999
+ return a;
1000
+ case Node.DOCUMENT_FRAGMENT_NODE:
1001
+ return a.host;
1002
+ case Node.TEXT_NODE:
1003
+ return axs.dom.parentElement(a);
1004
+ default:
1005
+ console.warn("Unhandled node type: ", a.nodeType);
1006
+ }
1007
+ return null;
1008
+ };
1009
+ axs.dom.composedTreeSearch = function(a, b, c, d, e) {
1010
+ if (a === b) {
1011
+ return !0;
1012
+ }
1013
+ if (a.nodeType == Node.ELEMENT_NODE) {
1014
+ var f = a
1015
+ }
1016
+ var g = !1;
1017
+ d = Object.create(d);
1018
+ if (f) {
1019
+ var h = f.localName;
1020
+ d.collectIdRefs && (d.idrefs = axs.utils.getReferencedIds(f));
1021
+ if (!d.disabled || "legend" === h && axs.browserUtils.matchSelector(f, "fieldset>legend:first-of-type")) {
1022
+ d.disabled = axs.utils.isElementDisabled(f, !0);
1023
+ }
1024
+ d.hidden || (d.hidden = axs.utils.isElementHidden(f));
1025
+ if (c.preorder && !c.preorder(f, d)) {
1026
+ return g;
1027
+ }
1028
+ var k = f.shadowRoot || f.webkitShadowRoot;
1029
+ if (k) {
1030
+ return d.level++, g = axs.dom.composedTreeSearch(k, b, c, d, k), f && c.postorder && !g && c.postorder(f, d), g;
1031
+ }
1032
+ if ("content" == h) {
1033
+ a = f.getDistributedNodes();
1034
+ for (h = 0;h < a.length && !g;h++) {
1035
+ g = axs.dom.composedTreeSearch(a[h], b, c, d, e);
1036
+ }
1037
+ c.postorder && !g && c.postorder.call(null, f, d);
1038
+ return g;
1634
1039
  }
1635
1040
  }
1636
- }
1637
- }, code:"AX_ARIA_03"};
1638
- axs.AuditRule.specs.unfocusableElementsWithOnClick = {name:"unfocusableElementsWithOnClick", heading:"Elements with onclick handlers must be focusable", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_focus_02--elements-with-onclick-handlers-must-be-focusable", severity:axs.constants.Severity.WARNING, opt_requiresConsoleAPI:!0, relevantElementMatcher:function(a) {
1639
- return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || axs.utils.isElementOrAncestorHidden(a) ? !1 : "click" in getEventListeners(a) ? !0 : !1
1640
- }, test:function(a) {
1641
- return!a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a) && !a.disabled
1642
- }, code:"AX_FOCUS_02"};
1643
- axs.AuditRule.specs.videoWithoutCaptions = {name:"videoWithoutCaptions", heading:"Video elements should use <track> elements to provide captions", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_video_01--video-elements-should-use-track-elements-to-provide-captions", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
1644
- return axs.browserUtils.matchSelector(a, "video")
1645
- }, test:function(a) {
1646
- return!a.querySelectorAll("track[kind=captions]").length
1647
- }, code:"AX_VIDEO_01"};
1041
+ for (a = a.firstChild;null != a && !g;) {
1042
+ g = axs.dom.composedTreeSearch(a, b, c, d, e), a = a.nextSibling;
1043
+ }
1044
+ f && c.postorder && !g && c.postorder.call(null, f, d);
1045
+ return g;
1046
+ };
1047
+ axs.utils = {};
1048
+ axs.utils.FOCUSABLE_ELEMENTS_SELECTOR = "input:not([type=hidden]):not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),a[href],iframe,[tabindex]";
1049
+ axs.utils.LABELABLE_ELEMENTS_SELECTOR = "button,input:not([type=hidden]),keygen,meter,output,progress,select,textarea";
1050
+ axs.utils.elementIsTransparent = function(a) {
1051
+ return "0" == a.style.opacity;
1052
+ };
1053
+ axs.utils.elementHasZeroArea = function(a) {
1054
+ a = a.getBoundingClientRect();
1055
+ var b = a.top - a.bottom;
1056
+ return a.right - a.left && b ? !1 : !0;
1057
+ };
1058
+ axs.utils.elementIsOutsideScrollArea = function(a) {
1059
+ for (var b = axs.dom.parentElement(a), c = a.ownerDocument.defaultView;b != c.document.body;) {
1060
+ if (axs.utils.isClippedBy(a, b)) {
1061
+ return !0;
1062
+ }
1063
+ if (axs.utils.canScrollTo(a, b) && !axs.utils.elementIsOutsideScrollArea(b)) {
1064
+ return !1;
1065
+ }
1066
+ b = axs.dom.parentElement(b);
1067
+ }
1068
+ return !axs.utils.canScrollTo(a, c.document.body);
1069
+ };
1070
+ axs.utils.canScrollTo = function(a, b) {
1071
+ var c = a.getBoundingClientRect(), d = b.getBoundingClientRect();
1072
+ if (b == b.ownerDocument.body) {
1073
+ var e = d.top, f = d.left
1074
+ } else {
1075
+ e = d.top - b.scrollTop, f = d.left - b.scrollLeft;
1076
+ }
1077
+ var g = e + b.scrollHeight, h = f + b.scrollWidth;
1078
+ if (c.right < f || c.bottom < e || c.left > h || c.top > g) {
1079
+ return !1;
1080
+ }
1081
+ e = a.ownerDocument.defaultView;
1082
+ f = e.getComputedStyle(b);
1083
+ return c.left > d.right || c.top > d.bottom ? "scroll" == f.overflow || "auto" == f.overflow || b instanceof e.HTMLBodyElement : !0;
1084
+ };
1085
+ axs.utils.isClippedBy = function(a, b) {
1086
+ var c = a.getBoundingClientRect(), d = b.getBoundingClientRect(), e = d.top - b.scrollTop, f = d.left - b.scrollLeft, g = a.ownerDocument.defaultView.getComputedStyle(b);
1087
+ return (c.right < d.left || c.bottom < d.top || c.left > d.right || c.top > d.bottom) && "hidden" == g.overflow ? !0 : c.right < f || c.bottom < e ? "visible" != g.overflow : !1;
1088
+ };
1089
+ axs.utils.isAncestor = function(a, b) {
1090
+ if (null == b) {
1091
+ return !1;
1092
+ }
1093
+ if (b === a) {
1094
+ return !0;
1095
+ }
1096
+ var c = axs.dom.composedParentNode(b);
1097
+ return axs.utils.isAncestor(a, c);
1098
+ };
1099
+ axs.utils.overlappingElements = function(a) {
1100
+ if (axs.utils.elementHasZeroArea(a)) {
1101
+ return null;
1102
+ }
1103
+ for (var b = [], c = a.getClientRects(), d = 0;d < c.length;d++) {
1104
+ var e = c[d], e = document.elementFromPoint((e.left + e.right) / 2, (e.top + e.bottom) / 2);
1105
+ if (null != e && e != a && !axs.utils.isAncestor(e, a) && !axs.utils.isAncestor(a, e)) {
1106
+ var f = window.getComputedStyle(e, null);
1107
+ f && (f = axs.utils.getBgColor(f, e)) && 0 < f.alpha && 0 > b.indexOf(e) && b.push(e);
1108
+ }
1109
+ }
1110
+ return b;
1111
+ };
1112
+ axs.utils.elementIsHtmlControl = function(a) {
1113
+ var b = a.ownerDocument.defaultView;
1114
+ return a instanceof b.HTMLButtonElement || a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement ? !0 : !1;
1115
+ };
1116
+ axs.utils.elementIsAriaWidget = function(a) {
1117
+ return a.hasAttribute("role") && (a = a.getAttribute("role")) && (a = axs.constants.ARIA_ROLES[a]) && "widget" in a.allParentRolesSet ? !0 : !1;
1118
+ };
1119
+ axs.utils.elementIsVisible = function(a) {
1120
+ return axs.utils.elementIsTransparent(a) || axs.utils.elementHasZeroArea(a) || axs.utils.elementIsOutsideScrollArea(a) || axs.utils.overlappingElements(a).length ? !1 : !0;
1121
+ };
1122
+ axs.utils.isLargeFont = function(a) {
1123
+ var b = a.fontSize;
1124
+ a = "bold" == a.fontWeight;
1125
+ var c = b.match(/(\d+)px/);
1126
+ if (c) {
1127
+ b = parseInt(c[1], 10);
1128
+ if (c = window.getComputedStyle(document.body, null).fontSize.match(/(\d+)px/)) {
1129
+ var d = parseInt(c[1], 10), c = 1.2 * d, d = 1.5 * d
1130
+ } else {
1131
+ c = 19.2, d = 24;
1132
+ }
1133
+ return a && b >= c || b >= d;
1134
+ }
1135
+ if (c = b.match(/(\d+)em/)) {
1136
+ return b = parseInt(c[1], 10), a && 1.2 <= b || 1.5 <= b ? !0 : !1;
1137
+ }
1138
+ if (c = b.match(/(\d+)%/)) {
1139
+ return b = parseInt(c[1], 10), a && 120 <= b || 150 <= b ? !0 : !1;
1140
+ }
1141
+ if (c = b.match(/(\d+)pt/)) {
1142
+ if (b = parseInt(c[1], 10), a && 14 <= b || 18 <= b) {
1143
+ return !0;
1144
+ }
1145
+ }
1146
+ return !1;
1147
+ };
1148
+ axs.utils.getBgColor = function(a, b) {
1149
+ var c = axs.color.parseColor(a.backgroundColor);
1150
+ if (!c) {
1151
+ return null;
1152
+ }
1153
+ 1 > a.opacity && (c.alpha *= a.opacity);
1154
+ if (1 > c.alpha) {
1155
+ var d = axs.utils.getParentBgColor(b);
1156
+ if (null == d) {
1157
+ return null;
1158
+ }
1159
+ c = axs.color.flattenColors(c, d);
1160
+ }
1161
+ return c;
1162
+ };
1163
+ axs.utils.getParentBgColor = function(a) {
1164
+ var b = a;
1165
+ a = [];
1166
+ for (var c = null;b = axs.dom.parentElement(b);) {
1167
+ var d = window.getComputedStyle(b, null);
1168
+ if (d) {
1169
+ var e = axs.color.parseColor(d.backgroundColor);
1170
+ if (e && (1 > d.opacity && (e.alpha *= d.opacity), 0 != e.alpha && (a.push(e), 1 == e.alpha))) {
1171
+ c = !0;
1172
+ break;
1173
+ }
1174
+ }
1175
+ }
1176
+ c || a.push(new axs.color.Color(255, 255, 255, 1));
1177
+ for (b = a.pop();a.length;) {
1178
+ c = a.pop(), b = axs.color.flattenColors(c, b);
1179
+ }
1180
+ return b;
1181
+ };
1182
+ axs.utils.getFgColor = function(a, b, c) {
1183
+ var d = axs.color.parseColor(a.color);
1184
+ if (!d) {
1185
+ return null;
1186
+ }
1187
+ 1 > d.alpha && (d = axs.color.flattenColors(d, c));
1188
+ 1 > a.opacity && (b = axs.utils.getParentBgColor(b), d.alpha *= a.opacity, d = axs.color.flattenColors(d, b));
1189
+ return d;
1190
+ };
1191
+ axs.utils.getContrastRatioForElement = function(a) {
1192
+ var b = window.getComputedStyle(a, null);
1193
+ return axs.utils.getContrastRatioForElementWithComputedStyle(b, a);
1194
+ };
1195
+ axs.utils.getContrastRatioForElementWithComputedStyle = function(a, b) {
1196
+ if (axs.utils.isElementHidden(b)) {
1197
+ return null;
1198
+ }
1199
+ var c = axs.utils.getBgColor(a, b);
1200
+ if (!c) {
1201
+ return null;
1202
+ }
1203
+ var d = axs.utils.getFgColor(a, b, c);
1204
+ return d ? axs.color.calculateContrastRatio(d, c) : null;
1205
+ };
1206
+ axs.utils.isNativeTextElement = function(a) {
1207
+ var b = a.tagName.toLowerCase();
1208
+ a = a.type ? a.type.toLowerCase() : "";
1209
+ if ("textarea" == b) {
1210
+ return !0;
1211
+ }
1212
+ if ("input" != b) {
1213
+ return !1;
1214
+ }
1215
+ switch(a) {
1216
+ case "email":
1217
+ ;
1218
+ case "number":
1219
+ ;
1220
+ case "password":
1221
+ ;
1222
+ case "search":
1223
+ ;
1224
+ case "text":
1225
+ ;
1226
+ case "tel":
1227
+ ;
1228
+ case "url":
1229
+ ;
1230
+ case "":
1231
+ return !0;
1232
+ default:
1233
+ return !1;
1234
+ }
1235
+ };
1236
+ axs.utils.isLowContrast = function(a, b, c) {
1237
+ a = Math.round(10 * a) / 10;
1238
+ return c ? 4.5 > a || !axs.utils.isLargeFont(b) && 7 > a : 3 > a || !axs.utils.isLargeFont(b) && 4.5 > a;
1239
+ };
1240
+ axs.utils.hasLabel = function(a) {
1241
+ var b = a.tagName.toLowerCase(), c = a.type ? a.type.toLowerCase() : "";
1242
+ if (a.hasAttribute("aria-label") || a.hasAttribute("title") || "img" == b && a.hasAttribute("alt") || "input" == b && "image" == c && a.hasAttribute("alt") || "input" == b && ("submit" == c || "reset" == c) || a.hasAttribute("aria-labelledby") || a.hasAttribute("id") && 0 < document.querySelectorAll('label[for="' + a.id + '"]').length) {
1243
+ return !0;
1244
+ }
1245
+ for (b = axs.dom.parentElement(a);b;) {
1246
+ if ("label" == b.tagName.toLowerCase() && b.control == a) {
1247
+ return !0;
1248
+ }
1249
+ b = axs.dom.parentElement(b);
1250
+ }
1251
+ return !1;
1252
+ };
1253
+ axs.utils.isNativelyDisableable = function(a) {
1254
+ return a.tagName.toUpperCase() in axs.constants.NATIVELY_DISABLEABLE;
1255
+ };
1256
+ axs.utils.isElementDisabled = function(a, b) {
1257
+ if (axs.browserUtils.matchSelector(a, b ? "[aria-disabled=true]" : "[aria-disabled=true], [aria-disabled=true] *")) {
1258
+ return !0;
1259
+ }
1260
+ if (!axs.utils.isNativelyDisableable(a) || axs.browserUtils.matchSelector(a, "fieldset>legend:first-of-type *")) {
1261
+ return !1;
1262
+ }
1263
+ for (var c = a;null !== c;c = axs.dom.parentElement(c)) {
1264
+ if (c.hasAttribute("disabled")) {
1265
+ return !0;
1266
+ }
1267
+ if (b) {
1268
+ break;
1269
+ }
1270
+ }
1271
+ return !1;
1272
+ };
1273
+ axs.utils.isElementHidden = function(a) {
1274
+ if (!(a instanceof a.ownerDocument.defaultView.HTMLElement)) {
1275
+ return !1;
1276
+ }
1277
+ if (a.hasAttribute("chromevoxignoreariahidden")) {
1278
+ var b = !0
1279
+ }
1280
+ var c = window.getComputedStyle(a, null);
1281
+ return "none" == c.display || "hidden" == c.visibility ? !0 : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() ? !b : !1;
1282
+ };
1283
+ axs.utils.isElementOrAncestorHidden = function(a) {
1284
+ return axs.utils.isElementHidden(a) ? !0 : axs.dom.parentElement(a) ? axs.utils.isElementOrAncestorHidden(axs.dom.parentElement(a)) : !1;
1285
+ };
1286
+ axs.utils.isInlineElement = function(a) {
1287
+ a = a.tagName.toUpperCase();
1288
+ return axs.constants.InlineElements[a];
1289
+ };
1290
+ axs.utils.getRoles = function(a, b) {
1291
+ if (!a || a.nodeType !== Node.ELEMENT_NODE || !a.hasAttribute("role") && !b) {
1292
+ return null;
1293
+ }
1294
+ var c = a.getAttribute("role");
1295
+ !c && b && (c = axs.properties.getImplicitRole(a));
1296
+ if (!c) {
1297
+ return null;
1298
+ }
1299
+ for (var c = c.split(" "), d = {roles:[], valid:!1}, e = 0;e < c.length;e++) {
1300
+ var f = c[e], g = axs.constants.ARIA_ROLES[f], f = {name:f};
1301
+ g && !g["abstract"] ? (f.details = g, d.applied || (d.applied = f), f.valid = d.valid = !0) : f.valid = !1;
1302
+ d.roles.push(f);
1303
+ }
1304
+ return d;
1305
+ };
1306
+ axs.utils.getAriaPropertyValue = function(a, b, c) {
1307
+ var d = a.replace(/^aria-/, ""), e = axs.constants.ARIA_PROPERTIES[d], d = {name:a, rawValue:b};
1308
+ if (!e) {
1309
+ return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d;
1310
+ }
1311
+ e = e.valueType;
1312
+ if (!e) {
1313
+ return d.valid = !1, d.reason = '"' + a + '" is not a valid ARIA property', d;
1314
+ }
1315
+ switch(e) {
1316
+ case "idref":
1317
+ a = axs.utils.isValidIDRefValue(b, c), d.valid = a.valid, d.reason = a.reason, d.idref = a.idref;
1318
+ case "idref_list":
1319
+ a = b.split(/\s+/);
1320
+ d.valid = !0;
1321
+ for (b = 0;b < a.length;b++) {
1322
+ e = axs.utils.isValidIDRefValue(a[b], c), e.valid || (d.valid = !1), d.values ? d.values.push(e) : d.values = [e];
1323
+ }
1324
+ return d;
1325
+ case "integer":
1326
+ c = axs.utils.isValidNumber(b);
1327
+ if (!c.valid) {
1328
+ return d.valid = !1, d.reason = c.reason, d;
1329
+ }
1330
+ Math.floor(c.value) !== c.value ? (d.valid = !1, d.reason = "" + b + " is not a whole integer") : (d.valid = !0, d.value = c.value);
1331
+ return d;
1332
+ case "decimal":
1333
+ ;
1334
+ case "number":
1335
+ c = axs.utils.isValidNumber(b);
1336
+ d.valid = c.valid;
1337
+ if (!c.valid) {
1338
+ return d.reason = c.reason, d;
1339
+ }
1340
+ d.value = c.value;
1341
+ return d;
1342
+ case "string":
1343
+ return d.valid = !0, d.value = b, d;
1344
+ case "token":
1345
+ return c = axs.utils.isValidTokenValue(a, b.toLowerCase()), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
1346
+ case "token_list":
1347
+ e = b.split(/\s+/);
1348
+ d.valid = !0;
1349
+ for (b = 0;b < e.length;b++) {
1350
+ c = axs.utils.isValidTokenValue(a, e[b].toLowerCase()), c.valid || (d.valid = !1, d.reason ? (d.reason = [d.reason], d.reason.push(c.reason)) : (d.reason = c.reason, d.possibleValues = c.possibleValues)), d.values ? d.values.push(c.value) : d.values = [c.value];
1351
+ }
1352
+ return d;
1353
+ case "tristate":
1354
+ return c = axs.utils.isPossibleValue(b.toLowerCase(), axs.constants.MIXED_VALUES, a), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
1355
+ case "boolean":
1356
+ return c = axs.utils.isValidBoolean(b), c.valid ? (d.valid = !0, d.value = c.value) : (d.valid = !1, d.value = b, d.reason = c.reason), d;
1357
+ }
1358
+ d.valid = !1;
1359
+ d.reason = "Not a valid ARIA property";
1360
+ return d;
1361
+ };
1362
+ axs.utils.isValidTokenValue = function(a, b) {
1363
+ var c = a.replace(/^aria-/, "");
1364
+ return axs.utils.isPossibleValue(b, axs.constants.ARIA_PROPERTIES[c].valuesSet, a);
1365
+ };
1366
+ axs.utils.isPossibleValue = function(a, b, c) {
1367
+ return b[a] ? {valid:!0, value:a} : {valid:!1, value:a, reason:'"' + a + '" is not a valid value for ' + c, possibleValues:Object.keys(b)};
1368
+ };
1369
+ axs.utils.isValidBoolean = function(a) {
1370
+ try {
1371
+ var b = JSON.parse(a);
1372
+ } catch (c) {
1373
+ b = "";
1374
+ }
1375
+ return "boolean" != typeof b ? {valid:!1, value:a, reason:'"' + a + '" is not a true/false value'} : {valid:!0, value:b};
1376
+ };
1377
+ axs.utils.isValidIDRefValue = function(a, b) {
1378
+ return 0 == a.length ? {valid:!0, idref:a} : b.ownerDocument.getElementById(a) ? {valid:!0, idref:a} : {valid:!1, idref:a, reason:'No element with ID "' + a + '"'};
1379
+ };
1380
+ axs.utils.isValidNumber = function(a) {
1381
+ var b = {valid:!1, value:a, reason:'"' + a + '" is not a number'};
1382
+ if (!a) {
1383
+ return b;
1384
+ }
1385
+ if (/^0x/i.test(a)) {
1386
+ return b.reason = '"' + a + '" is not a decimal number', b;
1387
+ }
1388
+ a *= 1;
1389
+ return isFinite(a) ? {valid:!0, value:a} : b;
1390
+ };
1391
+ axs.utils.isElementImplicitlyFocusable = function(a) {
1392
+ var b = a.ownerDocument.defaultView;
1393
+ return a instanceof b.HTMLAnchorElement || a instanceof b.HTMLAreaElement ? a.hasAttribute("href") : a instanceof b.HTMLInputElement || a instanceof b.HTMLSelectElement || a instanceof b.HTMLTextAreaElement || a instanceof b.HTMLButtonElement || a instanceof b.HTMLIFrameElement ? !a.disabled : !1;
1394
+ };
1395
+ axs.utils.values = function(a) {
1396
+ var b = [], c;
1397
+ for (c in a) {
1398
+ a.hasOwnProperty(c) && "function" != typeof a[c] && b.push(a[c]);
1399
+ }
1400
+ return b;
1401
+ };
1402
+ axs.utils.namedValues = function(a) {
1403
+ var b = {}, c;
1404
+ for (c in a) {
1405
+ a.hasOwnProperty(c) && "function" != typeof a[c] && (b[c] = a[c]);
1406
+ }
1407
+ return b;
1408
+ };
1409
+ function escapeId(a) {
1410
+ return a.replace(/[^a-zA-Z0-9_-]/g, function(a) {
1411
+ return "\\" + a;
1412
+ });
1413
+ }
1414
+ axs.utils.getQuerySelectorText = function(a) {
1415
+ if (null == a || "HTML" == a.tagName) {
1416
+ return "html";
1417
+ }
1418
+ if ("BODY" == a.tagName) {
1419
+ return "body";
1420
+ }
1421
+ if (a.hasAttribute) {
1422
+ if (a.id) {
1423
+ return "#" + escapeId(a.id);
1424
+ }
1425
+ if (a.className) {
1426
+ for (var b = "", c = 0;c < a.classList.length;c++) {
1427
+ b += "." + a.classList[c];
1428
+ }
1429
+ var d = 0;
1430
+ if (a.parentNode) {
1431
+ for (c = 0;c < a.parentNode.children.length;c++) {
1432
+ var e = a.parentNode.children[c];
1433
+ axs.browserUtils.matchSelector(e, b) && d++;
1434
+ if (e === a) {
1435
+ break;
1436
+ }
1437
+ }
1438
+ } else {
1439
+ d = 1;
1440
+ }
1441
+ if (1 == d) {
1442
+ return axs.utils.getQuerySelectorText(a.parentNode) + " > " + b;
1443
+ }
1444
+ }
1445
+ if (a.parentNode) {
1446
+ b = a.parentNode.children;
1447
+ d = 1;
1448
+ for (c = 0;b[c] !== a;) {
1449
+ b[c].tagName == a.tagName && d++, c++;
1450
+ }
1451
+ c = "";
1452
+ "BODY" != a.parentNode.tagName && (c = axs.utils.getQuerySelectorText(a.parentNode) + " > ");
1453
+ return 1 == d ? c + a.tagName : c + a.tagName + ":nth-of-type(" + d + ")";
1454
+ }
1455
+ } else {
1456
+ if (a.selectorText) {
1457
+ return a.selectorText;
1458
+ }
1459
+ }
1460
+ return "";
1461
+ };
1462
+ axs.utils.getAriaIdReferrers = function(a, b) {
1463
+ var c = function(a) {
1464
+ var b = axs.constants.ARIA_PROPERTIES[a];
1465
+ if (b) {
1466
+ if ("idref" === b.valueType) {
1467
+ return "[aria-" + a + "='" + d + "']";
1468
+ }
1469
+ if ("idref_list" === b.valueType) {
1470
+ return "[aria-" + a + "~='" + d + "']";
1471
+ }
1472
+ }
1473
+ return "";
1474
+ };
1475
+ if (!a) {
1476
+ return null;
1477
+ }
1478
+ var d = a.id;
1479
+ if (!d) {
1480
+ return null;
1481
+ }
1482
+ d = d.replace(/'/g, "\\'");
1483
+ if (b) {
1484
+ var e = b.replace(/^aria-/, ""), f = c(e);
1485
+ if (f) {
1486
+ return a.ownerDocument.querySelectorAll(f);
1487
+ }
1488
+ } else {
1489
+ var g = [];
1490
+ for (e in axs.constants.ARIA_PROPERTIES) {
1491
+ (f = c(e)) && g.push(f);
1492
+ }
1493
+ return a.ownerDocument.querySelectorAll(g.join(","));
1494
+ }
1495
+ return null;
1496
+ };
1497
+ axs.utils.getHtmlIdReferrers = function(a) {
1498
+ if (!a) {
1499
+ return null;
1500
+ }
1501
+ var b = a.id;
1502
+ if (!b) {
1503
+ return null;
1504
+ }
1505
+ var b = b.replace(/'/g, "\\'"), c = "[contextmenu='{id}'] [itemref~='{id}'] button[form='{id}'] button[menu='{id}'] fieldset[form='{id}'] input[form='{id}'] input[list='{id}'] keygen[form='{id}'] label[for='{id}'] label[form='{id}'] menuitem[command='{id}'] object[form='{id}'] output[for~='{id}'] output[form='{id}'] select[form='{id}'] td[headers~='{id}'] textarea[form='{id}'] tr[headers~='{id}']".split(" ").map(function(a) {
1506
+ return a.replace("{id}", b);
1507
+ });
1508
+ return a.ownerDocument.querySelectorAll(c.join(","));
1509
+ };
1510
+ axs.utils.getReferencedIds = function(a) {
1511
+ for (var b = [], c = function(a) {
1512
+ a && (0 < a.indexOf(" ") ? b = b.concat(f.value.split(" ")) : b.push(a));
1513
+ }, d = 0;d < a.attributes.length;d++) {
1514
+ var e = a.tagName.toLowerCase(), f = a.attributes[d];
1515
+ if (f.specified) {
1516
+ var g = f.name, h = g.match(/aria-(.+)/);
1517
+ if (h) {
1518
+ e = axs.constants.ARIA_PROPERTIES[h[1]], !e || "idref" !== e.valueType && "idref_list" !== e.valueType || c(f.value);
1519
+ } else {
1520
+ switch(g) {
1521
+ case "contextmenu":
1522
+ ;
1523
+ case "itemref":
1524
+ c(f.value);
1525
+ break;
1526
+ case "form":
1527
+ "button" != e && "fieldset" != e && "input" != e && "keygen" != e && "label" != e && "object" != e && "output" != e && "select" != e && "textarea" != e || c(f.value);
1528
+ break;
1529
+ case "for":
1530
+ "label" != e && "output" != e || c(f.value);
1531
+ break;
1532
+ case "menu":
1533
+ "button" == e && c(f.value);
1534
+ break;
1535
+ case "list":
1536
+ "input" == e && c(f.value);
1537
+ break;
1538
+ case "command":
1539
+ "menuitem" == e && c(f.value);
1540
+ break;
1541
+ case "headers":
1542
+ "td" != e && "tr" != e || c(f.value);
1543
+ }
1544
+ }
1545
+ }
1546
+ }
1547
+ return b;
1548
+ };
1549
+ axs.utils.getIdReferrers = function(a) {
1550
+ var b = [], c = axs.utils.getHtmlIdReferrers(a);
1551
+ c && (b = b.concat(Array.prototype.slice.call(c)));
1552
+ (c = axs.utils.getAriaIdReferrers(a)) && (b = b.concat(Array.prototype.slice.call(c)));
1553
+ return b;
1554
+ };
1555
+ axs.utils.getIdReferents = function(a, b) {
1556
+ var c = [], d = a.replace(/^aria-/, ""), d = axs.constants.ARIA_PROPERTIES[d];
1557
+ if (!d || !b.hasAttribute(a)) {
1558
+ return c;
1559
+ }
1560
+ d = d.valueType;
1561
+ if ("idref_list" === d || "idref" === d) {
1562
+ for (var d = b.ownerDocument, e = b.getAttribute(a), e = e.split(/\s+/), f = 0, g = e.length;f < g;f++) {
1563
+ var h = d.getElementById(e[f]);
1564
+ h && (c[c.length] = h);
1565
+ }
1566
+ }
1567
+ return c;
1568
+ };
1569
+ axs.utils.getAriaPropertiesByValueType = function(a) {
1570
+ var b = {}, c;
1571
+ for (c in axs.constants.ARIA_PROPERTIES) {
1572
+ var d = axs.constants.ARIA_PROPERTIES[c];
1573
+ d && 0 <= a.indexOf(d.valueType) && (b[c] = d);
1574
+ }
1575
+ return b;
1576
+ };
1577
+ axs.utils.getSelectorForAriaProperties = function(a) {
1578
+ a = Object.keys(a).map(function(a) {
1579
+ return "[aria-" + a + "]";
1580
+ });
1581
+ a.sort();
1582
+ return a.join(",");
1583
+ };
1584
+ axs.utils.findDescendantsWithRole = function(a, b) {
1585
+ if (!a || !b) {
1586
+ return [];
1587
+ }
1588
+ var c = axs.properties.getSelectorForRole(b);
1589
+ if (c && (c = a.querySelectorAll(c))) {
1590
+ c = Array.prototype.map.call(c, function(a) {
1591
+ return a;
1592
+ });
1593
+ } else {
1594
+ return [];
1595
+ }
1596
+ return c;
1597
+ };
1598
+ axs.properties = {};
1599
+ axs.properties.TEXT_CONTENT_XPATH = './/text()[normalize-space(.)!=""]/parent::*[name()!="script"]';
1600
+ axs.properties.getFocusProperties = function(a) {
1601
+ var b = {}, c = a.getAttribute("tabindex");
1602
+ void 0 != c ? b.tabindex = {value:c, valid:!0} : axs.utils.isElementImplicitlyFocusable(a) && (b.implicitlyFocusable = {value:!0, valid:!0});
1603
+ if (0 == Object.keys(b).length) {
1604
+ return null;
1605
+ }
1606
+ var d = axs.utils.elementIsTransparent(a), e = axs.utils.elementHasZeroArea(a), f = axs.utils.elementIsOutsideScrollArea(a), g = axs.utils.overlappingElements(a);
1607
+ if (d || e || f || 0 < g.length) {
1608
+ var c = axs.utils.isElementOrAncestorHidden(a), h = {value:!1, valid:c};
1609
+ d && (h.transparent = !0);
1610
+ e && (h.zeroArea = !0);
1611
+ f && (h.outsideScrollArea = !0);
1612
+ g && 0 < g.length && (h.overlappingElements = g);
1613
+ d = {value:c, valid:c};
1614
+ c && (d.reason = axs.properties.getHiddenReason(a));
1615
+ h.hidden = d;
1616
+ b.visible = h;
1617
+ } else {
1618
+ b.visible = {value:!0, valid:!0};
1619
+ }
1620
+ return b;
1621
+ };
1622
+ axs.properties.getHiddenReason = function(a) {
1623
+ if (!(a && a instanceof a.ownerDocument.defaultView.HTMLElement)) {
1624
+ return null;
1625
+ }
1626
+ if (a.hasAttribute("chromevoxignoreariahidden")) {
1627
+ var b = !0
1628
+ }
1629
+ var c = window.getComputedStyle(a, null);
1630
+ return "none" == c.display ? {property:"display: none", on:a} : "hidden" == c.visibility ? {property:"visibility: hidden", on:a} : a.hasAttribute("aria-hidden") && "true" == a.getAttribute("aria-hidden").toLowerCase() && !b ? {property:"aria-hidden", on:a} : axs.properties.getHiddenReason(axs.dom.parentElement(a));
1631
+ };
1632
+ axs.properties.getColorProperties = function(a) {
1633
+ var b = {};
1634
+ (a = axs.properties.getContrastRatioProperties(a)) && (b.contrastRatio = a);
1635
+ return 0 == Object.keys(b).length ? null : b;
1636
+ };
1637
+ axs.properties.hasDirectTextDescendant = function(a) {
1638
+ function b() {
1639
+ for (var b = c.evaluate(axs.properties.TEXT_CONTENT_XPATH, a, null, XPathResult.ANY_TYPE, null), e = b.iterateNext();null != e;e = b.iterateNext()) {
1640
+ if (e === a) {
1641
+ return !0;
1642
+ }
1643
+ }
1644
+ return !1;
1645
+ }
1646
+ var c;
1647
+ c = a.nodeType == Node.DOCUMENT_NODE ? a : a.ownerDocument;
1648
+ return c.evaluate ? b() : function() {
1649
+ for (var b = c.createTreeWalker(a, NodeFilter.SHOW_TEXT, null, !1);b.nextNode();) {
1650
+ var e = b.currentNode, f = e.parentNode.tagName.toLowerCase();
1651
+ if (e.nodeValue.trim() && "script" !== f && a !== e) {
1652
+ return !0;
1653
+ }
1654
+ }
1655
+ return !1;
1656
+ }();
1657
+ };
1658
+ axs.properties.getContrastRatioProperties = function(a) {
1659
+ if (!axs.properties.hasDirectTextDescendant(a)) {
1660
+ return null;
1661
+ }
1662
+ var b = {}, c = window.getComputedStyle(a, null), d = axs.utils.getBgColor(c, a);
1663
+ if (!d) {
1664
+ return null;
1665
+ }
1666
+ b.backgroundColor = axs.color.colorToString(d);
1667
+ var e = axs.utils.getFgColor(c, a, d);
1668
+ b.foregroundColor = axs.color.colorToString(e);
1669
+ a = axs.utils.getContrastRatioForElementWithComputedStyle(c, a);
1670
+ if (!a) {
1671
+ return null;
1672
+ }
1673
+ b.value = a.toFixed(2);
1674
+ axs.utils.isLowContrast(a, c) && (b.alert = !0);
1675
+ var f = axs.utils.isLargeFont(c) ? 3 : 4.5, c = axs.utils.isLargeFont(c) ? 4.5 : 7, g = {};
1676
+ f > a && (g.AA = f);
1677
+ c > a && (g.AAA = c);
1678
+ if (!Object.keys(g).length) {
1679
+ return b;
1680
+ }
1681
+ (d = axs.color.suggestColors(d, e, g)) && Object.keys(d).length && (b.suggestedColors = d);
1682
+ return b;
1683
+ };
1684
+ axs.properties.findTextAlternatives = function(a, b, c, d) {
1685
+ var e = c || !1;
1686
+ c = axs.dom.asElement(a);
1687
+ if (!c || !d && axs.utils.isElementOrAncestorHidden(c)) {
1688
+ return null;
1689
+ }
1690
+ if (a.nodeType == Node.TEXT_NODE) {
1691
+ return c = {type:"text"}, c.text = a.textContent, c.lastWord = axs.properties.getLastWord(c.text), b.content = c, a.textContent;
1692
+ }
1693
+ a = null;
1694
+ e || (a = axs.properties.getTextFromAriaLabelledby(c, b));
1695
+ if (c.hasAttribute("aria-label")) {
1696
+ var f = {type:"text"};
1697
+ f.text = c.getAttribute("aria-label");
1698
+ f.lastWord = axs.properties.getLastWord(f.text);
1699
+ a ? f.unused = !0 : e && axs.utils.elementIsHtmlControl(c) || (a = f.text);
1700
+ b.ariaLabel = f;
1701
+ }
1702
+ c.hasAttribute("role") && "presentation" == c.getAttribute("role") || (a = axs.properties.getTextFromHostLanguageAttributes(c, b, a, e));
1703
+ e && axs.utils.elementIsHtmlControl(c) && (f = c.ownerDocument.defaultView, c instanceof f.HTMLInputElement && ("text" == c.type && c.value && 0 < c.value.length && (b.controlValue = {text:c.value}), "range" == c.type && (b.controlValue = {text:c.value})), c instanceof f.HTMLSelectElement && (b.controlValue = {text:c.value}), b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text));
1704
+ if (e && axs.utils.elementIsAriaWidget(c)) {
1705
+ e = c.getAttribute("role");
1706
+ "textbox" == e && c.textContent && 0 < c.textContent.length && (b.controlValue = {text:c.textContent});
1707
+ if ("slider" == e || "spinbutton" == e) {
1708
+ c.hasAttribute("aria-valuetext") ? b.controlValue = {text:c.getAttribute("aria-valuetext")} : c.hasAttribute("aria-valuenow") && (b.controlValue = {value:c.getAttribute("aria-valuenow"), text:"" + c.getAttribute("aria-valuenow")});
1709
+ }
1710
+ if ("menu" == e) {
1711
+ for (var g = c.querySelectorAll("[role=menuitemcheckbox], [role=menuitemradio]"), f = [], h = 0;h < g.length;h++) {
1712
+ "true" == g[h].getAttribute("aria-checked") && f.push(g[h]);
1713
+ }
1714
+ if (0 < f.length) {
1715
+ g = "";
1716
+ for (h = 0;h < f.length;h++) {
1717
+ g += axs.properties.findTextAlternatives(f[h], {}, !0), h < f.length - 1 && (g += ", ");
1718
+ }
1719
+ b.controlValue = {text:g};
1720
+ }
1721
+ }
1722
+ if ("combobox" == e || "select" == e) {
1723
+ b.controlValue = {text:"TODO"};
1724
+ }
1725
+ b.controlValue && (f = b.controlValue, a ? f.unused = !0 : a = f.text);
1726
+ }
1727
+ f = !0;
1728
+ c.hasAttribute("role") && (e = c.getAttribute("role"), (e = axs.constants.ARIA_ROLES[e]) && (!e.namefrom || 0 > e.namefrom.indexOf("contents")) && (f = !1));
1729
+ (d = axs.properties.getTextFromDescendantContent(c, d)) && f && (e = {type:"text"}, e.text = d, e.lastWord = axs.properties.getLastWord(e.text), a ? e.unused = !0 : a = d, b.content = e);
1730
+ c.hasAttribute("title") && (d = {type:"string", valid:!0}, d.text = c.getAttribute("title"), d.lastWord = axs.properties.getLastWord(d.lastWord), a ? d.unused = !0 : a = d.text, b.title = d);
1731
+ return 0 == Object.keys(b).length && null == a ? null : a;
1732
+ };
1733
+ axs.properties.getTextFromDescendantContent = function(a, b) {
1734
+ for (var c = a.childNodes, d = [], e = 0;e < c.length;e++) {
1735
+ var f = axs.properties.findTextAlternatives(c[e], {}, !0, b);
1736
+ f && d.push(f.trim());
1737
+ }
1738
+ if (d.length) {
1739
+ c = "";
1740
+ for (e = 0;e < d.length;e++) {
1741
+ c = [c, d[e]].join(" ").trim();
1742
+ }
1743
+ return c;
1744
+ }
1745
+ return null;
1746
+ };
1747
+ axs.properties.getTextFromAriaLabelledby = function(a, b) {
1748
+ var c = null;
1749
+ if (!a.hasAttribute("aria-labelledby")) {
1750
+ return c;
1751
+ }
1752
+ for (var d = a.getAttribute("aria-labelledby").split(/\s+/), e = {valid:!0}, f = [], g = [], h = 0;h < d.length;h++) {
1753
+ var k = {type:"element"}, m = d[h];
1754
+ k.value = m;
1755
+ var l = document.getElementById(m);
1756
+ l ? (k.valid = !0, k.text = axs.properties.findTextAlternatives(l, {}, !0, !0), k.lastWord = axs.properties.getLastWord(k.text), f.push(k.text), k.element = l) : (k.valid = !1, e.valid = !1, k.errorMessage = {messageKey:"noElementWithId", args:[m]});
1757
+ g.push(k);
1758
+ }
1759
+ 0 < g.length && (g[g.length - 1].last = !0, e.values = g, e.text = f.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c = e.text, b.ariaLabelledby = e);
1760
+ return c;
1761
+ };
1762
+ axs.properties.getTextFromHostLanguageAttributes = function(a, b, c, d) {
1763
+ if (axs.browserUtils.matchSelector(a, "img") && a.hasAttribute("alt")) {
1764
+ var e = {type:"string", valid:!0};
1765
+ e.text = a.getAttribute("alt");
1766
+ c ? e.unused = !0 : c = e.text;
1767
+ b.alt = e;
1768
+ }
1769
+ if (axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])') && !d) {
1770
+ if (a.hasAttribute("id")) {
1771
+ d = document.querySelectorAll('label[for="' + a.id + '"]');
1772
+ for (var e = {}, f = [], g = [], h = 0;h < d.length;h++) {
1773
+ var k = {type:"element"}, m = d[h], l = axs.properties.findTextAlternatives(m, {}, !0);
1774
+ l && 0 < l.trim().length && (k.text = l.trim(), g.push(l.trim()));
1775
+ k.element = m;
1776
+ f.push(k);
1777
+ }
1778
+ 0 < f.length && (f[f.length - 1].last = !0, e.values = f, e.text = g.join(" "), e.lastWord = axs.properties.getLastWord(e.text), c ? e.unused = !0 : c = e.text, b.labelFor = e);
1779
+ }
1780
+ d = axs.dom.parentElement(a);
1781
+ for (e = {};d;) {
1782
+ if ("label" == d.tagName.toLowerCase() && (f = d, f.control == a)) {
1783
+ e.type = "element";
1784
+ e.text = axs.properties.findTextAlternatives(f, {}, !0);
1785
+ e.lastWord = axs.properties.getLastWord(e.text);
1786
+ e.element = f;
1787
+ break;
1788
+ }
1789
+ d = axs.dom.parentElement(d);
1790
+ }
1791
+ e.text && (c ? e.unused = !0 : c = e.text, b.labelWrapped = e);
1792
+ axs.browserUtils.matchSelector(a, 'input[type="image"]') && a.hasAttribute("alt") && (e = {type:"string", valid:!0}, e.text = a.getAttribute("alt"), c ? e.unused = !0 : c = e.text, b.alt = e);
1793
+ Object.keys(b).length || (b.noLabel = !0);
1794
+ }
1795
+ return c;
1796
+ };
1797
+ axs.properties.getLastWord = function(a) {
1798
+ if (!a) {
1799
+ return null;
1800
+ }
1801
+ var b = a.lastIndexOf(" ") + 1, c = a.length - 10;
1802
+ return a.substring(b > c ? b : c);
1803
+ };
1804
+ axs.properties.getTextProperties = function(a) {
1805
+ var b = {}, c = axs.properties.findTextAlternatives(a, b, !1, !0);
1806
+ if (0 == Object.keys(b).length && ((a = axs.dom.asElement(a)) && axs.browserUtils.matchSelector(a, "img") && (b.alt = {valid:!1, errorMessage:"No alt value provided"}, a = a.src, "string" == typeof a && (c = a.split("/").pop(), b.filename = {text:c})), !c)) {
1807
+ return null;
1808
+ }
1809
+ b.hasProperties = !!Object.keys(b).length;
1810
+ b.computedText = c;
1811
+ b.lastWord = axs.properties.getLastWord(c);
1812
+ return b;
1813
+ };
1814
+ axs.properties.getAriaProperties = function(a) {
1815
+ var b = {}, c = axs.properties.getGlobalAriaProperties(a), d;
1816
+ for (d in axs.constants.ARIA_PROPERTIES) {
1817
+ var e = "aria-" + d;
1818
+ if (a.hasAttribute(e)) {
1819
+ var f = a.getAttribute(e);
1820
+ c[e] = axs.utils.getAriaPropertyValue(e, f, a);
1821
+ }
1822
+ }
1823
+ 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1824
+ f = axs.utils.getRoles(a);
1825
+ if (!f) {
1826
+ return Object.keys(b).length ? b : null;
1827
+ }
1828
+ b.roles = f;
1829
+ if (!f.valid || !f.roles) {
1830
+ return b;
1831
+ }
1832
+ for (var e = f.roles, g = 0;g < e.length;g++) {
1833
+ var h = e[g];
1834
+ if (h.details && h.details.propertiesSet) {
1835
+ for (d in h.details.propertiesSet) {
1836
+ d in c || (a.hasAttribute(d) ? (f = a.getAttribute(d), c[d] = axs.utils.getAriaPropertyValue(d, f, a), "values" in c[d] && (f = c[d].values, f[f.length - 1].isLast = !0)) : h.details.requiredPropertiesSet[d] && (c[d] = {name:d, valid:!1, reason:"Required property not set"}));
1837
+ }
1838
+ }
1839
+ }
1840
+ 0 < Object.keys(c).length && (b.properties = axs.utils.values(c));
1841
+ return 0 < Object.keys(b).length ? b : null;
1842
+ };
1843
+ axs.properties.getGlobalAriaProperties = function(a) {
1844
+ var b = {}, c;
1845
+ for (c in axs.constants.GLOBAL_PROPERTIES) {
1846
+ if (a.hasAttribute(c)) {
1847
+ var d = a.getAttribute(c);
1848
+ b[c] = axs.utils.getAriaPropertyValue(c, d, a);
1849
+ }
1850
+ }
1851
+ return b;
1852
+ };
1853
+ axs.properties.getVideoProperties = function(a) {
1854
+ if (!axs.browserUtils.matchSelector(a, "video")) {
1855
+ return null;
1856
+ }
1857
+ var b = {};
1858
+ b.captionTracks = axs.properties.getTrackElements(a, "captions");
1859
+ b.descriptionTracks = axs.properties.getTrackElements(a, "descriptions");
1860
+ b.chapterTracks = axs.properties.getTrackElements(a, "chapters");
1861
+ return b;
1862
+ };
1863
+ axs.properties.getTrackElements = function(a, b) {
1864
+ var c = a.querySelectorAll("track[kind=" + b + "]"), d = {};
1865
+ if (!c.length) {
1866
+ return d.valid = !1, d.reason = {messageKey:"noTracksProvided", args:[[b]]}, d;
1867
+ }
1868
+ d.valid = !0;
1869
+ for (var e = [], f = 0;f < c.length;f++) {
1870
+ var g = {}, h = c[f].getAttribute("src"), k = c[f].getAttribute("srcLang"), m = c[f].getAttribute("label");
1871
+ h ? (g.valid = !0, g.src = h) : (g.valid = !1, g.reason = {messageKey:"noSrcProvided"});
1872
+ h = "";
1873
+ m && (h += m, k && (h += " "));
1874
+ k && (h += "(" + k + ")");
1875
+ "" == h && (h = "[[object Object]]");
1876
+ g.name = h;
1877
+ e.push(g);
1878
+ }
1879
+ d.values = e;
1880
+ return d;
1881
+ };
1882
+ axs.properties.getAllProperties = function(a) {
1883
+ var b = axs.dom.asElement(a);
1884
+ if (!b) {
1885
+ return {};
1886
+ }
1887
+ var c = {};
1888
+ c.ariaProperties = axs.properties.getAriaProperties(b);
1889
+ c.colorProperties = axs.properties.getColorProperties(b);
1890
+ c.focusProperties = axs.properties.getFocusProperties(b);
1891
+ c.textProperties = axs.properties.getTextProperties(a);
1892
+ c.videoProperties = axs.properties.getVideoProperties(b);
1893
+ return c;
1894
+ };
1895
+ (function() {
1896
+ function a(a) {
1897
+ if (!a) {
1898
+ return null;
1899
+ }
1900
+ var c = a.tagName;
1901
+ if (!c) {
1902
+ return null;
1903
+ }
1904
+ c = c.toUpperCase();
1905
+ c = axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO[c];
1906
+ if (!c || !c.length) {
1907
+ return null;
1908
+ }
1909
+ for (var d = null, e = 0, f = c.length;e < f;e++) {
1910
+ var g = c[e];
1911
+ if (g.selector) {
1912
+ if (axs.browserUtils.matchSelector(a, g.selector)) {
1913
+ return g;
1914
+ }
1915
+ } else {
1916
+ d = g;
1917
+ }
1918
+ }
1919
+ return d;
1920
+ }
1921
+ axs.properties.getImplicitRole = function(b) {
1922
+ return (b = a(b)) ? b.role : "";
1923
+ };
1924
+ axs.properties.canTakeAriaAttributes = function(b) {
1925
+ return (b = a(b)) ? !b.reserved : !0;
1926
+ };
1927
+ })();
1928
+ axs.properties.getNativelySupportedAttributes = function(a) {
1929
+ var b = [];
1930
+ if (!a) {
1931
+ return b;
1932
+ }
1933
+ a = a.cloneNode(!1);
1934
+ for (var c = Object.keys(axs.constants.ARIA_TO_HTML_ATTRIBUTE), d = 0;d < c.length;d++) {
1935
+ var e = c[d];
1936
+ axs.constants.ARIA_TO_HTML_ATTRIBUTE[e] in a && (b[b.length] = e);
1937
+ }
1938
+ return b;
1939
+ };
1940
+ (function() {
1941
+ var a = {};
1942
+ axs.properties.getSelectorForRole = function(b) {
1943
+ if (!b) {
1944
+ return "";
1945
+ }
1946
+ if (a[b] && a.hasOwnProperty(b)) {
1947
+ return a[b];
1948
+ }
1949
+ var c = ['[role="' + b + '"]'];
1950
+ Object.keys(axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO).forEach(function(a) {
1951
+ var e = axs.constants.TAG_TO_IMPLICIT_SEMANTIC_INFO[a];
1952
+ if (e && e.length) {
1953
+ for (var f = 0;f < e.length;f++) {
1954
+ var g = e[f];
1955
+ if (g.role === b) {
1956
+ if (g.selector) {
1957
+ c[c.length] = g.selector;
1958
+ } else {
1959
+ c[c.length] = a;
1960
+ break;
1961
+ }
1962
+ }
1963
+ }
1964
+ }
1965
+ });
1966
+ return a[b] = c.join(",");
1967
+ };
1968
+ })();
1969
+ axs.AuditRule = function(a) {
1970
+ for (var b = a.opt_requires || {}, c = !0, d = [], e = 0;e < axs.AuditRule.requiredFields.length;e++) {
1971
+ var f = axs.AuditRule.requiredFields[e];
1972
+ f in a || (c = !1, d.push(f));
1973
+ }
1974
+ if (!c) {
1975
+ throw "Invalid spec; the following fields were not specified: " + d.join(", ") + "\n" + JSON.stringify(a);
1976
+ }
1977
+ this.name = a.name;
1978
+ this.severity = a.severity;
1979
+ this.relevantElementMatcher_ = a.relevantElementMatcher;
1980
+ this.isRelevant_ = a.isRelevant || function(a, b) {
1981
+ return !0;
1982
+ };
1983
+ this.test_ = a.test;
1984
+ this.code = a.code;
1985
+ this.heading = a.heading || "";
1986
+ this.url = a.url || "";
1987
+ this.requiresConsoleAPI = !!b.consoleAPI;
1988
+ this.relevantElements = [];
1989
+ this.relatedElements = [];
1990
+ this.collectIdRefs = b.idRefs || !1;
1991
+ };
1992
+ axs.AuditRule.requiredFields = "name severity relevantElementMatcher test code heading".split(" ");
1993
+ axs.AuditRule.NOT_APPLICABLE = {result:axs.constants.AuditResult.NA};
1994
+ axs.AuditRule.prototype.addElement = function(a, b) {
1995
+ a.push(b);
1996
+ };
1997
+ axs.AuditRule.prototype.collectMatchingElement = function(a, b) {
1998
+ return this.relevantElementMatcher_(a, b) && b.inScope ? (this.relevantElements.push({element:a, flags:b}), !0) : !1;
1999
+ };
2000
+ axs.AuditRule.prototype.canRun = function(a) {
2001
+ return this.disabled || !a.withConsoleApi && this.requiresConsoleAPI ? !1 : !0;
2002
+ };
2003
+ axs.AuditRule.Result = function(a, b) {
2004
+ var c = axs.utils.namedValues(b);
2005
+ c.severity = a.getSeverity(b.name) || c.severity;
2006
+ this.rule = c;
2007
+ this.maxResults = a.maxResults;
2008
+ this.update(axs.constants.AuditResult.NA);
2009
+ };
2010
+ axs.AuditRule.Result.prototype.update = function(a, b) {
2011
+ if (a === axs.constants.AuditResult.FAIL) {
2012
+ var c = this.elements || (this.elements = []);
2013
+ this.result = a;
2014
+ this.maxResults && this.elements.length >= this.maxResults ? this.resultsTruncated = !0 : b && c.push(b);
2015
+ } else {
2016
+ a === axs.constants.AuditResult.PASS ? (this.elements || (this.elements = []), this.result !== axs.constants.AuditResult.FAIL && (this.result = a)) : this.result || (this.result = a);
2017
+ }
2018
+ };
2019
+ axs.AuditRule.prototype.run = function(a) {
2020
+ try {
2021
+ for (var b = this._options || {}, c = new axs.AuditRule.Result(a, this), d;d = this.relevantElements.shift();) {
2022
+ var e = d.element, f = d.flags;
2023
+ this.isRelevant_(e, f) && (this.test_(e, f, b.config) ? c.update(axs.constants.AuditResult.FAIL, e) : c.update(axs.constants.AuditResult.PASS, e));
2024
+ }
2025
+ return c;
2026
+ } finally {
2027
+ this.relatedElements.length = 0;
2028
+ }
2029
+ };
2030
+ axs.AuditRules = {};
2031
+ (function() {
2032
+ var a = {}, b = {};
2033
+ axs.AuditRules.specs = {};
2034
+ axs.AuditRules.addRule = function(c) {
2035
+ var d = new axs.AuditRule(c);
2036
+ if (d.code in b) {
2037
+ throw Error('Can not add audit rule with same code: "' + d.code + '"');
2038
+ }
2039
+ if (d.name in a) {
2040
+ throw Error('Can not add audit rule with same name: "' + d.name + '"');
2041
+ }
2042
+ a[d.name] = b[d.code] = d;
2043
+ axs.AuditRules.specs[c.name] = c;
2044
+ };
2045
+ axs.AuditRules.getRule = function(c) {
2046
+ return a[c] || b[c] || null;
2047
+ };
2048
+ axs.AuditRules.getRules = function(b) {
2049
+ var d = Object.keys(a);
2050
+ return b ? d : d.map(function(a) {
2051
+ return this.getRule(a);
2052
+ }, axs.AuditRules);
2053
+ };
2054
+ axs.AuditRules.getActiveRules = function(a) {
2055
+ var b;
2056
+ b = a.auditRulesToRun && 0 < a.auditRulesToRun.length ? a.auditRulesToRun : axs.AuditRules.getRules(!0);
2057
+ if (a.auditRulesToIgnore) {
2058
+ for (var e = 0;e < a.auditRulesToIgnore.length;e++) {
2059
+ var f = a.auditRulesToIgnore[e];
2060
+ 0 > b.indexOf(f) || b.splice(b.indexOf(f), 1);
2061
+ }
2062
+ }
2063
+ return b.map(axs.AuditRules.getRule);
2064
+ };
2065
+ })();
2066
+ axs.AuditResults = function() {
2067
+ this.errors_ = [];
2068
+ this.warnings_ = [];
2069
+ };
2070
+ goog.exportSymbol("axs.AuditResults", axs.AuditResults);
2071
+ axs.AuditResults.prototype.addError = function(a) {
2072
+ "" != a && this.errors_.push(a);
2073
+ };
2074
+ goog.exportProperty(axs.AuditResults.prototype, "addError", axs.AuditResults.prototype.addError);
2075
+ axs.AuditResults.prototype.addWarning = function(a) {
2076
+ "" != a && this.warnings_.push(a);
2077
+ };
2078
+ goog.exportProperty(axs.AuditResults.prototype, "addWarning", axs.AuditResults.prototype.addWarning);
2079
+ axs.AuditResults.prototype.numErrors = function() {
2080
+ return this.errors_.length;
2081
+ };
2082
+ goog.exportProperty(axs.AuditResults.prototype, "numErrors", axs.AuditResults.prototype.numErrors);
2083
+ axs.AuditResults.prototype.numWarnings = function() {
2084
+ return this.warnings_.length;
2085
+ };
2086
+ goog.exportProperty(axs.AuditResults.prototype, "numWarnings", axs.AuditResults.prototype.numWarnings);
2087
+ axs.AuditResults.prototype.getErrors = function() {
2088
+ return this.errors_;
2089
+ };
2090
+ goog.exportProperty(axs.AuditResults.prototype, "getErrors", axs.AuditResults.prototype.getErrors);
2091
+ axs.AuditResults.prototype.getWarnings = function() {
2092
+ return this.warnings_;
2093
+ };
2094
+ goog.exportProperty(axs.AuditResults.prototype, "getWarnings", axs.AuditResults.prototype.getWarnings);
2095
+ axs.AuditResults.prototype.toString = function() {
2096
+ for (var a = "", b = 0;b < this.errors_.length;b++) {
2097
+ 0 == b && (a += "\nErrors:\n");
2098
+ var c = this.errors_[b], a = a + (c + "\n\n");
2099
+ }
2100
+ for (b = 0;b < this.warnings_.length;b++) {
2101
+ 0 == b && (a += "\nWarnings:\n"), c = this.warnings_[b], a += c + "\n\n";
2102
+ }
2103
+ return a;
2104
+ };
2105
+ goog.exportProperty(axs.AuditResults.prototype, "toString", axs.AuditResults.prototype.toString);
2106
+ axs.Audit = {};
2107
+ axs.AuditConfiguration = function(a) {
2108
+ null == a && (a = {});
2109
+ this.rules_ = {};
2110
+ this.maxResults = this.auditRulesToIgnore = this.auditRulesToRun = this.scope = null;
2111
+ this.withConsoleApi = !1;
2112
+ this.showUnsupportedRulesWarning = this.walkDom = !0;
2113
+ for (var b in this) {
2114
+ this.hasOwnProperty(b) && b in a && (this[b] = a[b]);
2115
+ }
2116
+ goog.exportProperty(this, "scope", this.scope);
2117
+ goog.exportProperty(this, "auditRulesToRun", this.auditRulesToRun);
2118
+ goog.exportProperty(this, "auditRulesToIgnore", this.auditRulesToIgnore);
2119
+ goog.exportProperty(this, "withConsoleApi", this.withConsoleApi);
2120
+ goog.exportProperty(this, "walkDom", this.walkDom);
2121
+ goog.exportProperty(this, "showUnsupportedRulesWarning", this.showUnsupportedRulesWarning);
2122
+ };
2123
+ goog.exportSymbol("axs.AuditConfiguration", axs.AuditConfiguration);
2124
+ axs.AuditConfiguration.prototype = {ignoreSelectors:function(a, b) {
2125
+ a in this.rules_ || (this.rules_[a] = {});
2126
+ "ignore" in this.rules_[a] || (this.rules_[a].ignore = []);
2127
+ Array.prototype.push.call(this.rules_[a].ignore, b);
2128
+ }, getIgnoreSelectors:function(a) {
2129
+ return a in this.rules_ && "ignore" in this.rules_[a] ? this.rules_[a].ignore : [];
2130
+ }, setSeverity:function(a, b) {
2131
+ a in this.rules_ || (this.rules_[a] = {});
2132
+ this.rules_[a].severity = b;
2133
+ }, getSeverity:function(a) {
2134
+ return a in this.rules_ && "severity" in this.rules_[a] ? this.rules_[a].severity : null;
2135
+ }, setRuleConfig:function(a, b) {
2136
+ a in this.rules_ || (this.rules_[a] = {});
2137
+ this.rules_[a].config = b;
2138
+ }, getRuleConfig:function(a) {
2139
+ return a in this.rules_ && "config" in this.rules_[a] ? this.rules_[a].config : null;
2140
+ }};
2141
+ goog.exportProperty(axs.AuditConfiguration.prototype, "ignoreSelectors", axs.AuditConfiguration.prototype.ignoreSelectors);
2142
+ goog.exportProperty(axs.AuditConfiguration.prototype, "getIgnoreSelectors", axs.AuditConfiguration.prototype.getIgnoreSelectors);
2143
+ axs.Audit.unsupportedRulesWarningShown = !1;
2144
+ axs.Audit.getRulesCannotRun = function(a) {
2145
+ return a.withConsoleApi ? [] : axs.AuditRules.getRules().filter(function(a) {
2146
+ return a.requiresConsoleAPI;
2147
+ }).map(function(a) {
2148
+ return a.code;
2149
+ });
2150
+ };
2151
+ axs.Audit.run = function(a) {
2152
+ a = a || new axs.AuditConfiguration;
2153
+ if (!axs.Audit.unsupportedRulesWarningShown && a.showUnsupportedRulesWarning) {
2154
+ var b = axs.Audit.getRulesCannotRun(a);
2155
+ 0 < b.length && (console.warn("Some rules cannot be checked using the axs.Audit.run() method call. Use the Chrome plugin to check these rules: " + b.join(", ")), console.warn("To remove this message, pass an AuditConfiguration object to axs.Audit.run() and set configuration.showUnsupportedRulesWarning = false."));
2156
+ axs.Audit.unsupportedRulesWarningShown = !0;
2157
+ }
2158
+ b = axs.AuditRules.getActiveRules(a);
2159
+ a.collectIdRefs = b.some(function(a) {
2160
+ return a.collectIdRefs;
2161
+ });
2162
+ a.scope || (a.scope = document.documentElement);
2163
+ axs.Audit.collectMatchingElements(a, b);
2164
+ for (var c = [], d = 0;d < b.length;d++) {
2165
+ var e = b[d];
2166
+ e.canRun(a) && c.push(e.run(a));
2167
+ }
2168
+ return c;
2169
+ };
2170
+ goog.exportSymbol("axs.Audit.run", axs.Audit.run);
2171
+ (function() {
2172
+ function a(a, c) {
2173
+ var d = a.getIgnoreSelectors(c.name);
2174
+ if (0 < d.length || a.scope) {
2175
+ this.ignoreSelectors = d;
2176
+ }
2177
+ if (d = a.getRuleConfig(c.name)) {
2178
+ this.config = d;
2179
+ }
2180
+ }
2181
+ axs.Audit.collectMatchingElements = function(b, c) {
2182
+ axs.dom.composedTreeSearch(b.walkDom ? document.documentElement : b.scope, null, {preorder:function(d, e) {
2183
+ e.inScope || (e.inScope = d === b.scope);
2184
+ for (var f = 0;f < c.length;f++) {
2185
+ var g = c[f];
2186
+ g.canRun(b) && (g._options = new a(b, g), e.ignoring[g.name] || (e.ignoring[g.name] = g._options.shouldIgnore(d)) || g.collectMatchingElement(d, e));
2187
+ }
2188
+ return !0;
2189
+ }}, {walkDom:b.walkDom, collectIdRefs:b.collectIdRefs, level:0, ignoring:{}, disabled:!1, hidden:!1});
2190
+ };
2191
+ a.prototype.shouldIgnore = function(a) {
2192
+ var c = this.ignoreSelectors;
2193
+ if (c) {
2194
+ for (var d = 0;d < c.length;d++) {
2195
+ if (axs.browserUtils.matchSelector(a, c[d])) {
2196
+ return !0;
2197
+ }
2198
+ }
2199
+ }
2200
+ return !1;
2201
+ };
2202
+ })();
2203
+ axs.Audit.auditResults = function(a) {
2204
+ for (var b = new axs.AuditResults, c = 0;c < a.length;c++) {
2205
+ var d = a[c];
2206
+ d.result == axs.constants.AuditResult.FAIL && (d.rule.severity == axs.constants.Severity.SEVERE ? b.addError(axs.Audit.accessibilityErrorMessage(d)) : b.addWarning(axs.Audit.accessibilityErrorMessage(d)));
2207
+ }
2208
+ return b;
2209
+ };
2210
+ goog.exportSymbol("axs.Audit.auditResults", axs.Audit.auditResults);
2211
+ axs.Audit.createReport = function(a, b) {
2212
+ var c;
2213
+ c = "*** Begin accessibility audit results ***\nAn accessibility audit found " + axs.Audit.auditResults(a).toString();
2214
+ b && (c = c + "\nFor more information, please see " + b);
2215
+ return c + "\n*** End accessibility audit results ***";
2216
+ };
2217
+ goog.exportSymbol("axs.Audit.createReport", axs.Audit.createReport);
2218
+ axs.Audit.accessibilityErrorMessage = function(a) {
2219
+ for (var b = a.rule.severity == axs.constants.Severity.SEVERE ? "Error: " : "Warning: ", b = b + (a.rule.code + " (" + a.rule.heading + ") failed on the following " + (1 == a.elements.length ? "element" : "elements")), b = 1 == a.elements.length ? b + ":" : b + (" (1 - " + Math.min(5, a.elements.length) + " of " + a.elements.length + "):"), c = Math.min(a.elements.length, 5), d = 0;d < c;d++) {
2220
+ var e = a.elements[d], b = b + "\n";
2221
+ try {
2222
+ b += axs.utils.getQuerySelectorText(e);
2223
+ } catch (f) {
2224
+ b += " tagName:" + e.tagName, b += " id:" + e.id;
2225
+ }
2226
+ }
2227
+ "" != a.rule.url && (b += "\nSee " + a.rule.url + " for more information.");
2228
+ return b;
2229
+ };
2230
+ goog.exportSymbol("axs.Audit.accessibilityErrorMessage", axs.Audit.accessibilityErrorMessage);
2231
+ axs.AuditRules.addRule({name:"ariaOnReservedElement", heading:"This element does not support ARIA roles, states and properties", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_12", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2232
+ return !axs.properties.canTakeAriaAttributes(a);
2233
+ }, test:function(a) {
2234
+ return null !== axs.properties.getAriaProperties(a);
2235
+ }, code:"AX_ARIA_12"});
2236
+ axs.AuditRules.addRule({name:"ariaOwnsDescendant", heading:"aria-owns should not be used if ownership is implicit in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_06", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2237
+ return axs.browserUtils.matchSelector(a, "[aria-owns]");
2238
+ }, test:function(a) {
2239
+ return axs.utils.getIdReferents("aria-owns", a).some(function(b) {
2240
+ return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_CONTAINED_BY;
2241
+ });
2242
+ }, code:"AX_ARIA_06"});
2243
+ axs.AuditRules.addRule({name:"ariaRoleNotScoped", heading:"Elements with ARIA roles must be in the correct scope", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_09", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2244
+ return axs.browserUtils.matchSelector(a, "[role]");
2245
+ }, test:function(a) {
2246
+ var b = axs.utils.getRoles(a);
2247
+ if (!b || !b.applied) {
2248
+ return !1;
2249
+ }
2250
+ b = b.applied.details.scope;
2251
+ if (!b || 0 === b.length) {
2252
+ return !1;
2253
+ }
2254
+ for (var c = a;c = axs.dom.parentElement(c);) {
2255
+ var d = axs.utils.getRoles(c, !0);
2256
+ if (d && d.applied && 0 <= b.indexOf(d.applied.name)) {
2257
+ return !1;
2258
+ }
2259
+ }
2260
+ if (a = axs.utils.getAriaIdReferrers(a, "aria-owns")) {
2261
+ for (c = 0;c < a.length;c++) {
2262
+ if ((d = axs.utils.getRoles(a[c], !0)) && d.applied && 0 <= b.indexOf(d.applied.name)) {
2263
+ return !1;
2264
+ }
2265
+ }
2266
+ }
2267
+ return !0;
2268
+ }, code:"AX_ARIA_09"});
2269
+ axs.AuditRules.addRule({name:"audioWithoutControls", heading:"Audio elements should have controls", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_audio_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2270
+ return axs.browserUtils.matchSelector(a, "audio[autoplay]");
2271
+ }, test:function(a) {
2272
+ return !a.querySelectorAll("[controls]").length && 3 < a.duration;
2273
+ }, code:"AX_AUDIO_01"});
2274
+ (function() {
2275
+ var a = /^aria\-/;
2276
+ axs.AuditRules.addRule({name:"badAriaAttribute", heading:"This element has an invalid ARIA attribute", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_11", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(b) {
2277
+ b = b.attributes;
2278
+ for (var c = 0, d = b.length;c < d;c++) {
2279
+ if (a.test(b[c].name)) {
2280
+ return !0;
2281
+ }
2282
+ }
2283
+ return !1;
2284
+ }, test:function(b) {
2285
+ b = b.attributes;
2286
+ for (var c = 0, d = b.length;c < d;c++) {
2287
+ var e = b[c].name;
2288
+ if (a.test(e) && (e = e.replace(a, ""), !axs.constants.ARIA_PROPERTIES.hasOwnProperty(e))) {
2289
+ return !0;
2290
+ }
2291
+ }
2292
+ return !1;
2293
+ }, code:"AX_ARIA_11"});
2294
+ })();
2295
+ axs.AuditRules.addRule({name:"badAriaAttributeValue", heading:"ARIA state and property values must be valid", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_04", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2296
+ var b = axs.utils.getSelectorForAriaProperties(axs.constants.ARIA_PROPERTIES);
2297
+ return axs.browserUtils.matchSelector(a, b);
2298
+ }, test:function(a) {
2299
+ for (var b in axs.constants.ARIA_PROPERTIES) {
2300
+ var c = "aria-" + b;
2301
+ if (a.hasAttribute(c)) {
2302
+ var d = a.getAttribute(c);
2303
+ if (!axs.utils.getAriaPropertyValue(c, d, a).valid) {
2304
+ return !0;
2305
+ }
2306
+ }
2307
+ }
2308
+ return !1;
2309
+ }, code:"AX_ARIA_04"});
2310
+ axs.AuditRules.addRule({name:"badAriaRole", heading:"Elements with ARIA roles must use a valid, non-abstract ARIA role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_01", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2311
+ return axs.browserUtils.matchSelector(a, "[role]");
2312
+ }, test:function(a) {
2313
+ return !axs.utils.getRoles(a).valid;
2314
+ }, code:"AX_ARIA_01"});
2315
+ axs.AuditRules.addRule({name:"controlsWithoutLabel", heading:"Controls and media elements should have labels", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_01", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2316
+ if (!axs.browserUtils.matchSelector(a, 'input:not([type="hidden"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), video:not([disabled])') || "presentation" == a.getAttribute("role")) {
2317
+ return !1;
2318
+ }
2319
+ if (0 <= a.tabIndex) {
2320
+ return !0;
2321
+ }
2322
+ for (a = axs.dom.parentElement(a);null != a;a = axs.dom.parentElement(a)) {
2323
+ if (axs.utils.elementIsAriaWidget(a)) {
2324
+ return !1;
2325
+ }
2326
+ }
2327
+ return !0;
2328
+ }, test:function(a, b) {
2329
+ if (b.hidden || "input" == a.tagName.toLowerCase() && "button" == a.type && a.value.length || "button" == a.tagName.toLowerCase() && a.textContent.replace(/^\s+|\s+$/g, "").length || axs.utils.hasLabel(a)) {
2330
+ return !1;
2331
+ }
2332
+ var c = axs.properties.findTextAlternatives(a, {});
2333
+ return null === c || "" === c.trim() ? !0 : !1;
2334
+ }, code:"AX_TEXT_01", ruleName:"Controls and media elements should have labels"});
2335
+ axs.AuditRules.addRule({name:"duplicateId", heading:"Any ID referred to via an IDREF must be unique in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_html_02", severity:axs.constants.Severity.SEVERE, opt_requires:{idRefs:!0}, relevantElementMatcher:function(a, b) {
2336
+ b.idrefs.length && !b.hidden && this.relatedElements.push({element:a, flags:b});
2337
+ return a.hasAttribute("id") ? !0 : !1;
2338
+ }, isRelevant:function(a, b) {
2339
+ var c = a.id, d = b.level;
2340
+ return this.relatedElements.some(function(a) {
2341
+ var b = a.flags.idrefs;
2342
+ return a.flags.level === d && 0 <= b.indexOf(c);
2343
+ });
2344
+ }, test:function(a) {
2345
+ var b = "[id='" + a.id.replace(/'/g, "\\'") + "']";
2346
+ return 1 < a.ownerDocument.querySelectorAll(b).length;
2347
+ }, code:"AX_HTML_02"});
2348
+ axs.AuditRules.addRule({name:"focusableElementNotVisibleAndNotAriaHidden", heading:"These elements are focusable but either invisible or obscured by another element", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_focus_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2349
+ if (!axs.browserUtils.matchSelector(a, axs.utils.FOCUSABLE_ELEMENTS_SELECTOR)) {
2350
+ return !1;
2351
+ }
2352
+ if (0 <= a.tabIndex) {
2353
+ return !0;
2354
+ }
2355
+ for (var b = axs.dom.parentElement(a);null != b;b = axs.dom.parentElement(b)) {
2356
+ if (axs.utils.elementIsAriaWidget(b)) {
2357
+ return !1;
2358
+ }
2359
+ }
2360
+ a = axs.properties.findTextAlternatives(a, {});
2361
+ return null === a || "" === a.trim() ? !1 : !0;
2362
+ }, test:function(a, b) {
2363
+ if (b.hidden) {
2364
+ return !1;
2365
+ }
2366
+ a.focus();
2367
+ return !axs.utils.elementIsVisible(a);
2368
+ }, code:"AX_FOCUS_01"});
2369
+ axs.AuditRules.addRule({name:"humanLangMissing", heading:"The web page should have the content's human language indicated in the markup", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_html_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2370
+ return a instanceof a.ownerDocument.defaultView.HTMLHtmlElement;
2371
+ }, test:function(a) {
2372
+ return a.lang ? !1 : !0;
2373
+ }, code:"AX_HTML_01"});
2374
+ axs.AuditRules.addRule({name:"imagesWithoutAltText", heading:"Images should have a text alternative or presentational role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_02", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a, b) {
2375
+ return axs.browserUtils.matchSelector(a, "img") && !b.hidden;
2376
+ }, test:function(a) {
2377
+ if (a.hasAttribute("alt") && "" == a.alt || "presentation" == a.getAttribute("role")) {
2378
+ return !1;
2379
+ }
2380
+ var b = {};
2381
+ axs.properties.findTextAlternatives(a, b);
2382
+ return 0 == Object.keys(b).length ? !0 : !1;
2383
+ }, code:"AX_TEXT_02"});
2384
+ axs.AuditRules.addRule({name:"linkWithUnclearPurpose", heading:"The purpose of each link should be clear from the link text", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_04", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a, b) {
2385
+ return axs.browserUtils.matchSelector(a, "a[href]") && !b.hidden;
2386
+ }, test:function(a, b, c) {
2387
+ c = c || {};
2388
+ var d = c.blacklistPhrases || [], e = /\s+/;
2389
+ for (b = 0;b < d.length;b++) {
2390
+ var f = "^\\s*" + d[b].trim().replace(e, "\\s*") + "s*[^a-z]$";
2391
+ if ((new RegExp(f, "i")).test(a.textContent)) {
2392
+ return !0;
2393
+ }
2394
+ }
2395
+ c = c.stopwords || "click tap go here learn more this page link about".split(" ");
2396
+ a = axs.properties.findTextAlternatives(a, {});
2397
+ if (null === a || "" === a.trim()) {
2398
+ return !0;
2399
+ }
2400
+ a = a.replace(/[^a-zA-Z ]/g, "");
2401
+ for (b = 0;b < c.length;b++) {
2402
+ if (a = a.replace(new RegExp("\\b" + c[b] + "\\b", "ig"), ""), "" == a.trim()) {
2403
+ return !0;
2404
+ }
2405
+ }
2406
+ return !1;
2407
+ }, code:"AX_TEXT_04"});
2408
+ axs.AuditRules.addRule({name:"lowContrastElements", heading:"Text elements should have a reasonable contrast ratio", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_color_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a, b) {
2409
+ return !b.disabled && axs.properties.hasDirectTextDescendant(a);
2410
+ }, test:function(a) {
2411
+ var b = window.getComputedStyle(a, null);
2412
+ return (a = axs.utils.getContrastRatioForElementWithComputedStyle(b, a)) && axs.utils.isLowContrast(a, b);
2413
+ }, code:"AX_COLOR_01"});
2414
+ axs.AuditRules.addRule({name:"mainRoleOnInappropriateElement", heading:"role=main should only appear on significant elements", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_05", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2415
+ return axs.browserUtils.matchSelector(a, "[role~=main]");
2416
+ }, test:function(a) {
2417
+ if (axs.utils.isInlineElement(a)) {
2418
+ return !0;
2419
+ }
2420
+ a = axs.properties.getTextFromDescendantContent(a);
2421
+ return !a || 50 > a.length ? !0 : !1;
2422
+ }, code:"AX_ARIA_05"});
2423
+ axs.AuditRules.addRule({name:"elementsWithMeaningfulBackgroundImage", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a, b) {
2424
+ return !b.hidden;
2425
+ }, heading:"Meaningful images should not be used in element backgrounds", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_image_01", test:function(a) {
2426
+ if (a.textContent && 0 < a.textContent.length) {
2427
+ return !1;
2428
+ }
2429
+ a = window.getComputedStyle(a, null);
2430
+ var b = a.backgroundImage;
2431
+ if (!b || "undefined" === b || "none" === b || 0 != b.indexOf("url")) {
2432
+ return !1;
2433
+ }
2434
+ b = parseInt(a.width, 10);
2435
+ a = parseInt(a.height, 10);
2436
+ return 150 > b && 150 > a;
2437
+ }, code:"AX_IMAGE_01"});
2438
+ axs.AuditRules.addRule({name:"multipleAriaOwners", heading:"An element's ID must not be present in more that one aria-owns attribute at any time", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_07", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2439
+ return axs.browserUtils.matchSelector(a, "[aria-owns]");
2440
+ }, test:function(a) {
2441
+ return axs.utils.getIdReferents("aria-owns", a).some(function(a) {
2442
+ return 1 < axs.utils.getAriaIdReferrers(a, "aria-owns").length;
2443
+ });
2444
+ }, code:"AX_ARIA_07"});
2445
+ axs.AuditRules.addRule({name:"multipleLabelableElementsPerLabel", heading:"A label element may not have labelable descendants other than its labeled control.", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#-ax_text_03--labels-should-only-contain-one-labelable-element", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2446
+ return axs.browserUtils.matchSelector(a, "label");
2447
+ }, test:function(a) {
2448
+ if (1 < a.querySelectorAll(axs.utils.LABELABLE_ELEMENTS_SELECTOR).length) {
2449
+ return !0;
2450
+ }
2451
+ }, code:"AX_TEXT_03"});
2452
+ axs.AuditRules.addRule({name:"nonExistentRelatedElement", heading:"Attributes which refer to other elements by ID should refer to elements which exist in the DOM", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_html_03", severity:axs.constants.Severity.SEVERE, opt_requires:{idRefs:!0}, relevantElementMatcher:function(a, b) {
2453
+ return 0 < b.idrefs.length;
2454
+ }, test:function(a, b) {
2455
+ return b.idrefs.some(function(a) {
2456
+ return !document.getElementById(a);
2457
+ });
2458
+ }, code:"AX_HTML_03"});
2459
+ axs.AuditRules.addRule({name:"pageWithoutTitle", heading:"The web page should have a title that describes topic or purpose", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_title_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2460
+ return "html" == a.tagName.toLowerCase();
2461
+ }, test:function(a) {
2462
+ a = a.querySelector("head");
2463
+ return a ? (a = a.querySelector("title")) ? !a.textContent : !0 : !0;
2464
+ }, code:"AX_TITLE_01"});
2465
+ axs.AuditRules.addRule({name:"requiredAriaAttributeMissing", heading:"Elements with ARIA roles must have all required attributes for that role", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_03", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2466
+ return axs.browserUtils.matchSelector(a, "[role]");
2467
+ }, test:function(a) {
2468
+ var b = axs.utils.getRoles(a);
2469
+ if (!b.valid) {
2470
+ return !1;
2471
+ }
2472
+ for (var c = 0;c < b.roles.length;c++) {
2473
+ var d = b.roles[c].details.requiredPropertiesSet, e;
2474
+ for (e in d) {
2475
+ if (d = e.replace(/^aria-/, ""), !("defaultValue" in axs.constants.ARIA_PROPERTIES[d] || a.hasAttribute(e)) && 0 > axs.properties.getNativelySupportedAttributes(a).indexOf(e)) {
2476
+ return !0;
2477
+ }
2478
+ }
2479
+ }
2480
+ }, code:"AX_ARIA_03"});
2481
+ (function() {
2482
+ function a(a) {
2483
+ a = axs.utils.getRoles(a);
2484
+ if (!a || !a.applied) {
2485
+ return [];
2486
+ }
2487
+ a = a.applied;
2488
+ return a.valid ? a.details.mustcontain || [] : [];
2489
+ }
2490
+ axs.AuditRules.addRule({name:"requiredOwnedAriaRoleMissing", heading:"Elements with ARIA roles must ensure required owned elements are present", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_08", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(b) {
2491
+ return axs.browserUtils.matchSelector(b, "[role]") ? 0 < a(b).length : !1;
2492
+ }, test:function(b) {
2493
+ if ("true" === b.getAttribute("aria-busy")) {
2494
+ return !1;
2495
+ }
2496
+ for (var c = a(b), d = c.length - 1;0 <= d;d--) {
2497
+ var e = axs.utils.findDescendantsWithRole(b, c[d]);
2498
+ if (e && e.length) {
2499
+ return !1;
2500
+ }
2501
+ }
2502
+ b = axs.utils.getIdReferents("aria-owns", b);
2503
+ for (d = b.length - 1;0 <= d;d--) {
2504
+ if ((e = axs.utils.getRoles(b[d], !0)) && e.applied) {
2505
+ for (var e = e.applied, f = c.length - 1;0 <= f;f--) {
2506
+ if (e.name === c[f]) {
2507
+ return !1;
2508
+ }
2509
+ }
2510
+ }
2511
+ }
2512
+ return !0;
2513
+ }, code:"AX_ARIA_08"});
2514
+ })();
2515
+ axs.AuditRules.addRule({name:"roleTooltipRequiresDescribedby", heading:"Elements with role=tooltip should have a corresponding element with aria-describedby", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_02", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a, b) {
2516
+ return axs.browserUtils.matchSelector(a, "[role=tooltip]") && !b.hidden;
2517
+ }, test:function(a) {
2518
+ a = axs.utils.getAriaIdReferrers(a, "aria-describedby");
2519
+ return !a || 0 === a.length;
2520
+ }, code:"AX_TOOLTIP_01"});
2521
+ axs.AuditRules.addRule({name:"tabIndexGreaterThanZero", heading:"Avoid positive integer values for tabIndex", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_focus_03", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2522
+ return axs.browserUtils.matchSelector(a, "[tabindex]");
2523
+ }, test:function(a) {
2524
+ if (0 < a.tabIndex) {
2525
+ return !0;
2526
+ }
2527
+ }, code:"AX_FOCUS_03"});
2528
+ (function() {
2529
+ function a(a) {
2530
+ if (0 == a.childElementCount) {
2531
+ return !0;
2532
+ }
2533
+ if (a.hasAttribute("role") && "presentation" != a.getAttribute("role")) {
2534
+ return !1;
2535
+ }
2536
+ if ("presentation" == a.getAttribute("role")) {
2537
+ a = a.querySelectorAll("*");
2538
+ for (var c = 0;c < a.length;c++) {
2539
+ if ("TR" != a[c].tagName && "TD" != a[c].tagName) {
2540
+ return !1;
2541
+ }
2542
+ }
2543
+ return !0;
2544
+ }
2545
+ return !1;
2546
+ }
2547
+ axs.AuditRules.addRule({name:"tableHasAppropriateHeaders", heading:"Tables should have appropriate headers", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_table_01", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(b) {
2548
+ return axs.browserUtils.matchSelector(b, "table") && !a(b) && 0 < b.querySelectorAll("tr").length;
2549
+ }, test:function(a) {
2550
+ a = a.querySelectorAll("tr");
2551
+ var c;
2552
+ a: {
2553
+ c = a[0].children;
2554
+ for (var d = 0;d < c.length;d++) {
2555
+ if ("TH" != c[d].tagName) {
2556
+ c = !0;
2557
+ break a;
2558
+ }
2559
+ }
2560
+ c = !1;
2561
+ }
2562
+ if (c) {
2563
+ a: {
2564
+ for (c = 0;c < a.length;c++) {
2565
+ if ("TH" != a[c].children[0].tagName) {
2566
+ c = !0;
2567
+ break a;
2568
+ }
2569
+ }
2570
+ c = !1;
2571
+ }
2572
+ }
2573
+ if (c) {
2574
+ a: {
2575
+ c = a[0].children;
2576
+ for (d = 1;d < c.length;d++) {
2577
+ if ("TH" != c[d].tagName) {
2578
+ c = !0;
2579
+ break a;
2580
+ }
2581
+ }
2582
+ for (d = 1;d < a.length;d++) {
2583
+ if ("TH" != a[d].children[0].tagName) {
2584
+ c = !0;
2585
+ break a;
2586
+ }
2587
+ }
2588
+ c = !1;
2589
+ }
2590
+ }
2591
+ return c;
2592
+ }, code:"AX_TABLE_01"});
2593
+ })();
2594
+ (function() {
2595
+ axs.AuditRules.addRule({name:"uncontrolledTabpanel", heading:"A tabpanel should be related to a tab via aria-controls or aria-labelledby", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_13", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2596
+ return axs.browserUtils.matchSelector(a, '[role="tabpanel"]');
2597
+ }, test:function(a) {
2598
+ var b;
2599
+ b = document.querySelectorAll('[role="tab"][aria-controls="' + a.id + '"]');
2600
+ (b = a.id && 1 === b.length) || (a.hasAttribute("aria-labelledby") ? (a = document.querySelectorAll("#" + a.getAttribute("aria-labelledby")), b = 1 === a.length && "tab" === a[0].getAttribute("role")) : b = !1);
2601
+ return !b;
2602
+ }, code:"AX_ARIA_13"});
2603
+ })();
2604
+ axs.AuditRules.addRule({name:"unfocusableElementsWithOnClick", heading:"Elements with onclick handlers must be focusable", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_focus_02", severity:axs.constants.Severity.WARNING, opt_requires:{consoleAPI:!0}, relevantElementMatcher:function(a, b) {
2605
+ return a instanceof a.ownerDocument.defaultView.HTMLBodyElement || b.hidden ? !1 : "click" in getEventListeners(a) ? !0 : !1;
2606
+ }, test:function(a) {
2607
+ return !a.hasAttribute("tabindex") && !axs.utils.isElementImplicitlyFocusable(a) && !a.disabled;
2608
+ }, code:"AX_FOCUS_02"});
2609
+ (function() {
2610
+ var a = /^aria\-/, b = axs.utils.getSelectorForAriaProperties(axs.constants.ARIA_PROPERTIES);
2611
+ axs.AuditRules.addRule({name:"unsupportedAriaAttribute", heading:"This element has an unsupported ARIA attribute", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_10", severity:axs.constants.Severity.SEVERE, relevantElementMatcher:function(a) {
2612
+ return axs.browserUtils.matchSelector(a, b);
2613
+ }, test:function(b) {
2614
+ var d = axs.utils.getRoles(b, !0), d = d && d.applied ? d.applied.details.propertiesSet : axs.constants.GLOBAL_PROPERTIES;
2615
+ b = b.attributes;
2616
+ for (var e = 0, f = b.length;e < f;e++) {
2617
+ var g = b[e].name;
2618
+ if (a.test(g)) {
2619
+ var h = g.replace(a, "");
2620
+ if (axs.constants.ARIA_PROPERTIES.hasOwnProperty(h) && !(g in d)) {
2621
+ return !0;
2622
+ }
2623
+ }
2624
+ }
2625
+ return !1;
2626
+ }, code:"AX_ARIA_10"});
2627
+ })();
2628
+ axs.AuditRules.addRule({name:"videoWithoutCaptions", heading:"Video elements should use <track> elements to provide captions", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_video_01", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) {
2629
+ return axs.browserUtils.matchSelector(a, "video");
2630
+ }, test:function(a) {
2631
+ return !a.querySelectorAll("track[kind=captions]").length;
2632
+ }, code:"AX_VIDEO_01"});
1648
2633
 
2634
+ return axs;
2635
+ });
1649
2636
 
2637
+ // Define AMD module if possible, export globals otherwise.
2638
+ if (typeof define !== 'undefined' && define.amd) {
2639
+ define([], fn);
2640
+ } else {
2641
+ var axs = fn.call(this);
2642
+ }