longdown 2023.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/LICENSE +10 -0
  2. package/README.md +77 -0
  3. package/bin/cli.js +3 -0
  4. package/lib/cli.js +120 -0
  5. package/lib/cljs-runtime/cljs.core.js +38285 -0
  6. package/lib/cljs-runtime/cljs.core.js.map +1 -0
  7. package/lib/cljs-runtime/cljs_env.js +1268 -0
  8. package/lib/cljs-runtime/clojure.string.js +477 -0
  9. package/lib/cljs-runtime/clojure.string.js.map +1 -0
  10. package/lib/cljs-runtime/clojure.tools.cli.js +1684 -0
  11. package/lib/cljs-runtime/clojure.tools.cli.js.map +1 -0
  12. package/lib/cljs-runtime/clojure.walk.js +131 -0
  13. package/lib/cljs-runtime/clojure.walk.js.map +1 -0
  14. package/lib/cljs-runtime/goog.array.array.js +658 -0
  15. package/lib/cljs-runtime/goog.array.array.js.map +9 -0
  16. package/lib/cljs-runtime/goog.asserts.asserts.js +131 -0
  17. package/lib/cljs-runtime/goog.asserts.asserts.js.map +9 -0
  18. package/lib/cljs-runtime/goog.asserts.dom.js +87 -0
  19. package/lib/cljs-runtime/goog.asserts.dom.js.map +9 -0
  20. package/lib/cljs-runtime/goog.base.js +1242 -0
  21. package/lib/cljs-runtime/goog.base.js.map +9 -0
  22. package/lib/cljs-runtime/goog.collections.maps.js +79 -0
  23. package/lib/cljs-runtime/goog.collections.maps.js.map +9 -0
  24. package/lib/cljs-runtime/goog.debug.error.js +29 -0
  25. package/lib/cljs-runtime/goog.debug.error.js.map +9 -0
  26. package/lib/cljs-runtime/goog.dom.asserts.js +39 -0
  27. package/lib/cljs-runtime/goog.dom.asserts.js.map +9 -0
  28. package/lib/cljs-runtime/goog.dom.element.js +67 -0
  29. package/lib/cljs-runtime/goog.dom.element.js.map +9 -0
  30. package/lib/cljs-runtime/goog.dom.htmlelement.js +6 -0
  31. package/lib/cljs-runtime/goog.dom.htmlelement.js.map +9 -0
  32. package/lib/cljs-runtime/goog.dom.nodetype.js +5 -0
  33. package/lib/cljs-runtime/goog.dom.nodetype.js.map +9 -0
  34. package/lib/cljs-runtime/goog.dom.safe.js +265 -0
  35. package/lib/cljs-runtime/goog.dom.safe.js.map +9 -0
  36. package/lib/cljs-runtime/goog.dom.tagname.js +146 -0
  37. package/lib/cljs-runtime/goog.dom.tagname.js.map +9 -0
  38. package/lib/cljs-runtime/goog.dom.tags.js +9 -0
  39. package/lib/cljs-runtime/goog.dom.tags.js.map +9 -0
  40. package/lib/cljs-runtime/goog.flags.flags.js +11 -0
  41. package/lib/cljs-runtime/goog.flags.flags.js.map +9 -0
  42. package/lib/cljs-runtime/goog.fs.blob.js +37 -0
  43. package/lib/cljs-runtime/goog.fs.blob.js.map +9 -0
  44. package/lib/cljs-runtime/goog.fs.url.js +36 -0
  45. package/lib/cljs-runtime/goog.fs.url.js.map +9 -0
  46. package/lib/cljs-runtime/goog.functions.functions.js +210 -0
  47. package/lib/cljs-runtime/goog.functions.functions.js.map +9 -0
  48. package/lib/cljs-runtime/goog.html.safehtml.js +306 -0
  49. package/lib/cljs-runtime/goog.html.safehtml.js.map +9 -0
  50. package/lib/cljs-runtime/goog.html.safescript.js +61 -0
  51. package/lib/cljs-runtime/goog.html.safescript.js.map +9 -0
  52. package/lib/cljs-runtime/goog.html.safestyle.js +170 -0
  53. package/lib/cljs-runtime/goog.html.safestyle.js.map +9 -0
  54. package/lib/cljs-runtime/goog.html.safestylesheet.js +93 -0
  55. package/lib/cljs-runtime/goog.html.safestylesheet.js.map +9 -0
  56. package/lib/cljs-runtime/goog.html.safeurl.js +225 -0
  57. package/lib/cljs-runtime/goog.html.safeurl.js.map +9 -0
  58. package/lib/cljs-runtime/goog.html.trustedresourceurl.js +113 -0
  59. package/lib/cljs-runtime/goog.html.trustedresourceurl.js.map +9 -0
  60. package/lib/cljs-runtime/goog.html.trustedtypes.js +15 -0
  61. package/lib/cljs-runtime/goog.html.trustedtypes.js.map +9 -0
  62. package/lib/cljs-runtime/goog.html.uncheckedconversions.js +43 -0
  63. package/lib/cljs-runtime/goog.html.uncheckedconversions.js.map +9 -0
  64. package/lib/cljs-runtime/goog.labs.useragent.browser.js +332 -0
  65. package/lib/cljs-runtime/goog.labs.useragent.browser.js.map +9 -0
  66. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +13 -0
  67. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +9 -0
  68. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +72 -0
  69. package/lib/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +9 -0
  70. package/lib/cljs-runtime/goog.labs.useragent.useragent.js +20 -0
  71. package/lib/cljs-runtime/goog.labs.useragent.useragent.js.map +9 -0
  72. package/lib/cljs-runtime/goog.labs.useragent.util.js +77 -0
  73. package/lib/cljs-runtime/goog.labs.useragent.util.js.map +9 -0
  74. package/lib/cljs-runtime/goog.math.integer.js +425 -0
  75. package/lib/cljs-runtime/goog.math.integer.js.map +9 -0
  76. package/lib/cljs-runtime/goog.math.long.js +427 -0
  77. package/lib/cljs-runtime/goog.math.long.js.map +9 -0
  78. package/lib/cljs-runtime/goog.object.object.js +283 -0
  79. package/lib/cljs-runtime/goog.object.object.js.map +9 -0
  80. package/lib/cljs-runtime/goog.reflect.reflect.js +31 -0
  81. package/lib/cljs-runtime/goog.reflect.reflect.js.map +9 -0
  82. package/lib/cljs-runtime/goog.string.const.js +33 -0
  83. package/lib/cljs-runtime/goog.string.const.js.map +9 -0
  84. package/lib/cljs-runtime/goog.string.internal.js +118 -0
  85. package/lib/cljs-runtime/goog.string.internal.js.map +9 -0
  86. package/lib/cljs-runtime/goog.string.string.js +458 -0
  87. package/lib/cljs-runtime/goog.string.string.js.map +9 -0
  88. package/lib/cljs-runtime/goog.string.stringbuffer.js +31 -0
  89. package/lib/cljs-runtime/goog.string.stringbuffer.js.map +9 -0
  90. package/lib/cljs-runtime/goog.string.stringformat.js +74 -0
  91. package/lib/cljs-runtime/goog.string.stringformat.js.map +9 -0
  92. package/lib/cljs-runtime/goog.string.typedstring.js +8 -0
  93. package/lib/cljs-runtime/goog.string.typedstring.js.map +9 -0
  94. package/lib/cljs-runtime/goog.structs.structs.js +188 -0
  95. package/lib/cljs-runtime/goog.structs.structs.js.map +9 -0
  96. package/lib/cljs-runtime/goog.uri.uri.js +616 -0
  97. package/lib/cljs-runtime/goog.uri.uri.js.map +9 -0
  98. package/lib/cljs-runtime/goog.uri.utils.js +320 -0
  99. package/lib/cljs-runtime/goog.uri.utils.js.map +9 -0
  100. package/lib/cljs-runtime/longdown.cli.js +128 -0
  101. package/lib/cljs-runtime/longdown.cli.js.map +1 -0
  102. package/lib/cljs-runtime/longdown.lib.js +122 -0
  103. package/lib/cljs-runtime/longdown.lib.js.map +1 -0
  104. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_from_markdown.js +5 -0
  105. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_from_markdown.js.map +9 -0
  106. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js +5 -0
  107. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown$lib$unsafe.js.map +9 -0
  108. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown.js +5 -0
  109. package/lib/cljs-runtime/shadow.esm.esm_import$mdast_util_to_markdown.js.map +9 -0
  110. package/lib/cljs-runtime/shadow.esm.esm_import$node_fs.js +5 -0
  111. package/lib/cljs-runtime/shadow.esm.esm_import$node_fs.js.map +9 -0
  112. package/lib/cljs-runtime/shadow.esm.esm_import$node_path.js +5 -0
  113. package/lib/cljs-runtime/shadow.esm.esm_import$node_path.js.map +9 -0
  114. package/lib/cljs-runtime/shadow.esm.esm_import$remark_parse.js +5 -0
  115. package/lib/cljs-runtime/shadow.esm.esm_import$remark_parse.js.map +9 -0
  116. package/lib/cljs-runtime/shadow.esm.esm_import$remark_stringify.js +5 -0
  117. package/lib/cljs-runtime/shadow.esm.esm_import$remark_stringify.js.map +9 -0
  118. package/lib/cljs-runtime/shadow.esm.esm_import$unified.js +5 -0
  119. package/lib/cljs-runtime/shadow.esm.esm_import$unified.js.map +9 -0
  120. package/lib/cljs-runtime/shadow.module.cli.append.js +1 -0
  121. package/lib/cljs-runtime/shadow.module.cli.prepend.js +17 -0
  122. package/lib/cljs-runtime/shadow.module.lib.append.js +1 -0
  123. package/lib/cljs-runtime/shadow.module.lib.prepend.js +2 -0
  124. package/lib/lib.js +8 -0
  125. package/package.json +33 -0
@@ -0,0 +1,332 @@
1
+ import "./cljs_env.js";
2
+ goog.loadModule(function(exports) {
3
+ "use strict";
4
+ goog.module("goog.labs.userAgent.browser");
5
+ goog.module.declareLegacyNamespace();
6
+ const util = goog.require("goog.labs.userAgent.util");
7
+ const {AsyncValue, Version} = goog.require("goog.labs.userAgent.highEntropy.highEntropyValue");
8
+ const {assert, assertExists} = goog.require("goog.asserts");
9
+ const {compareVersions} = goog.require("goog.string.internal");
10
+ const {fullVersionList} = goog.require("goog.labs.userAgent.highEntropy.highEntropyData");
11
+ const {useClientHints} = goog.require("goog.labs.userAgent");
12
+ const Brand = {ANDROID_BROWSER:"Android Browser", CHROMIUM:"Chromium", EDGE:"Microsoft Edge", FIREFOX:"Firefox", IE:"Internet Explorer", OPERA:"Opera", SAFARI:"Safari", SILK:"Silk",};
13
+ exports.Brand = Brand;
14
+ function useUserAgentDataBrand(ignoreClientHintsFlag = false) {
15
+ if (util.ASSUME_CLIENT_HINTS_SUPPORT) {
16
+ return true;
17
+ }
18
+ if (!ignoreClientHintsFlag && !useClientHints()) {
19
+ return false;
20
+ }
21
+ const userAgentData = util.getUserAgentData();
22
+ return !!userAgentData && userAgentData.brands.length > 0;
23
+ }
24
+ function hasFullVersionList() {
25
+ return isAtLeast(Brand.CHROMIUM, 98);
26
+ }
27
+ function matchOpera() {
28
+ if (useUserAgentDataBrand()) {
29
+ return false;
30
+ }
31
+ return util.matchUserAgent("Opera");
32
+ }
33
+ function matchIE() {
34
+ if (useUserAgentDataBrand()) {
35
+ return false;
36
+ }
37
+ return util.matchUserAgent("Trident") || util.matchUserAgent("MSIE");
38
+ }
39
+ function matchEdgeHtml() {
40
+ if (useUserAgentDataBrand()) {
41
+ return false;
42
+ }
43
+ return util.matchUserAgent("Edge");
44
+ }
45
+ function matchEdgeChromium() {
46
+ if (useUserAgentDataBrand()) {
47
+ return util.matchUserAgentDataBrand(Brand.EDGE);
48
+ }
49
+ return util.matchUserAgent("Edg/");
50
+ }
51
+ function matchOperaChromium() {
52
+ if (useUserAgentDataBrand()) {
53
+ return util.matchUserAgentDataBrand(Brand.OPERA);
54
+ }
55
+ return util.matchUserAgent("OPR");
56
+ }
57
+ function matchFirefox() {
58
+ return util.matchUserAgent("Firefox") || util.matchUserAgent("FxiOS");
59
+ }
60
+ function matchSafari() {
61
+ return util.matchUserAgent("Safari") && !(matchChrome() || matchCoast() || matchOpera() || matchEdgeHtml() || matchEdgeChromium() || matchOperaChromium() || matchFirefox() || isSilk() || util.matchUserAgent("Android"));
62
+ }
63
+ function matchCoast() {
64
+ if (useUserAgentDataBrand()) {
65
+ return false;
66
+ }
67
+ return util.matchUserAgent("Coast");
68
+ }
69
+ function matchIosWebview() {
70
+ return (util.matchUserAgent("iPad") || util.matchUserAgent("iPhone")) && !matchSafari() && !matchChrome() && !matchCoast() && !matchFirefox() && util.matchUserAgent("AppleWebKit");
71
+ }
72
+ function matchChrome() {
73
+ if (useUserAgentDataBrand()) {
74
+ return util.matchUserAgentDataBrand(Brand.CHROMIUM);
75
+ }
76
+ return (util.matchUserAgent("Chrome") || util.matchUserAgent("CriOS")) && !matchEdgeHtml() || isSilk();
77
+ }
78
+ function matchAndroidBrowser() {
79
+ return util.matchUserAgent("Android") && !(isChrome() || isFirefox() || isOpera() || isSilk());
80
+ }
81
+ const isOpera = matchOpera;
82
+ exports.isOpera = isOpera;
83
+ const isIE = matchIE;
84
+ exports.isIE = isIE;
85
+ const isEdge = matchEdgeHtml;
86
+ exports.isEdge = isEdge;
87
+ const isEdgeChromium = matchEdgeChromium;
88
+ exports.isEdgeChromium = isEdgeChromium;
89
+ const isOperaChromium = matchOperaChromium;
90
+ exports.isOperaChromium = isOperaChromium;
91
+ const isFirefox = matchFirefox;
92
+ exports.isFirefox = isFirefox;
93
+ const isSafari = matchSafari;
94
+ exports.isSafari = isSafari;
95
+ const isCoast = matchCoast;
96
+ exports.isCoast = isCoast;
97
+ const isIosWebview = matchIosWebview;
98
+ exports.isIosWebview = isIosWebview;
99
+ const isChrome = matchChrome;
100
+ exports.isChrome = isChrome;
101
+ const isAndroidBrowser = matchAndroidBrowser;
102
+ exports.isAndroidBrowser = isAndroidBrowser;
103
+ function isSilk() {
104
+ return util.matchUserAgent("Silk");
105
+ }
106
+ exports.isSilk = isSilk;
107
+ function createVersionMap(versionTuples) {
108
+ const versionMap = {};
109
+ versionTuples.forEach(tuple => {
110
+ const key = tuple[0];
111
+ const value = tuple[1];
112
+ versionMap[key] = value;
113
+ });
114
+ return keys => versionMap[keys.find(key => key in versionMap)] || "";
115
+ }
116
+ function getVersion() {
117
+ const userAgentString = util.getUserAgent();
118
+ if (isIE()) {
119
+ return getIEVersion(userAgentString);
120
+ }
121
+ const versionTuples = util.extractVersionTuples(userAgentString);
122
+ const lookUpValueWithKeys = createVersionMap(versionTuples);
123
+ if (isOpera()) {
124
+ return lookUpValueWithKeys(["Version", "Opera"]);
125
+ }
126
+ if (isEdge()) {
127
+ return lookUpValueWithKeys(["Edge"]);
128
+ }
129
+ if (isEdgeChromium()) {
130
+ return lookUpValueWithKeys(["Edg"]);
131
+ }
132
+ if (isSilk()) {
133
+ return lookUpValueWithKeys(["Silk"]);
134
+ }
135
+ if (isChrome()) {
136
+ return lookUpValueWithKeys(["Chrome", "CriOS", "HeadlessChrome"]);
137
+ }
138
+ const tuple = versionTuples[2];
139
+ return tuple && tuple[1] || "";
140
+ }
141
+ exports.getVersion = getVersion;
142
+ function isVersionOrHigher(version) {
143
+ return compareVersions(getVersion(), version) >= 0;
144
+ }
145
+ exports.isVersionOrHigher = isVersionOrHigher;
146
+ function getIEVersion(userAgent) {
147
+ const rv = /rv: *([\d\.]*)/.exec(userAgent);
148
+ if (rv && rv[1]) {
149
+ return rv[1];
150
+ }
151
+ let version = "";
152
+ const msie = /MSIE +([\d\.]+)/.exec(userAgent);
153
+ if (msie && msie[1]) {
154
+ const tridentVersion = /Trident\/(\d.\d)/.exec(userAgent);
155
+ if (msie[1] == "7.0") {
156
+ if (tridentVersion && tridentVersion[1]) {
157
+ switch(tridentVersion[1]) {
158
+ case "4.0":
159
+ version = "8.0";
160
+ break;
161
+ case "5.0":
162
+ version = "9.0";
163
+ break;
164
+ case "6.0":
165
+ version = "10.0";
166
+ break;
167
+ case "7.0":
168
+ version = "11.0";
169
+ break;
170
+ }
171
+ } else {
172
+ version = "7.0";
173
+ }
174
+ } else {
175
+ version = msie[1];
176
+ }
177
+ }
178
+ return version;
179
+ }
180
+ function getFullVersionFromUserAgentString(browser) {
181
+ const userAgentString = util.getUserAgent();
182
+ if (browser === Brand.IE) {
183
+ return isIE() ? getIEVersion(userAgentString) : "";
184
+ }
185
+ const versionTuples = util.extractVersionTuples(userAgentString);
186
+ const lookUpValueWithKeys = createVersionMap(versionTuples);
187
+ switch(browser) {
188
+ case Brand.OPERA:
189
+ if (isOpera()) {
190
+ return lookUpValueWithKeys(["Version", "Opera"]);
191
+ } else if (isOperaChromium()) {
192
+ return lookUpValueWithKeys(["OPR"]);
193
+ }
194
+ break;
195
+ case Brand.EDGE:
196
+ if (isEdge()) {
197
+ return lookUpValueWithKeys(["Edge"]);
198
+ } else if (isEdgeChromium()) {
199
+ return lookUpValueWithKeys(["Edg"]);
200
+ }
201
+ break;
202
+ case Brand.CHROMIUM:
203
+ if (isChrome()) {
204
+ return lookUpValueWithKeys(["Chrome", "CriOS", "HeadlessChrome"]);
205
+ }
206
+ break;
207
+ }
208
+ if (browser === Brand.FIREFOX && isFirefox() || browser === Brand.SAFARI && isSafari() || browser === Brand.ANDROID_BROWSER && isAndroidBrowser() || browser === Brand.SILK && isSilk()) {
209
+ const tuple = versionTuples[2];
210
+ return tuple && tuple[1] || "";
211
+ }
212
+ return "";
213
+ }
214
+ function versionOf_(browser) {
215
+ let versionParts;
216
+ if (useUserAgentDataBrand() && browser !== Brand.SILK) {
217
+ const data = util.getUserAgentData();
218
+ const matchingBrand = data.brands.find(({brand}) => brand === browser);
219
+ if (!matchingBrand || !matchingBrand.version) {
220
+ return NaN;
221
+ }
222
+ versionParts = matchingBrand.version.split(".");
223
+ } else {
224
+ const fullVersion = getFullVersionFromUserAgentString(browser);
225
+ if (fullVersion === "") {
226
+ return NaN;
227
+ }
228
+ versionParts = fullVersion.split(".");
229
+ }
230
+ if (versionParts.length === 0) {
231
+ return NaN;
232
+ }
233
+ const majorVersion = versionParts[0];
234
+ return Number(majorVersion);
235
+ }
236
+ function isAtLeast(brand, majorVersion) {
237
+ assert(Math.floor(majorVersion) === majorVersion, "Major version must be an integer");
238
+ return versionOf_(brand) >= majorVersion;
239
+ }
240
+ exports.isAtLeast = isAtLeast;
241
+ function isAtMost(brand, majorVersion) {
242
+ assert(Math.floor(majorVersion) === majorVersion, "Major version must be an integer");
243
+ return versionOf_(brand) <= majorVersion;
244
+ }
245
+ exports.isAtMost = isAtMost;
246
+ class HighEntropyBrandVersion {
247
+ constructor(brand, useUach, fallbackVersion) {
248
+ this.brand_ = brand;
249
+ this.version_ = new Version(fallbackVersion);
250
+ this.useUach_ = useUach;
251
+ }
252
+ getIfLoaded() {
253
+ if (this.useUach_) {
254
+ const loadedVersionList = fullVersionList.getIfLoaded();
255
+ if (loadedVersionList !== undefined) {
256
+ const matchingBrand = loadedVersionList.find(({brand}) => this.brand_ === brand);
257
+ assertExists(matchingBrand);
258
+ return new Version(matchingBrand.version);
259
+ }
260
+ }
261
+ if (preUachHasLoaded) {
262
+ return this.version_;
263
+ }
264
+ return;
265
+ }
266
+ async load() {
267
+ if (this.useUach_) {
268
+ const loadedVersionList = await fullVersionList.load();
269
+ if (loadedVersionList !== undefined) {
270
+ const matchingBrand = loadedVersionList.find(({brand}) => this.brand_ === brand);
271
+ assertExists(matchingBrand);
272
+ return new Version(matchingBrand.version);
273
+ }
274
+ } else {
275
+ await 0;
276
+ }
277
+ preUachHasLoaded = true;
278
+ return this.version_;
279
+ }
280
+ }
281
+ let preUachHasLoaded = false;
282
+ async function loadFullVersions() {
283
+ if (useUserAgentDataBrand(true)) {
284
+ await fullVersionList.load();
285
+ }
286
+ preUachHasLoaded = true;
287
+ }
288
+ exports.loadFullVersions = loadFullVersions;
289
+ exports.resetForTesting = () => {
290
+ preUachHasLoaded = false;
291
+ fullVersionList.resetForTesting();
292
+ };
293
+ function fullVersionOf(browser) {
294
+ let fallbackVersionString = "";
295
+ if (!hasFullVersionList()) {
296
+ fallbackVersionString = getFullVersionFromUserAgentString(browser);
297
+ }
298
+ const useUach = browser !== Brand.SILK && useUserAgentDataBrand(true);
299
+ if (useUach) {
300
+ const data = util.getUserAgentData();
301
+ if (!data.brands.find(({brand}) => brand === browser)) {
302
+ return undefined;
303
+ }
304
+ } else if (fallbackVersionString === "") {
305
+ return undefined;
306
+ }
307
+ return new HighEntropyBrandVersion(browser, useUach, fallbackVersionString);
308
+ }
309
+ exports.fullVersionOf = fullVersionOf;
310
+ function getVersionStringForLogging(browser) {
311
+ if (useUserAgentDataBrand(true)) {
312
+ const fullVersionObj = fullVersionOf(browser);
313
+ if (fullVersionObj) {
314
+ const fullVersion = fullVersionObj.getIfLoaded();
315
+ if (fullVersion) {
316
+ return fullVersion.toVersionStringForLogging();
317
+ }
318
+ const data = util.getUserAgentData();
319
+ const matchingBrand = data.brands.find(({brand}) => brand === browser);
320
+ assertExists(matchingBrand);
321
+ return matchingBrand.version;
322
+ }
323
+ return "";
324
+ } else {
325
+ return getFullVersionFromUserAgentString(browser);
326
+ }
327
+ }
328
+ exports.getVersionStringForLogging = getVersionStringForLogging;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A,WAAf,EAApB;AACA,YAAIb,WAAJ;AACE,iBAAOA,WAAYyB,CAAAA,yBAAZ,EAAP;AADF;AAIA,cAAM9B,OAAO/E,IAAKuB,CAAAA,gBAAL,EAAb;AACA,cAAMyD,gBAAgBD,IAAKvD,CAAAA,MAAOqC,CAAAA,IAAZ,CAAiB,CAAC,CAACoB,KAAD,CAAD,CAAA,IAAaA,KAAb,KAAuBL,OAAxC,CAAtB;AAIAvE,oBAAA,CAAa2E,aAAb,CAAA;AACA,eAAOA,aAAcX,CAAAA,OAArB;AAZkB;AAiBpB,aAAO,EAAP;AAnB+B,KAAjC;AAqBE,aAAOM,iCAAA,CAAkCC,OAAlC,CAAP;AArBF;AAD2C;AAyB7C1D,SAAQyF,CAAAA,0BAAR,GAAqCA,0BAArC;AArxBA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
6
+ "sources":["goog/labs/useragent/browser.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Closure user agent detection (Browser).\n * @see <a href=\"http://www.useragentstring.com/\">User agent strings</a>\n * For more information on rendering engine, platform, or device see the other\n * sub-namespaces in goog.labs.userAgent, goog.labs.userAgent.platform,\n * goog.labs.userAgent.device respectively.)\n */\n\ngoog.module('goog.labs.userAgent.browser');\ngoog.module.declareLegacyNamespace();\n\nconst util = goog.require('goog.labs.userAgent.util');\nconst {AsyncValue, Version} = goog.require('goog.labs.userAgent.highEntropy.highEntropyValue');\nconst {assert, assertExists} = goog.require('goog.asserts');\nconst {compareVersions} = goog.require('goog.string.internal');\nconst {fullVersionList} = goog.require('goog.labs.userAgent.highEntropy.highEntropyData');\nconst {useClientHints} = goog.require('goog.labs.userAgent');\n\n// TODO(nnaze): Refactor to remove excessive exclusion logic in matching\n// functions.\n\n/**\n * A browser brand represents an opaque string that is used for making\n * brand-specific version checks in userAgentData.\n * @enum {string}\n */\nconst Brand = {\n /**\n * The browser brand for Android Browser.\n * Do not depend on the value of this string. Because Android Browser has not\n * implemented userAgentData yet, the value of this string is not guaranteed\n * to stay the same in future revisions.\n */\n ANDROID_BROWSER: 'Android Browser',\n /**\n * The browser brand for Chromium, including Chromium-based Edge and Opera.\n */\n CHROMIUM: 'Chromium',\n /**\n * The browser brand for Edge.\n * This brand can be used to get the version of both EdgeHTML and\n * Chromium-based Edge.\n */\n EDGE: 'Microsoft Edge',\n /**\n * The browser brand for Firefox.\n * Do not depend on the value of this string. Because Firefox has not\n * implemented userAgentData yet, the value of this string is not guaranteed\n * to stay the same in future revisions.\n */\n FIREFOX: 'Firefox',\n /**\n * The browser brand for Internet Explorer.\n * Do not depend on the value of this string. Because IE will never support\n * userAgentData, the value of this string should be treated as opaque (it's\n * used internally for legacy-userAgent fallback).\n */\n IE: 'Internet Explorer',\n /**\n * The browser brand for Opera.\n * This brand can be used to get the version of both Presto- and\n * Chromium-based Opera.\n */\n OPERA: 'Opera',\n /**\n * The browser brand for Safari.\n * Do not depend on the value of this string. Because Safari has not\n * implemented userAgentData yet, the value of this string is not guaranteed\n * to stay the same in future revisions.\n */\n SAFARI: 'Safari',\n /**\n * The browser brand for Silk.\n * See\n * https://docs.aws.amazon.com/silk/latest/developerguide/what-is-silk.html\n * Do not depend on the value of this string. Because Silk does not\n * identify itself in userAgentData yet, the value of this string is not\n * guaranteed to stay the same in future revisions.\n */\n SILK: 'Silk',\n};\nexports.Brand = Brand;\n\n/**\n * @param {boolean=} ignoreClientHintsFlag Iff truthy, the `useClientHints`\n * function will not be called when evaluating if User-Agent Client Hints\n * Brand data can be used. For existing labs.userAgent API surfaces with\n * widespread use, this should be a falsy value so that usage of the Client\n * Hints APIs can be gated behind flags / experiment rollouts.\n * @return {boolean} Whether to use navigator.userAgentData to determine\n * browser's brand.\n */\nfunction useUserAgentDataBrand(ignoreClientHintsFlag = false) {\n if (util.ASSUME_CLIENT_HINTS_SUPPORT) return true;\n // High-entropy API surfaces should not be gated behind the useClientHints\n // check (as in production it is gated behind a define).\n if (!ignoreClientHintsFlag && !useClientHints()) return false;\n const userAgentData = util.getUserAgentData();\n return !!userAgentData && userAgentData.brands.length > 0;\n}\n\n/**\n * @return {boolean} Whether this browser is likely to have the fullVersionList\n * high-entropy Client Hint.\n */\nfunction hasFullVersionList() {\n // https://chromiumdash.appspot.com/commits?commit=1eb643c3057e64ff4d22468432ad16c4cab12879&platform=Linux\n // indicates that for all platforms Chromium 98 shipped this feature.\n // See also\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List#browser_compatibility\n return isAtLeast(Brand.CHROMIUM, 98);\n}\n\n/**\n * @return {boolean} Whether the user's browser is Opera. Note: Chromium based\n * Opera (Opera 15+) is detected as Chrome to avoid unnecessary special\n * casing.\n */\nfunction matchOpera() {\n if (useUserAgentDataBrand()) {\n // Pre-Chromium Edge doesn't support navigator.userAgentData.\n return false;\n }\n return util.matchUserAgent('Opera');\n}\n\n/** @return {boolean} Whether the user's browser is IE. */\nfunction matchIE() {\n if (useUserAgentDataBrand()) {\n // IE doesn't support navigator.userAgentData.\n return false;\n }\n return util.matchUserAgent('Trident') || util.matchUserAgent('MSIE');\n}\n\n/**\n * @return {boolean} Whether the user's browser is Edge. This refers to\n * EdgeHTML based Edge.\n */\nfunction matchEdgeHtml() {\n if (useUserAgentDataBrand()) {\n // Pre-Chromium Edge doesn't support navigator.userAgentData.\n return false;\n }\n return util.matchUserAgent('Edge');\n}\n\n/** @return {boolean} Whether the user's browser is Chromium based Edge. */\nfunction matchEdgeChromium() {\n if (useUserAgentDataBrand()) {\n return util.matchUserAgentDataBrand(Brand.EDGE);\n }\n return util.matchUserAgent('Edg/');\n}\n\n/** @return {boolean} Whether the user's browser is Chromium based Opera. */\nfunction matchOperaChromium() {\n if (useUserAgentDataBrand()) {\n return util.matchUserAgentDataBrand(Brand.OPERA);\n }\n return util.matchUserAgent('OPR');\n}\n\n/** @return {boolean} Whether the user's browser is Firefox. */\nfunction matchFirefox() {\n // Firefox doesn't support navigator.userAgentData yet, so use\n // navigator.userAgent.\n return util.matchUserAgent('Firefox') || util.matchUserAgent('FxiOS');\n}\n\n/** @return {boolean} Whether the user's browser is Safari. */\nfunction matchSafari() {\n // Apple-based browsers don't support navigator.userAgentData yet, so use\n // navigator.userAgent.\n return util.matchUserAgent('Safari') &&\n !(matchChrome() || matchCoast() || matchOpera() || matchEdgeHtml() ||\n matchEdgeChromium() || matchOperaChromium() || matchFirefox() ||\n isSilk() || util.matchUserAgent('Android'));\n}\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n * iOS browser).\n */\nfunction matchCoast() {\n if (useUserAgentDataBrand()) {\n // Coast doesn't support navigator.userAgentData.\n return false;\n }\n return util.matchUserAgent('Coast');\n}\n\n/** @return {boolean} Whether the user's browser is iOS Webview. */\nfunction matchIosWebview() {\n // Apple-based browsers don't support navigator.userAgentData yet, so use\n // navigator.userAgent.\n // iOS Webview does not show up as Chrome or Safari.\n return (util.matchUserAgent('iPad') || util.matchUserAgent('iPhone')) &&\n !matchSafari() && !matchChrome() && !matchCoast() && !matchFirefox() &&\n util.matchUserAgent('AppleWebKit');\n}\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium browser. This\n * returns true for Chrome, Opera 15+, and Edge Chromium.\n */\nfunction matchChrome() {\n if (useUserAgentDataBrand()) {\n return util.matchUserAgentDataBrand(Brand.CHROMIUM);\n }\n return ((util.matchUserAgent('Chrome') || util.matchUserAgent('CriOS')) &&\n !matchEdgeHtml()) ||\n isSilk();\n}\n\n/** @return {boolean} Whether the user's browser is the Android browser. */\nfunction matchAndroidBrowser() {\n // Android can appear in the user agent string for Chrome on Android.\n // This is not the Android standalone browser if it does.\n return util.matchUserAgent('Android') &&\n !(isChrome() || isFirefox() || isOpera() || isSilk());\n}\n\n/** @return {boolean} Whether the user's browser is Opera. */\nconst isOpera = matchOpera;\nexports.isOpera = isOpera;\n\n/** @return {boolean} Whether the user's browser is IE. */\nconst isIE = matchIE;\nexports.isIE = isIE;\n\n/** @return {boolean} Whether the user's browser is EdgeHTML based Edge. */\nconst isEdge = matchEdgeHtml;\nexports.isEdge = isEdge;\n\n/** @return {boolean} Whether the user's browser is Chromium based Edge. */\nconst isEdgeChromium = matchEdgeChromium;\nexports.isEdgeChromium = isEdgeChromium;\n\n/** @return {boolean} Whether the user's browser is Chromium based Opera. */\nconst isOperaChromium = matchOperaChromium;\nexports.isOperaChromium = isOperaChromium;\n\n/** @return {boolean} Whether the user's browser is Firefox. */\nconst isFirefox = matchFirefox;\nexports.isFirefox = isFirefox;\n\n/** @return {boolean} Whether the user's browser is Safari. */\nconst isSafari = matchSafari;\nexports.isSafari = isSafari;\n\n/**\n * @return {boolean} Whether the user's browser is Coast (Opera's Webkit-based\n * iOS browser).\n */\nconst isCoast = matchCoast;\nexports.isCoast = isCoast;\n\n/** @return {boolean} Whether the user's browser is iOS Webview. */\nconst isIosWebview = matchIosWebview;\nexports.isIosWebview = isIosWebview;\n\n/**\n * @return {boolean} Whether the user's browser is any Chromium based browser (\n * Chrome, Blink-based Opera (15+) and Edge Chromium).\n */\nconst isChrome = matchChrome;\nexports.isChrome = isChrome;\n\n/** @return {boolean} Whether the user's browser is the Android browser. */\nconst isAndroidBrowser = matchAndroidBrowser;\nexports.isAndroidBrowser = isAndroidBrowser;\n\n/**\n * For more information, see:\n * http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html\n * @return {boolean} Whether the user's browser is Silk.\n */\nfunction isSilk() {\n // As of Silk 93, Silk does not identify itself in userAgentData.brands.\n // When Silk changes this behavior, update this method to call\n // matchUserAgentDataBrand (akin to isChrome, etc.)\n return util.matchUserAgent('Silk');\n}\nexports.isSilk = isSilk;\n\n/**\n * A helper function that returns a function mapping a list of candidate\n * version tuple keys to the first version string present under a key.\n * Ex:\n * <code>\n * // Arg extracted from \"Foo/1.2.3 Bar/0.2021\"\n * const mapVersion = createVersionMap([[\"Foo\", \"1.2.3\"], [\"Bar\", \"0.2021\"]]);\n * mapVersion([\"Bar\", \"Foo\"]); // returns \"0.2021\"\n * mapVersion([\"Baz\", \"Foo\"]); // returns \"1.2.3\"\n * mapVersion([\"Baz\", \"???\"]); // returns \"\"\n * </code>\n * @param {!Array<!Array<string>>} versionTuples Version tuples pre-extracted\n * from a user agent string.\n * @return {function(!Array<string>): string} The version string, or empty\n * string if it doesn't exist under the given key.\n */\nfunction createVersionMap(versionTuples) {\n // Construct a map for easy lookup.\n const versionMap = {};\n versionTuples.forEach((tuple) => {\n // Note that the tuple is of length three, but we only care about the\n // first two.\n const key = tuple[0];\n const value = tuple[1];\n versionMap[key] = value;\n });\n\n // Gives the value with the first key it finds, otherwise empty string.\n return (keys) => versionMap[keys.find((key) => key in versionMap)] || '';\n}\n\n/**\n * Returns the browser version.\n *\n * Note that for browsers with multiple brands, this function assumes a primary\n * brand and returns the version for that brand.\n *\n * Additionally, this function is not userAgentData-aware and will return\n * incorrect values when the User Agent string is frozen. The current status of\n * User Agent string freezing is available here:\n * https://www.chromestatus.com/feature/5704553745874944\n *\n * To mitigate both of these potential issues, use\n * getVersionStringForLogging() or fullVersionOf() instead.\n *\n * @return {string} The browser version or empty string if version cannot be\n * determined. Note that for Internet Explorer, this returns the version of\n * the browser, not the version of the rendering engine. (IE 8 in\n * compatibility mode will return 8.0 rather than 7.0. To determine the\n * rendering engine version, look at document.documentMode instead. See\n * http://msdn.microsoft.com/en-us/library/cc196988(v=vs.85).aspx for more\n * details.)\n */\nfunction getVersion() {\n const userAgentString = util.getUserAgent();\n\n // Special case IE since IE's version is inside the parenthesis and\n // without the '/'.\n if (isIE()) {\n return getIEVersion(userAgentString);\n }\n\n const versionTuples = util.extractVersionTuples(userAgentString);\n const lookUpValueWithKeys = createVersionMap(versionTuples);\n\n // Check Opera before Chrome since Opera 15+ has \"Chrome\" in the string.\n // See\n // http://my.opera.com/ODIN/blog/2013/07/15/opera-user-agent-strings-opera-15-and-beyond\n if (isOpera()) {\n // Opera 10 has Version/10.0 but Opera/9.8, so look for \"Version\" first.\n // Opera uses 'OPR' for more recent UAs.\n return lookUpValueWithKeys(['Version', 'Opera']);\n }\n\n // Check Edge before Chrome since it has Chrome in the string.\n if (isEdge()) {\n return lookUpValueWithKeys(['Edge']);\n }\n\n // Check Chromium Edge before Chrome since it has Chrome in the string.\n if (isEdgeChromium()) {\n return lookUpValueWithKeys(['Edg']);\n }\n\n // Check Silk before Chrome since it may have Chrome in its string and be\n // treated as Chrome.\n if (isSilk()) {\n return lookUpValueWithKeys(['Silk']);\n }\n\n if (isChrome()) {\n return lookUpValueWithKeys(['Chrome', 'CriOS', 'HeadlessChrome']);\n }\n\n // Usually products browser versions are in the third tuple after \"Mozilla\"\n // and the engine.\n const tuple = versionTuples[2];\n return tuple && tuple[1] || '';\n}\nexports.getVersion = getVersion;\n\n/**\n * Returns whether the current browser's version is at least as high as the\n * given one.\n *\n * Note that for browsers with multiple brands, this function assumes a primary\n * brand and checks the version for that brand.\n *\n * Additionally, this function is not userAgentData-aware and will return\n * incorrect values when the User Agent string is frozen. The current status of\n * User Agent string freezing is available here:\n * https://www.chromestatus.com/feature/5704553745874944\n *\n * To mitigate both of these potential issues, use isAtLeast()/isAtMost() or\n * fullVersionOf() instead.\n *\n * @param {string|number} version The version to check.\n * @return {boolean} Whether the browser version is higher or the same as the\n * given version.\n * @deprecated Use isAtLeast()/isAtMost() instead.\n */\nfunction isVersionOrHigher(version) {\n return compareVersions(getVersion(), version) >= 0;\n}\nexports.isVersionOrHigher = isVersionOrHigher;\n\n/**\n * A helper function to determine IE version. More information:\n * http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx#uaString\n * http://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx\n * http://blogs.msdn.com/b/ie/archive/2010/03/23/introducing-ie9-s-user-agent-string.aspx\n * http://blogs.msdn.com/b/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx\n * @param {string} userAgent the User-Agent.\n * @return {string}\n */\nfunction getIEVersion(userAgent) {\n // IE11 may identify itself as MSIE 9.0 or MSIE 10.0 due to an IE 11 upgrade\n // bug. Example UA:\n // Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; WOW64; Trident/7.0; rv:11.0)\n // like Gecko.\n // See http://www.whatismybrowser.com/developers/unknown-user-agent-fragments.\n const rv = /rv: *([\\d\\.]*)/.exec(userAgent);\n if (rv && rv[1]) {\n return rv[1];\n }\n\n let version = '';\n const msie = /MSIE +([\\d\\.]+)/.exec(userAgent);\n if (msie && msie[1]) {\n // IE in compatibility mode usually identifies itself as MSIE 7.0; in this\n // case, use the Trident version to determine the version of IE. For more\n // details, see the links above.\n const tridentVersion = /Trident\\/(\\d.\\d)/.exec(userAgent);\n if (msie[1] == '7.0') {\n if (tridentVersion && tridentVersion[1]) {\n switch (tridentVersion[1]) {\n case '4.0':\n version = '8.0';\n break;\n case '5.0':\n version = '9.0';\n break;\n case '6.0':\n version = '10.0';\n break;\n case '7.0':\n version = '11.0';\n break;\n }\n } else {\n version = '7.0';\n }\n } else {\n version = msie[1];\n }\n }\n return version;\n}\n\n/**\n * A helper function to return the navigator.userAgent-supplied full version\n * number of the current browser or an empty string, based on whether the\n * current browser is the one specified.\n * @param {string} browser The brand whose version should be returned.\n * @return {string}\n */\nfunction getFullVersionFromUserAgentString(browser) {\n const userAgentString = util.getUserAgent();\n // Special case IE since IE's version is inside the parenthesis and\n // without the '/'.\n if (browser === Brand.IE) {\n return isIE() ? getIEVersion(userAgentString) : '';\n }\n\n const versionTuples = util.extractVersionTuples(userAgentString);\n const lookUpValueWithKeys = createVersionMap(versionTuples);\n switch (browser) {\n case Brand.OPERA:\n // Opera 10 has Version/10.0 but Opera/9.8, so look for \"Version\"\n // first. Opera uses 'OPR' for more recent UAs.\n if (isOpera()) {\n return lookUpValueWithKeys(['Version', 'Opera']);\n } else if (isOperaChromium()) {\n return lookUpValueWithKeys(['OPR']);\n }\n break;\n case Brand.EDGE:\n if (isEdge()) {\n return lookUpValueWithKeys(['Edge']);\n } else if (isEdgeChromium()) {\n return lookUpValueWithKeys(['Edg']);\n }\n break;\n case Brand.CHROMIUM:\n if (isChrome()) {\n return lookUpValueWithKeys(['Chrome', 'CriOS', 'HeadlessChrome']);\n }\n break;\n }\n\n // For the following browsers, the browser version is in the third tuple after\n // \"Mozilla\" and the engine.\n if ((browser === Brand.FIREFOX && isFirefox()) ||\n (browser === Brand.SAFARI && isSafari()) ||\n (browser === Brand.ANDROID_BROWSER && isAndroidBrowser()) ||\n (browser === Brand.SILK && isSilk())) {\n const tuple = versionTuples[2];\n return tuple && tuple[1] || '';\n }\n\n return '';\n}\n\n/**\n * Returns the major version of the given browser brand, or NaN if the current\n * browser is not the given brand.\n * Note that the major version number may be different depending on which\n * browser is specified. The returned value can be used to make browser version\n * comparisons using comparison operators.\n * @private\n * @param {!Brand} browser The brand whose version should be returned.\n * @return {number} The major version number associated with the current\n * browser under the given brand, or NaN if the current browser doesn't match\n * the given brand.\n */\nfunction versionOf_(browser) {\n let versionParts;\n // Silk currently does not identify itself in its userAgentData.brands array,\n // so if checking its version, always fall back to the user agent string.\n if (useUserAgentDataBrand() && browser !== Brand.SILK) {\n const data = util.getUserAgentData();\n const matchingBrand = data.brands.find(({brand}) => brand === browser);\n if (!matchingBrand || !matchingBrand.version) {\n return NaN;\n }\n versionParts = matchingBrand.version.split('.');\n } else {\n const fullVersion = getFullVersionFromUserAgentString(browser);\n if (fullVersion === '') {\n return NaN;\n }\n versionParts = fullVersion.split('.');\n }\n if (versionParts.length === 0) {\n return NaN;\n }\n const majorVersion = versionParts[0];\n return Number(majorVersion); // Returns NaN if it is not parseable.\n}\n\n/**\n * Returns true if the current browser matches the given brand and is at least\n * the given major version. The major version must be a whole number (i.e.\n * decimals should not be used to represent a minor version).\n * @param {!Brand} brand The brand whose version should be returned.\n * @param {number} majorVersion The major version number to compare against.\n * This must be a whole number.\n * @return {boolean} Whether the current browser both matches the given brand\n * and is at least the given version.\n */\nfunction isAtLeast(brand, majorVersion) {\n assert(\n Math.floor(majorVersion) === majorVersion,\n 'Major version must be an integer');\n return versionOf_(brand) >= majorVersion;\n}\nexports.isAtLeast = isAtLeast;\n\n/**\n * Returns true if the current browser matches the given brand and is at most\n * the given version. The major version must be a whole number (i.e. decimals\n * should not be used to represent a minor version).\n * @param {!Brand} brand The brand whose version should be returned.\n * @param {number} majorVersion The major version number to compare against.\n * This must be a whole number.\n * @return {boolean} Whether the current browser both matches the given brand\n * and is at most the given version.\n */\nfunction isAtMost(brand, majorVersion) {\n assert(\n Math.floor(majorVersion) === majorVersion,\n 'Major version must be an integer');\n return versionOf_(brand) <= majorVersion;\n}\nexports.isAtMost = isAtMost;\n\n/**\n * Loads the high-entropy browser brand/version data and wraps the correct\n * version string in a Version object.\n * @implements {AsyncValue<!Version>}\n */\nclass HighEntropyBrandVersion {\n /**\n * @param {string} brand The brand whose version is retrieved in this\n * container.\n * @param {boolean} useUach Whether to attempt to use the User-Agent Client\n * Hints (UACH) API surface.\n * @param {string} fallbackVersion The fallback version derived from the\n * userAgent string.\n */\n constructor(brand, useUach, fallbackVersion) {\n /** @private @const {string} */\n this.brand_ = brand;\n\n /** @private @const {!Version} */\n this.version_ = new Version(fallbackVersion);\n\n /** @private @const {boolean} */\n this.useUach_ = useUach;\n }\n\n /**\n * @return {!Version|undefined}\n * @override\n */\n getIfLoaded() {\n if (this.useUach_) {\n const loadedVersionList = fullVersionList.getIfLoaded();\n if (loadedVersionList !== undefined) {\n const matchingBrand =\n loadedVersionList.find(({brand}) => this.brand_ === brand);\n // We assumed in fullVersionOf that if the fullVersionList is defined\n // the brands must match. Double-check this here.\n assertExists(matchingBrand);\n return new Version(matchingBrand.version);\n }\n // Fallthrough to fallback on Pre-UACH implementation\n }\n // We want to make sure the loading semantics of the Pre-UACH implementation\n // match those of the UACH implementation. Loading must happen before any\n // data can be retrieved from getIfLoaded.\n // For HighEntropyBrandVersion, loading can either be done by calling #load\n // or by calling the module-local loadFullVersions function.\n if (preUachHasLoaded) {\n return this.version_;\n }\n return;\n }\n\n /**\n * @return {!Promise<!Version>}\n * @override\n */\n async load() {\n if (this.useUach_) {\n const loadedVersionList = await fullVersionList.load();\n if (loadedVersionList !== undefined) {\n const matchingBrand =\n loadedVersionList.find(({brand}) => this.brand_ === brand);\n assertExists(matchingBrand);\n return new Version(matchingBrand.version);\n }\n // Fallthrough to fallback on Pre-UACH implementation\n } else {\n // Await something so that calling load with or without UACH API\n // availability results in waiting at least one macrotask before allowing\n // access to the cached version information.\n await 0;\n }\n // Regardless of whether we are using UACH APIs, we can now allow access to\n // the fallback case\n preUachHasLoaded = true;\n return this.version_;\n }\n}\n\n/**\n * Whether full version data should be considered available when using UACH\n * fallback implementations. This is flipped to true when either\n * loadFullVersions or HighEntropyBrandVersion.prototype.load are called,\n * matching the global singleton semantics of the UACH codepaths.\n */\nlet preUachHasLoaded = false;\n\n/**\n * Requests all full browser versions to be cached. When the returned promise\n * resolves, subsequent calls to `fullVersionOf(...).getIfLoaded()` will return\n * a value.\n *\n * This method should be avoided in favor of directly awaiting\n * `fullVersionOf(...).load()` where it is used.\n *\n * @return {!Promise<void>}\n */\nasync function loadFullVersions() {\n if (useUserAgentDataBrand(true)) {\n await fullVersionList.load();\n }\n preUachHasLoaded = true;\n}\nexports.loadFullVersions = loadFullVersions;\n\n/**\n * Resets module-local caches used by functionality in this module.\n * This is only for use by goog.labs.userAgent.testUtil.resetUserAgent (and\n * labs.userAgent tests).\n * @package\n */\nexports.resetForTesting = () => {\n preUachHasLoaded = false;\n fullVersionList.resetForTesting();\n};\n\n\n/**\n * Returns an object that provides access to the full version string of the\n * current browser -- or undefined, based on whether the current browser matches\n * the requested browser brand. Note that the full version string is a\n * high-entropy value, and must be asynchronously loaded before it can be\n * accessed synchronously.\n * @param {!Brand} browser The brand whose version should be returned.\n * @return {!AsyncValue<!Version>|undefined} An object that can be used\n * to get or load the full version string as a high-entropy value, or\n * undefined if the current browser doesn't match the given brand.\n */\nfunction fullVersionOf(browser) {\n let fallbackVersionString = '';\n // If we are reasonably certain now that the browser we are on has the\n // fullVersionList high-entropy hint, then we can skip computing the fallback\n // value as we won't end up using it.\n if (!hasFullVersionList()) {\n fallbackVersionString = getFullVersionFromUserAgentString(browser);\n }\n // Silk has the UACH API surface, but currently does not identify itself in\n // the userAgentData.brands array. Fallback to using userAgent string version\n // for Silk.\n const useUach = browser !== Brand.SILK && useUserAgentDataBrand(true);\n if (useUach) {\n const data = util.getUserAgentData();\n // Operate under the assumption that the low-entropy and high-entropy lists\n // of brand/version pairs contain an identical set of brands. Therefore, if\n // the low-entropy list doesn't contain the given brand, return undefined.\n if (!data.brands.find(({brand}) => brand === browser)) {\n return undefined;\n }\n } else if (fallbackVersionString === '') {\n return undefined;\n }\n return new HighEntropyBrandVersion(browser, useUach, fallbackVersionString);\n}\nexports.fullVersionOf = fullVersionOf;\n\n\n/**\n * Returns a version string for the current browser or undefined, based on\n * whether the current browser is the one specified.\n * This value should ONLY be used for logging/debugging purposes. Do not use it\n * to branch code paths. For comparing versions, use isAtLeast()/isAtMost() or\n * fullVersionOf() instead.\n * @param {!Brand} browser The brand whose version should be returned.\n * @return {string} The version as a string.\n */\nfunction getVersionStringForLogging(browser) {\n if (useUserAgentDataBrand(true)) {\n const fullVersionObj = fullVersionOf(browser);\n if (fullVersionObj) {\n const fullVersion = fullVersionObj.getIfLoaded();\n if (fullVersion) {\n return fullVersion.toVersionStringForLogging();\n }\n // No full version, return the major version instead.\n const data = util.getUserAgentData();\n const matchingBrand = data.brands.find(({brand}) => brand === browser);\n // Checking for the existence of matchingBrand is not necessary because\n // the existence of fullVersionObj implies that there is already a\n // matching brand.\n assertExists(matchingBrand);\n return matchingBrand.version;\n }\n // If fullVersionObj is undefined, this doesn't mean that the full version\n // is unavailable, but rather that the current browser doesn't match the\n // input `browser` argument.\n return '';\n } else {\n return getFullVersionFromUserAgentString(browser);\n }\n}\nexports.getVersionStringForLogging = getVersionStringForLogging;\n"],
8
+ "names":["goog","module","declareLegacyNamespace","util","require","AsyncValue","Version","assert","assertExists","compareVersions","fullVersionList","useClientHints","Brand","ANDROID_BROWSER","CHROMIUM","EDGE","FIREFOX","IE","OPERA","SAFARI","SILK","exports","useUserAgentDataBrand","ignoreClientHintsFlag","ASSUME_CLIENT_HINTS_SUPPORT","userAgentData","getUserAgentData","brands","length","hasFullVersionList","isAtLeast","matchOpera","matchUserAgent","matchIE","matchEdgeHtml","matchEdgeChromium","matchUserAgentDataBrand","matchOperaChromium","matchFirefox","matchSafari","matchChrome","matchCoast","isSilk","matchIosWebview","matchAndroidBrowser","isChrome","isFirefox","isOpera","isIE","isEdge","isEdgeChromium","isOperaChromium","isSafari","isCoast","isIosWebview","isAndroidBrowser","createVersionMap","versionTuples","versionMap","forEach","tuple","key","value","keys","find","getVersion","userAgentString","getUserAgent","getIEVersion","extractVersionTuples","lookUpValueWithKeys","isVersionOrHigher","version","userAgent","rv","exec","msie","tridentVersion","getFullVersionFromUserAgentString","browser","versionOf_","versionParts","data","matchingBrand","brand","NaN","split","fullVersion","majorVersion","Number","Math","floor","isAtMost","HighEntropyBrandVersion","constructor","useUach","fallbackVersion","brand_","version_","useUach_","getIfLoaded","loadedVersionList","undefined","preUachHasLoaded","load","loadFullVersions","resetForTesting","exports.resetForTesting","fullVersionOf","fallbackVersionString","getVersionStringForLogging","fullVersionObj","toVersionStringForLogging"]
9
+ }
@@ -0,0 +1,13 @@
1
+ import "./cljs_env.js";
2
+ goog.loadModule(function(exports) {
3
+ "use strict";
4
+ goog.module("goog.labs.userAgent.highEntropy.highEntropyData");
5
+ const {HighEntropyValue} = goog.require("goog.labs.userAgent.highEntropy.highEntropyValue");
6
+ const fullVersionList = new HighEntropyValue("fullVersionList");
7
+ exports.fullVersionList = fullVersionList;
8
+ const platformVersion = new HighEntropyValue("platformVersion");
9
+ exports.platformVersion = platformVersion;
10
+ return exports;
11
+ });
12
+
13
+ //# sourceMappingURL=goog.labs.useragent.highentropy.highentropydata.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.labs.useragent.highentropy.highentropydata.js",
4
+ "lineCount":11,
5
+ "mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAAA,cAAA;AAUAA,MAAKC,CAAAA,MAAL,CAAY,iDAAZ,CAAA;AAEA,QAAM,CAACC,gBAAD,CAAA,GAAqBF,IAAKG,CAAAA,OAAL,CAAa,kDAAb,CAA3B;AAKA,QAAMC,kBAAkB,IAAIF,gBAAJ,CAAqB,iBAArB,CAAxB;AACAG,SAAQD,CAAAA,eAAR,GAA0BA,eAA1B;AAKA,QAAME,kBAAkB,IAAIJ,gBAAJ,CAAqB,iBAArB,CAAxB;AACAG,SAAQC,CAAAA,eAAR,GAA0BA,eAA1B;AAxBA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
6
+ "sources":["goog/labs/useragent/highentropy/highentropydata.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides access to high-entropy user agent values.\n */\n\ngoog.module('goog.labs.userAgent.highEntropy.highEntropyData');\n\nconst {HighEntropyValue} = goog.require('goog.labs.userAgent.highEntropy.highEntropyValue');\n\n/**\n * @type {!HighEntropyValue<!Array<!NavigatorUABrandVersion>|undefined>}\n */\nconst fullVersionList = new HighEntropyValue('fullVersionList');\nexports.fullVersionList = fullVersionList;\n\n/**\n * @type {!HighEntropyValue<string>}\n */\nconst platformVersion = new HighEntropyValue('platformVersion');\nexports.platformVersion = platformVersion;"],
8
+ "names":["goog","module","HighEntropyValue","require","fullVersionList","exports","platformVersion"]
9
+ }
@@ -0,0 +1,72 @@
1
+ import "./cljs_env.js";
2
+ goog.loadModule(function(exports) {
3
+ "use strict";
4
+ goog.module("goog.labs.userAgent.highEntropy.highEntropyValue");
5
+ const util = goog.require("goog.labs.userAgent.util");
6
+ const {compareVersions} = goog.require("goog.string.internal");
7
+ class AsyncValue {
8
+ getIfLoaded() {
9
+ }
10
+ load() {
11
+ }
12
+ }
13
+ exports.AsyncValue = AsyncValue;
14
+ class HighEntropyValue {
15
+ constructor(key) {
16
+ this.key_ = key;
17
+ this.value_ = undefined;
18
+ this.promise_ = undefined;
19
+ this.pending_ = false;
20
+ }
21
+ getIfLoaded() {
22
+ const userAgentData = util.getUserAgentData();
23
+ if (!userAgentData) {
24
+ return undefined;
25
+ }
26
+ return this.value_;
27
+ }
28
+ async load() {
29
+ const userAgentData = util.getUserAgentData();
30
+ if (!userAgentData) {
31
+ return undefined;
32
+ }
33
+ if (!this.promise_) {
34
+ this.pending_ = true;
35
+ this.promise_ = (async() => {
36
+ try {
37
+ const dataValues = await userAgentData.getHighEntropyValues([this.key_]);
38
+ this.value_ = dataValues[this.key_];
39
+ return this.value_;
40
+ } finally {
41
+ this.pending_ = false;
42
+ }
43
+ })();
44
+ }
45
+ return await this.promise_;
46
+ }
47
+ resetForTesting() {
48
+ if (this.pending_) {
49
+ throw new Error("Unsafe call to resetForTesting");
50
+ }
51
+ this.promise_ = undefined;
52
+ this.value_ = undefined;
53
+ this.pending_ = false;
54
+ }
55
+ }
56
+ exports.HighEntropyValue = HighEntropyValue;
57
+ class Version {
58
+ constructor(versionString) {
59
+ this.versionString_ = versionString;
60
+ }
61
+ toVersionStringForLogging() {
62
+ return this.versionString_;
63
+ }
64
+ isAtLeast(version) {
65
+ return compareVersions(this.versionString_, version) >= 0;
66
+ }
67
+ }
68
+ exports.Version = Version;
69
+ return exports;
70
+ });
71
+
72
+ //# sourceMappingURL=goog.labs.useragent.highentropy.highentropyvalue.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.labs.useragent.highentropy.highentropyvalue.js",
4
+ "lineCount":70,
5
+ "mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAAA,cAAA;AAWAA,MAAKC,CAAAA,MAAL,CAAY,kDAAZ,CAAA;AAEA,QAAMC,OAAOF,IAAKG,CAAAA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G;AAChB,UAAI,IAAKL,CAAAA,QAAT;AAIE,cAAM,IAAIM,KAAJ,CAAU,gCAAV,CAAN;AAJF;AAMA,UAAKP,CAAAA,QAAL,GAAgBD,SAAhB;AACA,UAAKD,CAAAA,MAAL,GAAcC,SAAd;AACA,UAAKE,CAAAA,QAAL,GAAgB,KAAhB;AATgB;AAtEpB;AAkFAR,SAAQC,CAAAA,gBAAR,GAA2BA,gBAA3B;AAMA,OAAMc,QAAN;AAIEb,eAAW,CAACc,aAAD,CAAgB;AAKzB,UAAKC,CAAAA,cAAL,GAAsBD,aAAtB;AALyB;AAY3BE,6BAAyB,EAAG;AAC1B,aAAO,IAAKD,CAAAA,cAAZ;AAD0B;AAU5BE,aAAS,CAACC,OAAD,CAAU;AACjB,aAAOxB,eAAA,CAAgB,IAAKqB,CAAAA,cAArB,EAAqCG,OAArC,CAAP,IAAwD,CAAxD;AADiB;AA1BrB;AA8BApB,SAAQe,CAAAA,OAAR,GAAkBA,OAAlB;AAnKA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
6
+ "sources":["goog/labs/useragent/highentropy/highentropyvalue.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Provides helper classes and objects to work with High Entropy\n * user agent values.\n */\n\ngoog.module('goog.labs.userAgent.highEntropy.highEntropyValue');\n\nconst util = goog.require('goog.labs.userAgent.util');\nconst {compareVersions} = goog.require('goog.string.internal');\n\n/**\n * Represents a value that can be asynchronously loaded.\n * @interface\n * @template VALUE_TYPE\n */\nclass AsyncValue {\n /**\n * Get the value represented by this AsyncValue instance, if it was\n * previously requested.\n * @return {VALUE_TYPE|undefined}\n */\n getIfLoaded() {}\n\n /**\n * Request the value represented by this AsyncValue instance.\n * @return {!Promise<VALUE_TYPE>}\n */\n load() {}\n}\nexports.AsyncValue = AsyncValue;\n\n/**\n * Represents a high-entropy value.\n * High-entropy values must be specifically requested from the Promise-based\n * Client Hints API.\n * @template VALUE_TYPE The type of the value wrapped by this HighEntropyValue\n * instance.\n * @implements {AsyncValue<VALUE_TYPE>}\n */\nclass HighEntropyValue {\n /**\n * Constructs a new HighEntropyValue instance.\n * @param {string} key The name of the high-entropy value, used when\n * requesting it from the browser.\n */\n constructor(key) {\n /**\n * The key used to request the high-entropy value from the browser.\n * @const {string}\n * @private\n */\n this.key_ = key;\n\n /**\n * The value represented by this HighEntropyValue instance. If it hasn't\n * been successfully requested yet, its value will be undefined.\n * @type {VALUE_TYPE|undefined}\n * @protected\n */\n this.value_ = undefined;\n\n /**\n * The high-entropy value request. If it hasn't been requested yet, this\n * value will be undefined.\n * @type {!Promise<VALUE_TYPE>|undefined}\n * @private\n */\n this.promise_ = undefined;\n\n this.pending_ = false;\n }\n\n /**\n * @return {VALUE_TYPE|undefined}\n * @override\n */\n getIfLoaded() {\n const userAgentData = util.getUserAgentData();\n if (!userAgentData) {\n return undefined;\n }\n return this.value_;\n }\n\n /**\n * @return {!Promise<VALUE_TYPE>}\n * @override\n */\n async load() {\n const userAgentData = util.getUserAgentData();\n if (!userAgentData) return undefined;\n if (!this.promise_) {\n this.pending_ = true;\n this.promise_ = (async () => {\n try {\n const dataValues =\n await userAgentData.getHighEntropyValues([this.key_]);\n this.value_ =\n /** @type {!Object<string, VALUE_TYPE>} */ (\n dataValues)[this.key_];\n return this.value_;\n } finally {\n this.pending_ = false;\n }\n })();\n }\n return await this.promise_;\n }\n\n resetForTesting() {\n if (this.pending_) {\n // There is a pending request that may set this.value_ at any time.\n // Therefore, it can't be guaranteed that this object is actually in a\n // clean state.\n throw new Error('Unsafe call to resetForTesting');\n }\n this.promise_ = undefined;\n this.value_ = undefined;\n this.pending_ = false;\n }\n}\nexports.HighEntropyValue = HighEntropyValue;\n\n/**\n * An object that wraps a version string.\n * This allows for easy version comparisons.\n */\nclass Version {\n /**\n * @param {string} versionString The underlying version string.\n */\n constructor(versionString) {\n /**\n * @const {string}\n * @private\n */\n this.versionString_ = versionString;\n }\n\n /**\n * Returns the underlying version string.\n * @return {string}\n */\n toVersionStringForLogging() {\n return this.versionString_;\n }\n\n /**\n * Returns true if the underlying version string is equal to or greater than\n * the given version.\n * @param {string} version The version to compare against.\n * @return {boolean}\n */\n isAtLeast(version) {\n return compareVersions(this.versionString_, version) >= 0;\n }\n}\nexports.Version = Version;\n"],
8
+ "names":["goog","module","util","require","compareVersions","AsyncValue","getIfLoaded","load","exports","HighEntropyValue","constructor","key","key_","value_","undefined","promise_","pending_","userAgentData","getUserAgentData","dataValues","getHighEntropyValues","resetForTesting","Error","Version","versionString","versionString_","toVersionStringForLogging","isAtLeast","version"]
9
+ }
@@ -0,0 +1,20 @@
1
+ import "./cljs_env.js";
2
+ goog.loadModule(function(exports) {
3
+ "use strict";
4
+ goog.module("goog.labs.userAgent");
5
+ goog.module.declareLegacyNamespace();
6
+ const flags = goog.require("goog.flags");
7
+ const USE_CLIENT_HINTS_OVERRIDE = goog.define("goog.labs.userAgent.USE_CLIENT_HINTS_OVERRIDE", "");
8
+ const USE_CLIENT_HINTS = goog.define("goog.labs.userAgent.USE_CLIENT_HINTS", false);
9
+ let forceClientHintsInTests = false;
10
+ exports.setUseClientHintsForTesting = use => {
11
+ forceClientHintsInTests = use;
12
+ };
13
+ const useClientHintsRuntimeOverride = USE_CLIENT_HINTS_OVERRIDE ? !!goog.getObjectByName(USE_CLIENT_HINTS_OVERRIDE) : false;
14
+ exports.useClientHints = () => {
15
+ return flags.USE_USER_AGENT_CLIENT_HINTS || USE_CLIENT_HINTS || useClientHintsRuntimeOverride || forceClientHintsInTests;
16
+ };
17
+ return exports;
18
+ });
19
+
20
+ //# sourceMappingURL=goog.labs.useragent.useragent.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version":3,
3
+ "file":"goog.labs.useragent.useragent.js",
4
+ "lineCount":18,
5
+ "mappings":"AAAA,IAAA,CAAA,UAAA,CAAA,QAAA,CAAA,OAAA,CAAA;AAAA,cAAA;AAUAA,MAAKC,CAAAA,MAAL,CAAY,qBAAZ,CAAA;AACAD,MAAKC,CAAAA,MAAOC,CAAAA,sBAAZ,EAAA;AAEA,QAAMC,QAAQH,IAAKI,CAAAA,OAAL,CAAa,YAAb,CAAd;AAQA,QAAMC,4BACFL,IAAKM,CAAAA,MAAL,CAAY,+CAAZ,EAA6D,EAA7D,CADJ;AAQA,QAAMC,mBACFP,IAAKM,CAAAA,MAAL,CAAY,sCAAZ,EAAoD,KAApD,CADJ;AAGA,MAAIE,0BAA0B,KAA9B;AAcAC,SAAQC,CAAAA,2BAAR,GAAuCC,GAADC,IAAS;AAC7CJ,2BAAA,GAA0BG,GAA1B;AAD6C,GAA/C;AAKA,QAAME,gCAAgCR,yBAAA,GAClC,CAAC,CAACL,IAAKc,CAAAA,eAAL,CAAqBT,yBAArB,CADgC,GAElC,KAFJ;AAWAI,SAAQM,CAAAA,cAAR,GAAyB,EAAAC,IAAM;AAC7B,WAAOb,KAAMc,CAAAA,2BAAb,IAA4CV,gBAA5C,IACIM,6BADJ,IACqCL,uBADrC;AAD6B,GAA/B;AA9DA,SAAA,OAAA;AAAA,CAAA,CAAA;;",
6
+ "sources":["goog/labs/useragent/useragent.js"],
7
+ "sourcesContent":["/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Defines for goog.labs.userAgent.\n */\n\ngoog.module('goog.labs.userAgent');\ngoog.module.declareLegacyNamespace();\n\nconst flags = goog.require('goog.flags');\n\n/**\n * @define {string} Optional runtime override for the USE_CLIENT_HINTS flag.\n * If this is set (for example, to 'foo.bar') then any value of USE_CLIENT_HINTS\n * will be overridden by `globalThis.foo.bar` if it is non-null.\n * This flag will be removed in December 2021.\n */\nconst USE_CLIENT_HINTS_OVERRIDE =\n goog.define('goog.labs.userAgent.USE_CLIENT_HINTS_OVERRIDE', '');\n\n/**\n * @define {boolean} If true, use navigator.userAgentData. Note: this overrides\n * the `USE_USER_AGENT_CLIENT_HINTS` runtime flag. Please prefer the flag when\n * possible.\n */\nconst USE_CLIENT_HINTS =\n goog.define('goog.labs.userAgent.USE_CLIENT_HINTS', false);\n\nlet forceClientHintsInTests = false;\n\n/**\n * Sets whether to use client hints APIs in tests for codepaths that\n * - were originally implemented as checks against the navigator.userAgent\n * string.\n * - have an alternative implementation that uses Client Hints APIs.\n *\n * See the jsdoc on useClientHints for cases where this flag will be\n * ineffective, and the Client Hints APIs would be used regardless.\n * DO NOT call this function in production code - it will cause de-optimization.\n * @param {boolean} use Whether or not to use Client Hints API codepaths in\n * goog.labs.useragent.* modules.\n */\nexports.setUseClientHintsForTesting = (use) => {\n forceClientHintsInTests = use;\n};\n\n/** @const {boolean} */\nconst useClientHintsRuntimeOverride = USE_CLIENT_HINTS_OVERRIDE ?\n !!goog.getObjectByName(USE_CLIENT_HINTS_OVERRIDE) :\n false;\n\n/**\n * Whether to use UserAgent-Client Hints API surfaces in parts of the\n * labs.userAgent package that previously only relied on the navigator.userAgent\n * string. Newer labs.userAgent API surfaces may ignore the result of this\n * function as they are considered opt-in API surfaces.\n * @const {function():boolean}\n */\nexports.useClientHints = () => {\n return flags.USE_USER_AGENT_CLIENT_HINTS || USE_CLIENT_HINTS ||\n useClientHintsRuntimeOverride || forceClientHintsInTests;\n};\n"],
8
+ "names":["goog","module","declareLegacyNamespace","flags","require","USE_CLIENT_HINTS_OVERRIDE","define","USE_CLIENT_HINTS","forceClientHintsInTests","exports","setUseClientHintsForTesting","use","exports.setUseClientHintsForTesting","useClientHintsRuntimeOverride","getObjectByName","useClientHints","exports.useClientHints","USE_USER_AGENT_CLIENT_HINTS"]
9
+ }