1var $jscomp = $jscomp || {}; 2$jscomp.scope = {}; 3$jscomp.ASSUME_ES5 = !1; 4$jscomp.ASSUME_NO_NATIVE_MAP = !1; 5$jscomp.ASSUME_NO_NATIVE_SET = !1; 6$jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function(c, d, e) { 7 c != Array.prototype && c != Object.prototype && (c[d] = e.value); 8}; 9$jscomp.getGlobal = function(c) { 10 return "undefined" != typeof window && window === c ? c : "undefined" != typeof global && null != global ? global : c; 11}; 12$jscomp.global = $jscomp.getGlobal(this); 13$jscomp.SYMBOL_PREFIX = "jscomp_symbol_"; 14$jscomp.initSymbol = function() { 15 $jscomp.initSymbol = function() { 16 }; 17 $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol); 18}; 19$jscomp.Symbol = function() { 20 var c = 0; 21 return function(d) { 22 return $jscomp.SYMBOL_PREFIX + (d || "") + c++; 23 }; 24}(); 25$jscomp.initSymbolIterator = function() { 26 $jscomp.initSymbol(); 27 var c = $jscomp.global.Symbol.iterator; 28 c || (c = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator")); 29 "function" != typeof Array.prototype[c] && $jscomp.defineProperty(Array.prototype, c, {configurable:!0, writable:!0, value:function() { 30 return $jscomp.arrayIterator(this); 31 }}); 32 $jscomp.initSymbolIterator = function() { 33 }; 34}; 35$jscomp.arrayIterator = function(c) { 36 var d = 0; 37 return $jscomp.iteratorPrototype(function() { 38 return d < c.length ? {done:!1, value:c[d++]} : {done:!0}; 39 }); 40}; 41$jscomp.iteratorPrototype = function(c) { 42 $jscomp.initSymbolIterator(); 43 c = {next:c}; 44 c[$jscomp.global.Symbol.iterator] = function() { 45 return this; 46 }; 47 return c; 48}; 49$jscomp.makeIterator = function(c) { 50 $jscomp.initSymbolIterator(); 51 var d = c[Symbol.iterator]; 52 return d ? d.call(c) : $jscomp.arrayIterator(c); 53}; 54$jscomp.objectCreate = $jscomp.ASSUME_ES5 || "function" == typeof Object.create ? Object.create : function(c) { 55 var d = function() { 56 }; 57 d.prototype = c; 58 return new d; 59}; 60$jscomp.underscoreProtoCanBeSet = function() { 61 var c = {a:!0}, d = {}; 62 try { 63 return d.__proto__ = c, d.a; 64 } catch (e) { 65 } 66 return !1; 67}; 68$jscomp.setPrototypeOf = "function" == typeof Object.setPrototypeOf ? Object.setPrototypeOf : $jscomp.underscoreProtoCanBeSet() ? function(c, d) { 69 c.__proto__ = d; 70 if (c.__proto__ !== d) { 71 throw new TypeError(c + " is not extensible"); 72 } 73 return c; 74} : null; 75$jscomp.inherits = function(c, d) { 76 c.prototype = $jscomp.objectCreate(d.prototype); 77 c.prototype.constructor = c; 78 if ($jscomp.setPrototypeOf) { 79 var e = $jscomp.setPrototypeOf; 80 e(c, d); 81 } else { 82 for (e in d) { 83 if ("prototype" != e) { 84 if (Object.defineProperties) { 85 var f = Object.getOwnPropertyDescriptor(d, e); 86 f && Object.defineProperty(c, e, f); 87 } else { 88 c[e] = d[e]; 89 } 90 } 91 } 92 } 93 c.superClass_ = d.prototype; 94}; 95$jscomp.arrayFromIterator = function(c) { 96 for (var d, e = []; !(d = c.next()).done;) { 97 e.push(d.value); 98 } 99 return e; 100}; 101$jscomp.arrayFromIterable = function(c) { 102 return c instanceof Array ? c : $jscomp.arrayFromIterator($jscomp.makeIterator(c)); 103}; 104$jscomp.polyfill = function(c, d, e, f) { 105 if (d) { 106 e = $jscomp.global; 107 c = c.split("."); 108 for (f = 0; f < c.length - 1; f++) { 109 var g = c[f]; 110 g in e || (e[g] = {}); 111 e = e[g]; 112 } 113 c = c[c.length - 1]; 114 f = e[c]; 115 d = d(f); 116 d != f && null != d && $jscomp.defineProperty(e, c, {configurable:!0, writable:!0, value:d}); 117 } 118}; 119$jscomp.polyfill("Array.from", function(c) { 120 return c ? c : function(c, e, f) { 121 $jscomp.initSymbolIterator(); 122 e = null != e ? e : function(c) { 123 return c; 124 }; 125 var d = [], h = c[Symbol.iterator]; 126 if ("function" == typeof h) { 127 for (c = h.call(c); !(h = c.next()).done;) { 128 d.push(e.call(f, h.value)); 129 } 130 } else { 131 h = c.length; 132 for (var k = 0; k < h; k++) { 133 d.push(e.call(f, c[k])); 134 } 135 } 136 return d; 137 }; 138}, "es6", "es3"); 139$jscomp.iteratorFromArray = function(c, d) { 140 $jscomp.initSymbolIterator(); 141 c instanceof String && (c += ""); 142 var e = 0, f = {next:function() { 143 if (e < c.length) { 144 var g = e++; 145 return {value:d(g, c[g]), done:!1}; 146 } 147 f.next = function() { 148 return {done:!0, value:void 0}; 149 }; 150 return f.next(); 151 }}; 152 f[Symbol.iterator] = function() { 153 return f; 154 }; 155 return f; 156}; 157$jscomp.polyfill("Array.prototype.keys", function(c) { 158 return c ? c : function() { 159 return $jscomp.iteratorFromArray(this, function(c) { 160 return c; 161 }); 162 }; 163}, "es6", "es3"); 164$jscomp.checkStringArgs = function(c, d, e) { 165 if (null == c) { 166 throw new TypeError("The 'this' value for String.prototype." + e + " must not be null or undefined"); 167 } 168 if (d instanceof RegExp) { 169 throw new TypeError("First argument to String.prototype." + e + " must not be a regular expression"); 170 } 171 return c + ""; 172}; 173$jscomp.polyfill("String.prototype.startsWith", function(c) { 174 return c ? c : function(c, e) { 175 var d = $jscomp.checkStringArgs(this, c, "startsWith"); 176 c += "";
177 var g = d.length, h = c.length; 178 e = Math.max(0, Math.min(e | 0, d.length)); 179 for (var k = 0; k < h && e < g;) { 180 if (d[e++] != c[k++]) { 181 return !1; 182 } 183 } 184 return k >= h; 185 }; 186}, "es6", "es3"); 187$jscomp.polyfill("Object.is", function(c) { 188 return c ? c : function(c, e) { 189 return c === e ? 0 !== c || 1 / c === 1 / e : c !== c && e !== e; 190 }; 191}, "es6", "es3"); 192$jscomp.polyfill("Array.prototype.includes", function(c) { 193 return c ? c : function(c, e) { 194 var d = this; 195 d instanceof String && (d = String(d)); 196 var g = d.length; 197 e = e || 0; 198 for (0 > e && (e = Math.max(e + g, 0)); e < g; e++) { 199 var h = d[e]; 200 if (h === c || Object.is(h, c)) { 201 return !0; 202 } 203 } 204 return !1; 205 }; 206}, "es7", "es3"); 207$jscomp.polyfill("String.prototype.includes", function(c) { 208 return c ? c : function(c, e) { 209 return -1 !== $jscomp.checkStringArgs(this, c, "includes").indexOf(c, e || 0); 210 }; 211}, "es6", "es3"); 212$jscomp.polyfill("Array.prototype.entries", function(c) { 213 return c ? c : function() { 214 return $jscomp.iteratorFromArray(this, function(c, e) { 215 return [c, e]; 216 }); 217 }; 218}, "es6", "es3"); 219$jscomp.checkEs6ConformanceViaProxy = function() { 220 try { 221 var c = {}, d = Object.create(new $jscomp.global.Proxy(c, {get:function(e, f, g) { 222 return e == c && "q" == f && g == d; 223 }})); 224 return !0 === d.q; 225 } catch (e) { 226 return !1; 227 } 228}; 229$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS = !1; 230$jscomp.ES6_CONFORMANCE = $jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS && $jscomp.checkEs6ConformanceViaProxy(); 231$jscomp.owns = function(c, d) { 232 return Object.prototype.hasOwnProperty.call(c, d); 233}; 234$jscomp.polyfill("WeakMap", function(c) { 235 function d() { 236 if (!c || !Object.seal) { 237 return !1; 238 } 239 try { 240 var d = Object.seal({}), e = Object.seal({}), f = new c([[d, 2], [e, 3]]); 241 if (2 != f.get(d) || 3 != f.get(e)) { 242 return !1; 243 } 244 f.delete(d); 245 f.set(e, 4); 246 return !f.has(d) && 4 == f.get(e); 247 } catch (t) { 248 return !1; 249 } 250 } 251 function e(c) { 252 $jscomp.owns(c, g) || $jscomp.defineProperty(c, g, {value:{}}); 253 } 254 function f(c) { 255 var d = Object[c]; 256 d && (Object[c] = function(c) { 257 e(c); 258 return d(c); 259 }); 260 } 261 if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) { 262 if (c && $jscomp.ES6_CONFORMANCE) { 263 return c; 264 } 265 } else { 266 if (d()) { 267 return c; 268 } 269 } 270 var g = "$jscomp_hidden_" + Math.random(); 271 f("freeze"); 272 f("preventExtensions"); 273 f("seal"); 274 var h = 0, k = function(c) { 275 this.id_ = (h += Math.random() + 1).toString(); 276 if (c) { 277 $jscomp.initSymbol(); 278 $jscomp.initSymbolIterator(); 279 c = $jscomp.makeIterator(c); 280 for (var d; !(d = c.next()).done;) { 281 d = d.value, this.set(d[0], d[1]); 282 } 283 } 284 }; 285 k.prototype.set = function(c, d) { 286 e(c); 287 if (!$jscomp.owns(c, g)) { 288 throw Error("WeakMap key fail: " + c); 289 } 290 c[g][this.id_] = d; 291 return this; 292 }; 293 k.prototype.get = function(c) { 294 return $jscomp.owns(c, g) ? c[g][this.id_] : void 0; 295 }; 296 k.prototype.has = function(c) { 297 return $jscomp.owns(c, g) && $jscomp.owns(c[g], this.id_); 298 }; 299 k.prototype.delete = function(c) { 300 return $jscomp.owns(c, g) && $jscomp.owns(c[g], this.id_) ? delete c[g][this.id_] : !1; 301 }; 302 return k; 303}, "es6", "es3"); 304$jscomp.MapEntry = function() { 305}; 306$jscomp.polyfill("Map", function(c) { 307 function d() { 308 if ($jscomp.ASSUME_NO_NATIVE_MAP || !c || "function" != typeof c || !c.prototype.entries || "function" != typeof Object.seal) { 309 return !1; 310 } 311 try { 312 var d = Object.seal({x:4}), e = new c($jscomp.makeIterator([[d, "s"]])); 313 if ("s" != e.get(d) || 1 != e.size || e.get({x:4}) || e.set({x:4}, "t") != e || 2 != e.size) { 314 return !1; 315 } 316 var f = e.entries(), g = f.next(); 317 if (g.done || g.value[0] != d || "s" != g.value[1]) { 318 return !1; 319 } 320 g = f.next(); 321 return g.done || 4 != g.value[0].x || "t" != g.value[1] || !f.next().done ? !1 : !0; 322 } catch (v) { 323 return !1; 324 } 325 } 326 if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) { 327 if (c && $jscomp.ES6_CONFORMANCE) { 328 return c; 329 } 330 } else { 331 if (d()) { 332 return c; 333 } 334 } 335 $jscomp.initSymbol(); 336 $jscomp.initSymbolIterator(); 337 var e = new WeakMap, f = function(c) { 338 this.data_ = {}; 339 this.head_ = k(); 340 this.size = 0; 341 if (c) { 342 c = $jscomp.makeIterator(c); 343 for (var d; !(d = c.next()).done;) { 344 d = d.value, this.set(d[0], d[1]); 345 } 346 } 347 }; 348 f.prototype.set = function(c, d) { 349 var e = g(this, c); 350 e.list || (e.list = this.data_[e.id] = []); 351 e.entry ? e.entry.value = d : (e.entry = {next:this.head_, previous:this.head_.previous, head:this.head_, key:c, value:d}, e.list.push(e.entry), this.head_.previous.next = e.entry, this.head_.previous = e.entry, this.size++); 352 return this; 353 }; 354 f.prototype.delete = function(c) { 355 c = g(this, c); 356 return c.entry && c.list ? (c.list.splice(c.index, 1), c.list.length || delete this.data_[c.id], c.entry.previous.next = c.entry.next, c.entry.next.previous = c.entry.previous, c.entry.head = null, this.size--, !0) : !1; 357 }; 358 f.prototype.clear = function() { 359 this.data_ = {}; 360 this.head_ = this.head_.previous = k(); 361 this.size = 0; 362 }; 363 f.prototype.has = function(c) { 364 return !!g(this, c).entry; 365 }; 366 f.prototype.get = function(c) { 367 return (c = g(this, c).entry) && c.value; 368 }; 369 f.prototype.entries = function() { 370 return h(this, function(c) { 371 return [c.key, c.value]; 372 }); 373 }; 374 f.prototype.keys = function() { 375 return h(this, function(c) { 376 return c.key; 377 }); 378 }; 379 f.prototype.values = function() { 380 return h(this, function(c) { 381 return c.value; 382 }); 383 }; 384 f.prototype.forEach = function(c, d) { 385 for (var e = this.entries(), f; !(f = e.next()).done;) { 386 f = f.value, c.call(d, f[1], f[0], this); 387 } 388 }; 389 f.prototype[Symbol.iterator] = f.prototype.entries; 390 var g = function(c, d) { 391 var f = d && typeof d; 392 "object" == f || "function" == f ? e.has(d) ? f = e.get(d) : (f = "" + ++l, e.set(d, f)) : f = "p_" + d; 393 var g = c.data_[f]; 394 if (g && $jscomp.owns(c.data_, f)) { 395 for (c = 0; c < g.length; c++) { 396 var h = g[c]; 397 if (d !== d && h.key !== h.key || d === h.key) { 398 return {id:f, list:g, index:c, entry:h}; 399 } 400 } 401 } 402 return {id:f, list:g, index:-1, entry:void 0}; 403 }, h = function(c, d) { 404 var e = c.head_; 405 return $jscomp.iteratorPrototype(function() { 406 if (e) { 407 for (; e.head != c.head_;) { 408 e = e.previous; 409 } 410 for (; e.next != e.head;) { 411 return e = e.next, {done:!1, value:d(e)}; 412 } 413 e = null; 414 } 415 return {done:!0, value:void 0}; 416 }); 417 }, k = function() { 418 var c = {}; 419 return c.previous = c.next = c.head = c; 420 }, l = 0; 421 return f; 422}, "es6", "es3"); 423$jscomp.polyfill("Set", function(c) { 424 function d() { 425 if ($jscomp.ASSUME_NO_NATIVE_SET || !c || "function" != typeof c || !c.prototype.entries || "function" != typeof Object.seal) { 426 return !1; 427 } 428 try { 429 var d = Object.seal({x:4}), e = new c($jscomp.makeIterator([d])); 430 if (!e.has(d) || 1 != e.size || e.add(d) != e || 1 != e.size || e.add({x:4}) != e || 2 != e.size) { 431 return !1; 432 } 433 var h = e.entries(), k = h.next(); 434 if (k.done || k.value[0] != d || k.value[1] != d) { 435 return !1; 436 } 437 k = h.next(); 438 return k.done || k.value[0] == d || 4 != k.value[0].x || k.value[1] != k.value[0] ? !1 : h.next().done; 439 } catch (l) { 440 return !1; 441 } 442 } 443 if ($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS) { 444 if (c && $jscomp.ES6_CONFORMANCE) { 445 return c; 446 } 447 } else { 448 if (d()) { 449 return c; 450 } 451 } 452 $jscomp.initSymbol(); 453 $jscomp.initSymbolIterator(); 454 var e = function(c) { 455 this.map_ = new Map; 456 if (c) { 457 c = $jscomp.makeIterator(c); 458 for (var d; !(d = c.next()).done;) { 459 this.add(d.value); 460 } 461 } 462 this.size = this.map_.size; 463 }; 464 e.prototype.add = function(c) { 465 this.map_.set(c, c); 466 this.size = this.map_.size; 467 return this; 468 }; 469 e.prototype.delete = function(c) { 470 c = this.map_.delete(c); 471 this.size = this.map_.size; 472 return c; 473 }; 474 e.prototype.clear = function() { 475 this.map_.clear(); 476 this.size = 0; 477 }; 478 e.prototype.has = function(c) { 479 return this.map_.has(c); 480 }; 481 e.prototype.entries = function() { 482 return this.map_.entries(); 483 }; 484 e.prototype.values = function() { 485 return this.map_.values(); 486 }; 487 e.prototype.keys = e.prototype.values; 488 e.prototype[Symbol.iterator] = e.prototype.values; 489 e.prototype.forEach = function(c, d) { 490 var e = this; 491 this.map_.forEach(function(f) { 492 return c.call(d, f, f, e); 493 }); 494 }; 495 return e; 496}, "es6", "es3"); 497$jscomp.polyfill("Array.prototype.values", function(c) { 498 return c ? c : function() { 499 return $jscomp.iteratorFromArray(this, function(c, e) { 500 return e; 501 }); 502 }; 503}, "es8", "es3"); 504$jscomp.findInternal = function(c, d, e) { 505 c instanceof String && (c = String(c)); 506 for (var f = c.length, g = 0; g < f; g++) { 507 var h = c[g]; 508 if (d.call(e, h, g, c)) { 509 return {i:g, v:h}; 510 } 511 } 512 return {i:-1, v:void 0}; 513}; 514$jscomp.polyfill("Array.prototype.findIndex", function(c) { 515 return c ? c : function(c, e) { 516 return $jscomp.findInternal(this, c, e).i; 517 }; 518}, "es6", "es3"); 519$jscomp.assign = "function" == typeof Object.assign ? Object.assign : function(c, d) { 520 for (var e = 1; e < arguments.length; e++) { 521 var f = arguments[e]; 522 if (f) { 523 for (var g in f) { 524 $jscomp.owns(f, g) && (c[g] = f[g]); 525 } 526 } 527 } 528 return c; 529}; 530$jscomp.polyfill("Object.assign", function(c) { 531 return c || $jscomp.assign; 532}, "es6", "es3"); 533$jscomp.polyfill("String.prototype.repeat", function(c) { 534 return c ? c : function(c) { 535 var d = $jscomp.checkStringArgs(this, null, "repeat"); 536 if (0 > c || 1342177279 < c) { 537 throw new RangeError("Invalid count value"); 538 } 539 c |= 0; 540 for (var f = ""; c;) { 541 if (c & 1 && (f += d), c >>>= 1) { 542 d += d; 543 } 544 } 545 return f; 546 }; 547}, "es6", "es3"); 548$jscomp.polyfill("Array.prototype.find", function(c) { 549 return c ? c : function(c, e) { 550 return $jscomp.findInternal(this, c, e).v; 551 }; 552}, "es6", "es3"); 553$jscomp.polyfill("String.prototype.endsWith", function(c) { 554 return c ? c : function(c, e) { 555 var d = $jscomp.checkStringArgs(this, c, "endsWith"); 556 c += ""; 557 void 0 === e && (e = d.length); 558 e = Math.max(0, Math.min(e | 0, d.length)); 559 for (var g = c.length; 0 < g && 0 < e;) { 560 if (d[--e] != c[--g]) { 561 return !1; 562 } 563 } 564 return 0 >= g; 565 }; 566}, "es6", "es3"); 567var COMPILED = !0, goog = goog || {}; 568goog.global = this; 569goog.isDef = function(c) { 570 return void 0 !== c; 571}; 572goog.isString = function(c) { 573 return "string" == typeof c; 574}; 575goog.isBoolean = function(c) { 576 return "boolean" == typeof c; 577}; 578goog.isNumber = function(c) { 579 return "number" == typeof c; 580}; 581goog.exportPath_ = function(c, d, e) { 582 c = c.split("."); 583 e = e || goog.global; 584 c[0] in e || !e.execScript || e.execScript("var " + c[0]); 585 for (var f; c.length && (f = c.shift());) { 586 !c.length && goog.isDef(d) ? e[f] = d : e = e[f] && e[f] !== Object.prototype[f] ? e[f] : e[f] = {}; 587 } 588}; 589goog.define = function(c, d) { 590 if (!COMPILED) { 591 var e = goog.global.CLOSURE_UNCOMPILED_DEFINES, f = goog.global.CLOSURE_DEFINES; 592 e && void 0 === e.nodeType && Object.prototype.hasOwnProperty.call(e, c) ? d = e[c] : f && void 0 === f.nodeType && Object.prototype.hasOwnProperty.call(f, c) && (d = f[c]); 593 } 594 goog.exportPath_(c, d); 595}; 596goog.DEBUG = !0; 597goog.LOCALE = "en"; 598goog.TRUSTED_SITE = !0; 599goog.STRICT_MODE_COMPATIBLE = !1; 600goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG; 601goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1; 602goog.provide = function(c) { 603 if (goog.isInModuleLoader_()) { 604 throw Error("goog.provide can not be used within a goog.module."); 605 } 606 if (!COMPILED && goog.isProvided_(c)) { 607 throw Error('Namespace "' + c + '" already declared.'); 608 } 609 goog.constructNamespace_(c); 610}; 611goog.constructNamespace_ = function(c, d) { 612 if (!COMPILED) { 613 delete goog.implicitNamespaces_[c]; 614 for (var e = c; (e = e.substring(0, e.lastIndexOf("."))) && !goog.getObjectByName(e);) { 615 goog.implicitNamespaces_[e] = !0; 616 } 617 } 618 goog.exportPath_(c, d); 619}; 620goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; 621goog.module = function(c) { 622 if (!goog.isString(c) || !c || -1 == c.search(goog.VALID_MODULE_RE_)) { 623 throw Error("Invalid module identifier"); 624 } 625 if (!goog.isInModuleLoader_()) { 626 throw Error("Module " + c + " has been loaded incorrectly. Note, modules cannot be loaded as
626normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide."); 627 } 628 if (goog.moduleLoaderState_.moduleName) { 629 throw Error("goog.module may only be called once per module."); 630 } 631 goog.moduleLoaderState_.moduleName = c; 632 if (!COMPILED) { 633 if (goog.isProvided_(c)) { 634 throw Error('Namespace "' + c + '" already declared.'); 635 } 636 delete goog.implicitNamespaces_[c]; 637 } 638}; 639goog.module.get = function(c) { 640 return goog.module.getInternal_(c); 641}; 642goog.module.getInternal_ = function(c) { 643 if (!COMPILED) { 644 if (c in goog.loadedModules_) { 645 return goog.loadedModules_[c]; 646 } 647 if (!goog.implicitNamespaces_[c]) { 648 return c = goog.getObjectByName(c), null != c ? c : null; 649 } 650 } 651 return null; 652}; 653goog.moduleLoaderState_ = null; 654goog.isInModuleLoader_ = function() { 655 return null != goog.moduleLoaderState_; 656}; 657goog.module.declareLegacyNamespace = function() { 658 if (!COMPILED && !goog.isInModuleLoader_()) { 659 throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module"); 660 } 661 if (!COMPILED && !goog.moduleLoaderState_.moduleName) { 662 throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace."); 663 } 664 goog.moduleLoaderState_.declareLegacyNamespace = !0; 665}; 666goog.setTestOnly = function(c) { 667 if (goog.DISALLOW_TEST_ONLY_CODE) { 668 throw c = c || "", Error("Importing test-only code into non-debug environment" + (c ? ": " + c : ".")); 669 } 670}; 671goog.forwardDeclare = function(c) { 672}; 673COMPILED || (goog.isProvided_ = function(c) { 674 return c in goog.loadedModules_ || !goog.implicitNamespaces_[c] && goog.isDefAndNotNull(goog.getObjectByName(c)); 675}, goog.implicitNamespaces_ = {"goog.module":!0}); 676goog.getObjectByName = function(c, d) { 677 c = c.split("."); 678 d = d || goog.global; 679 for (var e = 0; e < c.length; e++) { 680 if (d = d[c[e]], !goog.isDefAndNotNull(d)) { 681 return null; 682 } 683 } 684 return d; 685}; 686goog.globalize = function(c, d) { 687 d = d || goog.global; 688 for (var e in c) { 689 d[e] = c[e]; 690 } 691}; 692goog.addDependency = function(c, d, e, f) { 693 if (goog.DEPENDENCIES_ENABLED) { 694 var g = goog.getLoader_(); 695 g && g.addDependency(c, d, e, f); 696 } 697}; 698goog.ENABLE_DEBUG_LOADER = !0; 699goog.logToConsole_ = function(c) { 700 goog.global.console && goog.global.console.error(c); 701}; 702goog.require = function(c) { 703 goog.ENABLE_DEBUG_LOADER && goog.debugLoader_ && goog.getLoader_().earlyProcessLoad(c); 704 if (!COMPILED) { 705 if (goog.isProvided_(c)) { 706 if (goog.isInModuleLoader_()) { 707 return goog.module.getInternal_(c); 708 } 709 } else { 710 if (goog.ENABLE_DEBUG_LOADER) { 711 var d = goog.moduleLoaderState_; 712 goog.moduleLoaderState_ = null; 713 try { 714 var e = goog.getLoader_(); 715 e ? e.load(c) : goog.logToConsole_("Could not load " + c + " because there is no debug loader."); 716 } finally { 717 goog.moduleLoaderState_ = d; 718 } 719 } 720 } 721 return null; 722 } 723}; 724goog.basePath = ""; 725goog.nullFunction = function() { 726}; 727goog.abstractMethod = function() { 728 throw Error("unimplemented abstract method"); 729}; 730goog.addSingletonGetter = function(c) { 731 c.instance_ = void 0; 732 c.getInstance = function() { 733 if (c.instance_) { 734 return c.instance_; 735 } 736 goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = c); 737 return c.instance_ = new c; 738 }; 739}; 740goog.instantiatedSingletons_ = []; 741goog.LOAD_MODULE_USING_EVAL = !0; 742goog.SEAL_MODULE_EXPORTS = goog.DEBUG; 743goog.loadedModules_ = {}; 744goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; 745goog.TRANSPILE = "detect"; 746goog.TRANSPILER = "transpile.js"; 747goog.DEBUG_LOADER = ""; 748goog.hasBadLetScoping = null; 749goog.useSafari10Workaround = function() { 750 if (null == goog.hasBadLetScoping) { 751 try { 752 var c = !eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";'); 753 } catch (d) { 754 c = !1; 755 } 756 goog.hasBadLetScoping = c; 757 } 758 return goog.hasBadLetScoping; 759}; 760goog.workaroundSafari10EvalBug = function(c) { 761 return "(function(){" + c + "\n;})();\n"; 762}; 763goog.loadModule = function(c) { 764 var d = goog.moduleLoaderState_; 765 try { 766 goog.moduleLoaderState_ = {moduleName:"", declareLegacyNamespace:!1}; 767 if (goog.isFunction(c)) { 768 var e = c.call(void 0, {}); 769 } else { 770 if (goog.isString(c)) { 771 goog.useSafari10Workaround() && (c = goog.workaroundSafari10EvalBug(c)), e = goog.loadModuleFromSource_.call(void 0, c
771); 772 } else { 773 throw Error("Invalid module definition"); 774 } 775 } 776 var f = goog.moduleLoaderState_.moduleName; 777 if (goog.isString(f) && f) { 778 goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(f, e) : goog.SEAL_MODULE_EXPORTS && Object.seal && "object" == typeof e && null != e && Object.seal(e), goog.loadedModules_[f] = e; 779 } else { 780 throw Error('Invalid module name "' + f + '"'); 781 } 782 } finally { 783 goog.moduleLoaderState_ = d; 784 } 785}; 786goog.loadModuleFromSource_ = function(c) { 787 eval(c); 788 return {}; 789}; 790goog.normalizePath_ = function(c) { 791 c = c.split("/"); 792 for (var d = 0; d < c.length;) { 793 "." == c[d] ? c.splice(d, 1) : d && ".." == c[d] && c[d - 1] && ".." != c[d - 1] ? c.splice(--d, 2) : d++; 794 } 795 return c.join("/"); 796}; 797goog.loadFileSync_ = function(c) { 798 if (goog.global.CLOSURE_LOAD_FILE_SYNC) { 799 return goog.global.CLOSURE_LOAD_FILE_SYNC(c); 800 } 801 try { 802 var d = new goog.global.XMLHttpRequest; 803 d.open("get", c, !1); 804 d.send(); 805 return 0 == d.status || 200 == d.status ? d.responseText : null; 806 } catch (e) { 807 return null; 808 } 809}; 810goog.transpile_ = function(c, d) { 811 var e = goog.global.$jscomp; 812 e || (goog.global.$jscomp = e = {}); 813 var f = e.transpile; 814 if (!f) { 815 var g = goog.basePath + goog.TRANSPILER, h = goog.loadFileSync_(g); 816 if (h) { 817 (function() { 818 eval(h + "\n//# sourceURL=" + g); 819 }).call(goog.global); 820 if (goog.global.$gwtExport && goog.global.$gwtExport.$jscomp && !goog.global.$gwtExport.$jscomp.transpile) { 821 throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: ' + JSON.stringify(goog.global.$gwtExport)); 822 } 823 goog.global.$jscomp.transpile = goog.global.$gwtExport.$jscomp.transpile; 824 e = goog.global.$jscomp; 825 f = e.transpile; 826 } 827 } 828 f || (f = e.transpile = function(c, d) { 829 goog.logToConsole_(d + " requires transpilation but no transpiler was found."); 830 return c; 831 }); 832 return f(c, d); 833}; 834goog.typeOf = function(c) { 835 var d = typeof c; 836 if ("object" == d) { 837 if (c) { 838 if (c instanceof Array) { 839 return "array"; 840 } 841 if (c instanceof Object) { 842 return d; 843 } 844 var e = Object.prototype.toString.call(c); 845 if ("[object Window]" == e) { 846 return "object"; 847 } 848 if ("[object Array]" == e || "number" == typeof c.length && "undefined" != typeof c.splice && "undefined" != typeof c.propertyIsEnumerable && !c.propertyIsEnumerable("splice")) { 849 return "array"; 850 } 851 if ("[object Function]" == e || "undefined" != typeof c.call && "undefined" != typeof c.propertyIsEnumerable && !c.propertyIsEnumerable("call")) { 852 return "function"; 853 } 854 } else { 855 return "null"; 856 } 857 } else { 858 if ("function" == d && "undefined" == typeof c.call) { 859 return "object"; 860 } 861 } 862 return d; 863}; 864goog.isNull = function(c) { 865 return null === c; 866}; 867goog.isDefAndNotNull = function(c) { 868 return null != c; 869}; 870goog.isArray = function(c) { 871 return "array" == goog.typeOf(c); 872}; 873goog.isArrayLike = function(c) { 874 var d = goog.typeOf(c); 875 return "array" == d || "object" == d && "number" == typeof c.length; 876}; 877goog.isDateLike = function(c) { 878 return goog.isObject(c) && "function" == typeof c.getFullYear; 879}; 880goog.isFunction = function(c) { 881 return "function" == goog.typeOf(c); 882}; 883goog.isObject = function(c) { 884 var d = typeof c; 885 return "object" == d && null != c || "function" == d; 886}; 887goog.getUid = function(c) { 888 return c[goog.UID_PROPERTY_] || (c[goog.UID_PROPERTY_] = ++goog.uidCounter_); 889}; 890goog.hasUid = function(c) { 891 return !!c[goog.UID_PROPERTY_]; 892}; 893goog.removeUid = function(c) { 894 null !== c && "removeAttribute" in c && c.removeAttribute(goog.UID_PROPERTY_); 895 try { 896 delete c[goog.UID_PROPERTY_]; 897 } catch (d) { 898 } 899}; 900goog.UID_PROPERTY_ = "closure_uid_" + (1e9 * Math.random() >>> 0); 901goog.uidCounter_ = 0; 902goog.getHashCode = goog.getUid; 903goog.removeHashCode = goog.removeUid; 904goog.cloneObject = function(c) { 905 var d = goog.typeOf(c); 906 if ("object" == d || "array" == d) { 907 if (c.clone) { 908 return c.clone(); 909 } 910 d = "array" == d ? [] : {}; 911 for (var e in c) { 912 d[e] = goog.cloneObject(c[e]); 913 } 914 return d; 915 } 916 return c; 917}; 918goog.bindNative_ = function(c, d, e) { 919 return c.call.apply(c.bind, arguments); 920}; 921goog.bindJs_ = function(c, d, e) { 922 if (!c) { 923 throw Error(); 924 } 925 if (2 < arguments.length) { 926 var f = Array.prototype.slice.call(arguments, 2); 927 return function() { 928 var e = Array.prototype.slice.call(arguments); 929 Array.prototype.unshift.apply(e, f); 930 return c.apply(d, e); 931 }; 932 } 933 return function() { 934 return c.apply(d, arguments); 935 }; 936}; 937goog.bind = function(c, d, e) { 938 Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; 939 return goog.bind.apply(null, arguments); 940}; 941goog.partial = function(c, d) { 942 var e = Array.prototype.slice.call(arguments, 1); 943 return function() { 944 var d = e.slice(); 945 d.push.apply(d, arguments); 946 return c.apply(this, d); 947 }; 948}; 949goog.mixin = function(c, d) { 950 for (var e in d) { 951 c[e] = d[e]; 952 } 953}; 954goog.now = goog.TRUSTED_SITE && Date.now || function() { 955 return +new Date; 956}; 957goog.globalEval = function(c) { 958 if (goog.global.execScript) { 959 goog.global.execScript(c, "JavaScript"); 960 } else { 961 if (goog.global.eval) { 962 if (null == goog.evalWorksForGlobals_) { 963 try { 964 goog.global.eval("var _evalTest_ = 1;"); 965 } catch (f) { 966 } 967 if ("undefined" != typeof goog.global._evalTest_) { 968 try { 969 delete goog.global._evalTest_; 970 } catch (f) { 971 } 972 goog.evalWorksForGlobals_ = !0; 973 } else { 974 goog.evalWorksForGlobals_ = !1; 975 } 976 } 977 if (goog.evalWorksForGlobals_) { 978 goog.global.eval(c); 979 } else { 980 var d = goog.global.document, e = d.createElement("SCRIPT"); 981 e.type = "text/javascript"; 982 e.defer = !1; 983 e.appendChild(d.createTextNode(c)); 984 d.head.appendChild(e); 985 d.head.removeChild(e); 986 } 987 } else { 988 throw Error("goog.globalEval not available"); 989 } 990 } 991}; 992goog.evalWorksForGlobals_ = null; 993goog.getCssName = function(c, d) { 994 if ("." == String(c).charAt(0)) { 995 throw Error('className passed in goog.getCssName must not start with ".". You passed: ' + c); 996 } 997 var e = function(c) { 998 return goog.cssNameMapping_[c] || c; 999 }, f = function(c) { 1000 c = c.split("-"); 1001 for (var d = [], f = 0; f < c.length; f++) { 1002 d.push(e(c[f])); 1003 } 1004 return d.join("-"); 1005 }; 1006 f = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? e : f : function(c) { 1007 return c; 1008 }; 1009 c = d ? c + "-" + f(d) : f(c); 1010 return goog.global.CLOSURE_CSS_NAME_MAP_FN ? goog.global.CLOSURE_CSS_NAME_MAP_FN(c) : c; 1011}; 1012goog.setCssNameMapping = function(c, d) { 1013 goog.cssNameMapping_ = c; 1014 goog.cssNameMappingStyle_ = d; 1015}; 1016!COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); 1017goog.getMsg = function(c, d) { 1018 d && (c = c.replace(/\{\$([^}]+)}/g, function(c, f) { 1019 return null != d && f in d ? d[f] : c; 1020 })); 1021 return c; 1022}; 1023goog.getMsgWithFallback = function(c, d) { 1024 return c; 1025}; 1026goog.exportSymbol = function(c, d, e) { 1027 goog.exportPath_(c, d, e); 1028}; 1029goog.exportProperty = function(c, d, e) { 1030 c[d] = e; 1031}; 1032goog.inherits = function(c, d) { 1033 function e() { 1034 } 1035 e.prototype = d.prototype; 1036 c.superClass_ = d.prototype; 1037 c.prototype = new e; 1038 c.prototype.constructor = c; 1039 c.base = function(c, e, h) { 1040 for (var f = Array(arguments.length - 2), g = 2; g < arguments.length; g++) { 1041 f[g - 2] = arguments[g]; 1042 } 1043 return d.prototype[e].apply(c, f); 1044 }; 1045}; 1046goog.base = function(c, d, e) { 1047 var f = arguments.callee.caller; 1048 if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !f) { 1049 throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode co
1049de. See http://www.ecma-international.org/ecma-262/5.1/#sec-C"); 1050 } 1051 if (f.superClass_) { 1052 for (var g = Array(arguments.length - 1), h = 1; h < arguments.length; h++) { 1053 g[h - 1] = arguments[h]; 1054 } 1055 return f.superClass_.constructor.apply(c, g); 1056 } 1057 g = Array(arguments.length - 2); 1058 for (h = 2; h < arguments.length; h++) { 1059 g[h - 2] = arguments[h]; 1060 } 1061 h = !1; 1062 for (var k = c.constructor; k; k = k.superClass_ && k.superClass_.constructor) { 1063 if (k.prototype[d] === f) { 1064 h = !0; 1065 } else { 1066 if (h) { 1067 return k.prototype[d].apply(c, g); 1068 } 1069 } 1070 } 1071 if (c[d] === f) { 1072 return c.constructor.prototype[d].apply(c, g); 1073 } 1074 throw Error("goog.base called from a method of one name to a method of a different name"); 1075}; 1076goog.scope = function(c) { 1077 if (goog.isInModuleLoader_()) { 1078 throw Error("goog.scope is not supported within a goog.module."); 1079 } 1080 c.call(goog.global); 1081}; 1082COMPILED || (goog.global.COMPILED = COMPILED); 1083goog.defineClass = function(c, d) { 1084 var e = d.constructor, f = d.statics; 1085 e && e != Object.prototype.constructor || (e = function() { 1086 throw Error("cannot instantiate an interface (no constructor defined)."); 1087 }); 1088 e = goog.defineClass.createSealingConstructor_(e, c); 1089 c && goog.inherits(e, c); 1090 delete d.constructor; 1091 delete d.statics; 1092 goog.defineClass.applyProperties_(e.prototype, d); 1093 null != f && (f instanceof Function ? f(e) : goog.defineClass.applyProperties_(e, f)); 1094 return e; 1095}; 1096goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG; 1097goog.defineClass.createSealingConstructor_ = function(c, d) { 1098 if (!goog.defineClass.SEAL_CLASS_INSTANCES) { 1099 return c; 1100 } 1101 var e = !goog.defineClass.isUnsealable_(d), f = function() { 1102 var d = c.apply(this, arguments) || this; 1103 d[goog.UID_PROPERTY_] = d[goog.UID_PROPERTY_]; 1104 this.constructor === f && e && Object.seal instanceof Function && Object.seal(d); 1105 return d; 1106 }; 1107 return f; 1108}; 1109goog.defineClass.isUnsealable_ = function(c) { 1110 return c && c.prototype && c.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]; 1111}; 1112goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); 1113goog.defineClass.applyProperties_ = function(c, d) { 1114 for (var e in d) { 1115 Object.prototype.hasOwnProperty.call(d, e) && (c[e] = d[e]); 1116 } 1117 for (var f = 0; f < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length; f++) { 1118 e = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, e) && (c[e] = d[e]); 1119 } 1120}; 1121goog.tagUnsealableClass = function(c) { 1122 !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (c.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0); 1123}; 1124goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable"; 1125goog.DEPENDENCIES_ENABLED && (goog.inHtmlDocument_ = function() { 1126 var c = goog.global.document; 1127 return null != c && "write" in c; 1128}, goog.findBasePath_ = function() { 1129 if (goog.isDef(goog.global.CLOSURE_BASE_PATH) && goog.isString(goog.global.CLOSURE_BASE_PATH)) { 1130 goog.basePath = goog.global.CLOSURE_BASE_PATH; 1131 } else { 1132 if (goog.inHtmlDocument_()) { 1133 var c = goog.global.document, d = c.currentScript; 1134 c = d ? [d] : c.getElementsByTagName("SCRIPT"); 1135 for (d = c.length - 1; 0 <= d; --d) { 1136 var e = c[d].src, f = e.lastIndexOf("?"); 1137 f = -1 == f ? e.length : f; 1138 if ("base.js" == e.substr(f - 7, 7)) { 1139 goog.basePath = e.substr(0, f - 7); 1140 break; 1141 } 1142 } 1143 } 1144 } 1145}, goog.findBasePath_(), goog.Transpiler = function() { 1146 this.requiresTranspilation_ = null; 1147}, goog.Transpiler.prototype.createRequiresTranspilation_ = function() { 1148 function c(c, d) { 1149 f ? e[c] = !0 : d() ? e[c] = !1 : f = e[c] = !0; 1150 } 1151 function d(c) { 1152 try { 1153 return !!eval(c); 1154 } catch (k) { 1155 return !1; 1156 } 1157 } 1158 var e = {es3:!1}, f = !1, g = goog.global.navigator && goog.global.navigator.userAgent ? goog.global.navigator.userAgent : ""; 1159 c("es5", function() { 1160 return d("[1,].length==1"); 1161 }); 1162 c("es6", function() { 1163 var c = g.match(/Edge\/(\d+)(\.\d)*/i); 1164 return c && 15 > Number(c[1]) ? !1 : d('(()=>{"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}})()'); 1165 }); 1166 c("es6-impl", function() { 1167 return !0; 1168 }); 1169 c("es7", function() { 1170 return d("2 ** 2 == 4"); 1171 }); 1172 c("es8", function() { 1173 return d("async () => 1, true"); 1174 }); 1175 c("es_next", function() { 1176 return d("({...rest} = {}), true"); 1177 }); 1178 return e; 1179}, goog.Transpiler.prototype.needsTranspile = function(c) { 1180 if ("always" == goog.TRANSPILE) { 1181 return !0; 1182 } 1183 if ("never" == goog.TRANSPILE) { 1184 return !1; 1185 } 1186 this.requiresTranspilation_ || (this.requiresTranspilation_ = this.createRequiresTranspilation_()); 1187 if (c in this.requiresTranspilation_) { 1188 return this.requiresTranspilation_[c]; 1189 } 1190 throw Error("Unknown language mode: " + c); 1191}, goog.Transpiler.prototype.transpile = function(c, d) { 1192 return goog.transpile_(c, d); 1193}, goog.transpiler_ = new goog.Transpiler, goog.DebugLoader = function() { 1194 this.dependencies_ = {loadFlags:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}; 1195 this.oldIeWaiting_ = !1; 1196 this.queuedModules_ = []; 1197 this.lastNonModuleScriptIndex_ = 0; 1198}, goog.DebugLoader.IS_OLD_IE_ = !(goog.global.atob || !goog.global.document || !goog.global.document.all), goog.DebugLoader.prototype.earlyProcessLoad = function(c) { 1199 goog.DebugLoader.IS_OLD_IE_ && this.maybeProcessDeferredDep_(c); 1200}, goog.DebugLoader.prototype.load = function(c) { 1201 var d = this.getPathFromDeps_(c); 1202 if (d) { 1203 var e = [], f = {}, g = this.dependencies_, h = this, k = function(c) { 1204 if (!(c in g.written || c in g.visited)) { 1205 g.visited[c] = !0; 1206 if (c in g.requires) { 1207 for (var d in g.requires[c]) { 1208 if (!h.isProvided(d)) { 1209 if (d in g.nameToPath) { 1210 k(g.nameToPath[d]); 1211 } else { 1212 throw Error("Undefined nameToPath for " + d); 1213 } 1214 } 1215 } 1216 } 1217 c in f || (f[c] = !0, e.push(c)); 1218 } 1219 }; 1220 k(d); 1221 for (c = 0; c < e.length; c++) { 1222 d = e[c], this.dependencies_.written[d] = !0; 1223 } 1224 for (c = 0; c < e.length; c++) { 1225 if (d = e[c]) { 1226 var l = g.loadFlags[d] || {}, m = l.lang || "es3"; 1227 m = this.getTranspiler().needsTranspile(m); 1228 "goog" == l.module || m ? this.importProcessedScript_(goog.basePath + d, "goog" == l.module, m) : this.importScript_(goog.basePath + d); 1229 } else { 1230 throw Error("Undefined script input"); 1231 } 1232 } 1233 } else { 1234 throw c = "goog.require could not find: " + c, this.logToConsole(c), Error(c); 1235 } 1236}, goog.DebugLoader.prototype.addDependency = function(c, d, e, f) { 1237 var g; 1238 c = c.replace(/\\/g, "/");
1239 var h = this.dependencies_; 1240 f && "boolean" !== typeof f || (f = f ? {module:"goog"} : {}); 1241 for (var k = 0; g = d[k]; k++) { 1242 h.nameToPath[g] = c, h.loadFlags[c] = f; 1243 } 1244 for (f = 0; d = e[f]; f++) { 1245 c in h.requires || (h.requires[c] = {}), h.requires[c][d] = !0; 1246 } 1247}, goog.DebugLoader.prototype.importScript_ = function(c, d) { 1248 (goog.global.CLOSURE_IMPORT_SCRIPT || goog.bind(this.writeScriptTag_, this))(c, d) && (this.dependencies_.written[c] = !0); 1249}, goog.DebugLoader.prototype.importProcessedScript_ = function(c, d, e) { 1250 this.importScript_("", 'goog.debugLoader_.retrieveAndExec_("' + c + '", ' + d + ", " + e + ");"); 1251}, goog.DebugLoader.prototype.retrieveAndExec_ = function(c, d, e) { 1252 if (!COMPILED) { 1253 var f = c; 1254 c = this.normalizePath(c); 1255 var g = goog.global.CLOSURE_IMPORT_SCRIPT || goog.bind(this.writeScriptTag_, this), h = this.loadFileSync(c); 1256 if (null == h) { 1257 throw Error('Load of "' + c + '" failed'); 1258 } 1259 e && (h = this.getTranspiler().transpile(h, c)); 1260 h = d ? this.wrapModule_(c, h) : h + ("\n//# sourceURL=" + c); 1261 goog.DebugLoader.IS_OLD_IE_ && this.oldIeWaiting_ ? (this.dependencies_.deferred[f] = h, this.queuedModules_.push(f)) : g(c, h); 1262 } 1263}, goog.DebugLoader.prototype.wrapModule_ = function(c, d) { 1264 return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loadModule(" + goog.global.JSON.stringify(d + "\n//# sourceURL=" + c + "\n") + ");" : 'goog.loadModule(function(exports) {"use strict";' + d + "\n;return exports});\n//# sourceURL=" + c + "\n"; 1265}, goog.DebugLoader.prototype.loadQueuedModules_ = function() { 1266 var c = this.queuedModules_.length; 1267 if (0 < c) { 1268 var d = this.queuedModules_; 1269 this.queuedModules_ = []; 1270 for (var e = 0; e < c; e++) { 1271 this.maybeProcessDeferredPath_(d[e]); 1272 } 1273 } 1274 this.oldIeWaiting_ = !1; 1275}, goog.DebugLoader.prototype.maybeProcessDeferredDep_ = function(c) { 1276 this.isDeferredModule_(c) && this.allDepsAreAvailable_(c) && (c = this.getPathFromDeps_(c), this.maybeProcessDeferredPath_(goog.basePath + c)); 1277}, goog.DebugLoader.prototype.isDeferredModule_ = function(c) { 1278 var d = (c = this.getPathFromDeps_(c)) && this.dependencies_.loadFlags[c] || {}, e = d.lang || "es3"; 1279 return c && ("goog" == d.module || this.getTranspiler().needsTranspile(e)) ? goog.basePath + c in this.dependencies_.deferred : !1; 1280}, goog.DebugLoader.prototype.allDepsAreAvailable_ = function(c) { 1281 if ((c = this.getPathFromDeps_(c)) && c in this.dependencies_.requires) { 1282 for (var d in this.dependencies_.requires[c]) { 1283 if (!this.isProvided(d) && !this.isDeferredModule_(d)) { 1284 return !1; 1285 } 1286 } 1287 } 1288 return !0; 1289}, goog.DebugLoader.prototype.maybeProcessDeferredPath_ = function(c) { 1290 if (c in this.dependencies_.deferred) { 1291 var d = this.dependencies_.deferred[c]; 1292 delete this.dependencies_.deferred[c]; 1293 goog.globalEval(d); 1294 } 1295}, goog.DebugLoader.prototype.writeScriptSrcNode_ = function(c) {
1296 goog.global.document.write('<script type="text/javascript" src="' + c + '">\x3c/script>'); 1297}, goog.DebugLoader.prototype.appendScriptSrcNode_ = function(c) { 1298 var d = goog.global.document, e = d.createElement("script"); 1299 e.type = "text/javascript"; 1300 e.src = c; 1301 e.defer = !1; 1302 e.async = !1; 1303 d.head.appendChild(e); 1304}, goog.DebugLoader.prototype.writeScriptTag_ = function(c, d) { 1305 if (this.inHtmlDocument()) { 1306 var e = goog.global.document; 1307 if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && "complete" == e.readyState) { 1308 if (/\bdeps.js$/.test(c)) { 1309 return !1; 1310 } 1311 throw Error('Cannot write "' + c + '" after document load'); 1312 } 1313 void 0 === d ? goog.DebugLoader.IS_OLD_IE_ ? (this.oldIeWaiting_ = !0, d = " onreadystatechange='goog.debugLoader_.onScriptLoad_(this, " + ++this.lastNonModuleScriptIndex_ + ")' ", e.write('<script type="text/javascript" src="' + c + '"' + d + ">\x3c/script>")) : goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING ? this.appendScriptSrcNode_(c) : this.writeScriptSrcNode_(c) : e.write('<script type="text/javascript">' + this.protectScriptTag_(d) + "\x3c/script>"); 1314 return !0; 1315 } 1316 return !1; 1317}, goog.DebugLoader.prototype.protectScriptTag_ = function(c) { 1318 return c.replace(/<\/(SCRIPT)/ig, "\\x3c/$1"); 1319}, goog.DebugLoader.prototype.onScriptLoad_ = function(c, d) { 1320 "complete" == c.readyState && this.lastNonModuleScriptIndex_ == d && this.loadQueuedModules_(); 1321 return !0; 1322}, goog.DebugLoader.prototype.getPathFromDeps_ = function(c) { 1323 return c in this.dependencies_.nameToPath ? this.dependencies_.nameToPath[c] : null; 1324}, goog.DebugLoader.prototype.getTranspiler = function() { 1325 return goog.transpiler_; 1326}, goog.DebugLoader.prototype.isProvided = function(c) { 1327 return goog.isProvided_(c); 1328}, goog.DebugLoader.prototype.inHtmlDocument = function() { 1329 return goog.inHtmlDocument_(); 1330}, goog.DebugLoader.prototype.logToConsole = function(c) { 1331 goog.logToConsole_(c); 1332}, goog.DebugLoader.prototype.loadFileSync = function(c) { 1333 return goog.loadFileSync_(c); 1334}, goog.DebugLoader.prototype.normalizePath = function(c) { 1335 return goog.normalizePath_(c); 1336}, goog.debugLoader_ = null, goog.registerDebugLoader = function(c) { 1337 if (goog.debugLoader_) { 1338 throw Error("Debug loader already registered!"); 1339 } 1340 if (!(c instanceof goog.DebugLoader)) { 1341 throw Error("Not a goog.DebugLoader."); 1342 } 1343 goog.debugLoader_ = c; 1344}, goog.getLoader_ = function() { 1345 if (!goog.debugLoader_ && goog.DEBUG_LOADER) { 1346 throw Error("Loaded debug loader file but no loader was registered!"); 1347 } 1348 goog.debugLoader_ || (goog.debugLoader_ = new goog.DebugLoader); 1349 return goog.debugLoader_; 1350}, function() { 1351 if (goog.DEBUG_LOADER) { 1352 var c = new goog.DebugLoader; 1353 c.importScript_(goog.basePath + goog.DEBUG_LOADER); 1354 } 1355 goog.global.CLOSURE_NO_DEPS || (c = c || new goog.DebugLoader, goog.DEBUG_LOADER || goog.registerDebugLoader(c), c.importScript_(goog.basePath + "deps.js")); 1356}()); 1357var Matrix = {Cells:{}}; 1358function clg(c) { 1359 for (var d = [], e = 0; e < arguments.length; ++e) { 1360 d[e - 0] = arguments[e]; 1361 } 1362 console.log(Array.from(d).join(",")); 1363} 1364function clgx(c) { 1365} 1366window.clg = clg; 1367window.clgx = clgx; 1368function ast(c, d, e) { 1369 for (var f = [], g = 2; g < arguments.length; ++g) { 1370 f[g - 2] = arguments[g]; 1371 } 1372 console.assert.apply(console, [c, void 0 === d ? "anon" : d].concat($jscomp.arrayFromIterable(f))); 1373} 1374window.ast = ast; 1375function find(c, d) { 1376 if (-1 !== d.indexOf(c)) { 1377 return c; 1378 } 1379} 1380function eko(c, d) { 1381 console.log("eko <" + c + "> = " + d.toString()); 1382 return d; 1383} 1384function xor(c, d) { 1385 return c ? !d : d; 1386} 1387window.xor = xor; 1388function uuidv4() { 1389 return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, function(c) { 1390 return (c ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); 1391 }); 1392} 1393window.uuidv4 = uuidv4; 1394function localStorageLoad(c) { 1395 var d = Object.keys(window.localStorage || {}), e = [], f = d.length; 1396 for (clg("lsl sees keys" + d); f--;) { 1397 d[f].startsWith(c) && e.push(JSON.parse(window.localStorage.getItem(d[f]) || "")); 1398 } 1399 return e; 1400} 1401function isString(c) { 1402 return "string" === typeof c; 1403} 1404Storage.prototype.setObject = function(c, d) { 1405 this.setItem(c, JSON.stringify(d)); 1406}; 1407Storage.prototype.getObject = function(c) { 1408 return (c = this.getItem(c)) && JSON.parse(c); 1409}; 1410var MISSING = {}, QUEUE_COMPACT_SIZE = 500; 1411function define(c, d) { 1412 for (var e in d) { 1413 var f = Object.getOwnPropertyDescriptor(d, e); 1414 f.enumerable = !1;
1415 Object.defineProperty(c, e, f); 1416 } 1417} 1418var ArrayQueue = function() { 1419 this._head = this.size = 0; 1420 this._items = []; 1421}; 1422ArrayQueue.prototype.emptyp = function() { 1423 return 0 === this.size; 1424}; 1425ArrayQueue.prototype.push = function(c) { 1426 this._items.push(c); 1427 return ++this.size; 1428}; 1429ArrayQueue.prototype.shift = function() { 1430 if (this.size) { 1431 var c = this._items[this._head]; 1432 this._head === QUEUE_COMPACT_SIZE ? (this._items = this._items.slice(this._head + 1), this._head = 0, this.size--) : this._items[this._head++] = MISSING; 1433 return c; 1434 } 1435}; 1436ArrayQueue.prototype.clear = function() { 1437 this._head = this.size = 0; 1438 this._items.length = 0; 1439}; 1440ArrayQueue.prototype.forEach = function(c, d) { 1441 if (this.size) { 1442 for (var e = this._head, f = 0; e < this._items.length; e++) { 1443 var g = this._items[e]; 1444 g !== MISSING && c.call(d, g, f++, this); 1445 } 1446 } 1447}; 1448var Stack = function() { 1449 var c = function() { 1450 var c = []; 1451 return [function() { 1452 return c.push.apply(c, arguments); 1453 }, function() { 1454 return c.pop.apply(c, arguments); 1455 }, function() { 1456 return c.length; 1457 }, function(d) { 1458 return c.length = d; 1459 }, function() { 1460 return c[c.length - 1]; 1461 }, function(d) { 1462 return c.includes(d); 1463 }, function() { 1464 return c; 1465 }]; 1466 }(); 1467 this.push = c[0]; 1468 this.pop = c[1]; 1469 this.getLength = c[2]; 1470 this.setLength = c[3]; 1471 this.peek = c[4]; 1472 this.includes = c[5]; 1473 this.elts = c[6]; 1474 this.push.apply(this, arguments); 1475}; 1476Array.prototype.somex = function(c) { 1477 for (var d = $jscomp.makeIterator(this.entries()), e = d.next(); !e.done; e = d.next()) { 1478 var f = $jscomp.makeIterator(e.value); 1479 e = f.next().value; 1480 f = f.next().value; 1481 if (e = c(e, f)) { 1482 return e; 1483 } 1484 } 1485 return null; 1486}; 1487var causation = new Stack, callStack = new Stack, depender = null, gNotToBe = !1, gCPropDepth = 0, gCDebug = !1, gStop = !1, ppulse = 0; 1488function gpulse() { 1489 return ppulse; 1490} 1491var gPar = null, onePulsep = !1, dpLogp = !1; 1492function dataPulseNext(c) { 1493 onePulsep || (dpLogp && clg("dpnext " + (void 0 === c ? "anon" : c)), ppulse += 1); 1494 return ppulse; 1495} 1496function cellsReset(c) { 1497 c = void 0 === c ? {} : c; 1498 gCDebug = c.debug; 1499 clientQHandler = c.clientQHandler;
1500 cellsInit(); 1501} 1502function cellsInit() { 1503 ppulse = 0; 1504} 1505var deferChanges = !1, clientQHandler = null, gCustomPropagator = null, gWithinIntegrity = !1, gSlotObserver = {}; 1506function gSlotObserverDef(c, d) { 1507 gSlotObserver[c] && clg("gSlotObserverDef overwriting $(slot) observer"); 1508 gSlotObserver[c] = d; 1509} 1510var qNotify = new ArrayQueue, qAwaken = new ArrayQueue; 1511window.qAwaken = qAwaken; 1512var qClient = new ArrayQueue, qEphemReset = new ArrayQueue, qChange = new ArrayQueue; 1513function ufbAdd(c, d) { 1514 c.push(d); 1515} 1516function withoutCDependency(c) { 1517 return function(d) { 1518 var e = depender; 1519 depender = null; 1520 try { 1521 return c(d); 1522 } finally { 1523 depender = e; 1524 } 1525 }; 1526} 1527function withoutIntegrity(c) { 1528 var d = gWithinIntegrity, e = deferChanges; 1529 try { 1530 deferChanges = gWithinIntegrity = !1, c(); 1531 } finally { 1532 gWithinIntegrity = d, deferChanges = e; 1533 } 1534} 1535function withIntegrity(c, d, e) { 1536 if (!gStop) { 1537 if (gWithinIntegrity) { 1538 if (c) { 1539 return ufbAdd(c, [d, e]), "deferred-to-ufb"; 1540 } 1541 e(c, d); 1542 } else { 1543 var f = gWithinIntegrity, g = deferChanges; 1544 gWithinIntegrity = !0; 1545 deferChanges = !1; 1546 try { 1547 gpulse() && c !== qChange || dataPulseNext("cwi"); 1548 var h = e(c, d); 1549 finBiz(qNotify); 1550 return h; 1551 } finally { 1552 gWithinIntegrity = f, deferChanges = g; 1553 } 1554 } 1555 } 1556} 1557window.withIntegrity = withIntegrity; 1558function withChg(c, d) { 1559 withIntegrity(qChange, c, d); 1560} 1561window.withChg = withChg; 1562function finBiz(c) { 1563 for (; c;) { 1564 switch(c) { 1565 case qNotify: 1566 qDo("notify", c); 1567 qDo("awaken", qAwaken); 1568 c = qNotify.emptyp() ? qClient : qNotify; 1569 break; 1570 case qClient: 1571 (clientQHandler || qDo)("client", c); 1572 c = qClient.emptyp() ? qEphemReset : qClient; 1573 break; 1574 case qEphemReset: 1575 qDo("reset empheral", c); 1576 c = qChange; 1577 break; 1578 case qChange: 1579 if (c = c.shift()) { 1580 var d = $jscomp.makeIterator(c); 1581 c = d.next().value; 1582 d = d.next().value; 1583 dataPulseNext("change"); 1584 d("change", c); 1585 c = qNotify; 1586 } else { 1587 c = null; 1588 } 1589 break; 1590 default: 1591 throw "finBiz sees invalid q: " + c.toString(); 1592 } 1593 } 1594} 1595function qDo(c, d) { 1596 d.forEach(function(d) { 1597 var e = $jscomp.makeIterator(d); 1598 d = e.next().value; 1599 e = e.next().value; 1600 e(c, d); 1601 }); 1602 d.clear(); 1603} 1604$jscomp.initSymbol(); 1605var kUnbound = Symbol("unbound"), kUncurrent = "uncurrent", kValid = "valid", kAwake = "c-awake", kQuiesced = "c-quiesced", kNascent = "nascent", kOptimizedAwayp = "optimized-away", kOptimizeWhenValued = "optimize-when-valued", kOnceAsked = "lazy-once-asked", kUntilAsked = "lazy-until-asked", kAlways = "lazy-always", kObserverUnresolved = "kObserverUnresolved", Cell = function(c, d, e, f, g, h, k) { 1606 k = void 0 === k ? !e : k; 1607 this.name = void 0 === h ? "anon" : h; 1608 this.md = null; 1609 this.pulseObserved = this.pulseLastChanged = this.pulse = -1; 1610 this.lazy = null; 1611 this.callers = new Set; 1612 this.useds = new Set; 1613 this.ephemeralp = f; 1614 this.inputp = e; 1615 this.observer = g; 1616 this.optimize = k; 1617 this.quiesceWith = null; 1618 this.synapticp = this.slotOwning = !1; 1619 d ? (this.rule = d, this.pv = kUnbound, this.state = kNascent, this.others = {}) : (this.pv = c, this.state = kValid); 1620 Object.defineProperty(this, "v", {enumerable:!0, get:this.slotValue, set:this.slotValueSet}); 1621}; 1622Cell.prototype.mx = function() { 1623 return this.md; 1624}; 1625Cell.prototype.optimizedAwayp = function() { 1626 return this.state === kOptimizedAwayp; 1627}; 1628Cell.prototype.unboundp = function() { 1629 return this.pv === kUnbound; 1630}; 1631Cell.prototype.uncurrentp = function() { 1632 return this.pv === kUncurrent; 1633}; 1634Cell.prototype.validp = function() { 1635 return !(this.unboundp() || this.uncurrentp()); 1636}; 1637Cell.prototype.valueState = function() { 1638 return this.unboundp() ? kUnbound : this.uncurrentp() ? kUncurrent : kValid; 1639}; 1640Cell.prototype.valueChangedp = function(c, d) { 1641 return c !== d; 1642}; 1643Cell.prototype.currentp = function() { 1644 return this.pulse >= gpulse(); 1645}; 1646Cell.prototype.pulseUpdate = function(c) { 1647 this.optimizedAwayp() || (ast(gpulse() >= this.pulse), this.pulse = gpulse()); 1648}; 1649Cell.prototype.awaken = function() { 1650 this.rule ? this.currentp() || this.calcNSet("c-awaken") : gpulse() > this.pulseObserved && (this.observe(kUnbound, "awaken"), this.ephemeralReset()); 1651}; 1652Cell.prototype.slotValue = function() { 1653 var c = void 0, d = this; 1654 withIntegrity(null, null, function() { 1655 var e = d.pv; 1656 c = d.ensureValueIsCurrent("c-read", null); 1657 !d.md && d.state === kNascent && gpulse() > d.pulseObserved && (d.state = kAwake, d.observe(e, "cget"), d.ephemeralReset()); 1658 }); 1659 depender && depender.recordDependency(this); 1660 return c; 1661}; 1662Cell.prototype.slotValueSet = function(c) { 1663 var d = this; 1664 if (deferChanges) { 1665 debugger; 1666 throw "Assign to " + this.name + " must be deferred by wrapping it in WITH-INTEGRITY"; 1667 } 1668 find(this.lazy, [kOnceAsked, kAlways, !0]) ? this.valueAssume(c, null) : withChg(this.name, function() { 1669 d.valueAssume(c, null); 1670 }); 1671}; 1672Cell.prototype.recordDependency = function(c) { 1673 c.optimizedAwayp() || (this.useds.add(c), ast(0 < this.useds.size), c.callerEnsure(this)); 1674}; 1675Cell.prototype.callerEnsure = function(c) { 1676 this.callers.add(c); 1677}; 1678Cell.prototype.callerDrop = function(c) { 1679 this.callers.delete(c); 1680}; 1681Cell.prototype.ensureValueIsCurrent = function(c, d) { 1682 if (gNotToBe) { 1683 return this.validp() ? this.pv : null; 1684 } 1685 if (this.currentp()) { 1686 return this.pv; 1687 } 1688 if (!this.inputp || !this.validp() || this.rule && this.optimize === kOptimizeWhenValued && null === this.pv) { 1689 if (this.md && this.md.mDeadp()) { 1690 throw "evic: read of dead " + this.name + " of " + this.md.name; 1691 } 1692 c = !1; 1693 if (this.validp()) { 1694 for (var e = $jscomp.makeIterator(this.useds.values()), f = e.next(); !f.done; f = e.next()) { 1695 if (f = f.value, f.ensureValueIsCurrent("nested", this), f.pulseLastChanged > this.pulse) { 1696 c = !0; 1697 break; 1698 } 1699 } 1700 } else { 1701 c = !0; 1702 } 1703 c ? this.currentp() || this.calcNSet("evic", d) : this.pulseUpdate("valid-uninfluence"); 1704 } 1705 return this.pv; 1706}; 1707Cell.prototype.calcNSet = function(c, d) { 1708 if (callStack.includes(this)) { 1709 callStack.elts(); 1710 clg("cyclic dependency: about to calculate " + this.name + " already calculating"); 1711 debugger; 1712 } 1713 c = this.calcNLink(); 1714 clbug(this, "rawval", c); 1715 if (!this.optimizedAwayp()) { 1716 return clbug(this, "assuming ", c, this.useds.size), this.valueAssume(c, null); 1717 } 1718}; 1719Cell.prototype.calcNLink = function() {
1720 var c = depender, d = deferChanges; 1721 depender = this; 1722 deferChanges = !0; 1723 try { 1724 return callStack.push(this), this.unlinkFromUsed("pre-rule-clear"), this.rule(this); 1725 } finally { 1726 callStack.pop(), depender = c, deferChanges = d; 1727 } 1728}; 1729Cell.prototype.valueAssume = function(c, d) { 1730 var e = this, f = this; 1731 withoutCDependency(function() { 1732 var g = f.pv, h = f.valueState(); 1733 f.pv = c; 1734 f.state = kAwake; 1735 f.md && !f.synapticp && mdSlotValueStore(f.md, f.name, c); 1736 f.pulseUpdate("sv-assume"); 1737 if ("propagate" === d || -1 === [kValid, kUncurrent].indexOf(h) || f.valueChangedp(c, g)) { 1738 h = f.rule ? f.optimize : null, h === kOptimizeWhenValued ? f.pv && (f.unlinkFromUsed("opti-when"), e.optimizeAwayMaybe(g)) : h && f.optimizeAwayMaybe(g), "no-propagate" === d || f.optimizedAwayp() || f.propagate(g, f.callers); 1739 } 1740 })(); 1741 return c; 1742}; 1743Cell.prototype.propagate = function(c, d) { 1744 if (onePulsep) { 1745 gCustomPropagator && gCustomPropagator(this, c); 1746 } else { 1747 this.pulseLastChanged = gpulse(); 1748 var e = depender, f = callStack, g = gCPropDepth, h = deferChanges; 1749 try { 1750 this.propagateToCallers(d), (gpulse() > this.pulseObserved || find(this.lazy, [kOnceAsked, kAlways, !0])) && this.observe(c, "propagate"), this.ephemeralReset(); 1751 } finally { 1752 depender = e, callStack = f, gCPropDepth = g, deferChanges = h; 1753 } 1754 } 1755}; 1756Cell.prototype.propagateToCallers = function(c) { 1757 if (c.size) { 1758 var d = this; 1759 withIntegrity(qNotify, d, function() { 1760 causation.push(d); 1761 try { 1762 for (var e = $jscomp.makeIterator(c.values()), f = e.next(); !f.done; f = e.next()) { 1763 var g = f.value; 1764 g.state === kQuiesced || g.currentp() || find(g.lazy, [!0, kAlways, kOnceAsked]) || !g.useds.has(d) || g.calcNSet("propagate"); 1765 } 1766 } finally { 1767 causation.pop(); 1768 } 1769 }); 1770 } 1771}; 1772Cell.prototype.observerResolve = function() { 1773 !this.observer && this.md && (this.observer = this.md.slotObserverResolve(this.name)); 1774 return this.observer === kObserverUnresolved ? null : this.observer; 1775}; 1776Cell.prototype.observe = function(c, d) { 1777 (d = this.observerResolve()) && d(this.name, this.md, this.pv, c, this); 1778}; 1779Cell.prototype.ephemeralReset = function() { 1780 if (this.ephemeralp) { 1781 var c = this; 1782 withIntegrity(qEphemReset, this, function() { 1783 c.pv = null; 1784 }); 1785 } 1786}; 1787Cell.prototype.unlinkFromUsed = function(c) { 1788 c = $jscomp.makeIterator(this.useds.values()); 1789 for (var d = c.next(); !d.done; d = c.next()) { 1790 d.value.callerDrop(this); 1791 } 1792 this.useds.clear(); 1793}; 1794Cell.prototype.mdCellFlush = function() { 1795}; 1796Cell.prototype.optimizeAwayMaybe = function(c) { 1797 if (this.rule && !this.useds.size && this.optimize && !this.optimizedAwayp() && this.validp() && !this.synapticp && !this.inputp) { 1798 this.state = kOptimizedAwayp; 1799 this.observe(c, "optimized-away"); 1800 this.md && this.mdCellFlush(); 1801 c = $jscomp.makeIterator(this.callers.values()); 1802 for (var d = c.next(); !d.done; d = c.next()) { 1803 d = d.value, this.callerDrop(d), d.ensureValueIsCurrent("opti-used", this); 1804 } 1805 } 1806}; 1807Cell.prototype.quiesce = function() { 1808 this.quiesceWith && (clg("quiescing!"), this.quiesceWith(this)); 1809 this.unlinkFromCallers(); 1810 this.unlinkFromUsed("quiesce"); 1811}; 1812Cell.prototype.unlinkFromCallers = function() { 1813 this.state = kUncurrent; 1814 for (var c = $jscomp.makeIterator(this.callers.values()), d = c.next(); !d.done; d = c.next()) { 1815 this.callerDrop(d.value); 1816 } 1817 this.callers.clear(); 1818}; 1819Cell.prototype.kidValuesKids = function() { 1820 var c = this, d = c.md, e = pnow(), f = c.pv === kUnbound ? [] : c.pv; 1821 if (d.kidValues.length > aDistinct(d.kidValues).length) { 1822 throw "Duplicate IDs not allowed in kidValues: " + d.kidValues.join(); 1823 } 1824 plaps("unique check", e); 1825 var g = c.md.kidValues.map(function(e) { 1826 var g = f.findIndex(function(d) { 1827 d = c.md.kidKey(d); 1828 var f = c.md.kidValueKey(e); 1829 return d === f; 1830 }); 1831 return -1 === g ? d.kidFactory(c, e) : f[g]; 1832 }); 1833 plaps("newkids build elapsed", e); 1834 return g; 1835}; 1836Cell.prototype.fm = function(c, d, e) { 1837 if (c) { 1838 if (!this.md) { 1839 throw "Family search attempted from Cell " + this + " lacking md (s/b a Model)"; 1840 } 1841 return this.md.fm(c, d, e); 1842 } 1843}; 1844Cell.prototype.fmUp = function(c, d, e) { 1845 if (!this.md) { 1846 throw "fmUp search attempted from Cell " + this + " lacking md (s/b a Model)"; 1847 } 1848 return this.md.fmUp(c, d, e); 1849}; 1850Cell.prototype.fmDown = function(c, d, e) { 1851 if (!this.md) { 1852 throw "fmDown search attempted from Cell " + this + " lacking md (s/b a Model)"; 1853 } 1854 return this.md.fmDown(c, e, d); 1855}; 1856function aDistinct(c) { 1857 return c.filter(function(c, e, f) { 1858 return f.indexOf(c) === e; 1859 }); 1860} 1861window.Cell = Cell; 1862Cell.prototype.mx = Cell.prototype.mx; 1863function mdSlotValueStore(c, d, e) { 1864} 1865function clbug(c, d) { 1866 for (var e = [], f = 1; f < arguments.length; ++f) { 1867 e[f - 1] = arguments[f]; 1868 } 1869 c.bug && console.log("clbug> " + c.name + ":" + c.useds.size + ":" + Array.from(e).join(",")); 1870} 1871function cF(c, d) { 1872 d = void 0 === d ? {} : d; 1873 return Object.assign(new Cell(null, c, !1, !1, null), d); 1874} 1875window.cF = cF; 1876function cF1(c, d) { 1877 d = void 0 === d ? {} : d; 1878 return Object.assign(new Cell(null, function(d) { 1879 return withoutCDependency(c)(d); 1880 }, !1, !1, null), d); 1881} 1882function cF_(c, d) { 1883 d = void 0 === d ? {} : d; 1884 return Object.assign(new Cell(null, c, !1, !1, null), {lazy:!0}, d); 1885} 1886function c_F(c, d) { 1887 d = void 0 === d ? {} : d; 1888 return Object.assign(new Cell(null, c, !1, !1, null), {lazy:kUntilAsked}, d); 1889} 1890function cFI(c, d) { 1891 d = void 0 === d ? {} : d; 1892 return Object.assign(new Cell(null, c, !0, !1, null), d); 1893} 1894window.cFI = cFI; 1895function cI(c, d) { 1896 d = void 0 === d ? {} : d; 1897 return Object.assign(new Cell(c, null, !0, !1, null), d); 1898} 1899window.cI = cI; 1900function cIe(c, d) { 1901 d = void 0 === d ? {} : d; 1902 return Object.assign(new Cell(c, null, !0, !0, null), d); 1903} 1904function obsDbg(c, d, e, f, g) { 1905 console.log("obsDbg! " + c + " " + (d ? d.name || d.id : "noMd") + " useds=" + g.useds.size + " new=" + e + " prior=" + (f === kUnbound ? "unbound" : f)); 1906} 1907function XobsDbg(c, d, e, f, g) { 1908} 1909;
1909Matrix.Model = {}; 1910function allArgs(c) { 1911 return Array.apply(null, c).slice(0); 1912} 1913window.allArgs = allArgs; 1914function cdrArgs(c) { 1915 return Array.apply(null, c).slice(1); 1916} 1917window.cdrArgs = cdrArgs; 1918function cddrArgs(c) { 1919 return Array.apply(null, c).slice(2); 1920} 1921window.cddrArgs = cddrArgs; 1922var kAwakening = "md-awakening", kDoomed = "md-doomed", kDead = "md-dead", sid = 0; 1923window.sid = sid; 1924var Model = function(c, d, e, f) { 1925 var g = this; 1926 f = void 0 === f ? !0 : f; 1927 this.par = c || gPar; 1928 this.sid = ++sid; 1929 this.name = d; 1930 this.kids = this.mdType = null; 1931 this.cells = {}; 1932 this.slotObservers = []; 1933 this.others = {}; 1934 this.state = kNascent; 1935 this.awakenOnInitp = this.doomed = !1; 1936 this.adoptCt = 0; 1937 c = {}; 1938 for (var h in e) { 1939 c.slot$13 = h, e.hasOwnProperty(c.slot$13) ? (c.value = e[c.slot$13], c.value instanceof Cell ? (c.value.name = c.slot$13, c.value.md = this, this.cells[c.slot$13] = c.value, Object.defineProperty(this, c.slot$13, {enumerable:!0, get:function(c) { 1940 return function() { 1941 return c.value.slotValue(); 1942 }; 1943 }(c), set:function(c) { 1944 return function(d) { 1945 return c.value.slotValueSet(d); 1946 }; 1947 }(c)})) : Object.defineProperty(this, c.slot$13, {enumerable:!0, get:function(c) { 1948 return function() { 1949 return c.value; 1950 }; 1951 }(c), set:function(c) { 1952 return function(e) { 1953 debugger; 1954 throw "Slot " + c.slot$13 + " of " + d + " cannot be set to " + e + " because it is not mediated by an input Cell"; 1955 }; 1956 }(c)})) : clg("DBG: yep, islot not hasown ", c.slot$13), c = {value:c.value, slot$13:c.slot$13}; 1957 } 1958 f && (this.awakenOnInitp ? this.awaken() : withIntegrity(qAwaken, this, function(c) { 1959 g.awaken(); 1960 })); 1961}; 1962Model.cname = function() { 1963 return "Model"; 1964}; 1965Model.prototype.dbg = function() { 1966 return "MD " + this.mdType + ":" + (this.name || this.sid); 1967}; 1968Model.prototype.awaken = function() { 1969 if (this.state !== kNascent) { 1970 return this; 1971 } 1972 this.state = kAwakening; 1973 for (var c in this.cells) { 1974 var d = this.cells[c]; 1975 console.assert(d.md, "No md for cell " + d.name + " at md awaken"); 1976 find(d.lazy, [!0, kAlways, kUntilAsked]) || d.awaken(); 1977 } 1978 this.state = kAwake; 1979 return this; 1980}; 1981Model.prototype.slotObserverResolve = function(c) { 1982 return null; 1983}; 1984Model.prototype.fmd = function(c, d, e) { 1985 return this.fm(c, Object.assign({mep:!1, upp:!1, insidep:!0}, e), d); 1986}; 1987Model.prototype.fm = function(c, d, e) { 1988 var f = null; 1989 if (e) { 1990 var g = this.others[e]; 1991 if (g) { 1992 return g; 1993 } 1994 } 1995 d = Object.assign({mep:!1, mustp:!0, insidep:!1, upp:!0, wocd:!0}, d); 1996 g = depender; 1997 depender = d.wocd ? null : depender; 1998 try { 1999 var h = this.fmTv(c, d); 2000 if (h) { 2001 f = this.others[e] = h; 2002 } else { 2003 if (d.mustp) { 2004 throw "fget failed what = " + c.toString() + ", id " + this.sid + ", where = " + this.name; 2005 } 2006 } 2007 } finally { 2008 depender = g; 2009 } 2010 return f; 2011}; 2012Model.prototype.fmUp = function(c, d, e) { 2013 return this.fm(c, Object.assign({upp:!0, mep:!1}, d), e); 2014}; 2015Model.prototype.fmDown = function(c, d, e) { 2016 return this.fm(c, Object.assign({upp:!1, insidep:!0, mep:!1}
2016, d), e); 2017}; 2018Model.prototype.fmatch = function(c) { 2019 return "function" === typeof c && c(this) || "string" === typeof c && this.name === c || this === c ? this : null; 2020}; 2021Model.prototype.fmTv = function(c, d) { 2022 return d.mep && this.fmatch(c) || d.insidep && this.kids && this.kids.somex(function(e, f) { 2023 if (f) { 2024 if ("string" !== typeof f && f.fmTv) { 2025 if (e = f !== d.skip && f.fmTv(c, Object.assign({}, d, {upp:!1, mep:!0}))) { 2026 return e; 2027 } 2028 } else { 2029 return null; 2030 } 2031 } else { 2032 return null; 2033 } 2034 }) || d.upp && this.par && this.par.fmTv(c, Object.assign({}, d, {mep:!0, insidep:!0, skip:this})); 2035}; 2036Model.prototype.mDeadp = function() { 2037 return this.state === kDead; 2038}; 2039window.Model = Model; 2040Model.prototype.awaken = Model.prototype.awaken; 2041var isModel = function(c) { 2042 return c instanceof Model; 2043}; 2044function mkm(c, d, e, f, g) { 2045 f = void 0 === f ? null : f; 2046 g = void 0 === g ? "Model" : g; 2047 e = Object.assign({}, e, f ? {kids:cKids(f)} : null); 2048 c = new window[g](c, d, e); 2049 if (!isModel(c)) { 2050 throw "mkm made not-modelp"; 2051 } 2052 return c; 2053} 2054window.mkm = mkm; 2055function mkmu(c, d, e, f, g) { 2056 f = void 0 === f ? null : f; 2057 g = void 0 === g ? "Model" : g; 2058 e = Object.assign({}, e, f ? {kids:cKids(f)} : null); 2059 c = new window[g](c, d, e, !1); 2060 if (!isModel(c)) { 2061 throw "mkm made not-modelp"; 2062 } 2063 return c; 2064} 2065window.mkmu = mkmu; 2066function pkdFlat(c, d) { 2067 d = void 0 === d ? [] : d; 2068 for (var e = 0; e < c.length; ++e) { 2069 null != c[e] && (c[e] instanceof Array ? pkdFlat(c[e], d) : d.push(c[e])); 2070 } 2071 return d; 2072} 2073function cKids(c, d) { 2074 d = void 0 === d ? {} : d; 2075 return Object.assign(new Cell(null, function(d) { 2076 if (!isModel(d.md)) { 2077 throw "ckids c.md not model"; 2078 } 2079 d = kfExpand(d, c); 2080 return d instanceof Array ? pkdFlat(d) : [d]; 2081 }, !1, !1, null), d); 2082} 2083window.cKids = cKids; 2084var kfExpandFinal = function(c) { 2085 return null === c || isString(c) || isModel(c) || c instanceof Array && c.every(kfExpandFinal); 2086}; 2087function kfExpand(c, d) { 2088 if (kfExpandFinal(d)) { 2089 return d; 2090 } 2091 if ("function" === typeof d) { 2092 return kfExpand(c, d(c)); 2093 } 2094 if (d instanceof Array) { 2095 return kfExpand(c, d.map(function(d) { 2096 return kfExpand(c, d); 2097 })); 2098 } 2099 clg("expand bad kf", d, null === d, typeof d); 2100 debugger; 2101} 2102;Matrix.mxWeb = {}; 2103var mxByDomId = [], domLogging = !1; 2104window.domLogging = domLogging; 2105function domlog(c) { 2106 for (var d = [], e = 0; e < arguments.length; ++e) { 2107 d[e - 0] = arguments[e]; 2108 } 2109 domLogging && console.log("domlog> ", Array.from(d).join(",")); 2110} 2111function dom2mx(c, d) { 2112 var e = mxByDomId[c.id]; 2113 if (!e && (void 0 === d || d)) { 2114 if (c.parentNode) { 2115 return dom2mx(c.parentNode, !0); 2116 } 2117 throw "dom2mx cannot find mxByDomId with dom.sid " + c.sid + ", dom.id " + c.id; 2118 } 2119 return e; 2120} 2121function obsContent(c, d, e, f, g) { 2122 f !== kUnbound && (ast(d.dom, "Tag obs Content"), domlog("content", e, f), d.dom.innerHTML = e); 2123} 2124function notToBe(c) { 2125 c.cleanUp && c.cleanUp(c); 2126 c.state = kDoomed; 2127 if (c.kids) { 2128 for (var d = $jscomp.makeIterator(c.kids), e = d.next(); !e.done; e = d.next()) { 2129 notToBe(e.value); 2130 } 2131 } 2132 for (var f in c.cells) { 2133 c.cells[f].quiesce(); 2134 } 2135 c.state = kDead; 2136} 2137function obsKids(c, d, e, f, g) { 2138 if (f !== kUnbound) { 2139 c = pnow(); 2140 d = d.dom; 2141 g = document.createDocumentFragment(); 2142 ast(d); 2143 for (var h = $jscomp.makeIterator(f), k = h.next(); !k.done; k = h.next()) { 2144 k = k.value, find(k, e) || notToBe(k); 2145 } 2146 e = $jscomp.makeIterator(e); 2147 for (h = e.next(); !h.done; h = e.next()) { 2148 if (h = h.value, find(h, f)) { 2149 if (h.dom.parentNode !== d) { 2150 throw "newk dom parent not = parent"; 2151 } 2152 g.appendChild(h.dom); 2153 } else { 2154 k = document.createElement("div"), k.innerHTML = Tag.toHTML(h), h = h.domCache = k.removeChild(k.firstChild), g.appendChild(h); 2155 } 2156 } 2157 d.innerHTML = null; 2158 d.appendChild(g); 2159 plaps("redid kids", c); 2160 } 2161} 2162function obsDisabled(c, d, e, f, g) { 2163 f !== kUnbound && (domlog("disabled", e, f), d.dom.disabled = !!e); 2164} 2165function obsHidden(c, d, e, f, g) { 2166 f !== kUnbound && (e ? d.dom.setAttribute("hidden", "") : d.dom.removeAttribute("hidden")); 2167} 2168function obsClass(c, d, e, f, g) { 2169 f !== kUnbound && (domlog("className", e, f), d.dom.className = e ? isString(e) ? e : e.join(" ") : ""); 2170} 2171function obsStyleProperty(c, d, e, f, g) { 2172 f !== kUnbound && (c = c.replace("_", "-"), d.tag.dom.style[c] = e); 2173} 2174function obsTagEventHandler(c, d, e, f, g) { 2175 f !== kUnbound && (d.dom[c] = e); 2176} 2177var AttrAliases = new Map([["class", "className"]]); 2178function obsAttrGlobal(c, d, e, f, g) { 2179 f !== kUnbound && (c = AttrAliases.get(c) || c, d.dom[c] = e); 2180} 2181function obsStyleAttr(c, d, e, f, g) {
2182 f !== kUnbound && (c = tagStyleString(d), d.dom.style = c); 2183} 2184var TagSession = function(c, d, e) { 2185 var f = Object.assign({sid:++sid}, e); 2186 Model.call(this, c, d || e.name, f, !0); 2187 this.routes || (this.routes = e.routes); 2188}; 2189$jscomp.inherits(TagSession, Model); 2190TagSession.make = function(c, d, e) { 2191 c = new TagSession(c, d, e); 2192 c.awakenOnInitp ? c.awaken() : withIntegrity(qAwaken, c, function(c) { 2193 clg("awakening tag session!!!", c.name); 2194 c.awaken(); 2195 return null; 2196 }); 2197}; 2198TagSession.cname = function() { 2199 return "TagSession"; 2200}; 2201TagSession.prototype.init = function() { 2202 this.routes && Router(this.routes).init(); 2203}; 2204window.TagSession = TagSession; 2205goog.exportSymbol("mxwebtagsession", TagSession); 2206var Tag = function(c, d, e, f) { 2207 var g = Object.assign({}, e, f); 2208 delete g.id; 2209 Model.call(this, c, d || f.name, g, !1); 2210 var h = this; 2211 this.sid = ++sid; 2212 if (void 0 === e) { 2213 debugger; 2214 } 2215 this.id = e.id ? e.id : e.id = this.sid; 2216 this.callbacks = new Map; 2217 this.attrKeys = []; 2218 for (var k in e) { 2219 this.attrKeys.push(k); 2220 } 2221 mxByDomId[this.id] && (mxByDomId[this.id] === this ? clg("double load!!!!!") : clgx("WARNING: dup DOM id: ", this.id, e.id, this.name, mxByDomId[this.id])); 2222 mxByDomId[this.id] = this; 2223 this.domCache = null; 2224 Object.defineProperty(this, "dom", {enumerable:!0, get:function() { 2225 if (null === h.domCache && (h.domCache = document.getElementById(h.id), ast(h.domCache, "Unable to locate DOM for Tag via Tag.id " + h.id), !h.domCache)) { 2226 throw clg("no dom", d), "Tag unable to find its DOM"; 2227 } 2228 return h.domCache; 2229 }}); 2230 this.awakenOnInitp ? this.awaken() : withIntegrity(qAwaken, this, function(c) { 2231 h.awaken(); 2232 }); 2233}; 2234$jscomp.inherits(Tag, Model); 2235Tag.prototype.dbg = function() { 2236 return "tag " + this.tag + " nm=" + this.name + " id=" + this.id + " "; 2237}; 2238Tag.cname = function() { 2239 return "Tag"; 2240}; 2241Tag.isTagKid = function(c) { 2242 return isString(c) || c instanceof Function || c instanceof Array; 2243}; 2244Tag.prototype.tagToHTML = function() { 2245 var c = this.tag, d = tagAttrsBuild(this), e = tagStyleBuild(this); 2246 d = "id=" + this.id + " " + d + " " + e; 2247 ast(c); 2248 return "<" + c + " " + d + ">" + (this.content || this.kidsToHTML()) + "</" + c + ">"; 2249}; 2250Tag.toHTML = function(c) { 2251 return isString(c) ? c : Array.isArray(c) ? c.reduce(function(c, e) { 2252 return c + Tag.toHTML(e); 2253 }, "") : "function" === typeof c ? c().tagToHTML() : c.tagToHTML(); 2254}; 2255Tag.prototype.kidsToHTML = function() { 2256 return this.kids ? this.kids.reduce(function(c, d) { 2257 return c + Tag.toHTML(d); 2258 }, "") : ""; 2259}; 2260Tag.prototype.slotObserverResolve = function(c) { 2261 var d = this.slotObservers[c]; 2262 d || (d = "content" === c ? obsContent : "kids" === c ? obsKids : "disabled" === c ? obsDisabled : "hidden" === c ? obsHidden : "class" === c ? obsClass : "style" === c ? obsStyleAttr : TagEvents.has(c) ? obsTagEventHandler : TagAttributesGlobal.has(c) ? obsAttrGlobal : kObserverUnresolved, this.slotObservers[c] = d); 2263 return d; 2264}; 2265Tag.prototype.fmTag = function(c, d) { 2266 return this.fmUp(function(d) { 2267 return d.tag === c; 2268 }, {}, d); 2269}; 2270window.Tag = Tag; 2271function tag2html(c) { 2272 return Tag.toHTML(c); 2273} 2274window.tag2html = tag2html; 2275goog.exportSymbol("tag2html", tag2html); 2276var isTag = function(c) { 2277 return c instanceof Tag; 2278}, TagAttributesGlobal = new Set("accesskey autofocus checked class cols content contenteditable contextmenu data dir draggable dropzone for hidden href id itemid itemprop itemref itemscope itemtype lang list max name selected spellcheck src style tabindex title translate type value viewBox fill d".split(" ")), TagEvents = new Set("onabort onautocomplete onautocompleteerror onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragexit ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onresize onscroll onseeked onseeking onselect onshow onsort onstalled onsubmit onsuspend ontimeupdate ontoggle onvolumechange onwaiting".split(" ")); 2279function tagEventHandler(c, d) { 2280 var e = dom2mx(c.target, !0); 2281 if (e) { 2282 if ("onclick" === d && "A" === c.target.tagName) { 2283 if (e !== mxByDomId[c.target.id]) { 2284 clg("not yours"); 2285 } else { 2286 var f = e.callbacks.get(d); 2287 f && (f(e, c, d), c.stopPropagation()); 2288 } 2289 } else { 2290 tagEventBubble(e, c, d); 2291 } 2292 } else { 2293 clg("tagEventHandler unable to find mx from", dom); 2294 } 2295} 2296function tagEventBubble(c, d, e) { 2297 if (c) { 2298 var f = c.callbacks.get(e); 2299 f ? (f(c, d, e), d.stopPropagation()) : tagEventBubble(c.par, d, e); 2300 } else { 2301 clg("tagEventBubble topped out", e, d); 2302 } 2303} 2304function tagAttrsBuild(c) { 2305 var d = "";
2306 c.attrKeys.forEach(function(e) { 2307 if (TagEvents.has(e)) { 2308 c[e] instanceof Function || (clg("bingo event!!!!!!!!!! " + e), clg("bingo event handler!!!!!!!!!! " + c[e])), ast(c[e] instanceof Function, "tagattrsbuild handler not fn"), c.callbacks.set(e, c[e]), d += " " + e + "=\"tagEventHandler(event, '" + e + "')\""; 2309 } else { 2310 switch(e) { 2311 case "disabled": 2312 case "autofocus": 2313 case "hidden": 2314 case "checked": 2315 c[e] && (d += " " + e); 2316 break; 2317 case "value": 2318 d += " " + e + '="' + c[e] + '"'; 2319 break; 2320 case "placeholder": 2321 d += " " + e + '="' + c[e] + '"'; 2322 break; 2323 case "style": 2324 d += tagStyleBuild(c); 2325 break; 2326 case "class": 2327 c[e] && (d += ' class="' + (isString(c[e]) ? c[e] : c[e].filter(function(c) { 2328 return null !== c && void 0 !== c; 2329 }).join(" ")) + '"'); 2330 break; 2331 default: 2332 c[e] && (TagAttributesGlobal.has(e) ? d += " " + e + '="' + c[e] + '"' : clg("unknown attribute prop", e)); 2333 } 2334 } 2335 }); 2336 return d; 2337} 2338function tag(c, d, e, f) { 2339 if (1 === f.length && isString(f[0])) { 2340 if (d.content) { 2341 throw "tag " + c + "has one string child " + f[0] + " but also content " + d.content; 2342 } 2343 d.content = f[0]; 2344 f = null; 2345 } 2346 if (e) { 2347 for (var g in d || {}) { 2348 e.hasOwnProperty(g) && clg("WARNING: duplicate key " + g + " in tag " + c); 2349 } 2350 } 2351 if (d) { 2352 for (var h in e || {}) { 2353 d.hasOwnProperty(h) && clg("WARNING: duplicate key " + h + " in tag " + c); 2354 } 2355 } 2356 return function(g) { 2357 var h = e || {}, k = Object.assign({}, {tag:c}, f ? {kids:cKids(f)} : null, h); 2358 return new Tag(g ? g.md : null, h.name || c, d, k); 2359 }; 2360} 2361function genTagEx(c) { 2362 window[c] = function() { 2363 return Tag.isTagKid(arguments[0]) ? tag(c, {}, {}, allArgs(arguments)) : Tag.isTagKid(arguments[1]) ? tag(c, arguments[0] || {}, {}, cdrArgs(arguments)) : tag(c, arguments[0] || {}, arguments[1] || {}, cddrArgs(arguments)); 2364 }; 2365} 2366var a, abbr, acronym, address, applet, area, article, aside, audio, b, base, basefont, bdi, bdo, bgsound, big, blink, blockquote, body, br, button, canvas, caption, center, cite, code, col, colgroup, command, content, data, datalist, dd, del, details, dfn, dialog, dir, div, dl, dt, element, em, embed, fieldset, figcaption, figure, font, footer, form, frame, frameset, h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html, i, iframe, image, img, input, ins, isindex, kbd, keygen, label, legend, li, 2367link, listing, main, map, mark, marquee, menu, menuitem, meta, meter, multicol, nav, nextid, nobr, noembed, noframes, noscript, object, ol, optgroup, option, output, p, param, path, picture, plaintext, pre, progress, q, rp, rt, rtc, ruby, s, samp, script, section, select, shadow, slot, small, source, spacer, span, strike, strong, style, sub, summary, sup, svg, table, tbody, td, template, textarea, tfoot, th, thead, time, title, tr, track, tt, u, ul, mxwvar, video, wbr, xmp, tagNames = "a abbr acronym address applet area article aside audio b base basefont bdi bdo bgsound big blink blockquote body br button canvas caption center cite code col colgroup command content data datalist dd del details dfn dialog dir div dl dt element em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe image img input ins isindex kbd keygen label legend li link listing main map mark marquee menu menuitem meta meter multicol nav nextid nobr noembed noframes noscript object ol optgroup option output p param path picture plaintext pre progress q rp rt rtc ruby s samp script section select shadow slot small source spacer span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul mxwvar video wbr xmp".split(" "); 2368tagNames.map(function(c) { 2369 return genTagEx(c); 2370}); 2371goog.exportSymbol("a", a); 2372goog.exportSymbol("abbr", abbr); 2373goog.exportSymbol("acronym", acronym); 2374goog.exportSymbol("address", address); 2375goog.exportSymbol("applet", applet); 2376goog.exportSymbol("area", area); 2377goog.exportSymbol("article", article); 2378goog.exportSymbol("aside", aside); 2379goog.exportSymbol("audio", audio); 2380goog.exportSymbol("b", b); 2381goog.exportSymbol("base", base); 2382goog.exportSymbol("basefont", basefont); 2383goog.exportSymbol("bdi", bdi); 2384goog.exportSymbol("bdo", bdo); 2385goog.exportSymbol("bgsound", bgsound); 2386goog.exportSymbol("big", big); 2387goog.exportSymbol("blink", blink); 2388goog.exportSymbol("blockquote", blockquote); 2389goog.exportSymbol("body", body); 2390goog.exportSymbol("br", br); 2391goog.exportSymbol("button", button); 2392goog.exportSymbol("canvas", canvas); 2393goog.exportSymbol("caption", caption); 2394goog.exportSymbol("center", center); 2395goog.exportSymbol("cite", cite);
2396goog.exportSymbol("code", code); 2397goog.exportSymbol("col", col); 2398goog.exportSymbol("colgroup", colgroup); 2399goog.exportSymbol("command", command); 2400goog.exportSymbol("content", content); 2401goog.exportSymbol("data", data); 2402goog.exportSymbol("datalist", datalist); 2403goog.exportSymbol("dd", dd); 2404goog.exportSymbol("del", del); 2405goog.exportSymbol("details", details); 2406goog.exportSymbol("dfn", dfn); 2407goog.exportSymbol("dialog", dialog); 2408goog.exportSymbol("dir", dir); 2409goog.exportSymbol("div", div); 2410goog.exportSymbol("dl", dl); 2411goog.exportSymbol("dt", dt); 2412goog.exportSymbol("element", element); 2413goog.exportSymbol("em", em); 2414goog.exportSymbol("embed", embed); 2415goog.exportSymbol("fieldset", fieldset); 2416goog.exportSymbol("figcaption", figcaption); 2417goog.exportSymbol("figure", figure); 2418goog.exportSymbol("font", font); 2419goog.exportSymbol("footer", footer); 2420goog.exportSymbol("form", form); 2421goog.exportSymbol("frame", frame); 2422goog.exportSymbol("frameset", frameset); 2423goog.exportSymbol("h1", h1); 2424goog.exportSymbol("h2", h2); 2425goog.exportSymbol("h3", h3); 2426goog.exportSymbol("h4", h4); 2427goog.exportSymbol("h5", h5); 2428goog.exportSymbol("h6", h6); 2429goog.exportSymbol("head", head); 2430goog.exportSymbol("header", header); 2431goog.exportSymbol("hgroup", hgroup); 2432goog.exportSymbol("hr", hr); 2433goog.exportSymbol("html", html); 2434goog.exportSymbol("i", i); 2435goog.exportSymbol("iframe", iframe); 2436goog.exportSymbol("image", image); 2437goog.exportSymbol("img", img); 2438goog.exportSymbol("input", input); 2439goog.exportSymbol("ins", ins); 2440goog.exportSymbol("isindex", isindex); 2441goog.exportSymbol("kbd", kbd); 2442goog.exportSymbol("keygen", keygen); 2443goog.exportSymbol("label", label); 2444goog.exportSymbol("legend", legend); 2445goog.exportSymbol("li", li); 2446goog.exportSymbol("link", link); 2447goog.exportSymbol("listing", listing); 2448goog.exportSymbol("main", main); 2449goog.exportSymbol("map", map); 2450goog.exportSymbol("mark", mark); 2451goog.exportSymbol("marquee", marquee); 2452goog.exportSymbol("menu", menu); 2453goog.exportSymbol("menuitem", menuitem); 2454goog.exportSymbol("meta", meta); 2455goog.exportSymbol("meter", meter); 2456goog.exportSymbol("multicol", multicol); 2457goog.exportSymbol("nav", nav); 2458goog.exportSymbol("nextid", nextid); 2459goog.exportSymbol("nobr", nobr); 2460goog.exportSymbol("noembed", noembed); 2461goog.exportSymbol("noframes", noframes); 2462goog.exportSymbol("noscript", noscript); 2463goog.exportSymbol("object", object); 2464goog.exportSymbol("ol", ol); 2465goog.exportSymbol("optgroup", optgroup); 2466goog.exportSymbol("option", option); 2467goog.exportSymbol("output", output); 2468goog.exportSymbol("p", p); 2469goog.exportSymbol("param", param); 2470goog.exportSymbol("path", path); 2471goog.exportSymbol("picture", picture); 2472goog.exportSymbol("plaintext", plaintext); 2473goog.exportSymbol("pre", pre); 2474goog.exportSymbol("progress", progress); 2475goog.exportSymbol("q", q); 2476goog.exportSymbol("rp", rp); 2477goog.exportSymbol("rt", rt); 2478goog.exportSymbol("rtc", rtc); 2479goog.exportSymbol("ruby", ruby); 2480goog.exportSymbol("s", s); 2481goog.exportSymbol("samp", samp); 2482goog.exportSymbol("script", script); 2483goog.exportSymbol("section", section); 2484goog.exportSymbol("select", select); 2485goog.exportSymbol("shadow", shadow); 2486goog.exportSymbol("slot", slot); 2487goog.exportSymbol("small", small); 2488goog.exportSymbol("source", source); 2489goog.exportSymbol("spacer", spacer); 2490goog.exportSymbol("span", span); 2491goog.exportSymbol("strike", strike); 2492goog.exportSymbol("strong", strong); 2493goog.exportSymbol("style", style); 2494goog.exportSymbol("sub", sub); 2495goog.exportSymbol("summary", summary); 2496goog.exportSymbol("sup", sup); 2497goog.exportSymbol("svg", svg); 2498goog.exportSymbol("table", table); 2499goog.exportSymbol("tbody", tbody); 2500goog.exportSymbol("td", td); 2501goog.exportSymbol("template", template); 2502goog.exportSymbol("textarea", textarea); 2503goog.exportSymbol("tfoot", tfoot); 2504goog.exportSymbol("th", th); 2505goog.exportSymbol("thead", thead); 2506goog.exportSymbol("time", time); 2507goog.exportSymbol("title", title); 2508goog.exportSymbol("tr", tr); 2509goog.exportSymbol("track", track); 2510goog.exportSymbol("tt", tt); 2511goog.exportSymbol("u", u); 2512goog.exportSymbol("ul", ul); 2513goog.exportSymbol("mxwvar", mxwvar); 2514goog.exportSymbol("video", video); 2515goog.exportSymbol("wbr", wbr); 2516goog.exportSymbol("xmp", xmp); 2517var mxCSS = function(c, d) { 2518 var e = Object.assign({}, d); 2519 Model.call(this, null, "css", e, !1); 2520 var f = this; 2521 this.cssProps = []; 2522 for (var g in d) { 2523 this.cssProps.push(g); 2524 } 2525 clg("cssProps!!!!", this.cssProps); 2526 this.sid = ++sid; 2527 this.tag = c; 2528 this.slotObservers = []; 2529 withIntegrity(qAwaken, this, function(c) { 2530 return f.awaken(); 2531 }); 2532}; 2533$jscomp.inherits(mxCSS, Model); 2534mxCSS.prototype.dbg = function() { 2535 return "mxCSS " + this.tag.tag + " tagnm=" + this.tag.name; 2536}; 2537mxCSS.cname = function() { 2538 return "mxCSS"; 2539}; 2540mxCSS.prototype.slotObserverResolve = function(c) { 2541 return obsStyleProperty; 2542}; 2543function mkCSS(c) { 2544 return function(d) { 2545 return new mxCSS(d, c); 2546 }; 2547} 2548function tagStyleBuild(c) { 2549 var d = "", e = c.style; 2550 e instanceof Function && (e = e(c)); 2551 if (isString(e)) { 2552 d = e; 2553 } else { 2554 if (e instanceof mxCSS) { 2555 e.cssProps.forEach(function(c) { 2556 var f = c.replace("_", "-"); 2557 d += f + ":" + e[c] + ";"; 2558 }); 2559 } else { 2560 for (var f in e) { 2561 c = f.replace("_", "-"), d += c + ":" + e[f] + ";"; 2562 } 2563 } 2564 } 2565 return "" === d ? "" : ' style="' + d + '"'; 2566}
2567function tagStyleString(c) { 2568 var d = "", e = c.style; 2569 e instanceof Function && (e = e(c)); 2570 if (isString(e)) { 2571 d = e; 2572 } else { 2573 if (e instanceof mxCSS) { 2574 e.cssProps.forEach(function(c) { 2575 var f = c.replace("_", "-"); 2576 d += f + ":" + e[c] + ";"; 2577 }); 2578 } else { 2579 for (var f in e) { 2580 c = f.replace("_", "-"), d += c + ":" + e[f] + ";"; 2581 } 2582 } 2583 } 2584 return d; 2585} 2586var MXStorable = function(c, d, e) { 2587 d = void 0 === d ? !1 : d; 2588 var f = c || {}; 2589 e = void 0 === e || e ? Object.assign({id:(f.lsPrefix || "MXSTOR_ANON") + uuidv4(), created:Date.now()}, f, {deleted:f.deleted || cI(null)}) : f; 2590 Model.call(this, null, null, e, !1); 2591 !d && c.id || this.store(); 2592}; 2593$jscomp.inherits(MXStorable, Model); 2594MXStorable.cname = Model.cname; 2595MXStorable.storableProperties = function() { 2596 return ["id", "created", "deleted"]; 2597}; 2598MXStorable.prototype.toJSON = function() { 2599 var c = this; 2600 return this.constructor.storableProperties().reduce(function(d, e) { 2601 d[e] = c[e]; 2602 return d; 2603 }, {}); 2604}; 2605MXStorable.load = function(c, d) { 2606 d = window.localStorage.getObject(d); 2607 return new c(d); 2608}; 2609MXStorable.obsAnyChange = function(c, d, e, f, g) { 2610 d.store(); 2611}; 2612MXStorable.prototype.slotObserverResolve = function(c) { 2613 return MXStorable.obsAnyChange; 2614}; 2615MXStorable.prototype.store = function() { 2616 MXStorable.storeObject(this.id, this.toJSON()); 2617}; 2618MXStorable.storeObject = function(c, d) { 2619 window.localStorage.setObject(c, d); 2620}; 2621MXStorable.prototype.delete = function() { 2622 this.deleted = Date.now(); 2623}; 2624MXStorable.countAllItems = function(c) { 2625 return Object.keys(window.localStorage || {}).filter(function(d) { 2626 return d.startsWith(c); 2627 }).length; 2628}; 2629MXStorable.loadAllItems = function(c, d) { 2630 return Object.keys(window.localStorage || {}).filter(function(c) { 2631 return c.startsWith(d); 2632 }).map(function(d) { 2633 return MXStorable.load(c, d); 2634 }); 2635}; 2636MXStorable.removeAllItems = function(c) { 2637 return Object.keys(window.localStorage || {}).filter(function(d) { 2638 return d.startsWith(c); 2639 }).map(function(c) { 2640 return window.localStorage.removeItem(c); 2641 }); 2642}; 2643window.MXStorable = MXStorable; 2644goog.exportSymbol("MXStorable", MXStorable); 2645goog.Thenable = function() { 2646}; 2647goog.Thenable.prototype.then = function(c, d, e) { 2648}; 2649goog.Thenable.IMPLEMENTED_BY_PROP = "$goog_Thenable"; 2650goog.Thenable.addImplementation = function(c) { 2651 c.prototype.then = c.prototype.then; 2652 COMPILED ? c.prototype[goog.Thenable.IMPLEMENTED_BY_PROP] = !0 : c.prototype.$goog_Thenable = !0; 2653}; 2654goog.Thenable.isImplementedBy = function(c) { 2655 if (!c) { 2656 return !1; 2657 } 2658 try { 2659 return COMPILED ? !!c[goog.Thenable.IMPLEMENTED_BY_PROP] : !!c.$goog_Thenable; 2660 } catch (d) { 2661 return !1; 2662 } 2663}; 2664goog.debug = {}; 2665goog.debug.Error = function(c) { 2666 if (Error.captureStackTrace) { 2667 Error.captureStackTrace(this, goog.debug.Error); 2668 } else { 2669 var d = Error().stack; 2670 d && (this.stack = d); 2671 } 2672 c && (this.message = String(c)); 2673 this.reportErrorToServer = !0; 2674}; 2675goog.inherits(goog.debug.Error, Error); 2676goog.debug.Error.prototype.name = "CustomError"; 2677goog.dom = {}; 2678goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12}; 2679goog.asserts = {}; 2680goog.asserts.ENABLE_ASSERTS = goog.DEBUG; 2681goog.asserts.AssertionError = function(c, d) { 2682 goog.debug.Error.call(this, goog.asserts.subs_(c, d)); 2683 this.messagePattern = c; 2684}; 2685goog.inherits(goog.asserts.AssertionError, goog.debug.Error); 2686goog.asserts.AssertionError.prototype.name = "AssertionError"; 2687goog.asserts.DEFAULT_ERROR_HANDLER = function(c) { 2688 throw c; 2689}; 2690goog.asserts.errorHandler_ = goog.asserts.DEFAULT_ERROR_HANDLER; 2691goog.asserts.subs_ = function(c, d) { 2692 c = c.split("%s"); 2693 for (var e = "", f = c.length - 1, g = 0; g < f; g++) { 2694 e += c[g] + (g < d.length ? d[g] : "%s"); 2695 } 2696 return e + c[f]; 2697}; 2698goog.asserts.doAssertFailure_ = function(c, d, e, f) { 2699 var g = "Assertion failed"; 2700 if (e) { 2701 g += ": " + e; 2702 var h = f; 2703 } else { 2704 c && (g += ": " + c, h = d); 2705 } 2706 c = new goog.asserts.AssertionError("" + g, h || []); 2707 goog.asserts.errorHandler_(c); 2708}; 2709goog.asserts.setErrorHandler = function(c) { 2710 goog.asserts.ENABLE_ASSERTS && (goog.asserts.errorHandler_ = c); 2711}; 2712goog.asserts.assert = function(c, d, e) { 2713 goog.asserts.ENABLE_ASSERTS && !c && goog.asserts.doAssertFailure_("", null, d, Array.prototype.slice.call(arguments, 2)); 2714 return c; 2715}; 2716goog.asserts.fail = function(c, d) { 2717 goog.asserts.ENABLE_ASSERTS && goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure" + (c ? ": " + c : ""), Array.prototype.slice.call(arguments, 1))); 2718}; 2719goog.asserts.assertNumber = function(c, d, e) { 2720 goog.asserts.ENABLE_ASSERTS && !goog.isNumber(c) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2721 return c; 2722}; 2723goog.asserts.assertString = function(c, d, e) { 2724 goog.asserts.ENABLE_ASSERTS && !goog.isString(c) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2725 return c; 2726}; 2727goog.asserts.assertFunction = function(c, d, e) { 2728 goog.asserts.ENABLE_ASSERTS && !goog.isFunction(c) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2729 return c; 2730}; 2731goog.asserts.assertObject = function(c, d, e) { 2732 goog.asserts.ENABLE_ASSERTS && !goog.isObject(c) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2733 return c; 2734}; 2735goog.asserts.assertArray = function(c, d, e) { 2736 goog.asserts.ENABLE_ASSERTS && !goog.isArray(c) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2737 return c; 2738}; 2739goog.asserts.assertBoolean = function(c, d, e) { 2740 goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(c) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2741 return c; 2742}; 2743goog.asserts.assertElement = function(c, d, e) { 2744 !goog.asserts.ENABLE_ASSERTS || goog.isObject(c) && c.nodeType == goog.dom.NodeType.ELEMENT || goog.asserts.doAssertFailure_("Expected Element but got %s: %s.", [goog.typeOf(c), c], d, Array.prototype.slice.call(arguments, 2)); 2745 return c; 2746}; 2747goog.asserts.assertInstanceof = function(c, d, e, f) { 2748 !goog.asserts.ENABLE_ASSERTS || c instanceof d || goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.", [goog.asserts.getType_(d), goog.asserts.getType_(c)], e, Array.prototype.slice.call(arguments, 3)); 2749 return c; 2750}; 2751goog.asserts.assertFinite = function(c, d, e) { 2752 !goog.asserts.ENABLE_ASSERTS || "number" == typeof c && isFinite(c) || goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.", [c], d, Array.prototype.slice.call(arguments, 2)); 2753 return c; 2754}; 2755goog.asserts.assertObjectPrototypeIsIntact = function() { 2756 for (var c in Object.prototype) { 2757 goog.asserts.fail(c + " should not be enumerable in Object.prototype."); 2758 } 2759}; 2760goog.asserts.getType_ = function(c) { 2761 return c instanceof Function ? c.displayName || c.name || "unknown type name" : c instanceof Object ? c.constructor.displayName || c.constructor.name || Object.prototype.toString.call(c) : null === c ? "null" : typeof c; 2762}; 2763goog.async = {}; 2764goog.async.FreeList = function(c, d, e) { 2765 this.limit_ = e; 2766 this.create_ = c; 2767 this.reset_ = d; 2768 this.occupants_ = 0; 2769 this.head_ = null; 2770}; 2771goog.async.FreeList.prototype.get = function() { 2772 if (0 < this.occupants_) { 2773 this.occupants_--; 2774 var c = this.head_; 2775 this.head_ = c.next; 2776 c.next = null; 2777 } else { 2778 c = this.create_(); 2779 } 2780 return c; 2781}; 2782goog.async.FreeList.prototype.put = function(c) { 2783 this.reset_(c); 2784 this.occupants_ < this.limit_ && (this.occupants_++, c.next = this.head_, this.head_ = c); 2785}; 2786goog.async.FreeList.prototype.occupants = function() { 2787 return this.occupants_; 2788}; 2789goog.async.WorkQueue = function() { 2790 this.workTail_ = this.workHead_ = null; 2791}; 2792goog.async.WorkQueue.DEFAULT_MAX_UNUSED = 100; 2793goog.async.WorkQueue.freelist_ = new goog.async.FreeList(function() { 2794 return new goog.async.WorkItem; 2795}, function(c) { 2796 c.reset(); 2797}, goog.async.WorkQueue.DEFAULT_MAX_UNUSED); 2798goog.async.WorkQueue.prototype.add = function(c, d) { 2799 var e = this.getUnusedItem_(); 2800 e.set(c, d); 2801 this.workTail_ ? this.workTail_.next = e : (goog.asserts.assert(!this.workHead_), this.workHead_ = e); 2802 this.workTail_ = e; 2803}; 2804goog.async.WorkQueue.prototype.remove = function() { 2805 var c = null; 2806 this.workHead_ && (c = this.workHead_, this.workHead_ = this.workHead_.next, this.workHead_ || (this.workTail_ = null), c.next = null); 2807 return c; 2808}; 2809goog.async.WorkQueue.prototype.returnUnused = function(c) { 2810 goog.async.WorkQueue.freelist_.put(c); 2811}; 2812goog.async.WorkQueue.prototype.getUnusedItem_ = function() { 2813 return goog.async.WorkQueue.freelist_.get(); 2814}; 2815goog.async.WorkItem = function() { 2816 this.next = this.scope = this.fn = null; 2817}; 2818goog.async.WorkItem.prototype.set = function(c, d) { 2819 this.fn = c; 2820 this.scope = d; 2821 this.next = null; 2822}; 2823goog.async.WorkItem.prototype.reset = function() { 2824 this.next = this.scope = this.fn = null; 2825}; 2826goog.debug.entryPointRegistry = {}; 2827goog.debug.EntryPointMonitor = function() { 2828}; 2829goog.debug.entryPointRegistry.refList_ = []; 2830goog.debug.entryPointRegistry.monitors_ = []; 2831goog.debug.entryPointRegistry.monitorsMayExist_ = !1; 2832goog.debug.entryPointRegistry.register = function(c) { 2833 goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length] = c; 2834 if (goog.debug.entryPointRegistry.monitorsMayExist_) { 2835 for (var d = goog.debug.entryPointRegistry.monitors_, e = 0; e < d.length; e++) { 2836 c(goog.bind(d[e].wrap, d[e])); 2837 } 2838 } 2839}; 2840goog.debug.entryPointRegistry.monitorAll = function(c) { 2841 goog.debug.entryPointRegistry.monitorsMayExist_ = !0; 2842 for (var d = goog.bind(c.wrap, c), e = 0; e < goog.debug.entryPointRegistry.refList_.length; e++) { 2843 goog.debug.entryPointRegistry.refList_[e](d); 2844 } 2845 goog.debug.entryPointRegistry.monitors_.push(c); 2846}; 2847goog.debug.entryPointRegistry.unmonitorAllIfPossible = function(c) { 2848 var d = goog.debug.entryPointRegistry.monitors_; 2849 goog.asserts.assert(c == d[d.length - 1], "Only the most recent monitor can be unwrapped."); 2850 c = goog.bind(c.unwrap, c); 2851 for (var e = 0; e < goog.debug.entryPointRegistry.refList_.length; e++) { 2852 goog.debug.entryPointRegistry.refList_[e](c); 2853 } 2854 d.length--; 2855}; 2856goog.dom.HtmlElement = function() { 2857}; 2858goog.dom.TagName = function(c) { 2859 this.tagName_ = c; 2860}; 2861goog.dom.TagName.prototype.toString = function() { 2862 return this.tagName_; 2863}; 2864goog.dom.TagName.A = new goog.dom.TagName("A"); 2865goog.dom.TagName.ABBR = new goog.dom.TagName("ABBR"); 2866goog.dom.TagName.ACRONYM = new goog.dom.TagName("ACRONYM"); 2867goog.dom.TagName.ADDRESS = new goog.dom.TagName("ADDRESS"); 2868goog.dom.TagName.APPLET = new goog.dom.TagName("APPLET"); 2869goog.dom.TagName.AREA = new goog.dom.TagName("AREA"); 2870goog.dom.TagName.ARTICLE = new goog.dom.TagName("ARTICLE"); 2871goog.dom.TagName.ASIDE = new goog.dom.TagName("ASIDE"); 2872goog.dom.TagName.AUDIO = new goog.dom.TagName("AUDIO"); 2873goog.dom.TagName.B = new goog.dom.TagName("B"); 2874goog.dom.TagName.BASE = new goog.dom.TagName("BASE"); 2875goog.dom.TagName.BASEFONT = new goog.dom.TagName("BASEFONT"); 2876goog.dom.TagName.BDI = new goog.dom.TagName("BDI"); 2877goog.dom.TagName.BDO = new goog.dom.TagName("BDO"); 2878goog.dom.TagName.BIG = new goog.dom.TagName("BIG"); 2879goog.dom.TagName.BLOCKQUOTE = new goog.dom.TagName("BLOCKQUOTE"); 2880goog.dom.TagName.BODY = new goog.dom.TagName("BODY"); 2881goog.dom.TagName.BR = new goog.dom.TagName("BR"); 2882goog.dom.TagName.BUTTON = new goog.dom.TagName("BUTTON"); 2883goog.dom.TagName.CANVAS = new goog.dom.TagName("CANVAS"); 2884goog.dom.TagName.CAPTION = new goog.dom.TagName("CAPTION"); 2885goog.dom.TagName.CENTER = new goog.dom.TagName("CENTER"); 2886goog.dom.TagName.CITE = new goog.dom.TagName("CITE"); 2887goog.dom.TagName.CODE = new goog.dom.TagName("CODE"); 2888goog.dom.TagName.COL = new goog.dom.TagName("COL"); 2889goog.dom.TagName.COLGROUP = new goog.dom.TagName("COLGROUP"); 2890goog.dom.TagName.COMMAND = new goog.dom.TagName("COMMAND"); 2891goog.dom.TagName.DATA = new goog.dom.TagName("DATA"); 2892goog.dom.TagName.DATALIST = new goog.dom.TagName("DATALIST"); 2893goog.dom.TagName.DD = new goog.dom.TagName("DD"); 2894goog.dom.TagName.DEL = new goog.dom.TagName("DEL"); 2895goog.dom.TagName.DETAILS = new goog.dom.TagName("DETAILS"); 2896goog.dom.TagName.DFN = new goog.dom.TagName("DFN"); 2897goog.dom.TagName.DIALOG = new goog.dom.TagName("DIALOG"); 2898goog.dom.TagName.DIR = new goog.dom.TagName("DIR"); 2899goog.dom.TagName.DIV = new goog.dom.TagName("DIV"); 2900goog.dom.TagName.DL = new goog.dom.TagName("DL"); 2901goog.dom.TagName.DT = new goog.dom.TagName("DT"); 2902goog.dom.TagName.EM = new goog.dom.TagName("EM"); 2903goog.dom.TagName.EMBED = new goog.dom.TagName("EMBED"); 2904goog.dom.TagName.FIELDSET = new goog.dom.TagName("FIELDSET"); 2905goog.dom.TagName.FIGCAPTION = new goog.dom.TagName("FIGCAPTION"); 2906goog.dom.TagName.FIGURE = new goog.dom.TagName("FIGURE"); 2907goog.dom.TagName.FONT = new goog.dom.TagName("FONT"); 2908goog.dom.TagName.FOOTER = new goog.dom.TagName("FOOTER"); 2909goog.dom.TagName.FORM = new goog.dom.TagName("FORM"); 2910goog.dom.TagName.FRAME = new goog.dom.TagName("FRAME"); 2911goog.dom.TagName.FRAMESET = new goog.dom.TagName("FRAMESET"); 2912goog.dom.TagName.H1 = new goog.dom.TagName("H1"); 2913goog.dom.TagName.H2 = new goog.dom.TagName("H2"); 2914goog.dom.TagName.H3 = new goog.dom.TagName("H3"); 2915goog.dom.TagName.H4 = new goog.dom.TagName("H4"); 2916goog.dom.TagName.H5 = new goog.dom.TagName("H5"); 2917goog.dom.TagName.H6 = new goog.dom.TagName("H6"); 2918goog.dom.TagName.HEAD = new goog.dom.TagName("HEAD"); 2919goog.dom.TagName.HEADER = new goog.dom.TagName("HEADER"); 2920goog.dom.TagName.HGROUP = new goog.dom.TagName("HGROUP"); 2921goog.dom.TagName.HR = new goog.dom.TagName("HR"); 2922goog.dom.TagName.HTML = new goog.dom.TagName("HTML"); 2923goog.dom.TagName.I = new goog.dom.TagName("I"); 2924goog.dom.TagName.IFRAME = new goog.dom.TagName("IFRAME"); 2925goog.dom.TagName.IMG = new goog.dom.TagName("IMG"); 2926goog.dom.TagName.INPUT = new goog.dom.TagName("INPUT"); 2927goog.dom.TagName.INS = new goog.dom.TagName("INS"); 2928goog.dom.TagName.ISINDEX = new goog.dom.TagName("ISINDEX"); 2929goog.dom.TagName.KBD = new goog.dom.TagName("KBD"); 2930goog.dom.TagName.KEYGEN = new goog.dom.TagName("KEYGEN"); 2931goog.dom.TagName.LABEL = new goog.dom.TagName("LABEL"); 2932goog.dom.TagName.LEGEND = new goog.dom.TagName("LEGEND"); 2933goog.dom.TagName.LI = new goog.dom.TagName("LI"); 2934goog.dom.TagName.LINK = new goog.dom.TagName("LINK"); 2935goog.dom.TagName.MAIN = new goog.dom.TagName("MAIN"); 2936goog.dom.TagName.MAP = new goog.dom.TagName("MAP"); 2937goog.dom.TagName.MARK = new goog.dom.TagName("MARK"); 2938goog.dom.TagName.MATH = new goog.dom.TagName("MATH"); 2939goog.dom.TagName.MENU = new goog.dom.TagName("MENU"); 2940goog.dom.TagName.MENUITEM = new goog.dom.TagName("MENUITEM"); 2941goog.dom.TagName.META = new goog.dom.TagName("META"); 2942goog.dom.TagName.METER = new goog.dom.TagName("METER"); 2943goog.dom.TagName.NAV = new goog.dom.TagName("NAV"); 2944goog.dom.TagName.NOFRAMES = new goog.dom.TagName("NOFRAMES"); 2945goog.dom.TagName.NOSCRIPT = new goog.dom.TagName("NOSCRIPT"); 2946goog.dom.TagName.OBJECT = new goog.dom.TagName("OBJECT"); 2947goog.dom.TagName.OL = new goog.dom.TagName("OL"); 2948goog.dom.TagName.OPTGROUP = new goog.dom.TagName("OPTGROUP"); 2949goog.dom.TagName.OPTION = new goog.dom.TagName("OPTION"); 2950goog.dom.TagName.OUTPUT = new goog.dom.TagName("OUTPUT"); 2951goog.dom.TagName.P = new goog.dom.TagName("P"); 2952goog.dom.TagName.PARAM = new goog.dom.TagName("PARAM"); 2953goog.dom.TagName.PICTURE = new goog.dom.TagName("PICTURE"); 2954goog.dom.TagName.PRE = new goog.dom.TagName("PRE"); 2955goog.dom.TagName.PROGRESS = new goog.dom.TagName("PROGRESS"); 2956goog.dom.TagName.Q = new goog.dom.TagName("Q"); 2957goog.dom.TagName.RP = new goog.dom.TagName("RP"); 2958goog.dom.TagName.RT = new goog.dom.TagName("RT"); 2959goog.dom.TagName.RTC = new goog.dom.TagName("RTC"); 2960goog.dom.TagName.RUBY = new goog.dom.TagName("RUBY"); 2961goog.dom.TagName.S = new goog.dom.TagName("S"); 2962goog.dom.TagName.SAMP = new goog.dom.TagName("SAMP"); 2963goog.dom.TagName.SCRIPT = new goog
2963.dom.TagName("SCRIPT"); 2964goog.dom.TagName.SECTION = new goog.dom.TagName("SECTION"); 2965goog.dom.TagName.SELECT = new goog.dom.TagName("SELECT"); 2966goog.dom.TagName.SMALL = new goog.dom.TagName("SMALL"); 2967goog.dom.TagName.SOURCE = new goog.dom.TagName("SOURCE"); 2968goog.dom.TagName.SPAN = new goog.dom.TagName("SPAN"); 2969goog.dom.TagName.STRIKE = new goog.dom.TagName("STRIKE"); 2970goog.dom.TagName.STRONG = new goog.dom.TagName("STRONG"); 2971goog.dom.TagName.STYLE = new goog.dom.TagName("STYLE"); 2972goog.dom.TagName.SUB = new goog.dom.TagName("SUB"); 2973goog.dom.TagName.SUMMARY = new goog.dom.TagName("SUMMARY"); 2974goog.dom.TagName.SUP = new goog.dom.TagName("SUP"); 2975goog.dom.TagName.SVG = new goog.dom.TagName("SVG"); 2976goog.dom.TagName.TABLE = new goog.dom.TagName("TABLE"); 2977goog.dom.TagName.TBODY = new goog.dom.TagName("TBODY"); 2978goog.dom.TagName.TD = new goog.dom.TagName("TD"); 2979goog.dom.TagName.TEMPLATE = new goog.dom.TagName("TEMPLATE"); 2980goog.dom.TagName.TEXTAREA = new goog.dom.TagName("TEXTAREA"); 2981goog.dom.TagName.TFOOT = new goog.dom.TagName("TFOOT"); 2982goog.dom.TagName.TH = new goog.dom.TagName("TH"); 2983goog.dom.TagName.THEAD = new goog.dom.TagName("THEAD"); 2984goog.dom.TagName.TIME = new goog.dom.TagName("TIME"); 2985goog.dom.TagName.TITLE = new goog.dom.TagName("TITLE"); 2986goog.dom.TagName.TR = new goog.dom.TagName("TR"); 2987goog.dom.TagName.TRACK = new goog.dom.TagName("TRACK"); 2988goog.dom.TagName.TT = new goog.dom.TagName("TT"); 2989goog.dom.TagName.U = new goog.dom.TagName("U"); 2990goog.dom.TagName.UL = new goog.dom.TagName("UL"); 2991goog.dom.TagName.VAR = new goog.dom.TagName("VAR"); 2992goog.dom.TagName.VIDEO = new goog.dom.TagName("VIDEO"); 2993goog.dom.TagName.WBR = new goog.dom.TagName("WBR"); 2994goog.functions = {}; 2995goog.functions.constant = function(c) { 2996 return function() { 2997 return c; 2998 }; 2999}; 3000goog.functions.FALSE = goog.functions.constant(!1); 3001goog.functions.TRUE = goog.functions.constant(!0); 3002goog.functions.NULL = goog.functions.constant(null); 3003goog.functions.identity = function(c, d) { 3004 return c; 3005}; 3006goog.functions.error = function(c) { 3007 return function() { 3008 throw Error(c); 3009 }; 3010}; 3011goog.functions.fail = function(c) { 3012 return function() { 3013 throw c; 3014 }; 3015}; 3016goog.functions.lock = function(c, d) { 3017 d = d || 0; 3018 return function() { 3019 return c.apply(this, Array.prototype.slice.call(arguments, 0, d)); 3020 }; 3021}; 3022goog.functions.nth = function(c) { 3023 return function() { 3024 return arguments[c]; 3025 }; 3026}; 3027goog.functions.partialRight = function(c, d) { 3028 var e = Array.prototype.slice.call(arguments, 1); 3029 return function() { 3030 var d = Array.prototype.slice.call(arguments); 3031 d.push.apply(d, e); 3032 return c.apply(this, d); 3033 }; 3034}; 3035goog.functions.withReturnValue = function(c, d) { 3036 return goog.functions.sequence(c, goog.functions.constant(d)); 3037}; 3038goog.functions.equalTo = function(c, d) { 3039 return function(e) { 3040 return d ? c == e : c === e; 3041 }; 3042}; 3043goog.functions.compose = function(c, d) { 3044 var e = arguments, f = e.length; 3045 return function() { 3046 var c; 3047 f && (c = e[f - 1].apply(this, arguments)); 3048 for (var d = f - 2; 0 <= d; d--) { 3049 c = e[d].call(this, c); 3050 } 3051 return c; 3052 }; 3053}; 3054goog.functions.sequence = function(c) { 3055 var d = arguments, e = d.length; 3056 return function() { 3057 for (var c, g = 0; g < e; g++) { 3058 c = d[g].apply(this, arguments); 3059 } 3060 return c; 3061 }; 3062}; 3063goog.functions.and = function(c) { 3064 var d = arguments, e = d.length; 3065 return function() { 3066 for (var c = 0; c < e; c++) { 3067 if (!d[c].apply(this, arguments)) { 3068 return !1; 3069 } 3070 } 3071 return !0; 3072 }; 3073}; 3074goog.functions.or = function(c) { 3075 var d = arguments, e = d.length; 3076 return function() { 3077 for (var c = 0; c < e; c++) { 3078 if (d[c].apply(this, arguments)) { 3079 return !0; 3080 } 3081 } 3082 return !1; 3083 }; 3084}; 3085goog.functions.not = function(c) { 3086 return function() { 3087 return !c.apply(this, arguments); 3088 }; 3089}; 3090goog.functions.create = function(c, d) { 3091 var e = function() { 3092 }; 3093 e.prototype = c.prototype; 3094 e = new e; 3095 c.apply(e, Array.prototype.slice.call(arguments, 1)); 3096 return e; 3097}; 3098goog.functions.CACHE_RETURN_VALUE = !0; 3099goog.functions.cacheReturnValue = function(c) { 3100 var d = !1, e; 3101 return function() { 3102 if (!goog.functions.CACHE_RETURN_VALUE) { 3103 return c(); 3104 } 3105 d || (e = c(), d = !0); 3106 return e; 3107 }; 3108}; 3109goog.functions.once = function(c) { 3110 var d = c; 3111 return function() { 3112 if (d) { 3113 var c = d; 3114 d = null; 3115 c(); 3116 } 3117 }; 3118}; 3119goog.functions.debounce = function(c, d, e) { 3120 var f = 0; 3121 return function(g) { 3122 goog.global.clearTimeout(f); 3123 var h = arguments; 3124 f = goog.global.setTimeout(function() { 3125 c.apply(e, h); 3126 }, d); 3127 }; 3128}; 3129goog.functions.throttle = function(c, d, e) { 3130 var f = 0, g = !1, h = [], k = function() { 3131 f = 0; 3132 g && (g = !1, l()); 3133 }, l = function() { 3134 f = goog.global.setTimeout(k, d); 3135 c.apply(e, h); 3136 }; 3137 return function(c) { 3138 h = arguments; 3139 f ? g = !0 : l(); 3140 }; 3141}; 3142goog.functions.rateLimit = function(c, d, e) { 3143 var f = 0, g = function() { 3144 f = 0; 3145 }; 3146 return function(h) { 3147 f || (f = goog.global.setTimeout(g, d), c.apply(e, arguments)); 3148 }; 3149}; 3150goog.array = {}; 3151goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE; 3152goog.array.ASSUME_NATIVE_FUNCTIONS = !1; 3153goog.array.peek = function(c) { 3154 return c[c.length - 1]; 3155}; 3156goog.array.last = goog.array.peek; 3157goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.indexOf) ? function(c, d, e) { 3158 goog.asserts.assert(null != c.length); 3159 return Array.prototype.indexOf.call(c, d, e); 3160} : function(c, d, e) { 3161 e = null == e ? 0 : 0 > e ? Math.max(0, c.length + e) : e; 3162 if (goog.isString(c)) { 3163 return goog.isString(d) && 1 == d.length ? c.indexOf(d, e) : -1; 3164 } 3165 for (; e < c.length; e++) { 3166 if (e in c && c[e] === d) { 3167 return e; 3168 } 3169 } 3170 return -1; 3171}; 3172goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.lastIndexOf) ? function(c, d, e) { 3173 goog.asserts.assert(null != c.length); 3174 return Array.prototype.lastIndexOf.call(c, d, null == e ? c.length - 1 : e); 3175} : function(c, d, e) { 3176 e = null == e ? c.length - 1 : e; 3177 0 > e && (e = Math.max(0, c.length + e)); 3178 if (goog.isString(c)) { 3179 return goog.isString(d) && 1 == d.length ? c.lastIndexOf(d, e) : -1; 3180 } 3181 for (; 0 <= e; e--) { 3182 if (e in c && c[e] === d) { 3183 return e; 3184 } 3185 } 3186 return -1; 3187}; 3188goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.forEach) ? function(c, d, e) { 3189 goog.asserts.assert(null != c.length); 3190 Array.prototype.forEach.call(c, d, e); 3191} : function(c, d, e) { 3192 for (var f = c.length, g = goog.isString(c) ? c.split("") : c, h = 0; h < f; h++) { 3193 h in g && d.call(e, g[h], h, c); 3194 } 3195}; 3196goog.array.forEachRight = function(c, d, e) { 3197 var f = c.length, g = goog.isString(c) ? c.split("") : c; 3198 for (--f; 0 <= f; --f) { 3199 f in g && d.call(e, g[f], f, c); 3200 } 3201}; 3202goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.filter) ? function(c, d, e) { 3203 goog.asserts.assert(null != c.length); 3204 return Array.prototype.filter.call(c, d, e); 3205} : function(c, d, e) { 3206 for (var f = c.length, g = [], h = 0, k = goog.isString(c) ? c.split("") : c, l = 0; l < f; l++) { 3207 if (l in k) { 3208 var m = k[l]; 3209 d.call(e, m, l, c) && (g[h++] = m); 3210 } 3211 } 3212 return g; 3213}; 3214goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.map) ? function(c, d, e) { 3215 goog.asserts.assert(null != c.length); 3216 return Array.prototype.map.call(c, d, e); 3217} : function(c, d, e) {
3218 for (var f = c.length, g = Array(f), h = goog.isString(c) ? c.split("") : c, k = 0; k < f; k++) { 3219 k in h && (g[k] = d.call(e, h[k], k, c)); 3220 } 3221 return g; 3222}; 3223goog.array.reduce = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduce) ? function(c, d, e, f) { 3224 goog.asserts.assert(null != c.length); 3225 f && (d = goog.bind(d, f)); 3226 return Array.prototype.reduce.call(c, d, e); 3227} : function(c, d, e, f) { 3228 var g = e; 3229 goog.array.forEach(c, function(e, k) { 3230 g = d.call(f, g, e, k, c); 3231 }); 3232 return g; 3233}; 3234goog.array.reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.reduceRight) ? function(c, d, e, f) { 3235 goog.asserts.assert(null != c.length); 3236 goog.asserts.assert(null != d); 3237 f && (d = goog.bind(d, f)); 3238 return Array.prototype.reduceRight.call(c, d, e); 3239} : function(c, d, e, f) { 3240 var g = e; 3241 goog.array.forEachRight(c, function(e, k) { 3242 g = d.call(f, g, e, k, c); 3243 }); 3244 return g; 3245}; 3246goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.some) ? function(c, d, e) { 3247 goog.asserts.assert(null != c.length); 3248 return Array.prototype.some.call(c, d, e); 3249} : function(c, d, e) { 3250 for (var f = c.length, g = goog.isString(c) ? c.split("") : c, h = 0; h < f; h++) { 3251 if (h in g && d.call(e, g[h], h, c)) { 3252 return !0; 3253 } 3254 } 3255 return !1; 3256}; 3257goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || Array.prototype.every) ? function(c, d, e) { 3258 goog.asserts.assert(null != c.length); 3259 return Array.prototype.every.call(c, d, e); 3260} : function(c, d, e) { 3261 for (var f = c.length, g = goog.isString(c) ? c.split("") : c, h = 0; h < f; h++) { 3262 if (h in g && !d.call(e, g[h], h, c)) { 3263 return !1; 3264 } 3265 } 3266 return !0; 3267}; 3268goog.array.count = function(c, d, e) { 3269 var f = 0; 3270 goog.array.forEach(c, function(c, h, k) { 3271 d.call(e, c, h, k) && ++f; 3272 }, e); 3273 return f; 3274}; 3275goog.array.find = function(c, d, e) { 3276 d = goog.array.findIndex(c, d, e); 3277 return 0 > d ? null : goog.isString(c) ? c.charAt(d) : c[d]; 3278}; 3279goog.array.findIndex = function(c, d, e) { 3280 for (var f = c.length, g = goog.isString(c) ? c.split("") : c, h = 0; h < f; h++) { 3281 if (h in g && d.call(e, g[h], h, c)) { 3282 return h; 3283 } 3284 } 3285 return -1; 3286}; 3287goog.array.findRight = function(c, d, e) { 3288 d = goog.array.findIndexRight(c, d, e); 3289 return 0 > d ? null : goog.isString(c) ? c.charAt(d) : c[d]; 3290}; 3291goog.array.findIndexRight = function(c, d, e) { 3292 var f = c.length, g = goog.isString(c) ? c.split("") : c; 3293 for (--f; 0 <= f; f--) { 3294 if (f in g && d.call(e, g[f], f, c)) { 3295 return f; 3296 } 3297 } 3298 return -1; 3299}; 3300goog.array.contains = function(c, d) { 3301 return 0 <= goog.array.indexOf(c, d); 3302}; 3303goog.array.isEmpty = function(c) { 3304 return 0 == c.length; 3305}; 3306goog.array.clear = function(c) { 3307 if (!goog.isArray(c)) { 3308 for (var d = c.length - 1; 0 <= d; d--) { 3309 delete c[d]; 3310 } 3311 } 3312 c.length = 0; 3313}; 3314goog.array.insert = function(c, d) { 3315 goog.array.contains(c, d) || c.push(d); 3316}; 3317goog.array.insertAt = function(c, d, e) { 3318 goog.array.splice(c, e, 0, d); 3319}; 3320goog.array.insertArrayAt = function(c, d, e) { 3321 goog.partial(goog.array.splice, c, e, 0).apply(null, d); 3322}; 3323goog.array.insertBefore = function(c, d, e) { 3324 var f; 3325 2 == arguments.length || 0 > (f = goog.array.indexOf(c, e)) ? c.push(d) : goog.array.insertAt(c, d, f); 3326}; 3327goog.array.remove = function(c, d) { 3328 d = goog.array.indexOf(c, d); 3329 var e; 3330 (e = 0 <= d) && goog.array.removeAt(c, d); 3331 return e; 3332}; 3333goog.array.removeLast = function(c, d) { 3334 d = goog.array.lastIndexOf(c, d); 3335 return 0 <= d ? (goog.array.removeAt(c, d), !0) : !1; 3336}; 3337goog.array.removeAt = function(c, d) { 3338 goog.asserts.assert(null != c.length); 3339 return 1 == Array.prototype.splice.call(c, d, 1).length; 3340}; 3341goog.array.removeIf = function(c, d, e) { 3342 d = goog.array.findIndex(c, d, e); 3343 return 0 <= d ? (goog.array.removeAt(c, d), !0) : !1; 3344}; 3345goog.array.removeAllIf = function(c, d, e) { 3346 var f = 0; 3347 goog.array.forEachRight(c, function(g, h) { 3348 d.call(e, g, h, c) && goog.array.removeAt(c, h) && f++; 3349 }); 3350 return f; 3351}; 3352goog.array.concat = function(c) { 3353 return Array.prototype.concat.apply([], arguments); 3354}; 3355goog.array.join = function(c) { 3356 return Array.prototype.concat.apply([], arguments); 3357}; 3358goog.array.toArray = function(c) { 3359 var d = c.length; 3360 if (0 < d) { 3361 for (var e = Array(d), f = 0; f < d; f++) { 3362 e[f] = c[f]; 3363 } 3364 return e; 3365 } 3366 return []; 3367}; 3368goog.array.clone = goog.array.toArray; 3369goog.array.extend = function(c, d) { 3370 for (var e = 1; e < arguments.length; e++) { 3371 var f = arguments[e]; 3372 if (goog.isArrayLike(f)) { 3373 var g = c.length || 0, h = f.length || 0; 3374 c.length = g + h; 3375 for (var k = 0; k < h; k++) { 3376 c[g + k] = f[k]; 3377 } 3378 } else { 3379 c.push(f); 3380 } 3381 } 3382}; 3383goog.array.splice = function(c, d, e, f) { 3384 goog.asserts.assert(null != c.length); 3385 return Array.prototype.splice.apply(c, goog.array.slice(arguments, 1)); 3386}; 3387goog.array.slice = function(c, d, e) { 3388 goog.asserts.assert(null != c.length); 3389 return 2 >= arguments.length ? Array.prototype.slice.call(c, d) : Array.prototype.slice.call(c, d, e); 3390}; 3391goog.array.removeDuplicates = function(c, d, e) { 3392 d = d || c; 3393 var f = function(c) { 3394 return goog.isObject(c) ? "o" + goog.getUid(c) : (typeof c).charAt(0) + c; 3395 }; 3396 e = e || f; 3397 f = {}; 3398 for (var g = 0, h = 0; h < c.length;) { 3399 var k = c[h++], l = e(k);
3400 Object.prototype.hasOwnProperty.call(f, l) || (f[l] = !0, d[g++] = k); 3401 } 3402 d.length = g; 3403}; 3404goog.array.binarySearch = function(c, d, e) { 3405 return goog.array.binarySearch_(c, e || goog.array.defaultCompare, !1, d); 3406}; 3407goog.array.binarySelect = function(c, d, e) { 3408 return goog.array.binarySearch_(c, d, !0, void 0, e); 3409}; 3410goog.array.binarySearch_ = function(c, d, e, f, g) { 3411 for (var h = 0, k = c.length, l; h < k;) { 3412 var m = h + k >> 1; 3413 var r = e ? d.call(g, c[m], m, c) : d(f, c[m]); 3414 0 < r ? h = m + 1 : (k = m, l = !r); 3415 } 3416 return l ? h : ~h; 3417}; 3418goog.array.sort = function(c, d) { 3419 c.sort(d || goog.array.defaultCompare); 3420}; 3421goog.array.stableSort = function(c, d) { 3422 for (var e = Array(c.length), f = 0; f < c.length; f++) { 3423 e[f] = {index:f, value:c[f]}; 3424 } 3425 var g = d || goog.array.defaultCompare; 3426 goog.array.sort(e, function(c, d) { 3427 return g(c.value, d.value) || c.index - d.index; 3428 }); 3429 for (f = 0; f < c.length; f++) { 3430 c[f] = e[f].value; 3431 } 3432}; 3433goog.array.sortByKey = function(c, d, e) { 3434 var f = e || goog.array.defaultCompare; 3435 goog.array.sort(c, function(c, e) { 3436 return f(d(c), d(e)); 3437 }); 3438}; 3439goog.array.sortObjectsByKey = function(c, d, e) { 3440 goog.array.sortByKey(c, function(c) { 3441 return c[d]; 3442 }, e); 3443}; 3444goog.array.isSorted = function(c, d, e) { 3445 d = d || goog.array.defaultCompare; 3446 for (var f = 1; f < c.length; f++) { 3447 var g = d(c[f - 1], c[f]); 3448 if (0 < g || 0 == g && e) { 3449 return !1; 3450 } 3451 } 3452 return !0; 3453}; 3454goog.array.equals = function(c, d, e) { 3455 if (!goog.isArrayLike(c) || !goog.isArrayLike(d) || c.length != d.length) { 3456 return !1; 3457 } 3458 var f = c.length; 3459 e = e || goog.array.defaultCompareEquality; 3460 for (var g = 0; g < f; g++) { 3461 if (!e(c[g], d[g])) { 3462 return !1; 3463 } 3464 } 3465 return !0; 3466}; 3467goog.array.compare3 = function(c, d, e) { 3468 e = e || goog.array.defaultCompare; 3469 for (var f = Math.min(c.length, d.length), g = 0; g < f; g++) { 3470 var h = e(c[g], d[g]); 3471 if (0 != h) { 3472 return h; 3473 } 3474 } 3475 return goog.array.defaultCompare(c.length, d.length); 3476}; 3477goog.array.defaultCompare = function(c, d) { 3478 return c > d ? 1 : c < d ? -1 : 0; 3479}; 3480goog.array.inverseDefaultCompare = function(c, d) { 3481 return -goog.array.defaultCompare(c, d); 3482}; 3483goog.array.defaultCompareEquality = function(c, d) { 3484 return c === d; 3485}; 3486goog.array.binaryInsert = function(c, d, e) { 3487 e = goog.array.binarySearch(c, d, e); 3488 return 0 > e ? (goog.array.insertAt(c, d, -(e + 1)), !0) : !1; 3489}; 3490goog.array.binaryRemove = function(c, d, e) { 3491 d = goog.array.binarySearch(c, d, e); 3492 return 0 <= d ? goog.array.removeAt(c, d) : !1; 3493}; 3494goog.array.bucket = function(c, d, e) { 3495 for (var f = {}, g = 0; g < c.length; g++) { 3496 var h = c[g], k = d.call(e, h, g, c); 3497 goog.isDef(k) && (f[k] || (f[k] = [])).push(h); 3498 } 3499 return f; 3500}; 3501goog.array.toObject = function(c, d, e) { 3502 var f = {}; 3503 goog.array.forEach(c, function(g, h) { 3504 f[d.call(e, g, h, c)] = g; 3505 }); 3506 return f; 3507}; 3508goog.array.range = function(c, d, e) { 3509 var f = [], g = 0, h = c; 3510 e = e || 1; 3511 void 0 !== d && (g = c, h = d); 3512 if (0 > e * (h - g)) { 3513 return []; 3514 } 3515 if (0 < e) { 3516 for (c = g; c < h; c += e) { 3517 f.push(c); 3518 } 3519 } else { 3520 for (c = g; c > h; c += e) { 3521 f.push(c); 3522 } 3523 } 3524 return f; 3525}; 3526goog.array.repeat = function(c, d) { 3527 for (var e = [], f = 0; f < d; f++) { 3528 e[f] = c; 3529 } 3530 return e; 3531}; 3532goog.array.flatten = function(c) { 3533 for (var d = [], e = 0; e < arguments.length; e++) { 3534 var f = arguments[e]; 3535 if (goog.isArray(f)) { 3536 for (var g = 0; g < f.length; g += 8192) { 3537 var h = goog.array.slice(f, g, g + 8192); 3538 h = goog.array.flatten.apply(null, h); 3539 for (var k = 0; k < h.length; k++) { 3540 d.push(h[k]); 3541 } 3542 } 3543 } else { 3544 d.push(f); 3545 } 3546 } 3547 return d; 3548}; 3549goog.array.rotate = function(c, d) { 3550 goog.asserts.assert(null != c.length); 3551 c.length && (d %= c.length, 0 < d ? Array.prototype.unshift.apply(c, c.splice(-d, d)) : 0 > d && Array.prototype.push.apply(c, c.splice(0, -d))); 3552 return c; 3553}; 3554goog.array.moveItem = function(c, d, e) { 3555 goog.asserts.assert(0 <= d && d < c.length); 3556 goog.asserts.assert(0 <= e && e < c.length); 3557 d = Array.prototype.splice.call(c, d, 1); 3558 Array.prototype.splice.call(c, e, 0, d[0]); 3559}; 3560goog.array.zip = function(c) { 3561 if (!arguments.length) { 3562 return []; 3563 } 3564 for (var d = [], e = arguments[0].length, f = 1; f < arguments.length; f++) { 3565 arguments[f].length < e && (e = arguments[f].length); 3566 } 3567 for (f = 0; f < e; f++) { 3568 for (var g = [], h = 0; h < arguments.length; h++) { 3569 g.push(arguments[h][f]); 3570 } 3571 d.push(g); 3572 } 3573 return d; 3574}; 3575goog.array.shuffle = function(c, d) { 3576 d = d || Math.random; 3577 for (var e = c.length - 1; 0 < e; e--) { 3578 var f = Math.floor(d() * (e + 1)), g = c[e]; 3579 c[e] = c[f]; 3580 c[f] = g; 3581 } 3582}; 3583goog.array.copyByIndex = function(c, d) { 3584 var e = []; 3585 goog.array.forEach(d, function(d) { 3586 e.push(c[d]); 3587 }); 3588 return e; 3589}; 3590goog.array.concatMap = function(c, d, e) { 3591 return goog.array.concat.apply([], goog.array.map(c, d, e)); 3592}; 3593goog.string = {}; 3594goog.string.DETECT_DOUBLE_ESCAPING = !1; 3595goog.string.FORCE_NON_DOM_HTML_UNESCAPING = !1; 3596goog.string.Unicode = {NBSP:"\u00a0"}; 3597goog.string.startsWith = function(c, d) { 3598 return 0 == c.lastIndexOf(d, 0); 3599}; 3600goog.string.endsWith = function(c, d) { 3601 var e = c.length - d.length; 3602 return 0 <= e && c.indexOf(d, e) == e; 3603}; 3604goog.string.caseInsensitiveStartsWith = function(c, d) { 3605 return 0 == goog.string.caseInsensitiveCompare(d, c.substr(0, d.length)); 3606}; 3607goog.string.caseInsensitiveEndsWith = function(c, d) { 3608 return 0 == goog.string.caseInsensitiveCompare(d, c.substr(c.length - d.length, d.length)); 3609}; 3610goog.string.caseInsensitiveEquals = function(c, d) { 3611 return c.toLowerCase() == d.toLowerCase(); 3612}; 3613goog.string.subs = function(c, d) { 3614 for (var e = c.split("%s"), f = "", g = Array.prototype.slice.call(arguments, 1); g.length && 1 < e.length;) { 3615 f += e.shift() + g.shift(); 3616 } 3617 return f + e.join("%s"); 3618}; 3619goog.string.collapseWhitespace = function(c) { 3620 return c.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, ""); 3621}; 3622goog.string.isEmptyOrWhitespace = function(c) { 3623 return /^[\s\xa0]*$/.test(c); 3624}; 3625goog.string.isEmptyString = function(c) { 3626 return 0 == c.length; 3627}; 3628goog.string.isEmpty = goog.string.isEmptyOrWhitespace; 3629goog.string.isEmptyOrWhitespaceSafe = function(c) { 3630 return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(c)); 3631}; 3632goog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe; 3633goog.string.isBreakingWhitespace = function(c) { 3634 return !/[^\t\n\r ]/.test(c); 3635}; 3636goog.string.isAlpha = function(c) { 3637 return !/[^a-zA-Z]/.test(c); 3638}; 3639goog.string.isNumeric = function(c) { 3640 return !/[^0-9]/.test(c); 3641}; 3642goog.string.isAlphaNumeric = function(c) { 3643 return !/[^a-zA-Z0-9]/.test(c); 3644}; 3645goog.string.isSpace = function(c) { 3646 return " " == c; 3647}; 3648goog.string.isUnicodeChar = function(c) { 3649 return 1 == c.length && " " <= c && "~" >= c || "\u0080" <= c && "\ufffd" >= c; 3650}; 3651goog.string.stripNewlines = function(c) { 3652 return c.replace(/(\r\n|\r|\n)+/g, " "); 3653}; 3654goog.string.canonicalizeNewlines = function(c) { 3655 return c.replace(/(\r\n|\r|\n)/g, "\n"); 3656}; 3657goog.string.normalizeWhitespace = function(c) { 3658 return c.replace(/\xa0|\s/g, " "); 3659}; 3660goog.string.normalizeSpaces = function(c) { 3661 return c.replace(/\xa0|[ \t]+/g, " "); 3662}; 3663goog.string.collapseBreakingSpaces = function(c) { 3664 return c.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); 3665}; 3666goog.string.trim = goog.TRUSTED_SITE && String.prototype.trim ? function(c) { 3667 return c.trim(); 3668} : function(c) { 3669 return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(c)[1]; 3670}; 3671goog.string.trimLeft = function(c) { 3672 return c.replace(/^[\s\xa0]+/, ""); 3673}; 3674goog.string.trimRight = function(c) { 3675 return c.replace(/[\s\xa0]+$/, ""); 3676}; 3677goog.string.caseInsensitiveCompare = function(c, d) { 3678 c = String(c).toLowerCase(); 3679 d = String(d).toLowerCase(); 3680 return c < d ? -1 : c == d ? 0 : 1; 3681}; 3682goog.string.numberAwareCompare_ = function(c, d, e) { 3683 if (c == d) { 3684 return 0; 3685 } 3686 if (!c) { 3687 return -1; 3688 } 3689 if (!d) { 3690 return 1; 3691 } 3692 for (var f = c.toLowerCase().match(e), g = d.toLowerCase().match(e), h = Math.min(f.length, g.length), k = 0; k < h; k++) { 3693 e = f[k]; 3694 var l = g[k]; 3695 if (e != l) { 3696 return c = parseInt(e, 10), !isNaN(c) && (d = parseInt(l, 10), !isNaN(d) && c - d) ? c - d : e < l ? -1 : 1; 3697 } 3698 } 3699 return f.length != g.length ? f.length - g.length : c < d ? -1 : 1; 3700}; 3701goog.string.intAwareCompare = function(c, d) { 3702 return goog.string.numberAwareCompare_(c, d, /\d+|\D+/g); 3703}; 3704goog.string.floatAwareCompare = function(c, d) { 3705 return goog.string.numberAwareCompare_(c, d, /\d+|\.\d+|\D+/g); 3706}; 3707goog.string.numerateCompare = goog.string.floatAwareCompare; 3708goog.string.urlEncode = function(c) { 3709 return encodeURIComponent(String(c)); 3710}; 3711goog.string.urlDecode = function(c) { 3712 return decodeURIComponent(c.replace(/\+/g, " ")); 3713}; 3714goog.string.newLineToBr = function(c, d) { 3715 return c.replace(/(\r\n|\r|\n)/g, d ? "<br />" : "<br>"); 3716}; 3717goog.string.htmlEscape = function(c, d) { 3718 if (d) { 3719 c = c.replace(goog.string.AMP_RE_, "&").replace(goog.string.LT_RE_, "<").replace(goog.string.GT_RE_, ">").replace(goog.string.QUOT_RE_, """).replace(goog.string.SINGLE_QUOTE_RE_, "'").replace(goog.string.NULL_RE_, "�"), goog.string.DETECT_DOUBLE_ESCAPING && (c = c.replace(goog.string.E_RE_, "e")); 3720 } else { 3721 if (!goog.string.ALL_RE_.test(c)) { 3722 return c; 3723 } 3724 -1 != c.indexOf("&") && (c = c.replace(goog.string.AMP_RE_, "&")); 3725 -1 != c.indexOf("<") && (c = c.replace(goog.string.LT_RE_, "<")); 3726 -1 != c.indexOf(">") && (c = c.replace(goog.string.GT_RE_, ">")); 3727 -1 != c.indexOf('"') && (c = c.replace(goog.string.QUOT_RE_, """)); 3728 -1 != c.indexOf("'") && (c = c.replace(goog.string.SINGLE_QUOTE_RE_, "'")); 3729 -1 != c.indexOf("\x00") && (c = c.replace(goog.string.NULL_RE_, "�")); 3730 goog.string.DETECT_DOUBLE_ESCAPING && -1 != c.indexOf("e") && (c = c.replace(goog.string.E_RE_, "e")); 3731 } 3732 return c; 3733}; 3734goog.string.AMP_RE_ = /&/g; 3735goog.string.LT_RE_ = /</g; 3736goog.string.GT_RE_ = />/g; 3737goog.string.QUOT_RE_ = /"/g; 3738goog.string.SINGLE_QUOTE_RE_ = /'/g; 3739goog.string.NULL_RE_ = /\x00/g; 3740goog.string.E_RE_ = /e/g; 3741goog.string.ALL_RE_ = goog.string.DETECT_DOUBLE_ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/; 3742goog.string.unescapeEntities = function(c) { 3743 return goog.string.contains(c, "&") ? !goog.string.FORCE_NON_DOM_HTML_UNESCAPING && "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(c) : goog.string.unescapePureXmlEntities_(c) : c; 3744}; 3745goog.string.unescapeEntitiesWithDocument = function(c, d) { 3746 return goog.string.contains(c, "&") ? goog.string.unescapeEntitiesUsingDom_(c, d) : c; 3747}; 3748goog.string.unescapeEntitiesUsingDom_ = function(c, d) { 3749 var e = {"&":"&", "<":"<", ">":">", """:'"'}; 3750 var f = d ? d.createElement("div") : goog.global.document.createElement("div"); 3751 return c.replace(goog.string.HTML_ENTITY_PATTERN_, function(c, d) { 3752 var g = e[c]; 3753 if (g) { 3754 return g; 3755 } 3756 "#" == d.charAt(0) && (d = Number("0" + d.substr(1)), isNaN(d) || (g = String.fromCharCode(d))); 3757 g || (f.innerHTML = c + " ", g = f.firstChild.nodeValue.slice(0, -1)); 3758 return e[c] = g; 3759 }); 3760}; 3761goog.string.unescapePureXmlEntities_ = function(c) { 3762 return c.replace(/&([^;]+);/g, function(c, e) { 3763 switch(e) { 3764 case "amp": 3765 return "&"; 3766 case "lt": 3767 return "<"; 3768 case "gt": 3769 return ">"; 3770 case "quot": 3771 return '"'; 3772 default: 3773 return "#" != e.charAt(0) || (e = Number("0" + e.substr(1)), isNaN(e)) ? c : String.fromCharCode(e); 3774 } 3775 }); 3776}; 3777goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; 3778goog.string.whitespaceEscape = function(c, d) { 3779 return goog.string.newLineToBr(c.replace(/ /g, "  "), d); 3780}; 3781goog.string.preserveSpaces = function(c) { 3782 return c.replace(/(^|[\n ]) /g, "$1" + goog.string.Unicode.NBSP); 3783}; 3784goog.string.stripQuotes = function(c, d) { 3785 for (var e = d.length, f = 0; f < e; f++) { 3786 var g = 1 == e ? d : d.charAt(f); 3787 if (c.charAt(0) == g && c.charAt(c.length - 1) == g) { 3788 return c.substring(1, c.length - 1); 3789 } 3790 } 3791 return c; 3792}; 3793goog.string.truncate = function(c, d, e) { 3794 e && (c = goog.string.unescapeEntities(c)); 3795 c.length > d && (c = c.substring(0, d - 3) + "..."); 3796 e && (c = goog.string.htmlEscape(c)); 3797 return c; 3798}; 3799goog.string.truncateMiddle = function(c, d, e, f) { 3800 e && (c = goog.string.unescapeEntities(c)); 3801 if (f && c.length > d) { 3802 f > d && (f = d); 3803 var g = c.length - f; 3804 c = c.substring(0, d - f) + "..." + c.substring(g); 3805 } else { 3806 c.length >
3806 d && (f = Math.floor(d / 2), g = c.length - f, c = c.substring(0, f + d % 2) + "..." + c.substring(g)); 3807 } 3808 e && (c = goog.string.htmlEscape(c)); 3809 return c; 3810}; 3811goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\", "<":"<"}; 3812goog.string.jsEscapeCache_ = {"'":"\\'"}; 3813goog.string.quote = function(c) { 3814 c = String(c); 3815 for (var d = ['"'], e = 0; e < c.length; e++) { 3816 var f = c.charAt(e), g = f.charCodeAt(0); 3817 d[e + 1] = goog.string.specialEscapeChars_[f] || (31 < g && 127 > g ? f : goog.string.escapeChar(f)); 3818 } 3819 d.push('"'); 3820 return d.join(""); 3821}; 3822goog.string.escapeString = function(c) { 3823 for (var d = [], e = 0; e < c.length; e++) { 3824 d[e] = goog.string.escapeChar(c.charAt(e)); 3825 } 3826 return d.join(""); 3827}; 3828goog.string.escapeChar = function(c) { 3829 if (c in goog.string.jsEscapeCache_) { 3830 return goog.string.jsEscapeCache_[c]; 3831 } 3832 if (c in goog.string.specialEscapeChars_) { 3833 return goog.string.jsEscapeCache_[c] = goog.string.specialEscapeChars_[c]; 3834 } 3835 var d = c.charCodeAt(0); 3836 if (31 < d && 127 > d) { 3837 var e = c; 3838 } else { 3839 if (256 > d) { 3840 if (e = "\\x", 16 > d || 256 < d) { 3841 e += "0"; 3842 } 3843 } else { 3844 e = "\\u", 4096 > d && (e += "0"); 3845 } 3846 e += d.toString(16).toUpperCase(); 3847 } 3848 return goog.string.jsEscapeCache_[c] = e; 3849}; 3850goog.string.contains = function(c, d) { 3851 return -1 != c.indexOf(d); 3852}; 3853goog.string.caseInsensitiveContains = function(c, d) { 3854 return goog.string.contains(c.toLowerCase(), d.toLowerCase()); 3855}; 3856goog.string.countOf = function(c, d) { 3857 return c && d ? c.split(d).length - 1 : 0; 3858}; 3859goog.string.removeAt = function(c, d, e) { 3860 var f = c; 3861 0 <= d && d < c.length && 0 < e && (f = c.substr(0, d) + c.substr(d + e, c.length - d - e)); 3862 return f; 3863}; 3864goog.string.remove = function(c, d) { 3865 return c.replace(d, ""); 3866}; 3867goog.string.removeAll = function(c, d) { 3868 d = new RegExp(goog.string.regExpEscape(d), "g"); 3869 return c.replace(d, ""); 3870}; 3871goog.string.replaceAll = function(c, d, e) { 3872 d = new RegExp(goog.string.regExpEscape(d), "g"); 3873 return c.replace(d, e.replace(/\$/g, "$$$$")); 3874}; 3875goog.string.regExpEscape = function(c) { 3876 return String(c).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08"); 3877}; 3878goog.string.repeat = String.prototype.repeat ? function(c, d) { 3879 return c.repeat(d); 3880} : function(c, d) { 3881 return Array(d + 1).join(c); 3882}; 3883goog.string.padNumber = function(c, d, e) { 3884 c = goog.isDef(e) ? c.toFixed(e) : String(c); 3885 e = c.indexOf("."); 3886 -1 == e && (e = c.length); 3887 return goog.string.repeat("0", Math.max(0, d - e)) + c; 3888}; 3889goog.string.makeSafe = function(c) { 3890 return null == c ? "" : String(c); 3891}; 3892goog.string.buildString = function(c) { 3893 return Array.prototype.join.call(arguments, ""); 3894}; 3895goog.string.getRandomString = function() { 3896 return Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ goog.now()).toString(36); 3897}; 3898goog.string.compareVersions = function(c, d) { 3899 var e = 0; 3900 c = goog.string.trim(String(c)).split("."); 3901 d = goog.string.trim(String(d)).split("."); 3902 for (var f = Math.max(c.length, d.length), g = 0; 0 == e && g < f; g++) { 3903 var h = c[g] || "", k = d[g] || ""; 3904 do { 3905 h = /(\d*)(\D*)(.*)/.exec(h) || ["", "", "", ""]; 3906 k = /(\d*)(\D*)(.*)/.exec(k) || ["", "", "", ""]; 3907 if (0 == h[0].length && 0 == k[0].length) { 3908 break; 3909 } 3910 e = 0 == h[1].length ? 0 : parseInt(h[1], 10); 3911 var l = 0 == k[1].length ? 0 : parseInt(k[1], 10); 3912 e = goog.string.compareElements_(e, l) || goog.string.compareElements_(0 == h[2].length, 0 == k[2].length) || goog.string.compareElements_(h[2], k[2]); 3913 h = h[3]; 3914 k = k[3]; 3915 } while (0 == e); 3916 } 3917 return e; 3918}; 3919goog.string.compareElements_ = function(c, d) { 3920 return c < d ? -1 : c > d ? 1 : 0; 3921}; 3922goog.string.hashCode = function(c) { 3923 for (var d = 0, e = 0; e < c.length; ++e) { 3924 d = 31 * d + c.charCodeAt(e) >>> 0; 3925 } 3926 return d; 3927}; 3928goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0; 3929goog.string.createUniqueString = function() { 3930 return "goog_" + goog.string.uniqueStringCounter_++; 3931}; 3932goog.string.toNumber = function(c) { 3933 var d = Number(c); 3934 return 0 == d && goog.string.isEmptyOrWhitespace(c) ? NaN : d; 3935}; 3936goog.string.isLowerCamelCase = function(c) { 3937 return /^[a-z]+([A-Z][a-z]*)*$/.test(c); 3938};
3939goog.string.isUpperCamelCase = function(c) { 3940 return /^([A-Z][a-z]*)+$/.test(c); 3941}; 3942goog.string.toCamelCase = function(c) { 3943 return String(c).replace(/\-([a-z])/g, function(c, e) { 3944 return e.toUpperCase(); 3945 }); 3946}; 3947goog.string.toSelectorCase = function(c) { 3948 return String(c).replace(/([A-Z])/g, "-$1").toLowerCase(); 3949}; 3950goog.string.toTitleCase = function(c, d) { 3951 d = goog.isString(d) ? goog.string.regExpEscape(d) : "\\s"; 3952 return c.replace(new RegExp("(^" + (d ? "|[" + d + "]+" : "") + ")([a-z])", "g"), function(c, d, g) { 3953 return d + g.toUpperCase(); 3954 }); 3955}; 3956goog.string.capitalize = function(c) { 3957 return String(c.charAt(0)).toUpperCase() + String(c.substr(1)).toLowerCase(); 3958}; 3959goog.string.parseInt = function(c) { 3960 isFinite(c) && (c = String(c)); 3961 return goog.isString(c) ? /^\s*-?0x/i.test(c) ? parseInt(c, 16) : parseInt(c, 10) : NaN; 3962}; 3963goog.string.splitLimit = function(c, d, e) { 3964 c = c.split(d); 3965 for (var f = []; 0 < e && c.length;) { 3966 f.push(c.shift()), e--; 3967 } 3968 c.length && f.push(c.join(d)); 3969 return f; 3970}; 3971goog.string.lastComponent = function(c, d) { 3972 if (d) { 3973 "string" == typeof d && (d = [d]); 3974 } else { 3975 return c; 3976 } 3977 for (var e = -1, f = 0; f < d.length; f++) { 3978 if ("" != d[f]) { 3979 var g = c.lastIndexOf(d[f]); 3980 g > e && (e = g); 3981 } 3982 } 3983 return -1 == e ? c : c.slice(e + 1); 3984}; 3985goog.string.editDistance = function(c, d) { 3986 var e = [], f = []; 3987 if (c == d) { 3988 return 0; 3989 } 3990 if (!c.length || !d.length) { 3991 return Math.max(c.length, d.length); 3992 } 3993 for (var g = 0; g < d.length + 1; g++) { 3994 e[g] = g; 3995 } 3996 for (g = 0; g < c.length; g++) { 3997 f[0] = g + 1; 3998 for (var h = 0; h < d.length; h++) { 3999 f[h + 1] = Math.min(f[h] + 1, e[h + 1] + 1, e[h] + Number(c[g] != d[h])); 4000 } 4001 for (h = 0; h < e.length; h++) { 4002 e[h] = f[h]; 4003 } 4004 } 4005 return f[d.length]; 4006}; 4007goog.labs = {}; 4008goog.labs.userAgent = {}; 4009goog.labs.userAgent.util = {}; 4010goog.labs.userAgent.util.getNativeUserAgentString_ = function() { 4011 var c = goog.labs.userAgent.util.getNavigator_(); 4012 return c && (c = c.userAgent) ? c : ""; 4013}; 4014goog.labs.userAgent.util.getNavigator_ = function() { 4015 return goog.global.navigator; 4016}; 4017goog.labs.userAgent.util.userAgent_ = goog.labs.userAgent.util.getNativeUserAgentString_(); 4018goog.labs.userAgent.util.setUserAgent = function(c) { 4019 goog.labs.userAgent.util.userAgent_ = c || goog.labs.userAgent.util.getNativeUserAgentString_(); 4020}; 4021goog.labs.userAgent.util.getUserAgent = function() { 4022 return goog.labs.userAgent.util.userAgent_; 4023}; 4024goog.labs.userAgent.util.matchUserAgent = function(c) { 4025 var d = goog.labs.userAgent.util.getUserAgent(); 4026 return goog.string.contains(d, c); 4027}; 4028goog.labs.userAgent.util.matchUserAgentIgnoreCase = function(c) { 4029 var d = goog.labs.userAgent.util.getUserAgent(); 4030 return goog.string.caseInsensitiveContains(d, c); 4031}; 4032goog.labs.userAgent.util.extractVersionTuples = function(c) { 4033 for (var d = /(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g, e = [], f; f = d.exec(c);) { 4034 e.push([f[1], f[2], f[3] || void 0]); 4035 } 4036 return e; 4037}; 4038goog.object = {}; 4039goog.object.is = function(c, d) { 4040 return c === d ? 0 !== c || 1 / c === 1 / d : c !== c && d !== d; 4041}; 4042goog.object.forEach = function(c, d, e) { 4043 for (var f in c) { 4044 d.call(e, c[f], f, c); 4045 } 4046}; 4047goog.object.filter = function(c, d, e) { 4048 var f = {}, g; 4049 for (g in c) { 4050 d.call(e, c[g], g, c) && (f[g] = c[g]); 4051 } 4052 return f; 4053}; 4054goog.object.map = function(c, d, e) { 4055 var f = {}, g; 4056 for (g in c) { 4057 f[g] = d.call(e, c[g], g, c); 4058 } 4059 return f; 4060}; 4061goog.object.some = function(c, d, e) { 4062 for (var f in c) { 4063 if (d.call(e, c[f], f, c)) { 4064 return !0; 4065 } 4066 } 4067 return !1; 4068}; 4069goog.object.every = function(c, d, e) { 4070 for (var f in c) { 4071 if (!d.call(e, c[f], f, c)) { 4072 return !1; 4073 } 4074 } 4075 return !0; 4076}; 4077goog.object.getCount = function(c) { 4078 var d = 0, e; 4079 for (e in c) { 4080 d++; 4081 } 4082 return d; 4083}; 4084goog.object.getAnyKey = function(c) { 4085 for (var d in c) { 4086 return d; 4087 } 4088}; 4089goog.object.getAnyValue = function(c) { 4090 for (var d in c) { 4091 return c[d]; 4092 } 4093}; 4094goog.object.contains = function(c, d) { 4095 return goog.object.containsValue(c, d); 4096}; 4097goog.object.getValues = function(c) { 4098 var d = [], e = 0, f; 4099 for (f in c) { 4100 d[e++] = c[f]; 4101 } 4102 return d; 4103}; 4104goog.object.getKeys = function(c) { 4105 var d = [], e = 0, f; 4106 for (f in c) { 4107 d[e++] = f; 4108 } 4109 return d; 4110}; 4111goog.object.getValueByKeys = function(c, d) { 4112 var e = goog.isArrayLike(d), f = e ? d : arguments; 4113 for (e = e ? 0 : 1; e < f.length; e++) { 4114 if (null == c) { 4115 return; 4116 } 4117 c = c[f[e]]; 4118 } 4119 return c; 4120}; 4121goog.object.containsKey = function(c, d) { 4122 return null !== c && d in c; 4123}; 4124goog.object.containsValue = function(c, d) { 4125 for (var e in c) { 4126 if (c[e] == d) { 4127 return !0; 4128 } 4129 } 4130 return !1; 4131}; 4132goog.object.findKey = function(c, d, e) { 4133 for (var f in c) { 4134 if (d.call(e, c[f], f, c)) { 4135 return f; 4136 } 4137 } 4138}; 4139goog.object.findValue = function(c, d, e) { 4140 return (d = goog.object.findKey(c, d, e)) && c[d]; 4141}; 4142goog.object.isEmpty = function(c) { 4143 for (var d in c) { 4144 return !1; 4145 } 4146 return !0; 4147}; 4148goog.object.clear = function(c) { 4149 for (var d in c) { 4150 delete c[d]; 4151 } 4152}; 4153goog.object.remove = function(c, d) { 4154 var e; 4155 (e = d in c) && delete c[d]; 4156 return e; 4157}; 4158goog.object.add = function(c, d, e) { 4159 if (null !== c && d in c) { 4160 throw Error('The object already contains the key "' + d + '"'); 4161 } 4162 goog.object.set(c, d, e); 4163}; 4164goog.object.get = function(c, d, e) { 4165 return null !== c && d in c ? c[d] : e; 4166}; 4167goog.object.set = function(c, d, e) { 4168 c[d] = e; 4169}; 4170goog.object.setIfUndefined = function(c, d, e) { 4171 return d in c ? c[d] : c[d] = e; 4172}; 4173goog.object.setWithReturnValueIfNotSet = function(c, d, e) { 4174 if (d in c) { 4175 return c[d]; 4176 } 4177 e = e(); 4178 return c[d] = e; 4179}; 4180goog.object.equals = function(c, d) { 4181 for (var e in c) { 4182 if (!(e in d) || c[e] !== d[e]) { 4183 return !1; 4184 } 4185 } 4186 for (e in d) { 4187 if (!(e in c)) { 4188 return !1; 4189 } 4190 } 4191 return !0; 4192}; 4193goog.object.clone = function(c) { 4194 var d = {}, e; 4195 for (e in c) { 4196 d[e] = c[e]; 4197 } 4198 return d; 4199}; 4200goog.object.unsafeClone = function(c) { 4201 var d = goog.typeOf(c); 4202 if ("object" == d || "array" == d) { 4203 if (goog.isFunction(c.clone)) { 4204 return c.clone(); 4205 } 4206 d = "array" == d ? [] : {}; 4207 for (var e in c) { 4208 d[e] = goog.object.unsafeClone(c[e]); 4209 } 4210 return d; 4211 } 4212 return c; 4213}; 4214goog.object.transpose = function(c) { 4215 var d = {}, e; 4216 for (e in c) { 4217 d[c[e]] = e; 4218 } 4219 return d; 4220}; 4221goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
4221ing toString valueOf".split(" "); 4222goog.object.extend = function(c, d) { 4223 for (var e, f, g = 1; g < arguments.length; g++) { 4224 f = arguments[g]; 4225 for (e in f) { 4226 c[e] = f[e]; 4227 } 4228 for (var h = 0; h < goog.object.PROTOTYPE_FIELDS_.length; h++) { 4229 e = goog.object.PROTOTYPE_FIELDS_[h], Object.prototype.hasOwnProperty.call(f, e) && (c[e] = f[e]); 4230 } 4231 } 4232}; 4233goog.object.create = function(c) { 4234 var d = arguments.length; 4235 if (1 == d && goog.isArray(arguments[0])) { 4236 return goog.object.create.apply(null, arguments[0]); 4237 } 4238 if (d % 2) { 4239 throw Error("Uneven number of arguments"); 4240 } 4241 for (var e = {}, f = 0; f < d; f += 2) { 4242 e[arguments[f]] = arguments[f + 1]; 4243 } 4244 return e; 4245}; 4246goog.object.createSet = function(c) { 4247 var d = arguments.length; 4248 if (1 == d && goog.isArray(arguments[0])) { 4249 return goog.object.createSet.apply(null, arguments[0]); 4250 } 4251 for (var e = {}, f = 0; f < d; f++) { 4252 e[arguments[f]] = !0; 4253 } 4254 return e; 4255}; 4256goog.object.createImmutableView = function(c) { 4257 var d = c; 4258 Object.isFrozen && !Object.isFrozen(c) && (d = Object.create(c), Object.freeze(d)); 4259 return d; 4260}; 4261goog.object.isImmutableView = function(c) { 4262 return !!Object.isFrozen && Object.isFrozen(c); 4263}; 4264goog.object.getAllPropertyNames = function(c, d, e) { 4265 if (!c) { 4266 return []; 4267 } 4268 if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) { 4269 return goog.object.getKeys(c); 4270 } 4271 for (var f = {}; c && (c !== Object.prototype || d) && (c !== Function.prototype || e);) { 4272 for (var g = Object.getOwnPropertyNames(c), h = 0; h < g.length; h++) { 4273 f[g[h]] = !0; 4274 } 4275 c = Object.getPrototypeOf(c); 4276 } 4277 return goog.object.getKeys(f); 4278}; 4279goog.labs.userAgent.browser = {}; 4280goog.labs.userAgent.browser.matchOpera_ = function() { 4281 return goog.labs.userAgent.util.matchUserAgent("Opera"); 4282}; 4283goog.labs.userAgent.browser.matchIE_ = function() { 4284 return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE"); 4285}; 4286goog.labs.userAgent.browser.matchEdge_ = function() { 4287 return goog.labs.userAgent.util.matchUserAgent("Edge"); 4288}; 4289goog.labs.userAgent.browser.matchFirefox_ = function() { 4290 return goog.labs.userAgent.util.matchUserAgent("Firefox"); 4291}; 4292goog.labs.userAgent.browser.matchSafari_ = function() { 4293 return goog.labs.userAgent.util.matchUserAgent("Safari") && !(goog.labs.userAgent.browser.matchChrome_() || goog.labs.userAgent.browser.matchCoast_() || goog.labs.userAgent.browser.matchOpera_() || goog.labs.userAgent.browser.matchEdge_() || goog.labs.userAgent.browser.isSilk() || goog.labs.userAgent.util.matchUserAgent("Android")); 4294}; 4295goog.labs.userAgent.browser.matchCoast_ = function() { 4296 return goog.labs.userAgent.util.matchUserAgent("Coast"); 4297}; 4298goog.labs.userAgent.browser.matchIosWebview_ = function() { 4299 return (goog.labs.userAgent.util.matchUserAgent("iPad") || goog.labs.userAgent.util.matchUserAgent("iPhone")) && !goog.labs.userAgent.browser.matchSafari_() && !goog.labs.userAgent.browser.matchChrome_() && !goog.labs.userAgent.browser.matchCoast_() && goog.labs.userAgent.util.matchUserAgent("AppleWebKit"); 4300}; 4301goog.labs.userAgent.browser.matchChrome_ = function() { 4302 return (goog.labs.userAgent.util.matchUserAgent("Chrome") || goog.labs.userAgent.util.matchUserAgent("CriOS")) && !goog.labs.userAgent.browser.matchEdge_(); 4303}; 4304goog.labs.userAgent.browser.matchAndroidBrowser_ = function() { 4305 return goog.labs.userAgent.util.matchUserAgent("Android") && !(goog.labs.userAgent.browser.isChrome() || goog.labs.userAgent.browser.isFirefox() || goog.labs.userAgent.browser.isOpera() || goog.labs.userAgent.browser.isSilk()); 4306}; 4307goog.labs.userAgent.browser.isOpera = goog.labs.userAgent.browser.matchOpera_; 4308goog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_; 4309goog.labs.userAgent.browser.isEdge = goog.labs.userAgent.browser.matchEdge_; 4310goog.labs.userAgent.browser.isFirefox = goog.labs.userAgent.browser.matchFirefox_; 4311goog.labs.userAgent.browser.isSafari = goog.labs.userAgent.browser.matchSafari_; 4312goog.labs.userAgent.browser.isCoast = goog.labs.userAgent.browser.matchCoast_; 4313goog.labs.userAgent.browser.isIosWebview = goog.labs.userAgent.browser.matchIosWebview_; 4314goog.labs.userAgent.browser.isChrome = goog.labs.userAgent.browser.matchChrome_; 4315goog.labs.userAgent.browser.isAndroidBrowser = goog.labs.userAgent.browser.matchAndroid
4315Browser_; 4316goog.labs.userAgent.browser.isSilk = function() { 4317 return goog.labs.userAgent.util.matchUserAgent("Silk"); 4318}; 4319goog.labs.userAgent.browser.getVersion = function() { 4320 function c(c) { 4321 c = goog.array.find(c, f); 4322 return e[c] || ""; 4323 } 4324 var d = goog.labs.userAgent.util.getUserAgent(); 4325 if (goog.labs.userAgent.browser.isIE()) { 4326 return goog.labs.userAgent.browser.getIEVersion_(d); 4327 } 4328 d = goog.labs.userAgent.util.extractVersionTuples(d); 4329 var e = {}; 4330 goog.array.forEach(d, function(c) { 4331 e[c[0]] = c[1]; 4332 }); 4333 var f = goog.partial(goog.object.containsKey, e); 4334 return goog.labs.userAgent.browser.isOpera() ? c(["Version", "Opera"]) : goog.labs.userAgent.browser.isEdge() ? c(["Edge"]) : goog.labs.userAgent.browser.isChrome() ? c(["Chrome", "CriOS"]) : (d = d[2]) && d[1] || ""; 4335}; 4336goog.labs.userAgent.browser.isVersionOrHigher = function(c) { 4337 return 0 <= goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(), c); 4338}; 4339goog.labs.userAgent.browser.getIEVersion_ = function(c) { 4340 var d = /rv: *([\d\.]*)/.exec(c); 4341 if (d && d[1]) { 4342 return d[1]; 4343 } 4344 d = ""; 4345 var e = /MSIE +([\d\.]+)/.exec(c); 4346 if (e && e[1]) { 4347 if (c = /Trident\/(\d.\d)/.exec(c), "7.0" == e[1]) { 4348 if (c && c[1]) { 4349 switch(c[1]) { 4350 case "4.0": 4351 d = "8.0"; 4352 break; 4353 case "5.0": 4354 d = "9.0"; 4355 break; 4356 case "6.0": 4357 d = "10.0"; 4358 break; 4359 case "7.0": 4360 d = "11.0"; 4361 } 4362 } else { 4363 d = "7.0"; 4364 } 4365 } else { 4366 d = e[1]; 4367 } 4368 } 4369 return d; 4370}; 4371goog.labs.userAgent.engine = {}; 4372goog.labs.userAgent.engine.isPresto = function() { 4373 return goog.labs.userAgent.util.matchUserAgent("Presto"); 4374}; 4375goog.labs.userAgent.engine.isTrident = function() { 4376 return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE"); 4377}; 4378goog.labs.userAgent.engine.isEdge = function() { 4379 return goog.labs.userAgent.util.matchUserAgent("Edge"); 4380}; 4381goog.labs.userAgent.engine.isWebKit = function() { 4382 return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit") && !goog.labs.userAgent.engine.isEdge(); 4383}; 4384goog.labs.userAgent.engine.isGecko = function() { 4385 return goog.labs.userAgent.util.matchUserAgent("Gecko") && !goog.labs.userAgent.engine.isWebKit() && !goog.labs.userAgent.engine.isTrident() && !goog.labs.userAgent.engine.isEdge(); 4386}; 4387goog.labs.userAgent.engine.getVersion = function() { 4388 var c = goog.labs.userAgent.util.getUserAgent(); 4389 if (c) { 4390 c = goog.labs.userAgent.util.extractVersionTuples(c); 4391 var d = goog.labs.userAgent.engine.getEngineTuple_(c); 4392 if (d) { 4393 return "Gecko" == d[0] ? goog.labs.userAgent.engine.getVersionForKey_(c, "Firefox") : d[1]; 4394 } 4395 c = c[0]; 4396 var e; 4397 if (c && (e = c[2]) && (e = /Trident\/([^\s;]+)/.exec(e))) { 4398 return e[1]; 4399 } 4400 } 4401 return ""; 4402}; 4403goog.labs.userAgent.engine.getEngineTuple_ = function(c) { 4404 if (!goog.labs.userAgent.engine.isEdge()) { 4405 return c[1]; 4406 } 4407 for (var d = 0; d < c.length; d++) { 4408 var e = c[d]; 4409 if ("Edge" == e[0]) { 4410 return e; 4411 } 4412 } 4413}; 4414goog.labs.userAgent.engine.isVersionOrHigher = function(c) { 4415 return 0 <= goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), c); 4416}; 4417goog.labs.userAgent.engine.getVersionForKey_ = function(c, d) { 4418 return (c = goog.array.find(c, function(c) { 4419 return d == c[0]; 4420 })) && c[1] || ""; 4421}; 4422goog.async.throwException = function(c) { 4423 goog.global.setTimeout(function() { 4424 throw c; 4425 }, 0); 4426}; 4427goog.async.nextTick = function(c, d, e) { 4428 var f = c; 4429 d && (f = goog.bind(c, d)); 4430 f = goog.async.nextTick.wrapCallback_(f); 4431 goog.isFunction(goog.global.setImmediate) && (e || goog.async.nextTick.useSetImmediate_()) ? goog.global.setImmediate(f) : (goog.async.nextTick.setImmediate_ || (goog.async.nextTick.setImmediate_ = goog.async.nextTick.getSetImmediateEmulator_()), goog.async.nextTick.setImmediate_(f)); 4432}; 4433goog.async.nextTick.useSetImmediate_ = function() { 4434 return goog.global.Window && goog.global.Window.prototype && !goog.labs.userAgent.browser.isEdge() && goog.global.Window.prototype.setImmediate == goog.global.setImmediate ? !1 : !0; 4435}; 4436goog.async.nextTick.getSetImmediateEmulator_ = function() {
4437 var c = goog.global.MessageChannel; 4438 "undefined" === typeof c && "undefined" !== typeof window && window.postMessage && window.addEventListener && !goog.labs.userAgent.engine.isPresto() && (c = function() { 4439 var c = document.createElement("IFRAME"); 4440 c.style.display = "none"; 4441 c.src = ""; 4442 document.documentElement.appendChild(c); 4443 var d = c.contentWindow; 4444 c = d.document; 4445 c.open(); 4446 c.write(""); 4447 c.close(); 4448 var e = "callImmediate" + Math.random(), f = "file:" == d.location.protocol ? "*" : d.location.protocol + "//" + d.location.host; 4449 c = goog.bind(function(c) { 4450 if (("*" == f || c.origin == f) && c.data == e) { 4451 this.port1.onmessage(); 4452 } 4453 }, this); 4454 d.addEventListener("message", c, !1); 4455 this.port1 = {}; 4456 this.port2 = {postMessage:function() { 4457 d.postMessage(e, f); 4458 }}; 4459 }); 4460 if ("undefined" !== typeof c && !goog.labs.userAgent.browser.isIE()) { 4461 var d = new c, e = {}, f = e; 4462 d.port1.onmessage = function() { 4463 if (goog.isDef(e.next)) { 4464 e = e.next; 4465 var c = e.cb; 4466 e.cb = null; 4467 c(); 4468 } 4469 }; 4470 return function(c) { 4471 f.next = {cb:c}; 4472 f = f.next; 4473 d.port2.postMessage(0); 4474 }; 4475 } 4476 return "undefined" !== typeof document && "onreadystatechange" in document.createElement("SCRIPT") ? function(c) { 4477 var d = document.createElement("SCRIPT"); 4478 d.onreadystatechange = function() { 4479 d.onreadystatechange = null; 4480 d.parentNode.removeChild(d); 4481 d = null; 4482 c(); 4483 c = null; 4484 }; 4485 document.documentElement.appendChild(d); 4486 } : function(c) { 4487 goog.global.setTimeout(c, 0); 4488 }; 4489}; 4490goog.async.nextTick.wrapCallback_ = goog.functions.identity; 4491goog.debug.entryPointRegistry.register(function(c) { 4492 goog.async.nextTick.wrapCallback_ = c; 4493}); 4494goog.async.run = function(c, d) { 4495 goog.async.run.schedule_ || goog.async.run.initializeRunner_(); 4496 goog.async.run.workQueueScheduled_ || (goog.async.run.schedule_(), goog.async.run.workQueueScheduled_ = !0); 4497 goog.async.run.workQueue_.add(c, d); 4498}; 4499goog.async.run.initializeRunner_ = function() { 4500 if (-1 != String(goog.global.Promise).indexOf("[native code]")) { 4501 var c = goog.global.Promise.resolve(void 0); 4502 goog.async.run.schedule_ = function() { 4503 c.then(goog.async.run.processWorkQueue); 4504 }; 4505 } else { 4506 goog.async.run.schedule_ = function() { 4507 goog.async.nextTick(goog.async.run.processWorkQueue); 4508 }; 4509 } 4510}; 4511goog.async.run.forceNextTick = function(c) { 4512 goog.async.run.schedule_ = function() { 4513 goog.async.nextTick(goog.async.run.processWorkQueue); 4514 c && c(goog.async.run.processWorkQueue); 4515 }; 4516}; 4517goog.async.run.workQueueScheduled_ = !1; 4518goog.async.run.workQueue_ = new goog.async.WorkQueue; 4519goog.DEBUG && (goog.async.run.resetQueue = function() { 4520 goog.async.run.workQueueScheduled_ = !1; 4521 goog.async.run.workQueue_ = new goog.async.WorkQueue; 4522}); 4523goog.async.run.processWorkQueue = function() { 4524 for (var c; c = goog.async.run.workQueue_.remove();) { 4525 try { 4526 c.fn.call(c.scope); 4527 } catch (d) { 4528 goog.async.throwException(d); 4529 } 4530 goog.async.run.workQueue_.returnUnused(c); 4531 } 4532 goog.async.run.workQueueScheduled_ = !1; 4533}; 4534goog.promise = {}; 4535goog.promise.Resolver = function() { 4536}; 4537goog.Promise = function(c, d) { 4538 this.state_ = goog.Promise.State_.PENDING; 4539 this.result_ = void 0; 4540 this.callbackEntriesTail_ = this.callbackEntries_ = this.parent_ = null; 4541 this.executing_ = !1; 4542 0 < goog.Promise.UNHANDLED_REJECTION_DELAY ? this.unhandledRejectionId_ = 0 : 0 == goog.Promise.UNHANDLED_REJECTION_DELAY && (this.hadUnhandledRejection_ = !1); 4543 goog.Promise.LONG_STACK_TRACES && (this.stack_ = [], this.addStackTrace_(Error("created")), this.currentStep_ = 0); 4544 if (c != goog.nullFunction) { 4545 try { 4546 var e = this; 4547 c.call(d, function(c) { 4548 e.resolve_(goog.Promise.State_.FULFILLED, c); 4549 }, function(c) { 4550 if (goog.DEBUG && !(c instanceof goog.Promise.CancellationError)) { 4551 try { 4552 if (c instanceof Error) { 4553 throw c; 4554 } 4555 throw Error("Promise rejected."); 4556 } catch (g) { 4557 } 4558 } 4559 e.resolve_(goog.Promise.State_.REJECTED, c); 4560 }); 4561 } catch (f) { 4562 this.resolve_(goog.Promise.State_.REJECTED, f); 4563 } 4564 } 4565}; 4566goog.Promise.LONG_STACK_TRACES = !1; 4567goog.Promise.UNHANDLED_REJECTION_DELAY = 0; 4568goog.Promise.State_ = {PENDING:0, BLOCKED:1, FULFILLED:2, REJECTED:3}; 4569goog.Promise.CallbackEntry_ = function() { 4570 this.next = this.context = this.onRejected = this.onFulfilled = this.child = null; 4571 this.always = !1; 4572}; 4573goog.Promise.CallbackEntry_.prototype.reset = function() { 4574 this.context = this.onRejected = this.onFulfilled = this.child = null; 4575 this.always = !1; 4576}; 4577goog.Promise.DEFAULT_MAX_UNUSED = 100; 4578goog.Promise.freelist_ = new goog.async.FreeList(function() { 4579 return new goog.Promise.CallbackEntry_; 4580}, function(c) { 4581 c.reset(); 4582}, goog.Promise.DEFAULT_MAX_UNUSED); 4583goog.Promise.getCallbackEntry_ = function(c, d, e) { 4584 var f = goog.Promise.freelist_.get(); 4585 f.onFulfilled = c; 4586 f.onRejected = d; 4587 f.context = e; 4588 return f; 4589}; 4590goog.Promise.returnEntry_ = function(c) { 4591 goog.Promise.freelist_.put(c); 4592}; 4593goog.Promise.resolve = function(c) { 4594 if (c instanceof goog.Promise) { 4595 return c; 4596 } 4597 var d = new goog.Promise(goog.nullFunction); 4598 d.resolve_(goog.Promise.State_.FULFILLED, c); 4599 return d; 4600}; 4601goog.Promise.reject = function(c) { 4602 return new goog.Promise(function(d, e) { 4603 e(c); 4604 }); 4605}; 4606goog.Promise.resolveThen_ = function(c, d, e) { 4607 goog.Promise.maybeThen_(c, d, e, null) || goog.async.run(goog.partial(d, c)); 4608}; 4609goog.Promise.race = function(c) { 4610 return new goog.Promise(function(d, e) { 4611 c.length || d(void 0); 4612 for (var f = 0, g; f < c.length; f++) { 4613 g = c[f], goog.Promise.resolveThen_(g, d, e); 4614 } 4615 }); 4616}; 4617goog.Promise.all = function(c) { 4618 return new goog.Promise(function(d, e) { 4619 var f = c.length, g = []; 4620 if (f) { 4621 for (var h = function(c, e) { 4622 f--; 4623 g[c] = e; 4624 0 == f && d(g); 4625 }, k = function(c) { 4626 e(c); 4627 }, l = 0, m; l < c.length; l++) { 4628 m = c[l], goog.Promise.resolveThen_(m, goog.partial(h, l), k); 4629 } 4630 } else { 4631 d(g); 4632 } 4633 }); 4634}; 4635goog.Promise.allSettled = function(c) { 4636 return new goog.Promise(function(d, e) { 4637 var f = c.length, g = []; 4638 if (f) { 4639 e = function(c, e, h) { 4640 f--; 4641 g[c] = e ? {fulfilled:!0, value:h} : {fulfilled:!1, reason:h}; 4642 0 == f && d(g); 4643 }; 4644 for (var h = 0, k; h < c.length; h++) { 4645 k = c[h], goog.Promise.resolveThen_(k, goog.partial(e, h, !0), goog.partial(e, h, !1)); 4646 } 4647 } else { 4648 d(g); 4649 } 4650 }); 4651}; 4652goog.Promise.firstFulfilled = function(c) { 4653 return new goog.Promise(function(d, e) { 4654 var f = c.length, g = []; 4655 if (f) { 4656 for (var h = function(c) { 4657 d(c); 4658 }, k = function(c, d) { 4659 f--; 4660 g[c] = d; 4661 0 == f && e(g); 4662 }, l = 0, m; l < c.length; l++) { 4663 m = c[l], goog.Promise.resolveThen_(m, h, goog.partial(k, l)); 4664 } 4665 } else { 4666 d(void 0); 4667 } 4668 }); 4669}; 4670goog.Promise.withResolver = function() { 4671 var c, d, e = new goog.Promise(function(e, g) { 4672 c = e; 4673 d = g; 4674 }); 4675 return new goog.Promise.Resolver_(e, c, d); 4676}; 4677goog.Promise.prototype.then = function(c, d, e) { 4678 null != c && goog.asserts.assertFunction(c, "opt_onFulfilled should be a function."); 4679 null != d && goog.asserts.assertFunction(d, "opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"); 4680 goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("then")); 4681 return this.addChildPromise_(goog.isFunction(c) ? c : null, goog.isFunction(d) ? d : null, e); 4682}; 4683goog.Thenable.addImplementation(goog.Promise); 4684goog.Promise.prototype.thenVoid = function(c, d, e) { 4685 null != c && goog.asserts.assertFunction(c, "opt_onFulfilled should be a function."); 4686 null != d && goog.asserts.assertFunction(d, "opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"); 4687 goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("then")); 4688 this.addCallbackEntry_(goog.Promise.getCallbackEntry_(c || goog.nullFunction, d || null, e)); 4689}; 4690goog.Promise.prototype.thenAlways = function(c, d) { 4691 goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("thenAlways")); 4692 c = goog.Promise.getCallbackEntry_(c, c, d); 4693 c.always = !0; 4694 this.addCallbackEntry_(c); 4695 return this; 4696}; 4697goog.Promise.prototype.thenCatch = function(c, d) { 4698 goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("thenCatch")); 4699 return this.addChildPromise_(null, c, d); 4700}; 4701goog.Promise.prototype.cancel = function(c) { 4702 this.state_ == goog.Promise.State_.PENDING && goog.async.run(function() { 4703 var d = new goog.Promise.CancellationError(c); 4704 this.cancelInternal_(d); 4705 }, this); 4706}; 4707goog.Promise.prototype.cancelInternal_ = function(c) { 4708 this.state_ == goog.Promise.State_.PENDING && (this.parent_ ? (this.parent_.cancelChild_(this, c), this.parent_ = null) : this.resolve_(goog.Promise.State_.REJECTED, c)); 4709}; 4710goog.Promise.prototype.cancelChild_ = function(c, d) { 4711 if (this.callbackEntries_) { 4712 for (var e = 0, f = null, g = null, h = this.callbackEntries_; h && (h.always || (e++, h.child == c && (f = h), !(f && 1 < e))); h = h.next) { 4713 f || (g = h); 4714 } 4715 f && (this.state_ == goog.Promise.State_.PENDING && 1 == e ? this.cancelInternal_(d) : (g ? this.removeEntryAfter_(g) : this.popEntry_(), this.executeCallback_(f, goog.Promise.State_.REJECTED, d))); 4716 } 4717}; 4718goog.Promise.prototype.addCallbackEntry_ = function(c) { 4719 this.hasEntry_() || this.state_ != goog.Promise.State_.FULFILLED && this.state_ != goog.Promise.State_.REJECTED || this.scheduleCallbacks_(); 4720 this.queueEntry_(c); 4721}; 4722goog.Promise.prototype.addChildPromise_ = function(c, d, e) { 4723 var f = goog.Promise.getCallbackEntry_(null, null, null); 4724 f.child = new goog.Promise(function(g, h) { 4725 f.onFulfilled = c ? function(d) {
4726 try { 4727 var f = c.call(e, d); 4728 g(f); 4729 } catch (m) { 4730 h(m); 4731 } 4732 } : g; 4733 f.onRejected = d ? function(c) { 4734 try { 4735 var f = d.call(e, c); 4736 !goog.isDef(f) && c instanceof goog.Promise.CancellationError ? h(c) : g(f); 4737 } catch (m) { 4738 h(m); 4739 } 4740 } : h; 4741 }); 4742 f.child.parent_ = this; 4743 this.addCallbackEntry_(f); 4744 return f.child; 4745}; 4746goog.Promise.prototype.unblockAndFulfill_ = function(c) { 4747 goog.asserts.assert(this.state_ == goog.Promise.State_.BLOCKED); 4748 this.state_ = goog.Promise.State_.PENDING; 4749 this.resolve_(goog.Promise.State_.FULFILLED, c); 4750}; 4751goog.Promise.prototype.unblockAndReject_ = function(c) { 4752 goog.asserts.assert(this.state_ == goog.Promise.State_.BLOCKED); 4753 this.state_ = goog.Promise.State_.PENDING; 4754 this.resolve_(goog.Promise.State_.REJECTED, c); 4755}; 4756goog.Promise.prototype.resolve_ = function(c, d) { 4757 this.state_ == goog.Promise.State_.PENDING && (this === d && (c = goog.Promise.State_.REJECTED, d = new TypeError("Promise cannot resolve to itself")), this.state_ = goog.Promise.State_.BLOCKED, goog.Promise.maybeThen_(d, this.unblockAndFulfill_, this.unblockAndReject_, this) || (this.result_ = d, this.state_ = c, this.parent_ = null, this.scheduleCallbacks_(), c != goog.Promise.State_.REJECTED || d instanceof goog.Promise.CancellationError || goog.Promise.addUnhandledRejection_(this, d))); 4758}; 4759goog.Promise.maybeThen_ = function(c, d, e, f) { 4760 if (c instanceof goog.Promise) { 4761 return c.thenVoid(d, e, f), !0; 4762 } 4763 if (goog.Thenable.isImplementedBy(c)) { 4764 return c.then(d, e, f), !0; 4765 } 4766 if (goog.isObject(c)) { 4767 try { 4768 var g = c.then; 4769 if (goog.isFunction(g)) { 4770 return goog.Promise.tryThen_(c, g, d, e, f), !0; 4771 } 4772 } catch (h) { 4773 return e.call(f, h), !0; 4774 } 4775 } 4776 return !1; 4777}; 4778goog.Promise.tryThen_ = function(c, d, e, f, g) { 4779 var h = !1, k = function(c) { 4780 h || (h = !0, e.call(g, c)); 4781 }, l = function(c) { 4782 h || (h = !0, f.call(g, c)); 4783 }; 4784 try { 4785 d.call(c, k, l); 4786 } catch (m) { 4787 l(m); 4788 } 4789}; 4790goog.Promise.prototype.scheduleCallbacks_ = function() { 4791 this.executing_ || (this.executing_ = !0, goog.async.run(this.executeCallbacks_, this)); 4792}; 4793goog.Promise.prototype.hasEntry_ = function() { 4794 return !!this.callbackEntries_; 4795}; 4796goog.Promise.prototype.queueEntry_ = function(c) { 4797 goog.asserts.assert(null != c.onFulfilled); 4798 this.callbackEntriesTail_ ? this.callbackEntriesTail_.next = c : this.callbackEntries_ = c; 4799 this.callbackEntriesTail_ = c; 4800}; 4801goog.Promise.prototype.popEntry_ = function() { 4802 var c = null; 4803 this.callbackEntries_ && (c = this.callbackEntries_, this.callbackEntries_ = c.next, c.next = null); 4804 this.callbackEntries_ || (this.callbackEntriesTail_ = null); 4805 null != c && goog.asserts.assert(null != c.onFulfilled); 4806 return c; 4807}; 4808goog.Promise.prototype.removeEntryAfter_ = function(c) { 4809 goog.asserts.assert(this.callbackEntries_); 4810 goog.asserts.assert(null != c); 4811 c.next == this.callbackEntriesTail_ && (this.callbackEntriesTail_ = c); 4812 c.next = c.next.next; 4813}; 4814goog.Promise.prototype.executeCallbacks_ = function() { 4815 for (var c; c = this.popEntry_();) { 4816 goog.Promise.LONG_STACK_TRACES && this.currentStep_++, this.executeCallback_(c, this.state_, this.result_); 4817 } 4818 this.executing_ = !1; 4819}; 4820goog.Promise.prototype.executeCallback_ = function(c, d, e) { 4821 d == goog.Promise.State_.REJECTED && c.onRejected && !c.always && this.removeUnhandledRejection_(); 4822 if (c.child) { 4823 c.child.parent_ = null, goog.Promise.invokeCallback_(c, d, e); 4824 } else { 4825 try { 4826 c.always ? c.onFulfilled.call(c.context) : goog.Promise.invokeCallback_(c, d, e); 4827 } catch (f) { 4828 goog.Promise.handleRejection_.call(null, f); 4829 } 4830 } 4831 goog.Promise.returnEntry_(c); 4832}; 4833goog.Promise.invokeCallback_ = function(c, d, e) { 4834 d == goog.Promise.State_.FULFILLED ? c.onFulfilled.call(c.context, e) : c.onRejected && c.onRejected.call(c.context, e); 4835}; 4836goog.Promise.prototype.addStackTrace_ = function(c) { 4837 if (goog.Promise.LONG_STACK_TRACES && goog.isString(c.stack)) { 4838 var d = c.stack.split("\n", 4)[3]; 4839 c = c.message; 4840 c += Array(11 - c.length).join(" "); 4841 this.stack_.push(c + d); 4842 } 4843}; 4844goog.Promise.prototype.appendLongStack_ = function(c) { 4845 if (goog.Promise.LONG_STACK_TRACES && c && goog.isString(c.stack) && this.stack_.length) { 4846 for (var d = ["Promise trace:"], e = this; e; e = e.parent_) { 4847 for (var f = this.currentStep_; 0 <= f; f--) { 4848 d.push(e.stack_[f]); 4849 } 4850 d.push("Value: [" + (e.state_ == goog.Promise.State_.REJECTED ? "REJECTED" : "FULFILLED") + "] <" + String(e.result_) + ">"); 4851 } 4852 c.stack += "\n\n" + d.join("\n"); 4853 } 4854}; 4855goog.Promise.prototype.removeUnhandledRejection_ = function() { 4856 if (0 < goog.Promise.UNHANDLED_REJECTION_DELAY) { 4857 for (var c = this; c && c.unhandledRejectionId_; c = c.parent_) { 4858 goog.global.clearTimeout(c.unhandledRejectionId_), c.unhandledRejectionId_ = 0; 4859 } 4860 } else { 4861 if (0 == goog.Promise.UNHANDLED_REJECTION_DELAY) { 4862 for (c = this; c && c.hadUnhandledRejection_; c = c.parent_) { 4863 c.hadUnhandledRejection_ = !1; 4864 } 4865 } 4866 } 4867}; 4868goog.Promise.addUnhandledRejection_ = function(c, d) { 4869 0 < goog.Promise.UNHANDLED_REJECTION_DELAY ? c.unhandledRejectionId_ = goog.global.setTimeout(function() { 4870 c.appendLongStack_(d); 4871 goog.Promise.handleRejection_.call(null, d); 4872 }, goog.Promise.UNHANDLED_REJECTION_DELAY) : 0 == goog.Promise.UNHANDLED_REJECTION_DELAY && (c.hadUnhandledRejection_ = !0, goog.async.run(function() { 4873 c.hadUnhandledRejection_ && (c.appendLongStack_(d), goog.Promise.handleRejection_.call(null, d)); 4874 })); 4875}; 4876goog.Promise.handleRejection_ = goog.async.throwException; 4877goog.Promise.setUnhandledRejectionHandler = function(c) { 4878 goog.Promise.handleRejection_ = c; 4879}; 4880goog.Promise.CancellationError = function(c) { 4881 goog.debug.Error.call(this, c); 4882}; 4883goog.inherits(goog.Promise.CancellationError, goog.debug.Error); 4884goog.Promise.CancellationError.prototype.name = "cancel"; 4885goog.Promise.Resolver_ = function(c, d, e) { 4886 this.promise = c; 4887 this.resolve = d; 4888 this.reject = e; 4889}; 4890goog.disposable = {}; 4891goog.disposable.IDisposable = function() { 4892}; 4893goog.disposable.IDisposable.prototype.dispose = goog.abstractMethod; 4894goog.disposable.IDisposable.prototype.isDisposed = goog.abstractMethod; 4895goog.Disposable = function() { 4896 goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF && (goog.Disposable.INCLUDE_STACK_ON_CREATION && (this.creationStack = Error().stack), goog.Disposable.instances_[goog.getUid(this)] = this); 4897 this.disposed_ = this.disposed_; 4898 this.onDisposeCallbacks_ = this.onDisposeCallbacks_; 4899}; 4900goog.Disposable.MonitoringMode = {OFF:0, PERMANENT:1, INTERACTIVE:2}; 4901goog.Disposable.MONITORING_MODE = 0; 4902goog.Disposable.INCLUDE_STACK_ON_CREATION = !0; 4903goog.Disposable.instances_ = {}; 4904goog.Disposable.getUndisposedObjects = function() { 4905 var c = [], d; 4906 for (d in goog.Disposable.instances_) { 4907 goog.Disposable.instances_.hasOwnProperty(d) && c.push(goog.Disposable.instances_[Number(d)]); 4908 } 4909 return c; 4910}; 4911goog.Disposable.clearUndisposedObjects = function() { 4912 goog.Disposable.instances_ = {}; 4913}; 4914goog.Disposable.prototype.disposed_ = !1; 4915goog.Disposable.prototype.isDisposed = function() { 4916 return this.disposed_; 4917}; 4918goog.Disposable.prototype.getDisposed = goog.Disposable.prototype.isDisposed; 4919goog.Disposable.prototype.dispose = function() { 4920 if (!this.disposed_ && (this.disposed_ = !0, this.disposeInternal(), goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF)) { 4921 var c = goog.getUid(this); 4922 if (goog.Disposable.MONITORING_MODE == goog.Disposable.MonitoringMode.PERMANENT && !goog.Disposable.instances_.hasOwnProperty(c)) { 4923 throw Error(this + " did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call"); 4924 } 4925 if (goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF && this.onDisposeCallbacks_ && 0 < this.onDisposeCallbacks_.length) { 4926 throw Error(this + " did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method."); 4927 } 4928 delete goog.Disposable.instances_[c]; 4929 } 4930}; 4931goog.Disposable.prototype.registerDisposable = function(c) {
4932 this.addOnDisposeCallback(goog.partial(goog.dispose, c)); 4933}; 4934goog.Disposable.prototype.addOnDisposeCallback = function(c, d) { 4935 this.disposed_ ? goog.isDef(d) ? c.call(d) : c() : (this.onDisposeCallbacks_ || (this.onDisposeCallbacks_ = []), this.onDisposeCallbacks_.push(goog.isDef(d) ? goog.bind(c, d) : c)); 4936}; 4937goog.Disposable.prototype.disposeInternal = function() { 4938 if (this.onDisposeCallbacks_) { 4939 for (; this.onDisposeCallbacks_.length;) { 4940 this.onDisposeCallbacks_.shift()(); 4941 } 4942 } 4943}; 4944goog.Disposable.isDisposed = function(c) { 4945 return c && "function" == typeof c.isDisposed ? c.isDisposed() : !1; 4946}; 4947goog.dispose = function(c) { 4948 c && "function" == typeof c.dispose && c.dispose(); 4949}; 4950goog.disposeAll = function(c) { 4951 for (var d = 0, e = arguments.length; d < e; ++d) { 4952 var f = arguments[d]; 4953 goog.isArrayLike(f) ? goog.disposeAll.apply(null, f) : goog.dispose(f); 4954 } 4955}; 4956goog.debug.errorcontext = {}; 4957goog.debug.errorcontext.addErrorContext = function(c, d, e) { 4958 c[goog.debug.errorcontext.CONTEXT_KEY_] || (c[goog.debug.errorcontext.CONTEXT_KEY_] = {}); 4959 c[goog.debug.errorcontext.CONTEXT_KEY_][d] = e; 4960}; 4961goog.debug.errorcontext.getErrorContext = function(c) { 4962 return c[goog.debug.errorcontext.CONTEXT_KEY_] || {}; 4963}; 4964goog.debug.errorcontext.CONTEXT_KEY_ = "__closure__error__context__984382"; 4965goog.labs.userAgent.platform = {}; 4966goog.labs.userAgent.platform.isAndroid = function() { 4967 return goog.labs.userAgent.util.matchUserAgent("Android"); 4968}; 4969goog.labs.userAgent.platform.isIpod = function() { 4970 return goog.labs.userAgent.util.matchUserAgent("iPod"); 4971}; 4972goog.labs.userAgent.platform.isIphone = function() { 4973 return goog.labs.userAgent.util.matchUserAgent("iPhone") && !goog.labs.userAgent.util.matchUserAgent("iPod") && !goog.labs.userAgent.util.matchUserAgent("iPad"); 4974}; 4975goog.labs.userAgent.platform.isIpad = function() { 4976 return goog.labs.userAgent.util.matchUserAgent("iPad"); 4977}; 4978goog.labs.userAgent.platform.isIos = function() { 4979 return goog.labs.userAgent.platform.isIphone() || goog.labs.userAgent.platform.isIpad() || goog.labs.userAgent.platform.isIpod(); 4980}; 4981goog.labs.userAgent.platform.isMacintosh = function() { 4982 return goog.labs.userAgent.util.matchUserAgent("Macintosh"); 4983}; 4984goog.labs.userAgent.platform.isLinux = function() { 4985 return goog.labs.userAgent.util.matchUserAgent("Linux"); 4986}; 4987goog.labs.userAgent.platform.isWindows = function() { 4988 return goog.labs.userAgent.util.matchUserAgent("Windows"); 4989}; 4990goog.labs.userAgent.platform.isChromeOS = function() { 4991 return goog.labs.userAgent.util.matchUserAgent("CrOS"); 4992}; 4993goog.labs.userAgent.platform.isChromecast = function() { 4994 return goog.labs.userAgent.util.matchUserAgent("CrKey"); 4995}; 4996goog.labs.userAgent.platform.getVersion = function() { 4997 var c = goog.labs.userAgent.util.getUserAgent(), d = ""; 4998 goog.labs.userAgent.platform.isWindows() ? (d = /Windows (?:NT|Phone) ([0-9.]+)/, d = (c = d.exec(c)) ? c[1] : "0.0") : goog.labs.userAgent.platform.isIos() ? (d = /(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/, d = (c = d.exec(c)) && c[1].replace(/_/g, ".")) : goog.labs.userAgent.platform.isMacintosh() ? (d = /Mac OS X ([0-9_.]+)/, d = (c = d.exec(c)) ? c[1].replace(/_/g, ".") : "10") : goog.labs.userAgent.platform.isAndroid() ? (d = /Android\s+([^\);]+)(\)|;)/, d = (c = d.exec(c)) && c[1]) : goog.labs.userAgent.platform.isChromeOS() && 4999 (d = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/, d = (c = d.exec(c)) && c[1]); 5000 return d || ""; 5001}; 5002goog.labs.userAgent.platform.isVersionOrHigher = function(c) { 5003 return 0 <= goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(), c); 5004}; 5005goog.reflect = {}; 5006goog.reflect.object = function(c, d) { 5007 return d; 5008}; 5009goog.reflect.objectProperty = function(c, d) { 5010 return c; 5011}; 5012goog.reflect.sinkValue = function(c) { 5013 goog.reflect.sinkValue[" "](c); 5014 return c; 5015}; 5016goog.reflect.sinkValue[" "] = goog.nullFunction; 5017goog.reflect.canAccessProperty = function(c, d) { 5018 try { 5019 return goog.reflect.sinkValue(c[d]), !0; 5020 } catch (e) { 5021 } 5022 return !1; 5023}; 5024goog.reflect.cache = function(c, d, e, f) { 5025 f = f ? f(d) : d; 5026 return Object.prototype.hasOwnProperty.call(c, f) ? c[f] : c[f] = e(d); 5027}; 5028goog.userAgent = {}; 5029goog.userAgent.ASSUME_IE = !1; 5030goog.userAgent.ASSUME_EDGE = !1; 5031goog.userAgent.ASSUME_GECKO = !1; 5032goog.userAgent.ASSUME_WEBKIT = !1; 5033goog.userAgent.ASSUME_MOBILE_WEBKIT = !1; 5034goog.userAgent.ASSUME_OPERA = !1; 5035goog.userAgent.ASSUME_ANY_VERSION = !1;
5036goog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE || goog.userAgent.ASSUME_EDGE || goog.userAgent.ASSUME_GECKO || goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_OPERA; 5037goog.userAgent.getUserAgentString = function() { 5038 return goog.labs.userAgent.util.getUserAgent(); 5039}; 5040goog.userAgent.getNavigator = function() { 5041 return goog.global.navigator || null; 5042}; 5043goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_OPERA : goog.labs.userAgent.browser.isOpera(); 5044goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_IE : goog.labs.userAgent.browser.isIE(); 5045goog.userAgent.EDGE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_EDGE : goog.labs.userAgent.engine.isEdge(); 5046goog.userAgent.EDGE_OR_IE = goog.userAgent.EDGE || goog.userAgent.IE; 5047goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_GECKO : goog.labs.userAgent.engine.isGecko(); 5048goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT : goog.labs.userAgent.engine.isWebKit(); 5049goog.userAgent.isMobile_ = function() { 5050 return goog.userAgent.WEBKIT && goog.labs.userAgent.util.matchUserAgent("Mobile"); 5051}; 5052goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_(); 5053goog.userAgent.SAFARI = goog.userAgent.WEBKIT; 5054goog.userAgent.determinePlatform_ = function() { 5055 var c = goog.userAgent.getNavigator(); 5056 return c && c.platform || ""; 5057}; 5058goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_(); 5059goog.userAgent.ASSUME_MAC = !1; 5060goog.userAgent.ASSUME_WINDOWS = !1; 5061goog.userAgent.ASSUME_LINUX = !1; 5062goog.userAgent.ASSUME_X11 = !1; 5063goog.userAgent.ASSUME_ANDROID = !1; 5064goog.userAgent.ASSUME_IPHONE = !1; 5065goog.userAgent.ASSUME_IPAD = !1; 5066goog.userAgent.ASSUME_IPOD = !1; 5067goog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC || goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX || goog.userAgent.ASSUME_X11 || goog.userAgent.ASSUME_ANDROID || goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD || goog.userAgent.ASSUME_IPOD; 5068goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_MAC : goog.labs.userAgent.platform.isMacintosh(); 5069goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_WINDOWS : goog.labs.userAgent.platform.isWindows(); 5070goog.userAgent.isLegacyLinux_ = function() { 5071 return goog.labs.userAgent.platform.isLinux() || goog.labs.userAgent.platform.isChromeOS(); 5072}; 5073goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_LINUX : goog.userAgent.isLegacyLinux_(); 5074goog.userAgent.isX11_ = function() { 5075 var c = goog.userAgent.getNavigator(); 5076 return !!c && goog.string.contains(c.appVersion || "", "X11"); 5077}; 5078goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_X11 : goog.userAgent.isX11_(); 5079goog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_ANDROID : goog.labs.userAgent.platform.isAndroid(); 5080goog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPHONE : goog.labs.userAgent.platform.isIphone(); 5081goog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPAD : goog.labs.userAgent.platform.isIpad(); 5082goog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPOD : goog.labs.userAgent.platform.isIpod(); 5083goog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD || goog.userAgent.ASSUME_IPOD : goog.labs.userAgent.platform.isIos(); 5084goog.userAgent.determineVersion_ = function() { 5085 var c = "", d = goog.userAgent.getVersionRegexResult_(); 5086 d && (c = d ? d[1] : ""); 5087 return goog.userAgent.IE && (d = goog.userAgent.getDocumentMode_(), null != d && d > parseFloat(c)) ? String(d) : c; 5088}; 5089goog.userAgent.getVersionRegexResult_ = function() { 5090 var c = goog.userAgent.getUserAgentString(); 5091 if (goog.userAgent.GECKO) { 5092 return /rv:([^\);]+)(\)|;)/.exec(c); 5093 } 5094 if (goog.userAgent.EDGE) { 5095 return /Edge\/([\d\.]+)/.exec(c); 5096 } 5097 if (goog.userAgent.IE) { 5098 return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(c); 5099 } 5100 if (goog.userAgent.WEBKIT) { 5101 return /WebKit\/(\S+)/.exec(c); 5102 } 5103 if (goog.userAgent.OPERA) { 5104 return /(?:Version)[ \/]?(\S+)/.exec(c); 5105 } 5106}; 5107goog.userAgent.getDocumentMode_ = function() { 5108 var c = goog.global.document; 5109 return c ? c.documentMode : void 0; 5110}; 5111goog.userAgent.VERSION = goog.userAgent.determineVersion_(); 5112goog.userAgent.compare = function(c, d) { 5113 return goog.string.compareVersions(c, d); 5114}; 5115goog.userAgent.isVersionOrHigherCache_ = {}; 5116goog.userAgent.isVersionOrHigher = function(c) { 5117 return goog.userAgent.ASSUME_ANY_VERSION || goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_, c, function() { 5118 return 0 <= goog.string.compareVersions(goog.userAgent.VERSION, c); 5119 }); 5120}; 5121goog.userAgent.isVersion = goog.userAgent.isVersionOrHigher; 5122goog.userAgent.isDocumentModeOrHigher = function(c) { 5123 return Number(goog.userAgent.DOCUMENT_MODE) >= c; 5124}; 5125goog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher; 5126goog.userAgent.DOCUMENT_MODE = function() { 5127 var c = goog.global.document, d = goog.userAgent.getDocumentMode_(); 5128 if (c && goog.userAgent.IE) { 5129 return d || ("CSS1Compat" == c.compatMode ? parseInt(goog.userAgent.VERSION, 10) : 5); 5130 } 5131}(); 5132goog.debug.LOGGING_ENABLED = goog.DEBUG; 5133goog.debug.FORCE_SLOPPY_STACKS = !1; 5134goog.debug.catchErrors = function(c, d, e) { 5135 e = e || goog.global; 5136 var f = e.onerror, g = !!d; 5137 goog.userAgent.WEBKIT && !goog.userAgent.isVersionOrHigher("535.3") && (g = !g); 5138 e.onerror = function(d, e, l, m, r) { 5139 f && f(d, e, l, m, r); 5140 c({message:d, fileName:e, line:l, lineNumber:l, col:m, error:r}); 5141 return g; 5142 }; 5143}; 5144goog.debug.expose = function(c, d) { 5145 if ("undefined" == typeof c) { 5146 return "undefined"; 5147 } 5148 if (null == c) { 5149 return "NULL"; 5150 } 5151 var e = [], f; 5152 for (f in c) { 5153 if (d || !goog.isFunction(c[f])) { 5154 var g = f + " = ";
5155 try { 5156 g += c[f]; 5157 } catch (h) { 5158 g += "*** " + h + " ***"; 5159 } 5160 e.push(g); 5161 } 5162 } 5163 return e.join("\n"); 5164}; 5165goog.debug.deepExpose = function(c, d) { 5166 var e = [], f = [], g = {}, h = function(c, l) { 5167 var k = l + " "; 5168 try { 5169 if (goog.isDef(c)) { 5170 if (goog.isNull(c)) { 5171 e.push("NULL"); 5172 } else { 5173 if (goog.isString(c)) { 5174 e.push('"' + c.replace(/\n/g, "\n" + l) + '"'); 5175 } else { 5176 if (goog.isFunction(c)) { 5177 e.push(String(c).replace(/\n/g, "\n" + l)); 5178 } else { 5179 if (goog.isObject(c)) { 5180 goog.hasUid(c) || f.push(c); 5181 var r = goog.getUid(c); 5182 if (g[r]) { 5183 e.push("*** reference loop detected (id=" + r + ") ***"); 5184 } else { 5185 g[r] = !0; 5186 e.push("{"); 5187 for (var t in c) { 5188 if (d || !goog.isFunction(c[t])) { 5189 e.push("\n"), e.push(k), e.push(t + " = "), h(c[t], k); 5190 } 5191 } 5192 e.push("\n" + l + "}"); 5193 delete g[r]; 5194 } 5195 } else { 5196 e.push(c); 5197 } 5198 } 5199 } 5200 } 5201 } else { 5202 e.push("undefined"); 5203 } 5204 } catch (x) { 5205 e.push("*** " + x + " ***"); 5206 } 5207 }; 5208 h(c, ""); 5209 for (c = 0; c < f.length; c++) { 5210 goog.removeUid(f[c]); 5211 } 5212 return e.join(""); 5213}; 5214goog.debug.exposeArray = function(c) { 5215 for (var d = [], e = 0; e < c.length; e++) { 5216 goog.isArray(c[e]) ? d.push(goog.debug.exposeArray(c[e])) : d.push(c[e]); 5217 } 5218 return "[ " + d.join(", ") + " ]"; 5219}; 5220goog.debug.normalizeErrorObject = function(c) { 5221 var d = goog.getObjectByName("window.location.href"); 5222 if (goog.isString(c)) { 5223 return {message:c, name:"Unknown error", lineNumber:"Not available", fileName:d, stack:"Not available"}; 5224 } 5225 var e = !1; 5226 try { 5227 var f = c.lineNumber || c.line || "Not available"; 5228 } catch (h) { 5229 f = "Not available", e = !0; 5230 } 5231 try { 5232 var g = c.fileName || c.filename || c.sourceURL || goog.global.$googDebugFname || d; 5233 } catch (h) { 5234 g = "Not available", e = !0; 5235 } 5236 return !e && c.lineNumber && c.fileName && c.stack && c.message && c.name ? c : {message:c.message || "Not available", name:c.name || "UnknownError", lineNumber:f, fileName:g, stack:c.stack || "Not available"}; 5237}; 5238goog.debug.enhanceError = function(c, d) { 5239 c instanceof Error || (c = Error(c), Error.captureStackTrace && Error.captureStackTrace(c, goog.debug.enhanceError)); 5240 c.stack || (c.stack = goog.debug.getStacktrace(goog.debug.enhanceError)); 5241 if (d) { 5242 for (var e = 0; c["message" + e];) { 5243 ++e; 5244 } 5245 c["message" + e] = String(d); 5246 } 5247 return c; 5248}; 5249goog.debug.enhanceErrorWithContext = function(c, d) { 5250 c = goog.debug.enhanceError(c); 5251 if (d) { 5252 for (var e in d) { 5253 goog.debug.errorcontext.addErrorContext(c, e, d[e]); 5254 } 5255 } 5256 return c; 5257}; 5258goog.debug.getStacktraceSimple = function(c) { 5259 if (!goog.debug.FORCE_SLOPPY_STACKS) { 5260 var d = goog.debug.getNativeStackTrace_(goog.debug.getStacktraceSimple); 5261 if (d) { 5262 return d; 5263 } 5264 } 5265 d = []; 5266 for (var e = arguments.callee.caller, f = 0; e && (!c || f < c);) { 5267 d.push(goog.debug.getFunctionName(e)); 5268 d.push("()\n"); 5269 try { 5270 e = e.caller; 5271 } catch (g) { 5272 d.push("[exception trying to get caller]\n"); 5273 break; 5274 } 5275 f++; 5276 if (f >= goog.debug.MAX_STACK_DEPTH) { 5277 d.push("[...long stack...]"); 5278 break; 5279 } 5280 } 5281 c && f >= c ? d.push("[...reached max depth limit...]") : d.push("[end]"); 5282 return d.join(""); 5283}; 5284goog.debug.MAX_STACK_DEPTH = 50; 5285goog.debug.getNativeStackTrace_ = function(c) { 5286 var d = Error(); 5287 if (Error.captureStackTrace) { 5288 return Error.captureStackTrace(d, c), String(d.stack); 5289 } 5290 try { 5291 throw d; 5292 } catch (e) { 5293 d = e; 5294 } 5295 return (c = d.stack) ? String(c) : null; 5296}; 5297goog.debug.getStacktrace = function(c) { 5298 var d; 5299 goog.debug.FORCE_SLOPPY_STACKS || (d = goog.debug.getNativeStackTrace_(c || goog.debug.getStacktrace)); 5300 d || (d = goog.debug.getStacktraceHelper_(c || arguments.callee.caller, [])); 5301 return d; 5302}; 5303goog.debug.getStacktraceHelper_ = function(c, d) { 5304 var e = []; 5305 if (goog.array.contains(d, c)) { 5306 e.push("[...circular reference...]"); 5307 } else { 5308 if (c && d.length < goog.debug.MAX_STACK_DEPTH) { 5309 e.push(goog.debug.getFunctionName(c) + "("); 5310 for (var f = c.arguments, g = 0; f && g < f.length; g++) { 5311 0 < g && e.push(", "); 5312 var h = f[g]; 5313 switch(typeof h) { 5314 case "object": 5315 h = h ? "object" : "null"; 5316 break; 5317 case "string": 5318 break; 5319 case "number": 5320 h = String(h); 5321 break; 5322 case "boolean": 5323 h = h ? "true" : "false"; 5324 break; 5325 case "function": 5326 h = (h = goog.debug.getFunctionName(h)) ? h : "[fn]"; 5327 break; 5328 default: 5329 h = typeof h; 5330 } 5331 40 < h.length && (h = h.substr(0, 40) + "..."); 5332 e.push(h); 5333 } 5334 d.push(c); 5335 e.push(")\n");
5336 try { 5337 e.push(goog.debug.getStacktraceHelper_(c.caller, d)); 5338 } catch (k) { 5339 e.push("[exception trying to get caller]\n"); 5340 } 5341 } else { 5342 c ? e.push("[...long stack...]") : e.push("[end]"); 5343 } 5344 } 5345 return e.join(""); 5346}; 5347goog.debug.setFunctionResolver = function(c) { 5348 goog.debug.fnNameResolver_ = c; 5349}; 5350goog.debug.getFunctionName = function(c) { 5351 if (goog.debug.fnNameCache_[c]) { 5352 return goog.debug.fnNameCache_[c]; 5353 } 5354 if (goog.debug.fnNameResolver_) { 5355 var d = goog.debug.fnNameResolver_(c); 5356 if (d) { 5357 return goog.debug.fnNameCache_[c] = d; 5358 } 5359 } 5360 c = String(c); 5361 goog.debug.fnNameCache_[c] || (d = /function ([^\(]+)/.exec(c), goog.debug.fnNameCache_[c] = d ? d[1] : "[Anonymous]"); 5362 return goog.debug.fnNameCache_[c]; 5363}; 5364goog.debug.makeWhitespaceVisible = function(c) { 5365 return c.replace(/ /g, "[_]").replace(/\f/g, "[f]").replace(/\n/g, "[n]\n").replace(/\r/g, "[r]").replace(/\t/g, "[t]"); 5366}; 5367goog.debug.runtimeType = function(c) { 5368 return c instanceof Function ? c.displayName || c.name || "unknown type name" : c instanceof Object ? c.constructor.displayName || c.constructor.name || Object.prototype.toString.call(c) : null === c ? "null" : typeof c; 5369}; 5370goog.debug.fnNameCache_ = {}; 5371goog.debug.freezeInternal_ = goog.DEBUG && Object.freeze || function(c) { 5372 return c; 5373}; 5374goog.debug.freeze = function(c) { 5375 return goog.debug.freezeInternal_(c); 5376}; 5377goog.events = {}; 5378$jscomp.scope.purify = function(c) { 5379 return c(); 5380}; 5381goog.events.BrowserFeature = {HAS_W3C_BUTTON:!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9), HAS_W3C_EVENT_SUPPORT:!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9), SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE && !goog.userAgent.isVersionOrHigher("9"), HAS_NAVIGATOR_ONLINE_PROPERTY:!goog.userAgent.WEBKIT || goog.userAgent.isVersionOrHigher("528"), HAS_HTML5_NETWORK_EVENT_SUPPORT:goog.userAgent.GECKO && goog.userAgent.isVersionOrHigher("1.9b") || goog.userAgent.IE && 5382goog.userAgent.isVersionOrHigher("8") || goog.userAgent.OPERA && goog.userAgent.isVersionOrHigher("9.5") || goog.userAgent.WEBKIT && goog.userAgent.isVersionOrHigher("528"), HTML5_NETWORK_EVENTS_FIRE_ON_BODY:goog.userAgent.GECKO && !goog.userAgent.isVersionOrHigher("8") || goog.userAgent.IE && !goog.userAgent.isVersionOrHigher("9"), TOUCH_ENABLED:"ontouchstart" in goog.global || !!(goog.global.document && document.documentElement && "ontouchstart" in document.documentElement) || !(!goog.global.navigator || 5383!goog.global.navigator.maxTouchPoints && !goog.global.navigator.msMaxTouchPoints), POINTER_EVENTS:"PointerEvent" in goog.global, MSPOINTER_EVENTS:"MSPointerEvent" in goog.global && !(!goog.global.navigator || !goog.global.navigator.msPointerEnabled), PASSIVE_EVENTS:(0,$jscomp.scope.purify)(function() { 5384 if (!goog.global.addEventListener || !Object.defineProperty) { 5385 return !1; 5386 } 5387 var c = !1, d = Object.defineProperty({}, "passive", {get:function() { 5388 c = !0; 5389 }}); 5390 goog.global.addEventListener("test", goog.nullFunction, d); 5391 goog.global.removeEventListener("test", goog.nullFunction, d); 5392 return c; 5393})}; 5394goog.events.EventId = function(c) { 5395 this.id = c; 5396}; 5397goog.events.EventId.prototype.toString = function() { 5398 return this.id; 5399}; 5400goog.events.Event = function(c, d) { 5401 this.type = c instanceof goog.events.EventId ? String(c) : c; 5402 this.currentTarget = this.target = d; 5403 this.defaultPrevented = this.propagationStopped_ = !1; 5404 this.returnValue_ = !0; 5405}; 5406goog.events.Event.prototype.stopPropagation = function() { 5407 this.propagationStopped_ = !0; 5408}; 5409goog.events.Event.prototype.preventDefault = function() { 5410 this.defaultPrevented = !0; 5411 this.returnValue_ = !1; 5412}; 5413goog.events.Event.stopPropagation = function(c) { 5414 c.stopPropagation(); 5415}; 5416goog.events.Event.preventDefault = function(c) { 5417 c.preventDefault(); 5418}; 5419goog.events.getVendorPrefixedName_ = function(c) { 5420 return goog.userAgent.WEBKIT ? "webkit" + c : goog.userAgent.OPERA ? "o" + c.toLowerCase() : c.toLowerCase(); 5421}; 5422goog.events.EventType = {CLICK:"click", RIGHTCLICK:"rightclick", DBLCLICK:"dblclick", MOUSEDOWN:"mousedown", MOUSEUP:"mouseup", MOUSEOVER:"mouseover", MOUSEOUT:"mouseout", MOUSEMOVE:"mousemove", MOUSEENTER:"mouseenter", MOUSELEAVE:"mouseleave", SELECTIONCHANGE:"selectionchange", SELECTSTART:"selectstart", WHEEL:"wheel", KEYPRESS:"keypress", KEYDOWN:"keydown", KEYUP:"keyup", BLUR:"blur", FOCUS:"focus", DEACTIVATE:"deactivate", FOCUSIN:"focusin", FOCUSOUT:"focusout", CHANGE:"change", RESET:"reset", 5423SELECT:"select", SUBMIT:"submit", INPUT:"input", PROPERTYCHANGE:"propertychange", DRAGSTART:"dragstart", DRAG:"drag", DRAGENTER:"dragenter", DRAGOVER:"dragover", DRAGLEAVE:"dragleave", DROP:"drop", DRAGEND:"dragend", TOUCHSTART:"touchstart", TOUCHMOVE:"touchmove", TOUCHEND:"touchend", TOUCHCANCEL:"touchcancel", BEFOREUNLOAD:"beforeunload", CONSOLEMESSAGE:"consolemessage", CONTEXTMENU:"contextmenu", DEVICEMOTION:"devicemotion", DEVICEORIENTATION:"deviceorientation", DOMCONTENTLOADED:"DOMContentLoaded", 5424ERROR:"error", HELP:"help", LOAD:"load", LOSECAPTURE:"losecapture", ORIENTATIONCHANGE:"orientationchange", READYSTATECHANGE:"readystatechange", RESIZE:"resize", SCROLL:"scroll", UNLOAD:"unload", CANPLAY:"canplay", CANPLAYTHROUGH:"canplaythrough", DURATIONCHANGE:"durationchange", EMPTIED:"emptied", ENDED:"ended", LOADEDDATA:"loadeddata", LOADEDMETADATA:"loadedmetadata", PAUSE:"pause", PLAY:"play", PLAYING:"playing", RATECHANGE:"ratechange", SEEKED:"seeked", SEEKING:"seeking", STALLED:"stalled", SUSPEND:"suspend", 5425TIMEUPDATE:"timeupdate", VOLUMECHANGE:"volumechange", WAITING:"waiting", SOURCEOPEN:"sourceopen", SOURCEENDED:"sourceended", SOURCECLOSED:"sourceclosed", ABORT:"abort", UPDATE:"update", UPDATESTART:"updatestart", UPDATEEND:"updateend", HASHCHANGE:"hashchange", PAGEHIDE:"pagehide", PAGESHOW:"pageshow", POPSTATE:"popstate", COPY:"copy", PASTE:"paste", CUT:"cut", BEFORECOPY:"beforec
5425opy", BEFORECUT:"beforecut", BEFOREPASTE:"beforepaste", ONLINE:"online", OFFLINE:"offline", MESSAGE:"message", CONNECT:"connect", 5426INSTALL:"install", ACTIVATE:"activate", FETCH:"fetch", FOREIGNFETCH:"foreignfetch", MESSAGEERROR:"messageerror", STATECHANGE:"statechange", UPDATEFOUND:"updatefound", CONTROLLERCHANGE:"controllerchange", ANIMATIONSTART:goog.events.getVendorPrefixedName_("AnimationStart"), ANIMATIONEND:goog.events.getVendorPrefixedName_("AnimationEnd"), ANIMATIONITERATION:goog.events.getVendorPrefixedName_("AnimationIteration"), TRANSITIONEND:goog.events.getVendorPrefixedName_("TransitionEnd"), POINTERDOWN:"pointerdown", 5427POINTERUP:"pointerup", POINTERCANCEL:"pointercancel", POINTERMOVE:"pointermove", POINTEROVER:"pointerover", POINTEROUT:"pointerout", POINTERENTER:"pointerenter", POINTERLEAVE:"pointerleave", GOTPOINTERCAPTURE:"gotpointercapture", LOSTPOINTERCAPTURE:"lostpointercapture", MSGESTURECHANGE:"MSGestureChange", MSGESTUREEND:"MSGestureEnd", MSGESTUREHOLD:"MSGestureHold", MSGESTURESTART:"MSGestureStart", MSGESTURETAP:"MSGestureTap", MSGOTPOINTERCAPTURE:"MSGotPointerCapture", MSINERTIASTART:"MSInertiaStart", 5428MSLOSTPOINTERCAPTURE:"MSLostPointerCapture", MSPOINTERCANCEL:"MSPointerCancel", MSPOINTERDOWN:"MSPointerDown", MSPOINTERENTER:"MSPointerEnter", MSPOINTERHOVER:"MSPointerHover", MSPOINTERLEAVE:"MSPointerLeave", MSPOINTERMOVE:"MSPointerMove", MSPOINTEROUT:"MSPointerOut", MSPOINTEROVER:"MSPointerOver", MSPOINTERUP:"MSPointerUp", TEXT:"text", TEXTINPUT:goog.userAgent.IE ? "textinput" : "textInput", COMPOSITIONSTART:"compositionstart", COMPOSITIONUPDATE:"compositionupdate", COMPOSITIONEND:"compositionend", 5429BEFOREINPUT:"beforeinput", EXIT:"exit", LOADABORT:"loadabort", LOADCOMMIT:"loadcommit", LOADREDIRECT:"loadredirect", LOADSTART:"loadstart", LOADSTOP:"loadstop", RESPONSIVE:"responsive", SIZECHANGED:"sizechanged", UNRESPONSIVE:"unresponsive", VISIBILITYCHANGE:"visibilitychange", STORAGE:"storage", DOMSUBTREEMODIFIED:"DOMSubtreeModified", DOMNODEINSERTED:"DOMNodeInserted", DOMNODEREMOVED:"DOMNodeRemoved", DOMNODEREMOVEDFROMDOCUMENT:"DOMNodeRemovedFromDocument", DOMNODEINSERTEDINTODOCUMENT:"DOMNodeInsertedIntoDocument", 5430DOMATTRMODIFIED:"DOMAttrModified", DOMCHARACTERDATAMODIFIED:"DOMCharacterDataModified", BEFOREPRINT:"beforeprint", AFTERPRINT:"afterprint", BEFOREINSTALLPROMPT:"beforeinstallprompt", APPINSTALLED:"appinstalled"}; 5431goog.events.getPointerFallbackEventName_ = function(c, d, e) { 5432 return goog.events.BrowserFeature.POINTER_EVENTS ? c : goog.events.BrowserFeature.MSPOINTER_EVENTS ? d : e; 5433}; 5434goog.events.PointerFallbackEventType = {POINTERDOWN:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERDOWN, goog.events.EventType.MSPOINTERDOWN, goog.events.EventType.MOUSEDOWN), POINTERUP:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERUP, goog.events.EventType.MSPOINTERUP, goog.events.EventType.MOUSEUP), POINTERCANCEL:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERCANCEL, goog.events.EventType.MSPOINTERCANCEL, "mousecancel"), POINTERMOVE:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERMOVE, 5435goog.events.EventType.MSPOINTERMOVE, goog.events.EventType.MOUSEMOVE), POINTEROVER:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTEROVER, goog.events.EventType.MSPOINTEROVER, goog.events.EventType.MOUSEOVER), POINTEROUT:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTEROUT, goog.events.EventType.MSPOINTEROUT, goog.events.EventType.MOUSEOUT), POINTERENTER:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERENTER, goog.events.EventType.MSPOINTERENTER, 5436goog.events.EventType.MOUSEENTER), POINTERLEAVE:goog.events.getPointerFallbackEventName_(goog.events.EventType.POINTERLEAVE, goog.events.EventType.MSPOINTERLEAVE, goog.events.EventType.MOUSELEAVE)}; 5437goog.events.BrowserEvent = function(c, d) { 5438 goog.events.Event.call(this, c ? c.type : ""); 5439 this.relatedTarget = this.currentTarget = this.target = null; 5440 this.button = this.screenY = this.screenX = this.clientY = this.clientX = this.offsetY = this.offsetX = 0; 5441 this.key = ""; 5442 this.charCode = this.keyCode = 0; 5443 this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1; 5444 this.state = null; 5445 this.platformModifierKey = !1; 5446 this.pointerId = 0; 5447 this.pointerType = ""; 5448 this.event_ = null; 5449 c && this.init(c, d); 5450}; 5451goog.inherits(goog.events.BrowserEvent, goog.events.Event); 5452goog.events.BrowserEvent.MouseButton = {LEFT:0, MIDDLE:1, RIGHT:2}; 5453goog.events.BrowserEvent.PointerType = {MOUSE:"mouse", PEN:"pen", TOUCH:"touch"}; 5454goog.events.BrowserEvent.IEButtonMap = goog.debug.freeze([1, 4, 2]); 5455goog.events.BrowserEvent.IE_BUTTON_MAP = goog.events.BrowserEvent.IEButtonMap; 5456goog.events.BrowserEvent.IE_POINTER_TYPE_MAP = goog.debug.freeze({2:goog.events.BrowserEvent.PointerType.TOUCH, 3:goog.events.BrowserEvent.PointerType.PEN, 4:goog.events.BrowserEvent.PointerType.MOUSE}); 5457goog.events.BrowserEvent.prototype.init = function(c, d) { 5458 var e = this.type = c.type, f = c.changedTouches ? c.changedTouches[0] : null; 5459 this.target = c.target || c.srcElement; 5460 this.currentTarget = d; 5461 (d = c.relatedTarget) ? goog.userAgent.GECKO && (goog.reflect.canAccessProperty(d, "nodeName") || (d = null)) : e == goog.events.EventType.MOUSEOVER ? d = c.fromElement : e == goog.events.EventType.MOUSEOUT && (d = c.toElement); 5462 this.relatedTarget = d; 5463 goog.isNull(f) ? (this.offsetX = goog.userAgent.WEBKIT || void 0 !== c.offsetX ? c.offsetX : c.layerX, this.offsetY = goog.userAgent.WEBKIT || void 0 !== c.offsetY ? c.offsetY : c.layerY, this.clientX = void 0 !== c.clientX ? c.clientX : c.pageX, this.clientY = void 0 !== c.clientY ? c.clientY : c.pageY, this.screenX = c.screenX || 0, this.screenY = c.screenY || 0) : (this.clientX = void 0 !== f.clientX ? f.clientX : f.pageX, this.clientY = void 0 !== f.clientY ? f.clientY : f.pageY, this.screenX = 5464 f.screenX || 0, this.screenY = f.screenY || 0); 5465 this.button = c.button; 5466 this.keyCode = c.keyCode || 0; 5467 this.key = c.key || "";
5468 this.charCode = c.charCode || ("keypress" == e ? c.keyCode : 0); 5469 this.ctrlKey = c.ctrlKey; 5470 this.altKey = c.altKey; 5471 this.shiftKey = c.shiftKey; 5472 this.metaKey = c.metaKey; 5473 this.platformModifierKey = goog.userAgent.MAC ? c.metaKey : c.ctrlKey; 5474 this.pointerId = c.pointerId || 0; 5475 this.pointerType = goog.events.BrowserEvent.getPointerType_(c); 5476 this.state = c.state; 5477 this.event_ = c; 5478 c.defaultPrevented && this.preventDefault(); 5479}; 5480goog.events.BrowserEvent.prototype.isButton = function(c) { 5481 return goog.events.BrowserFeature.HAS_W3C_BUTTON ? this.event_.button == c : "click" == this.type ? c == goog.events.BrowserEvent.MouseButton.LEFT : !!(this.event_.button & goog.events.BrowserEvent.IE_BUTTON_MAP[c]); 5482}; 5483goog.events.BrowserEvent.prototype.isMouseActionButton = function() { 5484 return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) && !(goog.userAgent.WEBKIT && goog.userAgent.MAC && this.ctrlKey); 5485}; 5486goog.events.BrowserEvent.prototype.stopPropagation = function() { 5487 goog.events.BrowserEvent.superClass_.stopPropagation.call(this); 5488 this.event_.stopPropagation ? this.event_.stopPropagation() : this.event_.cancelBubble = !0; 5489}; 5490goog.events.BrowserEvent.prototype.preventDefault = function() { 5491 goog.events.BrowserEvent.superClass_.preventDefault.call(this); 5492 var c = this.event_; 5493 if (c.preventDefault) { 5494 c.preventDefault(); 5495 } else { 5496 if (c.returnValue = !1, goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT) { 5497 try { 5498 if (c.ctrlKey || 112 <= c.keyCode && 123 >= c.keyCode) { 5499 c.keyCode = -1; 5500 } 5501 } catch (d) { 5502 } 5503 } 5504 } 5505}; 5506goog.events.BrowserEvent.prototype.getBrowserEvent = function() { 5507 return this.event_; 5508}; 5509goog.events.BrowserEvent.getPointerType_ = function(c) { 5510 return goog.isString(c.pointerType) ? c.pointerType : goog.events.BrowserEvent.IE_POINTER_TYPE_MAP[c.pointerType] || ""; 5511}; 5512goog.events.Listenable = function() { 5513}; 5514goog.events.Listenable.IMPLEMENTED_BY_PROP = "closure_listenable_" + (1e6 * Math.random() | 0); 5515goog.events.Listenable.addImplementation = function(c) { 5516 c.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP] = !0; 5517}; 5518goog.events.Listenable.isImplementedBy = function(c) { 5519 return !(!c || !c[goog.events.Listenable.IMPLEMENTED_BY_PROP]); 5520}; 5521goog.events.ListenableKey = function() { 5522}; 5523goog.events.ListenableKey.counter_ = 0; 5524goog.events.ListenableKey.reserveKey = function() { 5525 return ++goog.events.ListenableKey.counter_; 5526}; 5527goog.events.Listener = function(c, d, e, f, g, h) { 5528 goog.events.Listener.ENABLE_MONITORING && (this.creationStack = Error().stack); 5529 this.listener = c; 5530 this.proxy = d; 5531 this.src = e; 5532 this.type = f; 5533 this.capture = !!g; 5534 this.handler = h; 5535 this.key = goog.events.ListenableKey.reserveKey(); 5536 this.removed = this.callOnce = !1; 5537}; 5538goog.events.Listener.ENABLE_MONITORING = !1; 5539goog.events.Listener.prototype.markAsRemoved = function() { 5540 this.removed = !0; 5541 this.handler = this.src = this.proxy = this.listener = null; 5542}; 5543goog.events.ListenerMap = function(c) { 5544 this.src = c; 5545 this.listeners = {}; 5546 this.typeCount_ = 0; 5547}; 5548goog.events.ListenerMap.prototype.getTypeCount = function() { 5549 return this.typeCount_; 5550}; 5551goog.events.ListenerMap.prototype.getListenerCount = function() { 5552 var c = 0, d; 5553 for (d in this.listeners) { 5554 c += this.listeners[d].length; 5555 } 5556 return c; 5557}; 5558goog.events.ListenerMap.prototype.add = function(c, d, e, f, g) { 5559 var h = c.toString(); 5560 c = this.listeners[h]; 5561 c || (c = this.listeners[h] = [], this.typeCount_++); 5562 var k = goog.events.ListenerMap.findListenerIndex_(c, d, f, g); 5563 -1 < k ? (d = c[k], e || (d.callOnce = !1)) : (d = new goog.events.Listener(d, null, this.src, h, !!f, g), d.callOnce = e, c.push(d)); 5564 return d; 5565}; 5566goog.events.ListenerMap.prototype.remove = function(c, d, e, f) { 5567 c = c.toString(); 5568 if (!(c in this.listeners)) { 5569 return !1; 5570 } 5571 var g = this.listeners[c]; 5572 d = goog.events.ListenerMap.findListenerIndex_(g, d, e, f); 5573 return -1 < d ? (g[d].markAsRemoved(), goog.array.removeAt(g, d), 0 == g.length && (delete this.listeners[c], this.typeCount_--), !0) : !1; 5574}; 5575goog.events.ListenerMap.prototype.removeByKey = function(c) { 5576 var d = c.type; 5577 if (!(d in this.listeners)) { 5578 return !1; 5579 } 5580 var e = goog.array.remove(this.listeners[d], c); 5581 e && (c.markAsRemoved(), 0 == this.listeners[d].length && (delete this.listeners[d], this.typeCount_--)); 5582 return e; 5583}; 5584goog.events.ListenerMap.prototype.removeAll = function(c) { 5585 c = c && c.toString(); 5586 var d = 0, e; 5587 for (e in this.listeners) { 5588 if (!c || e == c) { 5589 for (var f = this.listeners[e], g = 0; g < f.length; g++) { 5590 ++d, f[g].markAsRemoved(); 5591 } 5592 delete this.listeners[e]; 5593 this.typeCount_--; 5594 } 5595 } 5596 return d; 5597}; 5598goog.events.ListenerMap.prototype.getListeners = function(c, d) { 5599 c = this.listeners[c.toString()]; 5600 var e = []; 5601 if (c) { 5602 for (var f = 0; f < c.length; ++f) { 5603 var g = c[f]; 5604 g.capture == d && e.push(g); 5605 } 5606 } 5607 return e; 5608}; 5609goog.events.ListenerMap.prototype.getListener = function(c, d, e, f) { 5610 c = this.listeners[c.toString()]; 5611 var g = -1; 5612 c && (g = goog.events.ListenerMap.findListenerIndex_(c, d, e, f)); 5613 return -1 < g ? c[g] : null; 5614}; 5615goog.events.ListenerMap.prototype.hasListener = function(c, d) { 5616 var e = goog.isDef(c), f = e ? c.toString() : "", g = goog.isDef(d); 5617 return goog.object.some(this.listeners, function(c, k) { 5618 for (k = 0; k < c.length; ++k) { 5619 if (!(e && c[k].type != f || g && c[k].capture != d)) { 5620 return !0; 5621 } 5622 } 5623 return !1; 5624 }); 5625}; 5626goog.events.ListenerMap.findListenerIndex_ = function(c, d, e, f) { 5627 for (var g = 0; g < c.length; ++g) { 5628 var h = c[g]; 5629 if (!h.removed && h.listener == d && h.capture == !!e && h.handler == f) { 5630 return g; 5631 } 5632 } 5633 return -1; 5634}; 5635goog.events.LISTENER_MAP_PROP_ = "closure_lm_" + (1e6 * Math.random() | 0); 5636goog.events.onString_ = "on"; 5637goog.events.onStringMap_ = {}; 5638goog.events.CaptureSimulationMode = {OFF_AND_FAIL:0, OFF_AND_SILENT:1, ON:2}; 5639goog.events.CAPTURE_SIMULATION_MODE = 2; 5640goog.events.listenerCountEstimate_ = 0; 5641goog.events.listen = function(c, d, e, f, g) { 5642 if (f && f.once) { 5643 return goog.events.listenOnce(c, d, e, f, g); 5644 } 5645 if (goog.isArray(d)) { 5646 for (var h = 0; h < d.length; h++) { 5647 goog.events.listen(c, d[h], e, f, g); 5648 } 5649 return null; 5650 } 5651 e = goog.events.wrapListener(e); 5652 return goog.events.Listenable.isImplementedBy(c) ? (f = goog.isObject(f) ? !!f.capture : !!f, c.listen(d, e, f, g)) : goog.events.listen_(c, d, e, !1, f, g); 5653}; 5654goog.events.listen_ = function(c, d, e, f, g, h) { 5655 if (!d) { 5656 throw Error("Invalid event type"); 5657 } 5658 var k = goog.isObject(g) ? !!g.capture : !!g; 5659 if (k && !goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) { 5660 if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.OFF_AND_FAIL) { 5661 return goog.asserts.fail("Can not register capture listener in IE8-."), null; 5662 } 5663 if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.OFF_AND_SILENT) { 5664 return null; 5665 } 5666 } 5667 var l = goog.events.getListenerMap_(c); 5668 l || (c[goog.events.LISTENER_MAP_PROP_] = l = new goog.events.ListenerMap(c)); 5669 e = l.add(d, e, f, k, h); 5670 if (e.proxy) { 5671 return e; 5672 } 5673 f = goog.events.getProxy(); 5674 e.proxy = f; 5675 f.src = c; 5676 f.listener = e; 5677 if (c.addEventListener) { 5678 goog.events.BrowserFeature.PASSIVE_EVENTS || (g = k), void 0 === g && (g = !1), c.addEventListener(d.toString(), f, g); 5679 } else { 5680 if (c.attachEvent) { 5681 c.attachEvent(goog.events.getOnString_(d.toString()), f); 5682 } else { 5683 if (c.addListener && c.removeListener) { 5684 goog.asserts.assert("change" === d, "MediaQueryList only has a change event"), c.addListener(f); 5685 } else { 5686 throw Error("addEventListener and attachEvent are unavailable."); 5687 } 5688 } 5689 } 5690 goog.events.listenerCountEstimate_++; 5691 return e; 5692}; 5693goog.events.getProxy = function() { 5694 var c = goog.events.handleBrowserEvent_, d = goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT ? function(e) { 5695 return c.call(d.src, d.listener, e); 5696 } : function(e) { 5697 e = c.call(d.src, d.listener, e); 5698 if (!e) { 5699 return e; 5700 } 5701 }; 5702 return d; 5703}; 5704goog.events.listenOnce = function(c, d, e, f, g) { 5705 if (goog.isArray(d)) { 5706 for (var h = 0; h < d.length; h++) { 5707 goog.events.listenOnce(c, d[h], e, f, g); 5708 } 5709 return null; 5710 } 5711 e = goog.events.wrapListener(e); 5712 return goog.events.Listenable.isImplementedBy(c) ? (f = goog.isObject(f) ? !!f.capture : !!f, c.listenOnce(d, e, f, g)) : goog.events.listen_(c, d, e, !0, f, g); 5713}; 5714goog.events.listenWithWrapper = function(c, d, e, f, g) { 5715 d.listen(c, e, f, g); 5716}; 5717goog.events.unlisten = function(c, d, e, f, g) { 5718 if (goog.isArray(d)) { 5719 for (var h = 0; h < d.length; h++) { 5720 goog.events.unlisten(c, d[h], e, f, g); 5721 } 5722 return null; 5723 } 5724 f = goog.isObject(f) ? !!f.capture : !!f; 5725 e = goog.events.wrapListener(e); 5726 if (goog.events.Listenable.isImplementedBy(c)) { 5727 return c.unlisten(d, e, f, g); 5728 } 5729 if (!c) { 5730 return !1; 5731 } 5732 if (c = goog.events.getListenerMap_(c)) { 5733 if (d = c.getListener(d, e, f, g)) { 5734 return goog.events.unlistenByKey(d); 5735 } 5736 } 5737 return !1; 5738}; 5739goog.events.unlistenByKey = function(c) { 5740 if (goog.isNumber(c) || !c || c.removed) { 5741 return !1; 5742 } 5743 var d = c.src; 5744 if (goog.events.Listenable.isImplementedBy(d)) { 5745 return d.unlistenByKey(c); 5746 } 5747 var e = c.type, f = c.proxy; 5748 d.removeEventListener ? d.removeEventListener(e, f, c.capture) : d.detachEvent ? d.detachEvent(goog.events.getOnString_(e), f) : d.addListener && d.removeListener && d.removeListener(f); 5749 goog.events.listenerCountEstimate_--; 5750 (e = goog.events.getListenerMap_(d)) ? (e.removeByKey(c), 0 == e.getTypeCount() && (e.src = null, d[goog.events.LISTENER_MAP_PROP_] = null)) : c.markAsRemoved(); 5751 return !0; 5752}; 5753goog.events.unlistenWithWrapper = function(c, d, e, f, g) { 5754 d.unlisten(c, e, f, g); 5755}; 5756goog.events.removeAll = function(c, d) { 5757 if (!c) { 5758 return 0; 5759 } 5760 if (goog.events.Listenable.isImplementedBy(c)) { 5761 return c.removeAllListeners(d); 5762 } 5763 c = goog.events.getListenerMap_(c); 5764 if (!c) { 5765 return 0; 5766 } 5767 var e = 0; 5768 d = d && d.toString(); 5769 for (var f in c.listeners) { 5770 if (!d || f == d) { 5771 for (var g = c.listeners[f].concat(), h = 0; h < g.length; ++h) { 5772 goog.events.unlistenByKey(g[h]) && ++e; 5773 } 5774 } 5775 } 5776 return e; 5777}; 5778goog.events.getListeners = function(c, d, e) { 5779 return goog.events.Listenable.isImplementedBy(c) ? c.getListeners(d, e) : c ? (c = goog.events.getListenerMap_(c)) ? c.getListeners(d, e) : [] : []; 5780}; 5781goog.events.getListener = function(c, d, e, f, g) { 5782 e = goog.events.wrapListener(e); 5783 f = !!f; 5784 return goog.events.Listenable.isImplementedBy(c) ? c.getListener(d, e, f, g) : c ? (c = goog.events.getListenerMap_(c)) ? c.getListener(d, e, f, g) : null : null; 5785}; 5786goog.events.hasListener = function(c, d, e) { 5787 if (goog.events.Listenable.isImplementedBy(c)) { 5788 return c.hasListener(d, e); 5789 } 5790 c = goog.events.getListenerMap_(c); 5791 return !!c && c.hasListener(d, e); 5792}; 5793goog.events.expose = function(c) { 5794 var d = [], e; 5795 for (e in c) { 5796 c[e] && c[e].id ? d.push(e + " = " + c[e] + " (" + c[e].id + ")") : d.push(e + " = " + c[e]); 5797 } 5798 return d.join("\n"); 5799}; 5800goog.events.getOnString_ = function(c) { 5801 return c in goog.events.onStringMap_ ? goog.events.onStringMap_[c] : goog.events.onStringMap_[c] = goog.events.onString_ + c; 5802}; 5803goog.events.fireListeners = function(c, d, e, f) { 5804 return goog.events.Listenable.isImplementedBy(c) ? c.fireListeners(d, e, f) : goog.events.fireListeners_(c, d, e, f); 5805}; 5806goog.events.fireListeners_ = function(c, d, e, f) { 5807 var g = !0; 5808 if (c = goog.events.getListenerMap_(c)) { 5809 if (d = c.listeners[d.toString()]) { 5810 for (d = d.concat(), c = 0; c < d.length; c++) { 5811 var h = d[c]; 5812 h && h.capture == e && !h.removed && (h = goog.events.fireListener(h, f), g = g && !1 !== h); 5813 } 5814 } 5815 } 5816 return g; 5817}; 5818goog.events.fireListener = function(c, d) { 5819 var e = c.listener, f = c.handler || c.src; 5820 c.callOnce && goog.events.unlistenByKey(c); 5821 return e.call(f, d); 5822}; 5823goog.events.getTotalListenerCount = function() { 5824 return goog.events.listenerCountEstimate_; 5825}; 5826goog.events.dispatchEvent = function(c, d) { 5827 goog.asserts.assert(goog.events.Listenable.isImplementedBy(c), "Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance."); 5828 return c.dispatchEvent(d); 5829}; 5830goog.events.protectBrowserEventEntryPoint = function(c) { 5831 goog.events.handleBrowserEvent_ = c.protectEntryPoint(goog.events.handleBrowserEvent_); 5832}; 5833goog.events.handleBrowserEvent_ = function(c, d) { 5834 if (c.removed) { 5835 return !0; 5836 } 5837 if (!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) { 5838 var e = d || goog.getObjectByName("window.event"); 5839 d = new goog.events.BrowserEvent(e, this); 5840 var f = !0; 5841 if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.ON) { 5842 if (!goog.events.isMarkedIeEvent_(e)) { 5843 goog.events.markIeEvent_(e); 5844 e = []; 5845 for (var g = d.currentTarget; g; g = g.parentNode) { 5846 e.push(g); 5847 } 5848 c = c.type; 5849 for (g = e.length - 1; !d.propagationStopped_ && 0 <= g; g--) { 5850 d.currentTarget = e[g]; 5851 var h = goog.events.fireListeners_(e[g], c, !0, d); 5852 f = f && h; 5853 } 5854 for (g = 0; !d.propagationStopped_ && g < e.length; g++) { 5855 d.currentTarget = e[g], h = goog.events.fireListeners_(e[g], c, !1, d), f = f && h; 5856 } 5857 } 5858 } else { 5859 f = goog.events.fireListener(c, d); 5860 } 5861 return f; 5862 } 5863 return goog.events.fireListener(c, new goog.events.BrowserEvent(d, this)); 5864}; 5865goog.events.markIeEvent_ = function(c) { 5866 var d = !1; 5867 if (0 == c.keyCode) { 5868 try { 5869 c.keyCode = -1; 5870 return; 5871 } catch (e) { 5872 d = !0; 5873 } 5874 } 5875 if (d || void 0 == c.returnValue) { 5876 c.returnValue = !0; 5877 } 5878}; 5879goog.events.isMarkedIeEvent_ = function(c) { 5880 return 0 > c.keyCode || void 0 != c.returnValue; 5881}; 5882goog.events.uniqueIdCounter_ = 0; 5883goog.events.getUniqueId = function(c) { 5884 return c + "_" + goog.events.uniqueIdCounter_++; 5885}; 5886goog.events.getListenerMap_ = function(c) { 5887 c = c[goog.events.LISTENER_MAP_PROP_]; 5888 return c instanceof goog.events.ListenerMap ? c : null; 5889}; 5890goog.events.LISTENER_WRAPPER_PROP_ = "__closure_events_fn_" + (1e9 * Math.random() >>> 0); 5891goog.events.wrapListener = function(c) { 5892 goog.asserts.assert(c, "Listener can not be null."); 5893 if (goog.isFunction(c)) { 5894 return c; 5895 } 5896 goog.asserts.assert(c.handleEvent, "An object listener must have handleEvent method."); 5897 c[goog.events.LISTENER_WRAPPER_PROP_] || (c[goog.events.LISTENER_WRAPPER_PROP_] = function(d) { 5898 return c.handleEvent(d); 5899 }); 5900 return c[goog.events.LISTENER_WRAPPER_PROP_]; 5901}; 5902goog.debug.entryPointRegistry.register(function(c) { 5903 goog.events.handleBrowserEvent_ = c(goog.events.handleBrowserEvent_); 5904}); 5905goog.events.EventTarget = function() { 5906 goog.Disposable.call(this); 5907 this.eventTargetListeners_ = new goog.events.ListenerMap(this); 5908 this.actualEventTarget_ = this; 5909 this.parentEventTarget_ = null; 5910}; 5911goog.inherits(goog.events.EventTarget, goog.Disposable); 5912goog.events.Listenable.addImplementation(goog.events.EventTarget); 5913goog.events.EventTarget.MAX_ANCESTORS_ = 1000; 5914goog.events.EventTarget.prototype.getParentEventTarget = function() { 5915 return this.parentEventTarget_; 5916}; 5917goog.events.EventTarget.prototype.setParentEventTarget = function(c) { 5918 this.parentEventTarget_ = c; 5919}; 5920goog.events.EventTarget.prototype.addEventListener = function(c, d, e, f) { 5921 goog.events.listen(this, c, d, e, f); 5922}; 5923goog.events.EventTarget.prototype.removeEventListener = function(c, d, e, f) { 5924 goog.events.unlisten(this, c, d, e, f); 5925}; 5926goog.events.EventTarget.prototype.dispatchEvent = function(c) { 5927 this.assertInitialized_(); 5928 var d = this.getParentEventTarget(); 5929 if (d) { 5930 var e = []; 5931 for (var f = 1; d; d = d.getParentEventTarget()) { 5932 e.push(d), goog.asserts.assert(++f < goog.events.EventTarget.MAX_ANCESTORS_, "infinite loop"); 5933 } 5934 } 5935 return goog.events.EventTarget.dispatchEventInternal_(this.actualEventTarget_, c, e); 5936}; 5937goog.events.EventTarget.prototype.disposeInternal = func
5937tion() { 5938 goog.events.EventTarget.superClass_.disposeInternal.call(this); 5939 this.removeAllListeners(); 5940 this.parentEventTarget_ = null; 5941}; 5942goog.events.EventTarget.prototype.listen = function(c, d, e, f) { 5943 this.assertInitialized_(); 5944 return this.eventTargetListeners_.add(String(c), d, !1, e, f); 5945}; 5946goog.events.EventTarget.prototype.listenOnce = function(c, d, e, f) { 5947 return this.eventTargetListeners_.add(String(c), d, !0, e, f); 5948}; 5949goog.events.EventTarget.prototype.unlisten = function(c, d, e, f) { 5950 return this.eventTargetListeners_.remove(String(c), d, e, f); 5951}; 5952goog.events.EventTarget.prototype.unlistenByKey = function(c) { 5953 return this.eventTargetListeners_.removeByKey(c); 5954}; 5955goog.events.EventTarget.prototype.removeAllListeners = function(c) { 5956 return this.eventTargetListeners_ ? this.eventTargetListeners_.removeAll(c) : 0; 5957}; 5958goog.events.EventTarget.prototype.fireListeners = function(c, d, e) { 5959 c = this.eventTargetListeners_.listeners[String(c)]; 5960 if (!c) { 5961 return !0; 5962 } 5963 c = c.concat(); 5964 for (var f = !0, g = 0; g < c.length; ++g) { 5965 var h = c[g]; 5966 if (h && !h.removed && h.capture == d) { 5967 var k = h.listener, l = h.handler || h.src; 5968 h.callOnce && this.unlistenByKey(h); 5969 f = !1 !== k.call(l, e) && f; 5970 } 5971 } 5972 return f && 0 != e.returnValue_; 5973}; 5974goog.events.EventTarget.prototype.getListeners = function(c, d) { 5975 return this.eventTargetListeners_.getListeners(String(c), d); 5976}; 5977goog.events.EventTarget.prototype.getListener = function(c, d, e, f) { 5978 return this.eventTargetListeners_.getListener(String(c), d, e, f); 5979}; 5980goog.events.EventTarget.prototype.hasListener = function(c, d) { 5981 c = goog.isDef(c) ? String(c) : void 0; 5982 return this.eventTargetListeners_.hasListener(c, d); 5983}; 5984goog.events.EventTarget.prototype.setTargetForTesting = function(c) { 5985 this.actualEventTarget_ = c; 5986}; 5987goog.events.EventTarget.prototype.assertInitialized_ = function() { 5988 goog.asserts.assert(this.eventTargetListeners_, "Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?"); 5989}; 5990goog.events.EventTarget.dispatchEventInternal_ = function(c, d, e) { 5991 var f = d.type || d; 5992 if (goog.isString(d)) { 5993 d = new goog.events.Event(d, c); 5994 } else { 5995 if (d instanceof goog.events.Event) { 5996 d.target = d.target || c; 5997 } else { 5998 var g = d; 5999 d = new goog.events.Event(f, c); 6000 goog.object.extend(d, g); 6001 } 6002 } 6003 g = !0; 6004 if (e) { 6005 for (var h = e.length - 1; !d.propagationStopped_ && 0 <= h; h--) { 6006 var k = d.currentTarget = e[h]; 6007 g = k.fireListeners(f, !0, d) && g; 6008 } 6009 } 6010 d.propagationStopped_ || (k = d.currentTarget = c, g = k.fireListeners(f, !0, d) && g, d.propagationStopped_ || (g = k.fireListeners(f, !1, d) && g)); 6011 if (e) { 6012 for (h = 0; !d.propagationStopped_ && h < e.length; h++) { 6013 k = d.currentTarget = e[h], g = k.fireListeners(f, !1, d) && g; 6014 } 6015 } 6016 return g; 6017}; 6018goog.Timer = function(c, d) { 6019 goog.events.EventTarget.call(this); 6020 this.interval_ = c || 1; 6021 this.timerObject_ = d || goog.Timer.defaultTimerObject; 6022 this.boundTick_ = goog.bind(this.tick_, this); 6023 this.last_ = goog.now(); 6024}; 6025goog.inherits(goog.Timer, goog.events.EventTarget); 6026goog.Timer.MAX_TIMEOUT_ = 2147483647; 6027goog.Timer.INVALID_TIMEOUT_ID_ = -1; 6028goog.Timer.prototype.enabled = !1; 6029goog.Timer.defaultTimerObject = goog.global; 6030goog.Timer.intervalScale = 0.8; 6031goog.Timer.prototype.timer_ = null; 6032goog.Timer.prototype.getInterval = function() { 6033 return this.interval_; 6034}; 6035goog.Timer.prototype.setInterval = function(c) { 6036 this.interval_ = c; 6037 this.timer_ && this.enabled ? (this.stop(), this.start()) : this.timer_ && this.stop(); 6038}; 6039goog.Timer.prototype.tick_ = function() { 6040 if (this.enabled) { 6041 var c = goog.now() - this.last_; 6042 0 < c && c < this.interval_ * goog.Timer.intervalScale ? this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_ - c) : (this.timer_ && (this.timerObject_.clearTimeout(this.timer_), this.timer_ = null), this.dispatchTick(), this.enabled && (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now())); 6043 } 6044}; 6045goog.Timer.prototype.dispatchTick = function() { 6046 this.dispatchEvent(goog.Timer.TICK); 6047}; 6048goog.Timer.prototype.start = function() { 6049 this.enabled = !0; 6050 this.timer_ || (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now()); 6051}; 6052goog.Timer.prototype.stop = function() { 6053 this.enabled = !1; 6054 this.timer_ && (this.timerObject_.clearTimeout(this.timer_), this.timer_ = null); 6055}; 6056goog.Timer.prototype.disposeInternal = function() { 6057 goog.Timer.superClass_.disposeInternal.call(this); 6058 this.stop(); 6059 delete this.timerObject_; 6060}; 6061goog.Timer.TICK = "tick"; 6062goog.Timer.callOnce = function(c, d, e) { 6063 if (goog.isFunction(c)) { 6064 e && (c = goog.bind(c, e)); 6065 } else { 6066 if (c && "function" == typeof c.handleEvent) { 6067 c = goog.bind(c.handleEvent, c); 6068 } else { 6069 throw Error("Invalid listener argument"); 6070 } 6071 } 6072 return Number(d) > goog.Timer.MAX_TIMEOUT_ ? goog.Timer.INVALID_TIMEOUT_ID_ : goog.Timer.defaultTimerObject.setTimeout(c, d || 0); 6073}; 6074goog.Timer.clear = function(c) { 6075 goog.Timer.defaultTimerObject.clearTimeout(c); 6076}; 6077goog.Timer.promise = function(c, d) { 6078 var e = null; 6079 return (new goog.Promise(function(f, g) { 6080 e = goog.Timer.callOnce(function() { 6081 f(d); 6082 }, c); 6083 e == goog.Timer.INVALID_TIMEOUT_ID_ && g(Error("Failed to schedule timer.")); 6084 })).thenCatch(function(c) { 6085 goog.Timer.clear(e); 6086 throw c; 6087 }); 6088}; 6089goog.json = {}; 6090goog.json.USE_NATIVE_JSON = !1; 6091goog.json.TRY_NATIVE_JSON = !1; 6092goog.json.isValid = function(c) { 6093 return /^\s*$/.test(c) ? !1 : /^[\],:{}\s\u2028\u2029]*$/.test(c.replace(/\\["\\\/bfnrtu]/g, "@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g, "]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g, "")); 6094}; 6095goog.json.errorLogger_ = goog.nullFunction; 6096goog.json.setErrorLogger = function(c) { 6097 goog.json.errorLogger_ = c; 6098}; 6099goog.json.parse = goog.json.USE_NATIVE_JSON ? goog.global.JSON.parse : function(c) { 6100 if (goog.json.TRY_NATIVE_JSON) { 6101 try { 6102 return goog.global.JSON.parse(c); 6103 } catch (f) { 6104 var d = f; 6105 } 6106 } 6107 c = String(c); 6108 if (goog.json.isValid(c)) { 6109 try { 6110 var e = eval("(" + c + ")"); 6111 d && goog.json.errorLogger_("Invalid JSON: " + c, d); 6112 return e; 6113 } catch (f) { 6114 } 6115 } 6116 throw Error("Invalid JSON string: " + c); 6117}; 6118goog.json.serialize = goog.json.USE_NATIVE_JSON ? goog.global.JSON.stringify : function(c, d) { 6119 return (new goog.json.Serializer(d)).serialize(c); 6120}; 6121goog.json.Serializer = function(c) { 6122 this.replacer_ = c; 6123}; 6124goog.json.Serializer.prototype.serialize = function(c) { 6125 var d = []; 6126 this.serializeInternal(c, d); 6127 return d.join(""); 6128}; 6129goog.json.Serializer.prototype.serializeInternal = function(c, d) { 6130 if (null == c) { 6131 d.push("null"); 6132 } else { 6133 if ("object" == typeof c) { 6134 if (goog.isArray(c)) { 6135 this.serializeArray(c, d); 6136 return; 6137 } 6138 if (c instanceof String || c instanceof Number || c instanceof Boolean) { 6139 c = c.valueOf(); 6140 } else { 6141 this.serializeObject_(c, d); 6142 return; 6143 } 6144 } 6145 switch(typeof c) { 6146 case "string": 6147 this.serializeString_(c, d); 6148 break; 6149 case "number": 6150 this.serializeNumber_(c, d); 6151 break; 6152 case "boolean": 6153 d.push(String(c)); 6154 break; 6155 case "function": 6156 d.push("null"); 6157 break; 6158 default: 6159 throw Error("Unknown type: " + typeof c); 6160 } 6161 } 6162}; 6163goog.json.Serializer.charToJsonCharCache_ = {'"':'\\"', "\\":"\\\\", "/":"\\/", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\u000b"}; 6164goog.json.Serializer.charsToReplace_ = /\uffff/.test("\uffff") ? /[\\"\x00-\x1f\x7f-\uffff]/g : /[\\"\x00-\x1f\x7f-\xff]/g; 6165goog.json.Serializer.prototype.serializeString_ = function(c, d) { 6166 d.push('"', c.replace(goog.json.Serializer.charsToReplace_, function(c) { 6167 var d = goog.json.Serializer.charToJsonCharCache_[c]; 6168 d || (d = "\\u" + (c.charCodeAt(0) | 65536).toString(16).substr(1), goog.json.Serializer.charToJsonCharCache_[c] = d); 6169 return d; 6170 }), '"'); 6171}; 6172goog.json.Serializer.prototype.serializeNumber_ = function(c, d) { 6173 d.push(isFinite(c) && !isNaN(c) ? String(c) : "null"); 6174}; 6175goog.json.Serializer.prototype.serializeArray = function(c, d) { 6176 var e = c.length; 6177 d.push("["); 6178 for (var f = "", g = 0; g < e; g++) { 6179 d.push(f), f = c[g], this.serializeInternal(this.replacer_ ? this.replacer_.call(c, String(g), f) : f, d), f = ","; 6180 } 6181 d.push("]"); 6182}; 6183goog.json.Serializer.prototype.serializeObject_ = function(c, d) { 6184 d.push("{"); 6185 var e = "", f; 6186 for (f in c) { 6187 if (Object.prototype.hasOwnProperty.call(c, f)) { 6188 var g = c[f]; 6189 "function" != typeof g && (d.push(e), this.serializeString_(f, d), d.push(":"), this.serializeInternal(this.replacer_ ? this.replacer_.call(c, f, g) : g, d), e = ","); 6190 } 6191 } 6192 d.push("}"); 6193}; 6194goog.json.hybrid = {};
6195goog.json.hybrid.stringify = goog.json.USE_NATIVE_JSON ? goog.global.JSON.stringify : function(c) { 6196 if (goog.global.JSON) { 6197 try { 6198 return goog.global.JSON.stringify(c); 6199 } catch (d) { 6200 } 6201 } 6202 return goog.json.serialize(c); 6203}; 6204goog.json.hybrid.parse_ = function(c, d) { 6205 if (goog.global.JSON) { 6206 try { 6207 var e = goog.global.JSON.parse(c); 6208 goog.asserts.assert("object" == typeof e); 6209 return e; 6210 } catch (f) { 6211 } 6212 } 6213 return d(c); 6214}; 6215goog.json.hybrid.parse = goog.json.USE_NATIVE_JSON ? goog.global.JSON.parse : function(c) { 6216 return goog.json.hybrid.parse_(c, goog.json.parse); 6217}; 6218goog.debug.LogRecord = function(c, d, e, f, g) { 6219 this.reset(c, d, e, f, g); 6220}; 6221goog.debug.LogRecord.prototype.sequenceNumber_ = 0; 6222goog.debug.LogRecord.prototype.exception_ = null; 6223goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS = !0; 6224goog.debug.LogRecord.nextSequenceNumber_ = 0; 6225goog.debug.LogRecord.prototype.reset = function(c, d, e, f, g) { 6226 goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS && (this.sequenceNumber_ = "number" == typeof g ? g : goog.debug.LogRecord.nextSequenceNumber_++); 6227 this.time_ = f || goog.now(); 6228 this.level_ = c; 6229 this.msg_ = d; 6230 this.loggerName_ = e; 6231 delete this.exception_; 6232}; 6233goog.debug.LogRecord.prototype.getLoggerName = function() { 6234 return this.loggerName_; 6235}; 6236goog.debug.LogRecord.prototype.getException = function() { 6237 return this.exception_; 6238}; 6239goog.debug.LogRecord.prototype.setException = function(c) { 6240 this.exception_ = c; 6241}; 6242goog.debug.LogRecord.prototype.setLoggerName = function(c) { 6243 this.loggerName_ = c; 6244}; 6245goog.debug.LogRecord.prototype.getLevel = function() { 6246 return this.level_; 6247}; 6248goog.debug.LogRecord.prototype.setLevel = function(c) { 6249 this.level_ = c; 6250}; 6251goog.debug.LogRecord.prototype.getMessage = function() { 6252 return this.msg_; 6253}; 6254goog.debug.LogRecord.prototype.setMessage = function(c) { 6255 this.msg_ = c; 6256}; 6257goog.debug.LogRecord.prototype.getMillis = function() { 6258 return this.time_; 6259}; 6260goog.debug.LogRecord.prototype.setMillis = function(c) { 6261 this.time_ = c; 6262}; 6263goog.debug.LogRecord.prototype.getSequenceNumber = function() { 6264 return this.sequenceNumber_; 6265}; 6266goog.debug.LogBuffer = function() { 6267 goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(), "Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY."); 6268 this.clear(); 6269}; 6270goog.debug.LogBuffer.getInstance = function() { 6271 goog.debug.LogBuffer.instance_ || (goog.debug.LogBuffer.instance_ = new goog.debug.LogBuffer); 6272 return goog.debug.LogBuffer.instance_; 6273}; 6274goog.debug.LogBuffer.CAPACITY = 0; 6275goog.debug.LogBuffer.prototype.addRecord = function(c, d, e) { 6276 var f = (this.curIndex_ + 1) % goog.debug.LogBuffer.CAPACITY; 6277 this.curIndex_ = f; 6278 if (this.isFull_) { 6279 return f = this.buffer_[f], f.reset(c, d, e), f; 6280 } 6281 this.isFull_ = f == goog.debug.LogBuffer.CAPACITY - 1; 6282 return this.buffer_[f] = new goog.debug.LogRecord(c, d, e); 6283}; 6284goog.debug.LogBuffer.isBufferingEnabled = function() { 6285 return 0 < goog.debug.LogBuffer.CAPACITY; 6286}; 6287goog.debug.LogBuffer.prototype.clear = function() { 6288 this.buffer_ = Array(goog.debug.LogBuffer.CAPACITY); 6289 this.curIndex_ = -1; 6290 this.isFull_ = !1; 6291}; 6292goog.debug.LogBuffer.prototype.forEachRecord = function(c) { 6293 var d = this.buffer_; 6294 if (d[0]) { 6295 var e = this.curIndex_, f = this.isFull_ ? e : -1; 6296 do { 6297 f = (f + 1) % goog.debug.LogBuffer.CAPACITY, c(d[f]); 6298 } while (f != e); 6299 } 6300}; 6301goog.debug.Logger = function(c) { 6302 this.name_ = c; 6303 this.handlers_ = this.children_ = this.level_ = this.parent_ = null; 6304}; 6305goog.debug.Logger.ROOT_LOGGER_NAME = ""; 6306goog.debug.Logger.ENABLE_HIERARCHY = !0; 6307goog.debug.Logger.ENABLE_PROFILER_LOGGING = !1; 6308goog.debug.Logger.ENABLE_HIERARCHY || (goog.debug.Logger.rootHandlers_ = []); 6309goog.debug.Logger.Level = function(c, d) { 6310 this.name = c; 6311 this.value = d; 6312}; 6313goog.debug.Logger.Level.prototype.toString = function() { 6314 return this.name; 6315}; 6316goog.debug.Logger.Level.OFF = new goog.debug.Logger.Level("OFF", Infinity); 6317goog.debug.Logger.Level.SHOUT = new goog.debug.Logger.Level("SHOUT", 1200); 6318goog.debug.Logger.Level.SEVERE = new goog.debug.Logger.Level("SEVERE", 1000); 6319goog.debug.Logger.Level.WARNING = new goog.debug.Logger.Level("WARNING", 900); 6320goog.debug.Logger.Level.INFO = new goog.debug.Logger.Level("INFO", 800); 6321goog.debug.Logger.Level.CONFIG = new goog.debug.Logger.Level("CONFIG", 700); 6322goog.debug.Logger.Level.FINE = new goog.debug.Logger.Level("FINE", 500); 6323goog.debug.Logger.Level.FINER = new goog.debug.Logger.Level("FINER", 400); 6324goog.debug.Logger.Level.FINEST = new goog.debug.Logger.Level("FINEST", 300); 6325goog.debug.Logger.Level.ALL = new goog.debug.Logger.Level("ALL", 0); 6326goog.debug.Logger.Level.PREDEFINED_LEVELS = [goog.debug.Logger.Level.OFF, goog.debug.Logger.Level.SHOUT, goog.debug.Logger.Level.SEVERE, goog.debug.Logger.Level.WARNING, goog.debug.Logger.Level.INFO, goog.debug.Logger.Level.CONFIG, goog.debug.Logger.Level.FINE, goog.debug.Logger.Level.FINER, goog.debug.Logger.Level.FINEST, goog.debug.Logger.Level.ALL]; 6327goog.debug.Logger.Level.predefinedLevelsCache_ = null; 6328goog.debug.Logger.Level.createPredefinedLevelsCache_ = function() { 6329 goog.debug.Logger.Level.predefinedLevelsCache_ = {}; 6330 for (var c = 0, d; d = goog.debug.Logger.Level.PREDEFINED_LEVELS[c]; c++) { 6331 goog.debug.Logger.Level.predefinedLevelsCache_[d.value] = d, goog.debug.Logger.Level.predefinedLevelsCache_[d.name] = d; 6332 } 6333}; 6334goog.debug.Logger.Level.getPredefinedLevel = function(c) { 6335 goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_(); 6336 return goog.debug.Logger.Level.predefinedLevelsCache_[c] || null; 6337}; 6338goog.debug.Logger.Level.getPredefinedLevelByValue = function(c) { 6339 goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_(); 6340 if (c in goog.debug.Logger.Level.predefinedLevelsCache_) { 6341 return goog.debug.Logger.Level.predefinedLevelsCache_[c]; 6342 } 6343 for (var d = 0; d < goog.debug.Logger.Level.PREDEFINED_LEVELS.length; ++d) { 6344 var e = goog.debug.Logger.Level.PREDEFINED_LEVELS[d]; 6345 if (e.value <= c) { 6346 return e; 6347 } 6348 } 6349 return null; 6350}; 6351goog.debug.Logger.getLogger = function(c) { 6352 return goog.debug.LogManager.getLogger(c); 6353}; 6354goog.debug.Logger.logToProfilers = function(c) { 6355 if (goog.debug.Logger.ENABLE_PROFILER_LOGGING) { 6356 var d = goog.global.msWriteProfilerMark; 6357 d ? d(c) : (d = goog.global.console) && d.timeStamp && d.timeStamp(c); 6358 } 6359}; 6360goog.debug.Logger.prototype.getName = function() { 6361 return this.name_; 6362}; 6363goog.debug.Logger.prototype.addHandler = function(c) { 6364 goog.debug.LOGGING_ENABLED && (goog.debug.Logger.ENABLE_HIERARCHY ? (this.handlers_ || (this.handlers_ = []), this.handlers_.push(c)) : (goog.asserts.assert(!this.name_, "Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."), goog.debug.Logger.rootHandlers_.push(c))); 6365}; 6366goog.debug.Logger.prototype.removeHandler = function(c) { 6367 if (goog.debug.LOGGING_ENABLED) { 6368 var d = goog.debug.Logger.ENABLE_HIERARCHY ? this.handlers_ : goog.debug.Logger.rootHandlers_; 6369 return !!d && goog.array.remove(d, c); 6370 } 6371 return !1; 6372}; 6373goog.debug.Logger.prototype.getParent = function() { 6374 return this.parent_; 6375}; 6376goog.debug.Logger.prototype.getChildren = function() { 6377 this.children_ || (this.children_ = {}); 6378 return this.children_; 6379}; 6380goog.debug.Logger.prototype.setLevel = function(c) { 6381 goog.debug.LOGGING_ENABLED && (goog.debug.Logger.ENABLE_HIERARCHY ? this.level_ = c : (goog.asserts.assert(!this.name_, "Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."), goog.debug.Logger.rootLevel_ = c)); 6382}; 6383goog.debug.Logger.prototype.getLevel = function() { 6384 return goog.debug.LOGGING_ENABLED ? this.level_ : goog.debug.Logger.Level.OFF; 6385}; 6386goog.debug.Logger.prototype.getEffectiveLevel = function() { 6387 if (!goog.debug.LOGGING_ENABLED) { 6388 return goog.debug.Logger.Level.OFF; 6389 } 6390 if (!goog.debug.Logger.ENABLE_HIERARCHY) { 6391 return goog.debug.Logger.rootLevel_; 6392 } 6393 if (this.level_) { 6394 return this.level_; 6395 } 6396 if (this.parent_) { 6397 return this.parent_.getEffectiveLevel(); 6398 } 6399 goog.asserts.fail("Root logger has no level set."); 6400 return null; 6401}; 6402goog.debug.Logger.prototype.isLoggable = function(c) { 6403 return goog.debug.LOGGING_ENABLED && c.value >= this.getEffectiveLevel().value; 6404}; 6405goog.debug.Logger.prototype.log = function(c, d, e) { 6406 goog.debug.LOGGING_ENABLED && this.isLoggable(c) && (goog.isFunction(d) && (d = d()), this.doLogRecord_(this.getLogRecord(c, d, e))); 6407}; 6408goog.debug.Logger.prototype.getLogRecord = function(c, d, e) { 6409 c = goog.debug.LogBuffer.isBufferingEnabled() ? goog.debug.LogBuffer.getInstance().addRecord(c, d, this.name_) : new goog.debug.LogRecord(c, String(d), this.name_); 6410 e && c.setException(e); 6411 return c; 6412}; 6413goog.debug.Logger.prototype.shout = function(c, d) { 6414 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.SHOUT, c, d); 6415}; 6416goog.debug.Logger.prototype.severe = function(c, d) { 6417 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.SEVERE, c, d); 6418}; 6419goog.debug.Logger.prototype.warning = function(c, d) { 6420 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.WARNING, c, d); 6421}; 6422goog.debug.Logger.prototype.info = function(c, d) { 6423 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.INFO, c, d); 6424}; 6425goog.debug.Logger.prototype.config = function(c, d) { 6426 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.CONFIG, c, d); 6427}; 6428goog.debug.Logger.prototype.fine = function(c, d) { 6429 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINE, c, d); 6430}; 6431goog.debug.Logger.prototype.finer = function(c, d) { 6432 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINER, c, d); 6433}; 6434goog.debug.Logger.prototype.finest = function(c, d) { 6435 goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINEST, c, d); 6436}; 6437goog.debug.Logger.prototype.logRecord = function(c) { 6438 goog.debug.LOGGING_ENABLED && this.isLoggable(c.getLevel()) && this.doLogRecord_(c); 6439}; 6440goog.debug.Logger.prototype.doLogRecord_ = function(c) { 6441 goog.debug.Logger.ENABLE_PROFILER_LOGGING && goog.debug.Logger.logToProfilers("log:" + c.getMessage()); 6442 if (goog.debug.Logger.ENABLE_HIERARCHY) { 6443 for (var d = this; d;) { 6444 d.callPublish_(c), d = d.getParent(); 6445 } 6446 } else { 6447 d = 0; 6448 for (var e; e = goog.debug.Logger.rootHandlers_[d++];) { 6449 e(c); 6450 } 6451 } 6452}; 6453goog.debug.Logger.prototype.callPublish_ = function(c) { 6454 if (this.handlers_) { 6455 for (var d = 0, e; e = this.handlers_[d]; d++) { 6456 e(c); 6457 } 6458 } 6459}; 6460goog.debug.Logger.prototype.setParent_ = function(c) { 6461 this.parent_ = c; 6462}; 6463goog.debug.Logger.prototype.addChild_ = function(c, d) { 6464 this.getChildren()[c] = d; 6465}; 6466goog.debug.LogManager = {}; 6467goog.debug.LogManager.loggers_ = {}; 6468goog.debug.LogManager.rootLogger_ = null; 6469goog.debug.LogManager.initialize = function() { 6470 goog.debug.LogManager.rootLogger_ || (goog.debug.LogManager.rootLogger_ = new goog.debug.Logger(goog.debug.Logger.ROOT_LOGGER_NAME), goog.debug.LogManager.loggers_[goog.debug.Logger.ROOT_LOGGER_NAME] = goog.debug.LogManager.rootLogger_, goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG)); 6471}; 6472goog.debug.LogManager.getLoggers = function() { 6473 return goog.debug.LogManager.loggers_; 6474}; 6475goog.debug.LogManager.getRoot = function() { 6476 goog.debug.LogManager.initialize(); 6477 return goog.debug.LogManager.rootLogger_; 6478}; 6479goog.debug.LogManager.getLogger = function(c) { 6480 goog.debug.LogManager.initialize(); 6481 return goog.debug.LogManager.loggers_[c] || goog.debug.LogManager.createLogger_(c); 6482}; 6483goog.debug.LogManager.createFunctionForCatchErrors = function(c) { 6484 return function(d) { 6485 (c || goog.debug.LogManager.getRoot()).severe("Error: " + d.message + " (" + d.fileName + " @ Line: " + d.line + ")"); 6486 }; 6487}; 6488goog.debug.LogManager.createLogger_ = function(c) { 6489 var d = new goog.debug.Logger(c); 6490 if (goog.debug.Logger.ENABLE_HIERARCHY) { 6491 var e = c.lastIndexOf("."), f = c.substr(0, e); 6492 e = c.substr(e + 1); 6493 f = goog.debug.LogManager.getLogger(f); 6494 f.addChild_(e, d); 6495 d.setParent_(f); 6496 } 6497 return goog.debug.LogManager.loggers_[c] = d; 6498}; 6499goog.log = {}; 6500goog.log.ENABLED = goog.debug.LOGGING_ENABLED; 6501goog.log.ROOT_LOGGER_NAME = goog.debug.Logger.ROOT_LOGGER_NAME; 6502goog.log.Logger = goog.debug.Logger; 6503goog.log.Level = goog.debug.Logger.Level; 6504goog.log.LogRecord = goog.debug.LogRecord; 6505goog.log.getLogger = function(c, d) { 6506 return goog.log.ENABLED ? (c = goog.debug.LogManager.getLogger(c), d && c && c.setLevel(d), c) : null; 6507}; 6508goog.log.addHandler = function(c, d) { 6509 goog.log.ENABLED && c && c.addHandler(d); 6510}; 6511goog.log.removeHandler = function(c, d) { 6512 return goog.log.ENABLED && c ? c.removeHandler(d) : !1; 6513}; 6514goog.log.log = function(c, d, e, f) { 6515 goog.log.ENABLED && c && c.log(d, e, f); 6516}; 6517goog.log.error = function(c, d, e) { 6518 goog.log.ENABLED && c && c.severe(d, e); 6519}; 6520goog.log.warning = function(c, d, e) { 6521 goog.log.ENABLED && c && c.warning(d, e); 6522}; 6523goog.log.info = function(c, d, e) { 6524 goog.log.ENABLED && c && c.info(d, e); 6525}; 6526goog.log.fine = function(c, d, e) { 6527 goog.log.ENABLED && c && c.fine(d, e); 6528}; 6529goog.net = {};
6530goog.net.ErrorCode = {NO_ERROR:0, ACCESS_DENIED:1, FILE_NOT_FOUND:2, FF_SILENT_ERROR:3, CUSTOM_ERROR:4, EXCEPTION:5, HTTP_ERROR:6, ABORT:7, TIMEOUT:8, OFFLINE:9}; 6531goog.net.ErrorCode.getDebugMessage = function(c) { 6532 switch(c) { 6533 case goog.net.ErrorCode.NO_ERROR: 6534 return "No Error"; 6535 case goog.net.ErrorCode.ACCESS_DENIED: 6536 return "Access denied to content document"; 6537 case goog.net.ErrorCode.FILE_NOT_FOUND: 6538 return "File not found"; 6539 case goog.net.ErrorCode.FF_SILENT_ERROR: 6540 return "Firefox silently errored"; 6541 case goog.net.ErrorCode.CUSTOM_ERROR: 6542 return "Application custom error"; 6543 case goog.net.ErrorCode.EXCEPTION: 6544 return "An exception occurred"; 6545 case goog.net.ErrorCode.HTTP_ERROR: 6546 return "Http response at 400 or 500 level"; 6547 case goog.net.ErrorCode.ABORT: 6548 return "Request was aborted"; 6549 case goog.net.ErrorCode.TIMEOUT: 6550 return "Request timed out"; 6551 case goog.net.ErrorCode.OFFLINE: 6552 return "The resource is not available offline"; 6553 default: 6554 return "Unrecognized error code"; 6555 } 6556}; 6557goog.net.EventType = {COMPLETE:"complete", SUCCESS:"success", ERROR:"error", ABORT:"abort", READY:"ready", READY_STATE_CHANGE:"readystatechange", TIMEOUT:"timeout", INCREMENTAL_DATA:"incrementaldata", PROGRESS:"progress", DOWNLOAD_PROGRESS:"downloadprogress", UPLOAD_PROGRESS:"uploadprogress"}; 6558goog.net.HttpStatus = {CONTINUE:100, SWITCHING_PROTOCOLS:101, OK:200, CREATED:201, ACCEPTED:202, NON_AUTHORITATIVE_INFORMATION:203, NO_CONTENT:204, RESET_CONTENT:205, PARTIAL_CONTENT:206, MULTIPLE_CHOICES:300, MOVED_PERMANENTLY:301, FOUND:302, SEE_OTHER:303, NOT_MODIFIED:304, USE_PROXY:305, TEMPORARY_REDIRECT:307, BAD_REQUEST:400, UNAUTHORIZED:401, PAYMENT_REQUIRED:402, FORBIDDEN:403, NOT_FOUND:404, METHOD_NOT_ALLOWED:405, NOT_ACCEPTABLE:406, PROXY_AUTHENTICATION_REQUIRED:407, REQUEST_TIMEOUT:408, 6559CONFLICT:409, GONE:410, LENGTH_REQUIRED:411, PRECONDITION_FAILED:412, REQUEST_ENTITY_TOO_LARGE:413, REQUEST_URI_TOO_LONG:414, UNSUPPORTED_MEDIA_TYPE:415, REQUEST_RANGE_NOT_SATISFIABLE:416, EXPECTATION_FAILED:417, PRECONDITION_REQUIRED:428, TOO_MANY_REQUESTS:429, REQUEST_HEADER_FIELDS_TOO_LARGE:431, INTERNAL_SERVER_ERROR:500, NOT_IMPLEMENTED:501, BAD_GATEWAY:502, SERVICE_UNAVAILABLE:503, GATEWAY_TIMEOUT:504, HTTP_VERSION_NOT_SUPPORTED:505, NETWORK_AUTHENTICATION_REQUIRED:511, QUIRK_IE_NO_CONTENT:1223}; 6560goog.net.HttpStatus.isSuccess = function(c) { 6561 switch(c) { 6562 case goog.net.HttpStatus.OK: 6563 case goog.net.HttpStatus.CREATED: 6564 case goog.net.HttpStatus.ACCEPTED: 6565 case goog.net.HttpStatus.NO_CONTENT: 6566 case goog.net.HttpStatus.PARTIAL_CONTENT: 6567 case goog.net.HttpStatus.NOT_MODIFIED: 6568 case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT: 6569 return !0; 6570 default: 6571 return !1; 6572 } 6573}; 6574goog.net.XhrLike = function() { 6575}; 6576goog.net.XhrLike.prototype.open = function(c, d, e, f, g) { 6577}; 6578goog.net.XhrLike.prototype.send = function(c) { 6579}; 6580goog.net.XhrLike.prototype.abort = function() { 6581}; 6582goog.net.XhrLike.prototype.setRequestHeader = function(c, d) { 6583}; 6584goog.net.XhrLike.prototype.getResponseHeader = function(c) { 6585}; 6586goog.net.XhrLike.prototype.getAllResponseHeaders = function() { 6587}; 6588goog.net.XmlHttpFactory = function() { 6589}; 6590goog.net.XmlHttpFactory.prototype.cachedOptions_ = null; 6591goog.net.XmlHttpFactory.prototype.createInstance = goog.abstractMethod; 6592goog.net.XmlHttpFactory.prototype.getOptions = function() { 6593 return this.cachedOptions_ || (this.cachedOptions_ = this.internalGetOptions()); 6594}; 6595goog.net.XmlHttpFactory.prototype.internalGetOptions = goog.abstractMethod; 6596goog.net.WrapperXmlHttpFactory = function(c, d) { 6597 goog.net.XmlHttpFactory.call(this); 6598 this.xhrFactory_ = c; 6599 this.optionsFactory_ = d; 6600}; 6601goog.inherits(goog.net.WrapperXmlHttpFactory, goog.net.XmlHttpFactory); 6602goog.net.WrapperXmlHttpFactory.prototype.createInstance = function() { 6603 return this.xhrFactory_(); 6604}; 6605goog.net.WrapperXmlHttpFactory.prototype.getOptions = function() { 6606 return this.optionsFactory_(); 6607}; 6608goog.net.XmlHttp = function() { 6609 return goog.net.XmlHttp.factory_.createInstance(); 6610}; 6611goog.net.XmlHttp.ASSUME_NATIVE_XHR = !1; 6612goog.net.XmlHttpDefines = {}; 6613goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR = !1; 6614goog.net.XmlHttp.getOptions = function() { 6615 return goog.net.XmlHttp.factory_.getOptions(); 6616}; 6617goog.net.XmlHttp.OptionType = {USE_NULL_FUNCTION:0, LOCAL_REQUEST_ERROR:1}; 6618goog.net.XmlHttp.ReadyState = {UNINITIALIZED:0, LOADING:1, LOADED:2, INT
6618ERACTIVE:3, COMPLETE:4}; 6619goog.net.XmlHttp.setFactory = function(c, d) { 6620 goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(goog.asserts.assert(c), goog.asserts.assert(d))); 6621}; 6622goog.net.XmlHttp.setGlobalFactory = function(c) { 6623 goog.net.XmlHttp.factory_ = c; 6624}; 6625goog.net.DefaultXmlHttpFactory = function() { 6626 goog.net.XmlHttpFactory.call(this); 6627}; 6628goog.inherits(goog.net.DefaultXmlHttpFactory, goog.net.XmlHttpFactory); 6629goog.net.DefaultXmlHttpFactory.prototype.createInstance = function() { 6630 var c = this.getProgId_(); 6631 return c ? new ActiveXObject(c) : new XMLHttpRequest; 6632}; 6633goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions = function() { 6634 var c = {}; 6635 this.getProgId_() && (c[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] = !0, c[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] = !0); 6636 return c; 6637}; 6638goog.net.DefaultXmlHttpFactory.prototype.getProgId_ = function() { 6639 if (goog.net.XmlHttp.ASSUME_NATIVE_XHR || goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR) { 6640 return ""; 6641 } 6642 if (!this.ieProgId_ && "undefined" == typeof XMLHttpRequest && "undefined" != typeof ActiveXObject) { 6643 for (var c = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], d = 0; d < c.length; d++) { 6644 var e = c[d]; 6645 try { 6646 return new ActiveXObject(e), this.ieProgId_ = e; 6647 } catch (f) { 6648 } 6649 } 6650 throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed"); 6651 } 6652 return this.ieProgId_; 6653}; 6654goog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory); 6655goog.structs = {}; 6656goog.structs.getCount = function(c) { 6657 return c.getCount && "function" == typeof c.getCount ? c.getCount() : goog.isArrayLike(c) || goog.isString(c) ? c.length : goog.object.getCount(c); 6658}; 6659goog.structs.getValues = function(c) { 6660 if (c.getValues && "function" == typeof c.getValues) { 6661 return c.getValues(); 6662 } 6663 if (goog.isString(c)) { 6664 return c.split(""); 6665 } 6666 if (goog.isArrayLike(c)) { 6667 for (var d = [], e = c.length, f = 0; f < e; f++) { 6668 d.push(c[f]); 6669 } 6670 return d; 6671 } 6672 return goog.object.getValues(c); 6673}; 6674goog.structs.getKeys = function(c) { 6675 if (c.getKeys && "function" == typeof c.getKeys) { 6676 return c.getKeys(); 6677 } 6678 if (!c.getValues || "function" != typeof c.getValues) { 6679 if (goog.isArrayLike(c) || goog.isString(c)) { 6680 var d = []; 6681 c = c.length; 6682 for (var e = 0; e < c; e++) { 6683 d.push(e); 6684 } 6685 return d; 6686 } 6687 return goog.object.getKeys(c); 6688 } 6689}; 6690goog.structs.contains = function(c, d) { 6691 return c.contains && "function" == typeof c.contains ? c.contains(d) : c.containsValue && "function" == typeof c.containsValue ? c.containsValue(d) : goog.isArrayLike(c) || goog.isString(c) ? goog.array.contains(c, d) : goog.object.containsValue(c, d); 6692}; 6693goog.structs.isEmpty = function(c) { 6694 return c.isEmpty && "function" == typeof c.isEmpty ? c.isEmpty() : goog.isArrayLike(c) || goog.isString(c) ? goog.array.isEmpty(c) : goog.object.isEmpty(c); 6695}; 6696goog.structs.clear = function(c) { 6697 c.clear && "function" == typeof c.clear ? c.clear() : goog.isArrayLike(c) ? goog.array.clear(c) : goog.object.clear(c); 6698}; 6699goog.structs.forEach = function(c, d, e) { 6700 if (c.forEach && "function" == typeof c.forEach) { 6701 c.forEach(d, e); 6702 } else { 6703 if (goog.isArrayLike(c) || goog.isString(c)) { 6704 goog.array.forEach(c, d, e); 6705 } else { 6706 for (var f = goog.structs.getKeys(c), g = goog.structs.getValues(c), h = g.length, k = 0; k < h; k++) { 6707 d.call(e, g[k], f && f[k], c); 6708 } 6709 } 6710 } 6711}; 6712goog.structs.filter = function(c, d, e) { 6713 if ("function" == typeof c.filter) { 6714 return c.filter(d, e); 6715 } 6716 if (goog.isArrayLike(c) || goog.isString(c)) { 6717 return goog.array.filter(c, d, e); 6718 } 6719 var f = goog.structs.getKeys(c), g = goog.structs.getValues(c), h = g.length; 6720 if (f) { 6721 var k = {}; 6722 for (var l = 0; l < h; l++) { 6723 d.call(e, g[l], f[l], c) && (k[f[l]] = g[l]); 6724 } 6725 } else { 6726 for (k = [], l = 0; l < h; l++) { 6727 d.call(e, g[l], void 0, c) && k.push(g[l]); 6728 } 6729 } 6730 return k; 6731}; 6732goog.structs.map = function(c, d, e) { 6733 if ("function" == typeof c.map) { 6734 return c.map(d, e); 6735 } 6736 if (goog.isArrayLike(c) || goog.isString(c)) { 6737 return goog.array.map(c, d, e); 6738 } 6739 var f = goog.structs.getKeys(c), g = goog.structs.getValues(c), h = g.length; 6740 if (f) { 6741 var k = {}; 6742 for (var l = 0; l < h; l++) { 6743 k[f[l]] = d.call(e, g[l], f[l], c); 6744 } 6745 } else { 6746 for (k = [], l = 0; l < h; l++) {
6747 k[l] = d.call(e, g[l], void 0, c); 6748 } 6749 } 6750 return k; 6751}; 6752goog.structs.some = function(c, d, e) { 6753 if ("function" == typeof c.some) { 6754 return c.some(d, e); 6755 } 6756 if (goog.isArrayLike(c) || goog.isString(c)) { 6757 return goog.array.some(c, d, e); 6758 } 6759 for (var f = goog.structs.getKeys(c), g = goog.structs.getValues(c), h = g.length, k = 0; k < h; k++) { 6760 if (d.call(e, g[k], f && f[k], c)) { 6761 return !0; 6762 } 6763 } 6764 return !1; 6765}; 6766goog.structs.every = function(c, d, e) { 6767 if ("function" == typeof c.every) { 6768 return c.every(d, e); 6769 } 6770 if (goog.isArrayLike(c) || goog.isString(c)) { 6771 return goog.array.every(c, d, e); 6772 } 6773 for (var f = goog.structs.getKeys(c), g = goog.structs.getValues(c), h = g.length, k = 0; k < h; k++) { 6774 if (!d.call(e, g[k], f && f[k], c)) { 6775 return !1; 6776 } 6777 } 6778 return !0; 6779}; 6780goog.math = {}; 6781goog.math.randomInt = function(c) { 6782 return Math.floor(Math.random() * c); 6783}; 6784goog.math.uniformRandom = function(c, d) { 6785 return c + Math.random() * (d - c); 6786}; 6787goog.math.clamp = function(c, d, e) { 6788 return Math.min(Math.max(c, d), e); 6789}; 6790goog.math.modulo = function(c, d) { 6791 c %= d; 6792 return 0 > c * d ? c + d : c; 6793}; 6794goog.math.lerp = function(c, d, e) { 6795 return c + e * (d - c); 6796}; 6797goog.math.nearlyEquals = function(c, d, e) { 6798 return Math.abs(c - d) <= (e || 0.000001); 6799}; 6800goog.math.standardAngle = function(c) { 6801 return goog.math.modulo(c, 360); 6802}; 6803goog.math.standardAngleInRadians = function(c) { 6804 return goog.math.modulo(c, 2 * Math.PI); 6805}; 6806goog.math.toRadians = function(c) { 6807 return c * Math.PI / 180; 6808}; 6809goog.math.toDegrees = function(c) { 6810 return 180 * c / Math.PI; 6811}; 6812goog.math.angleDx = function(c, d) { 6813 return d * Math.cos(goog.math.toRadians(c)); 6814}; 6815goog.math.angleDy = function(c, d) { 6816 return d * Math.sin(goog.math.toRadians(c)); 6817}; 6818goog.math.angle = function(c, d, e, f) { 6819 return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(f - d, e - c))); 6820}; 6821goog.math.angleDifference = function(c, d) { 6822 c = goog.math.standardAngle(d) - goog.math.standardAngle(c); 6823 180 < c ? c -= 360 : -180 >= c && (c = 360 + c); 6824 return c; 6825}; 6826goog.math.sign = function(c) { 6827 return 0 < c ? 1 : 0 > c ? -1 : c; 6828}; 6829goog.math.longestCommonSubsequence = function(c, d, e, f) { 6830 e = e || function(c, d) { 6831 return c == d; 6832 }; 6833 f = f || function(d, e) { 6834 return c[d]; 6835 }; 6836 for (var g = c.length, h = d.length, k = [], l = 0; l < g + 1; l++) { 6837 k[l] = [], k[l][0] = 0; 6838 } 6839 for (var m = 0; m < h + 1; m++) { 6840 k[0][m] = 0; 6841 } 6842 for (l = 1; l <= g; l++) { 6843 for (m = 1; m <= h; m++) { 6844 e(c[l - 1], d[m - 1]) ? k[l][m] = k[l - 1][m - 1] + 1 : k[l][m] = Math.max(k[l - 1][m], k[l][m - 1]); 6845 } 6846 } 6847 var r = []; 6848 l = g; 6849 for (m = h; 0 < l && 0 < m;) { 6850 e(c[l - 1], d[m - 1]) ? (r.unshift(f(l - 1, m - 1)), l--, m--) : k[l - 1][m] > k[l][m - 1] ? l-- : m--; 6851 } 6852 return r; 6853}; 6854goog.math.sum = function(c) { 6855 return goog.array.reduce(arguments, function(c, e) { 6856 return c + e; 6857 }, 0); 6858}; 6859goog.math.average = function(c) { 6860 return goog.math.sum.apply(null, arguments) / arguments.length; 6861}; 6862goog.math.sampleVariance = function(c) { 6863 var d = arguments.length; 6864 if (2 > d) { 6865 return 0; 6866 } 6867 var e = goog.math.average.apply(null, arguments); 6868 return goog.math.sum.apply(null, goog.array.map(arguments, function(c) { 6869 return Math.pow(c - e, 2); 6870 })) / (d - 1); 6871}; 6872goog.math.standardDeviation = function(c) { 6873 return Math.sqrt(goog.math.sampleVariance.apply(null, arguments)); 6874}; 6875goog.math.isInt = function(c) { 6876 return isFinite(c) && 0 == c % 1; 6877}; 6878goog.math.isFiniteNumber = function(c) { 6879 return isFinite(c); 6880}; 6881goog.math.isNegativeZero = function(c) { 6882 return 0 == c && 0 > 1 / c; 6883}; 6884goog.math.log10Floor = function(c) { 6885 if (0 < c) { 6886 var d = Math.round(Math.log(c) * Math.LOG10E); 6887 return d - (parseFloat("1e" + d) > c ? 1 : 0); 6888 } 6889 return 0 == c ? -Infinity : NaN; 6890}; 6891goog.math.safeFloor = function(c, d) { 6892 goog.asserts.assert(!goog.isDef(d) || 0 < d); 6893 return Math.floor(c + (d || 2e-15)); 6894}; 6895goog.math.safeCeil = function(c, d) { 6896 goog.asserts.assert(!goog.isDef(d) || 0 < d); 6897 return Math.ceil(c - (d || 2e-15)); 6898}; 6899goog.iter = {}; 6900goog.iter.StopIteration = "StopIteration" in goog.global ? goog.global.StopIteration : {message:"StopIteration", stack:""}; 6901goog.iter.Iterator = function() { 6902}; 6903goog.iter.Iterator.prototype.next = function() { 6904 throw goog.iter.StopIteration; 6905}; 6906goog.iter.Iterator.prototype.__iterator__ = function(c) { 6907 return this; 6908}; 6909goog.iter.toIterator = function(c) { 6910 if (c instanceof goog.iter.Iterator) { 6911 return c; 6912 } 6913 if ("function" == typeof c.__iterator__) { 6914 return c.__iterator__(!1); 6915 } 6916 if (goog.isArrayLike(c)) { 6917 var d = 0, e = new goog.iter.Iterator; 6918 e.next = function() { 6919 for (;;) { 6920 if (d >= c.length) { 6921 throw goog.iter.StopIteration; 6922 } 6923 if (d in c) { 6924 return c[d++]; 6925 } 6926 d++; 6927 } 6928 }; 6929 return e; 6930 } 6931 throw Error("Not implemented"); 6932}; 6933goog.iter.forEach = function(c, d, e) { 6934 if (goog.isArrayLike(c)) { 6935 try { 6936 goog.array.forEach(c, d, e); 6937 } catch (f) { 6938 if (f !== goog.iter.StopIteration) { 6939 throw f; 6940 } 6941 } 6942 } else { 6943 c = goog.iter.toIterator(c); 6944 try { 6945 for (;;) {
6946 d.call(e, c.next(), void 0, c); 6947 } 6948 } catch (f) { 6949 if (f !== goog.iter.StopIteration) { 6950 throw f; 6951 } 6952 } 6953 } 6954}; 6955goog.iter.filter = function(c, d, e) { 6956 var f = goog.iter.toIterator(c); 6957 c = new goog.iter.Iterator; 6958 c.next = function() { 6959 for (;;) { 6960 var c = f.next(); 6961 if (d.call(e, c, void 0, f)) { 6962 return c; 6963 } 6964 } 6965 }; 6966 return c; 6967}; 6968goog.iter.filterFalse = function(c, d, e) { 6969 return goog.iter.filter(c, goog.functions.not(d), e); 6970}; 6971goog.iter.range = function(c, d, e) { 6972 var f = 0, g = c, h = e || 1; 6973 1 < arguments.length && (f = c, g = +d); 6974 if (0 == h) { 6975 throw Error("Range step argument must not be zero"); 6976 } 6977 var k = new goog.iter.Iterator; 6978 k.next = function() { 6979 if (0 < h && f >= g || 0 > h && f <= g) { 6980 throw goog.iter.StopIteration; 6981 } 6982 var c = f; 6983 f += h; 6984 return c; 6985 }; 6986 return k; 6987}; 6988goog.iter.join = function(c, d) { 6989 return goog.iter.toArray(c).join(d); 6990}; 6991goog.iter.map = function(c, d, e) { 6992 var f = goog.iter.toIterator(c); 6993 c = new goog.iter.Iterator; 6994 c.next = function() { 6995 var c = f.next(); 6996 return d.call(e, c, void 0, f); 6997 }; 6998 return c; 6999}; 7000goog.iter.reduce = function(c, d, e, f) { 7001 var g = e; 7002 goog.iter.forEach(c, function(c) { 7003 g = d.call(f, g, c); 7004 }); 7005 return g; 7006}; 7007goog.iter.some = function(c, d, e) { 7008 c = goog.iter.toIterator(c); 7009 try { 7010 for (;;) { 7011 if (d.call(e, c.next(), void 0, c)) { 7012 return !0; 7013 } 7014 } 7015 } catch (f) { 7016 if (f !== goog.iter.StopIteration) { 7017 throw f; 7018 } 7019 } 7020 return !1; 7021}; 7022goog.iter.every = function(c, d, e) { 7023 c = goog.iter.toIterator(c); 7024 try { 7025 for (;;) { 7026 if (!d.call(e, c.next(), void 0, c)) { 7027 return !1; 7028 } 7029 } 7030 } catch (f) { 7031 if (f !== goog.iter.StopIteration) { 7032 throw f; 7033 } 7034 } 7035 return !0; 7036}; 7037goog.iter.chain = function(c) { 7038 return goog.iter.chainFromIterable(arguments); 7039}; 7040goog.iter.chainFromIterable = function(c) { 7041 var d = goog.iter.toIterator(c); 7042 c = new goog.iter.Iterator; 7043 var e = null; 7044 c.next = function() { 7045 for (;;) { 7046 if (null == e) { 7047 var c = d.next(); 7048 e = goog.iter.toIterator(c); 7049 } 7050 try { 7051 return e.next(); 7052 } catch (g) { 7053 if (g !== goog.iter.StopIteration) { 7054 throw g; 7055 } 7056 e = null; 7057 } 7058 } 7059 }; 7060 return c; 7061}; 7062goog.iter.dropWhile = function(c, d, e) { 7063 var f = goog.iter.toIterator(c); 7064 c = new goog.iter.Iterator; 7065 var g = !0; 7066 c.next = function() { 7067 for (;;) { 7068 var c = f.next(); 7069 if (!g || !d.call(e, c, void 0, f)) { 7070 return g = !1, c; 7071 } 7072 } 7073 }; 7074 return c; 7075}; 7076goog.iter.takeWhile = function(c, d, e) { 7077 var f = goog.iter.toIterator(c); 7078 c = new goog.iter.Iterator; 7079 c.next = function() { 7080 var c = f.next(); 7081 if (d.call(e, c, void 0, f)) { 7082 return c; 7083 } 7084 throw goog.iter.StopIteration; 7085 }; 7086 return c; 7087}; 7088goog.iter.toArray = function(c) { 7089 if (goog.isArrayLike(c)) { 7090 return goog.array.toArray(c); 7091 } 7092 c = goog.iter.toIterator(c); 7093 var d = []; 7094 goog.iter.forEach(c, function(c) { 7095 d.push(c); 7096 }); 7097 return d; 7098}; 7099goog.iter.equals = function(c, d, e) { 7100 c = goog.iter.zipLongest({}, c, d); 7101 var f = e || goog.array.defaultCompareEquality; 7102 return goog.iter.every(c, function(c) { 7103 return f(c[0], c[1]); 7104 }); 7105}; 7106goog.iter.nextOrValue = function(c, d) { 7107 try { 7108 return goog.iter.toIterator(c).next(); 7109 } catch (e) { 7110 if (e != goog.iter.StopIteration) { 7111 throw e; 7112 } 7113 return d; 7114 } 7115}; 7116goog.iter.product = function(c) { 7117 if (goog.array.some(arguments, function(c) { 7118 return !c.length; 7119 }) || !arguments.length) { 7120 return new goog.iter.Iterator; 7121 } 7122 var d = new goog.iter.Iterator, e = arguments, f = goog.array.repeat(0, e.length); 7123 d.next = function() { 7124 if (f) { 7125 for (var c = goog.array.map(f, function(c, d) { 7126 return e[d][c]; 7127 }), d = f.length - 1; 0 <= d; d--) { 7128 goog.asserts.assert(f); 7129 if (f[d] < e[d].length - 1) { 7130 f[d]++; 7131 break; 7132 } 7133 if (0 == d) { 7134 f = null; 7135 break; 7136 } 7137 f[d] = 0; 7138 } 7139 return c; 7140 } 7141 throw goog.iter.StopIteration; 7142 }; 7143 return d; 7144}; 7145goog.iter.cycle = function(c) { 7146 var d = goog.iter.toIterator(c), e = [], f = 0; 7147 c = new goog.iter.Iterator; 7148 var g = !1; 7149 c.next = function() { 7150 var c = null; 7151 if (!g) {
7152 try { 7153 return c = d.next(), e.push(c), c; 7154 } catch (k) { 7155 if (k != goog.iter.StopIteration || goog.array.isEmpty(e)) { 7156 throw k; 7157 } 7158 g = !0; 7159 } 7160 } 7161 c = e[f]; 7162 f = (f + 1) % e.length; 7163 return c; 7164 }; 7165 return c; 7166}; 7167goog.iter.count = function(c, d) { 7168 var e = c || 0, f = goog.isDef(d) ? d : 1; 7169 c = new goog.iter.Iterator; 7170 c.next = function() { 7171 var c = e; 7172 e += f; 7173 return c; 7174 }; 7175 return c; 7176}; 7177goog.iter.repeat = function(c) { 7178 var d = new goog.iter.Iterator; 7179 d.next = goog.functions.constant(c); 7180 return d; 7181}; 7182goog.iter.accumulate = function(c) { 7183 var d = goog.iter.toIterator(c), e = 0; 7184 c = new goog.iter.Iterator; 7185 c.next = function() { 7186 return e += d.next(); 7187 }; 7188 return c; 7189}; 7190goog.iter.zip = function(c) { 7191 var d = arguments, e = new goog.iter.Iterator; 7192 if (0 < d.length) { 7193 var f = goog.array.map(d, goog.iter.toIterator); 7194 e.next = function() { 7195 return goog.array.map(f, function(c) { 7196 return c.next(); 7197 }); 7198 }; 7199 } 7200 return e; 7201}; 7202goog.iter.zipLongest = function(c, d) { 7203 var e = goog.array.slice(arguments, 1), f = new goog.iter.Iterator; 7204 if (0 < e.length) { 7205 var g = goog.array.map(e, goog.iter.toIterator); 7206 f.next = function() { 7207 var d = !1, e = goog.array.map(g, function(e) { 7208 try { 7209 var f = e.next(); 7210 d = !0; 7211 } catch (r) { 7212 if (r !== goog.iter.StopIteration) { 7213 throw r; 7214 } 7215 f = c; 7216 } 7217 return f; 7218 }); 7219 if (!d) { 7220 throw goog.iter.StopIteration; 7221 } 7222 return e; 7223 }; 7224 } 7225 return f; 7226}; 7227goog.iter.compress = function(c, d) { 7228 var e = goog.iter.toIterator(d); 7229 return goog.iter.filter(c, function() { 7230 return !!e.next(); 7231 }); 7232}; 7233goog.iter.GroupByIterator_ = function(c, d) { 7234 this.iterator = goog.iter.toIterator(c); 7235 this.keyFunc = d || goog.functions.identity; 7236}; 7237goog.inherits(goog.iter.GroupByIterator_, goog.iter.Iterator); 7238goog.iter.GroupByIterator_.prototype.next = function() { 7239 for (; this.currentKey == this.targetKey;) { 7240 this.currentValue = this.iterator.next(), this.currentKey = this.keyFunc(this.currentValue); 7241 } 7242 this.targetKey = this.currentKey; 7243 return [this.currentKey, this.groupItems_(this.targetKey)]; 7244}; 7245goog.iter.GroupByIterator_.prototype.groupItems_ = function(c) { 7246 for (var d = []; this.currentKey == c;) { 7247 d.push(this.currentValue); 7248 try { 7249 this.currentValue = this.iterator.next(); 7250 } catch (e) { 7251 if (e !== goog.iter.StopIteration) { 7252 throw e; 7253 } 7254 break; 7255 } 7256 this.currentKey = this.keyFunc(this.currentValue); 7257 } 7258 return d; 7259}; 7260goog.iter.groupBy = function(c, d) { 7261 return new goog.iter.GroupByIterator_(c, d); 7262}; 7263goog.iter.starMap = function(c, d, e) { 7264 var f = goog.iter.toIterator(c); 7265 c = new goog.iter.Iterator; 7266 c.next = function() { 7267 var c = goog.iter.toArray(f.next()); 7268 return d.apply(e, goog.array.concat(c, void 0, f)); 7269 }; 7270 return c; 7271}; 7272goog.iter.tee = function(c, d) { 7273 var e = goog.iter.toIterator(c); 7274 c = goog.isNumber(d) ? d : 2; 7275 var f = goog.array.map(goog.array.range(c), function() { 7276 return []; 7277 }), g = function() { 7278 var c = e.next(); 7279 goog.array.forEach(f, function(d) { 7280 d.push(c); 7281 }); 7282 }; 7283 return goog.array.map(f, function(c) { 7284 var d = new goog.iter.Iterator; 7285 d.next = function() { 7286 goog.array.isEmpty(c) && g(); 7287 goog.asserts.assert(!goog.array.isEmpty(c)); 7288 return c.shift(); 7289 }; 7290 return d; 7291 }); 7292}; 7293goog.iter.enumerate = function(c, d) { 7294 return goog.iter.zip(goog.iter.count(d), c); 7295}; 7296goog.iter.limit = function(c, d) { 7297 goog.asserts.assert(goog.math.isInt(d) && 0 <= d); 7298 var e = goog.iter.toIterator(c); 7299 c = new goog.iter.Iterator; 7300 var f = d; 7301 c.next = function() { 7302 if (0 < f--) { 7303 return e.next(); 7304 } 7305 throw goog.iter.StopIteration; 7306 }; 7307 return c; 7308}; 7309goog.iter.consume = function(c, d) { 7310 goog.asserts.assert(goog.math.isInt(d) && 0 <= d); 7311 for (c = goog.iter.toIterator(c); 0 < d--;) { 7312 goog.iter.nextOrValue(c, null); 7313 } 7314 return c; 7315}; 7316goog.iter.slice = function(c, d, e) { 7317 goog.asserts.assert(goog.math.isInt(d) && 0 <= d); 7318 c = goog.iter.consume(c, d); 7319 goog.isNumber(e) && (goog.asserts.assert(goog.math.isInt(e) && e >= d), c = goog.iter.limit(c, e - d)); 7320 return c; 7321}; 7322goog.iter.hasDuplicates_ = function(c) { 7323 var d = []; 7324 goog.array.removeDuplicates(c, d); 7325 return c.length != d.length; 7326}; 7327goog.iter.permutations = function(c, d) { 7328 c = goog.iter.toArray(c); 7329 d = goog.isNumber(d) ? d : c.length; 7330 d = goog.array.repeat(c, d); 7331 d = goog.iter.product.apply(void 0, d); 7332 return goog.iter.filter(d, function(c) { 7333 return !goog.iter.hasDuplicates_(c); 7334 }); 7335}; 7336goog.iter.combinations = function(c, d) { 7337 function e(c) { 7338 return f[c]; 7339 } 7340 var f = goog.iter.toArray(c); 7341 c = goog.iter.range(f.length); 7342 d = goog.iter.permutations(c, d); 7343 var g = goog.iter.filter(d, function(c) { 7344 return goog.array.isSorted(c); 7345 }); 7346 d = new goog.iter.Iterator; 7347 d.next = function() { 7348 return goog.array.map(g.next(), e); 7349 }; 7350 return d; 7351}; 7352goog.iter.combinationsWithReplacement = function(c, d) { 7353 function e(c) { 7354 return f[c]; 7355 } 7356 var f = goog.iter.toArray(c); 7357 c = goog.array.range(f.length); 7358 d = goog.array.repeat(c, d); 7359 d = goog.iter.product.apply(void 0, d); 7360 var g = goog.iter.filter(d, function(c) { 7361 return goog.array.isSorted(c); 7362 }); 7363 d = new goog.iter.Iterator; 7364 d.next = function() { 7365 return goog.array.map(g.next(), e); 7366 }; 7367 return d; 7368}; 7369goog.structs.Map = function(c, d) { 7370 this.map_ = {}; 7371 this.keys_ = []; 7372 this.version_ = this.count_ = 0; 7373 var e = arguments.length; 7374 if (1 < e) { 7375 if (e % 2) { 7376 throw Error("Uneven number of arguments"); 7377 } 7378 for (var f = 0; f < e; f += 2) { 7379 this.set(arguments[f], arguments[f + 1]); 7380 } 7381 } else { 7382 c && this.addAll(c); 7383 } 7384}; 7385goog.structs.Map.prototype.getCount = function() { 7386 return this.count_; 7387}; 7388goog.structs.Map.prototype.getValues = function() { 7389 this.cleanupKeysArray_(); 7390 for (var c = [], d = 0; d < this.keys_.length; d++) { 7391 c.push(this.map_[this.keys_[d]]); 7392 } 7393 return c; 7394}; 7395goog.structs.Map.prototype.getKeys = function() { 7396 this.cleanupKeysArray_(); 7397 return this.keys_.concat(); 7398}; 7399goog.structs.Map.prototype.containsKey = function(c) { 7400 return goog.structs.Map.hasKey_(this.map_, c); 7401}; 7402goog.structs.Map.prototype.containsValue = function(c) { 7403 for (var d = 0; d < this.keys_.length; d++) { 7404 var e = this.keys_[d]; 7405 if (goog.structs.Map.hasKey_(this.map_, e) && this.map_[e] == c) { 7406 return !0; 7407 } 7408 } 7409 return !1; 7410}; 7411goog.structs.Map.prototype.equals = function(c, d) { 7412 if (this === c) { 7413 return !0; 7414 } 7415 if (this.count_ != c.getCount()) { 7416 return !1; 7417 } 7418 d = d || goog.structs.Map.defaultEquals; 7419 this.cleanupKeysArray_(); 7420 for (var e, f = 0; e = this.keys_[f]; f++) { 7421 if (!d(this.get(e), c.get(e))) { 7422 return !1; 7423 } 7424 } 7425 return !0; 7426}; 7427goog.structs.Map.defaultEquals = function(c, d) { 7428 return c === d; 7429}; 7430goog.structs.Map.prototype.isEmpty = function() { 7431 return 0 == this.count_; 7432}; 7433goog.structs.Map.prototype.clear = function() { 7434 this.map_ = {}; 7435 this.version_ = this.count_ = this.keys_.length = 0; 7436}; 7437goog.structs.Map.prototype.remove = function(c) { 7438 return goog.structs.Map.hasKey_(this.map_, c) ? (delete this.map_[c], this.count_--, this.version_++, this.keys_.length > 2 * this.count_ && this.cleanupKeysArray_(), !0) : !1; 7439}; 7440goog.structs.Map.prototype.cleanupKeysArray_ = function() { 7441 if (this.count_ != this.keys_.length) { 7442 for (var c = 0, d = 0; c < this.keys_.length;) { 7443 var e = this.keys_[c]; 7444 goog.structs.Map.hasKey_(this.map_, e) && (this.keys_[d++] = e); 7445 c++; 7446 } 7447 this.keys_.length = d; 7448 } 7449 if (this.count_ != this.keys_.length) { 7450 var f = {}; 7451 for (d = c = 0; c < this.keys_.length;) { 7452 e = this.keys_[c], goog.structs.Map.hasKey_(f, e) || (this.keys_[d++] = e, f[e] = 1), c++; 7453 } 7454 this.keys_.length = d; 7455 } 7456}; 7457goog.structs.Map.prototype.get = function(c, d) { 7458 return goog.structs.Map.hasKey_(this.map_, c) ? this.map_[c] : d; 7459}; 7460goog.structs.Map.prototype.set = function(c, d) { 7461 goog.structs.Map.hasKey_(this.map_, c) || (this.count_++, this.keys_.push(c), this.version_++); 7462 this.map_[c] = d; 7463}; 7464goog.structs.Map.prototype.addAll = function(c) { 7465 if (c instanceof goog.structs.Map) { 7466 for (var d = c.getKeys(), e = 0; e < d.length; e++) { 7467 this.set(d[e], c.get(d[e])); 7468 } 7469 } else { 7470 for (d in c) { 7471 this.set(d, c[d]); 7472 } 7473 } 7474}; 7475goog.structs.Map.prototype.forEach = function(c, d) { 7476 for (var e = this.getKeys(), f = 0; f < e.length; f++) { 7477 var g = e[f], h = this.get(g); 7478 c.call(d, h, g, this); 7479 } 7480}; 7481goog.structs.Map.prototype.clone = function() { 7482 return new goog.structs.Map(this); 7483}; 7484goog.structs.Map.prototype.transpose = function() { 7485 for (var c = new goog.structs.Map, d = 0; d < this.keys_.length; d++) { 7486 var e = this.keys_[d]; 7487 c.set(this.map_[e], e); 7488 } 7489 return c; 7490}; 7491goog.structs.Map.prototype.toObject = function() { 7492 this.cleanupKeysArray_(); 7493 for (var c = {}, d = 0; d < this.keys_.length; d++) { 7494 var e = this.keys_[d]; 7495 c[e] = this.map_[e]; 7496 } 7497 return c; 7498}; 7499goog.structs.Map.prototype.getKeyIterator = function() { 7500 return this.__iterator__(!0); 7501}; 7502goog.structs.Map.prototype.getValueIterator = function() { 7503 return this.__iterator__(!1); 7504}; 7505goog.structs.Map.prototype.__iterator__ = function(c) { 7506 this.cleanupKeysArray_(); 7507 var d = 0, e = this.version_, f = this, g = new goog.iter.Iterator; 7508 g.next = function() { 7509 if (e != f.version_) { 7510 throw Error("The map has changed since the iterator was created"); 7511 } 7512 if (d >
7512= f.keys_.length) { 7513 throw goog.iter.StopIteration; 7514 } 7515 var g = f.keys_[d++]; 7516 return c ? g : f.map_[g]; 7517 }; 7518 return g; 7519}; 7520goog.structs.Map.hasKey_ = function(c, d) { 7521 return Object.prototype.hasOwnProperty.call(c, d); 7522}; 7523goog.uri = {}; 7524goog.uri.utils = {}; 7525goog.uri.utils.CharCode_ = {AMPERSAND:38, EQUAL:61, HASH:35, QUESTION:63}; 7526goog.uri.utils.buildFromEncodedParts = function(c, d, e, f, g, h, k) { 7527 var l = ""; 7528 c && (l += c + ":"); 7529 e && (l += "//", d && (l += d + "@"), l += e, f && (l += ":" + f)); 7530 g && (l += g); 7531 h && (l += "?" + h); 7532 k && (l += "#" + k); 7533 return l; 7534}; 7535goog.uri.utils.splitRe_ = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/; 7536goog.uri.utils.ComponentIndex = {SCHEME:1, USER_INFO:2, DOMAIN:3, PORT:4, PATH:5, QUERY_DATA:6, FRAGMENT:7}; 7537goog.uri.utils.split = function(c) { 7538 return c.match(goog.uri.utils.splitRe_); 7539}; 7540goog.uri.utils.decodeIfPossible_ = function(c, d) { 7541 return c ? d ? decodeURI(c) : decodeURIComponent(c) : c; 7542}; 7543goog.uri.utils.getComponentByIndex_ = function(c, d) { 7544 return goog.uri.utils.split(d)[c] || null; 7545}; 7546goog.uri.utils.getScheme = function(c) { 7547 return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME, c); 7548}; 7549goog.uri.utils.getEffectiveScheme = function(c) { 7550 c = goog.uri.utils.getScheme(c); 7551 !c && goog.global.self && goog.global.self.location && (c = goog.global.self.location.protocol, c = c.substr(0, c.length - 1)); 7552 return c ? c.toLowerCase() : ""; 7553}; 7554goog.uri.utils.getUserInfoEncoded = function(c) { 7555 return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO, c); 7556}; 7557goog.uri.utils.getUserInfo = function(c) { 7558 return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(c)); 7559}; 7560goog.uri.utils.getDomainEncoded = function(c) { 7561 return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN, c); 7562}; 7563goog.uri.utils.getDomain = function(c) { 7564 return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(c), !0); 7565}; 7566goog.uri.utils.getPort = function(c) { 7567 return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT, c)) || null; 7568}; 7569goog.uri.utils.getPathEncoded = function(c) { 7570 return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH, c); 7571}; 7572goog.uri.utils.getPath = function(c) { 7573 return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(c), !0); 7574}; 7575goog.uri.utils.getQueryData = function(c) { 7576 return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA, c); 7577}; 7578goog.uri.utils.getFragmentEncoded = function(c) { 7579 var d = c.indexOf("#"); 7580 return 0 > d ? null : c.substr(d + 1); 7581}; 7582goog.uri.utils.setFragmentEncoded = function(c, d) { 7583 return goog.uri.utils.removeFragment(c) + (d ? "#" + d : ""); 7584}; 7585goog.uri.utils.getFragment = function(c) { 7586 return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(c)); 7587}; 7588goog.uri.utils.getHost = function(c) { 7589 c = goog.uri.utils.split(c); 7590 return goog.uri.utils.buildFromEncodedParts(c[goog.uri.utils.ComponentIndex.SCHEME], c[goog.uri.utils.ComponentIndex.USER_INFO], c[goog.uri.utils.ComponentIndex.DOMAIN], c[goog.uri.utils.ComponentIndex.PORT]); 7591}; 7592goog.uri.utils.getOrigin = function(c) { 7593 c = goog.uri.utils.split(c); 7594 return goog.uri.utils.buildFromEncodedParts(c[goog.uri.utils.ComponentIndex.SCHEME], null, c[goog.uri.utils.ComponentIndex.DOMAIN], c[goog.uri.utils.ComponentIndex.PORT]); 7595}; 7596goog.uri.utils.getPathAndAfter = function(c) { 7597 c = goog.uri.utils.split(c); 7598 return goog.uri.utils.buildFromEncodedParts(null, null, null, null, c[goog.uri.utils.ComponentIndex.PATH], c[goog.uri.utils.ComponentIndex.QUERY_DATA], c[goog.uri.utils.ComponentIndex.FRAGMENT]); 7599}; 7600goog.uri.utils.removeFragment = function(c) { 7601 var d = c.indexOf("#"); 7602 return 0 > d ? c : c.substr(0, d); 7603}; 7604goog.uri.utils.haveSameDomain = function(c, d) { 7605 c = goog.uri.utils.split(c); 7606 d = goog.uri.utils.split(d); 7607 return c[goog.uri.utils.ComponentIndex.DOMAIN] == d[goog.uri.utils.ComponentIndex.DOMAIN] && c[goog.uri.utils.ComponentIndex.SCHEME] == d[goog.uri.utils.ComponentIndex.SCHEME] && c[goog.uri.utils.ComponentIndex.PORT] == d[goog.uri.utils.ComponentIndex.PORT]; 7608}; 7609goog.uri.utils.assertNoFragmentsOrQueries_ = function(c) { 7610 goog.asserts.assert(0 > c.indexOf("#") && 0 > c.indexOf("?"), "goog.uri.utils: Fragment or query identifiers are not supported: [%s]", c); 7611}; 7612goog.uri.utils.parseQueryData = function(c, d) { 7613 if (c) { 7614 c = c.split("&"); 7615 for (var e = 0; e < c.length; e++) { 7616 var f = c[e].indexOf("="), g = null; 7617 if (0 <= f) { 7618 var h = c[e].substring(0, f); 7619 g = c[e].substring(f + 1); 7620 } else { 7621 h = c[e]; 7622 } 7623 d(h, g ? goog.string.urlDecode(g) : ""); 7624 } 7625 } 7626}; 7627goog.uri.utils.splitQueryData_ = function(c) { 7628 var d = c.indexOf("#"); 7629 0 > d && (d = c.length); 7630 var e = c.indexOf("?"); 7631 if (0 > e || e > d) { 7632 e = d; 7633 var f = ""; 7634 } else { 7635 f = c.substring(e + 1, d); 7636 } 7637 return [c.substr(0, e), f, c.substr(d)]; 7638}; 7639goog.uri.utils.joinQueryData_ = function(c) { 7640 return c[0] + (c[1] ? "?" + c[1] : "") + c[2]; 7641}; 7642goog.uri.utils.appendQueryData_ = function(c, d) { 7643 return d ? c ? c + "&" + d : d : c; 7644}; 7645goog.uri.utils.appendQueryDataToUri_ = function(c, d) { 7646 if (!d) { 7647 return c; 7648 } 7649 c = goog.uri.utils.splitQueryData_(c); 7650 c[1] = goog.uri.utils.appendQueryData_(c[1], d); 7651 return goog.uri.utils.joinQueryData_(c); 7652}; 7653goog.uri.utils.appendKeyValuePairs_ = function(c, d, e) { 7654 goog.asserts.assertString(c); 7655 if (goog.isArray(d)) { 7656 goog.asserts.assertArray(d); 7657 for (var f = 0; f < d.length; f++) { 7658 goog.uri.utils.appendKeyValuePairs_(c, String(d[f]), e); 7659 } 7660 } else { 7661 null != d && e.push(c + ("" === d ? "" : "=" + goog.string.urlEncode(d))); 7662 } 7663}; 7664goog.uri.utils.buildQueryData = function(c, d) { 7665 goog.asserts.assert(0 == Math.max(c.length - (d || 0), 0) % 2, "goog.uri.utils: Key/value lists must be even in length."); 7666 var e = []; 7667 for (d = d || 0; d < c.length; d += 2) { 7668 goog.uri.utils.appendKeyValuePairs_(c[d], c[d + 1], e); 7669 } 7670 return e.join("&"); 7671}; 7672goog.uri.utils.buildQueryDataFromMap = function(c) { 7673 var d = [], e; 7674 for (e in c) { 7675 goog.uri.utils.appendKeyValuePairs_(e, c[e], d); 7676 } 7677 return d.join("&"); 7678}; 7679goog.uri.utils.appendParams = function(c, d) { 7680 var e = 2 == arguments.length ? goog.uri.utils.buildQueryData(arguments[1], 0) : goog.uri.utils.buildQueryData(arguments, 1); 7681 return goog.uri.utils.appendQueryDataToUri_(c, e); 7682}; 7683goog.uri.utils.appendParamsFromMap = function(c, d) { 7684 d = goog.uri.utils.buildQueryDataFromMap(d); 7685 return goog.uri.utils.appendQueryDataToUri_(c, d); 7686}; 7687goog.uri.utils.appendParam = function(c, d, e) { 7688 e = goog.isDefAndNotNull(e) ? "=" + goog.string.urlEncode(e) : ""; 7689 return goog.uri.utils.appendQueryDataToUri_(c, d + e); 7690}; 7691goog.uri.utils.findParam_ = function(c, d, e, f) { 7692 for (var g = e.length; 0 <= (d = c.indexOf(e, d)) && d < f;) {
7693 var h = c.charCodeAt(d - 1); 7694 if (h == goog.uri.utils.CharCode_.AMPERSAND || h == goog.uri.utils.CharCode_.QUESTION) { 7695 if (h = c.charCodeAt(d + g), !h || h == goog.uri.utils.CharCode_.EQUAL || h == goog.uri.utils.CharCode_.AMPERSAND || h == goog.uri.utils.CharCode_.HASH) { 7696 return d; 7697 } 7698 } 7699 d += g + 1; 7700 } 7701 return -1; 7702}; 7703goog.uri.utils.hashOrEndRe_ = /#|$/; 7704goog.uri.utils.hasParam = function(c, d) { 7705 return 0 <= goog.uri.utils.findParam_(c, 0, d, c.search(goog.uri.utils.hashOrEndRe_)); 7706}; 7707goog.uri.utils.getParamValue = function(c, d) { 7708 var e = c.search(goog.uri.utils.hashOrEndRe_), f = goog.uri.utils.findParam_(c, 0, d, e); 7709 if (0 > f) { 7710 return null; 7711 } 7712 var g = c.indexOf("&", f); 7713 if (0 > g || g > e) { 7714 g = e; 7715 } 7716 f += d.length + 1; 7717 return goog.string.urlDecode(c.substr(f, g - f)); 7718}; 7719goog.uri.utils.getParamValues = function(c, d) { 7720 for (var e = c.search(goog.uri.utils.hashOrEndRe_), f = 0, g, h = []; 0 <= (g = goog.uri.utils.findParam_(c, f, d, e));) { 7721 f = c.indexOf("&", g); 7722 if (0 > f || f > e) { 7723 f = e; 7724 } 7725 g += d.length + 1; 7726 h.push(goog.string.urlDecode(c.substr(g, f - g))); 7727 } 7728 return h; 7729}; 7730goog.uri.utils.trailingQueryPunctuationRe_ = /[?&]($|#)/; 7731goog.uri.utils.removeParam = function(c, d) { 7732 for (var e = c.search(goog.uri.utils.hashOrEndRe_), f = 0, g, h = []; 0 <= (g = goog.uri.utils.findParam_(c, f, d, e));) { 7733 h.push(c.substring(f, g)), f = Math.min(c.indexOf("&", g) + 1 || e, e); 7734 } 7735 h.push(c.substr(f)); 7736 return h.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_, "$1"); 7737}; 7738goog.uri.utils.setParam = function(c, d, e) { 7739 return goog.uri.utils.appendParam(goog.uri.utils.removeParam(c, d), d, e); 7740}; 7741goog.uri.utils.setParamsFromMap = function(c, d) { 7742 c = goog.uri.utils.splitQueryData_(c); 7743 var e = c[1], f = []; 7744 e && goog.array.forEach(e.split("&"), function(c) { 7745 var e = c.indexOf("="); 7746 e = 0 <= e ? c.substr(0, e) : c; 7747 d.hasOwnProperty(e) || f.push(c); 7748 }); 7749 c[1] = goog.uri.utils.appendQueryData_(f.join("&"), goog.uri.utils.buildQueryDataFromMap(d)); 7750 return goog.uri.utils.joinQueryData_(c); 7751}; 7752goog.uri.utils.appendPath = function(c, d) { 7753 goog.uri.utils.assertNoFragmentsOrQueries_(c); 7754 goog.string.endsWith(c, "/") && (c = c.substr(0, c.length - 1)); 7755 goog.string.startsWith(d, "/") && (d = d.substr(1)); 7756 return goog.string.buildString(c, "/", d); 7757}; 7758goog.uri.utils.setPath = function(c, d) { 7759 goog.string.startsWith(d, "/") || (d = "/" + d); 7760 c = goog.uri.utils.split(c); 7761 return goog.uri.utils.buildFromEncodedParts(c[goog.uri.utils.ComponentIndex.SCHEME], c[goog.uri.utils.ComponentIndex.USER_INFO], c[goog.uri.utils.ComponentIndex.DOMAIN], c[goog.uri.utils.ComponentIndex.PORT], d, c[goog.uri.utils.ComponentIndex.QUERY_DATA], c[goog.uri.utils.ComponentIndex.FRAGMENT]); 7762}; 7763goog.uri.utils.StandardQueryParam = {RANDOM:"zx"}; 7764goog.uri.utils.makeUnique = function(c) { 7765 return goog.uri.utils.setParam(c, goog.uri.utils.StandardQueryParam.RANDOM, goog.string.getRandomString()); 7766}; 7767goog.net.XhrIo = function(c) { 7768 goog.events.EventTarget.call(this); 7769 this.headers = new goog.structs.Map; 7770 this.xmlHttpFactory_ = c || null; 7771 this.active_ = !1; 7772 this.xhrOptions_ = this.xhr_ = null; 7773 this.lastMethod_ = this.lastUri_ = ""; 7774 this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR; 7775 this.lastError_ = ""; 7776 this.inAbort_ = this.inOpen_ = this.inSend_ = this.errorDispatched_ = !1; 7777 this.timeoutInterval_ = 0; 7778 this.timeoutId_ = null; 7779 this.responseType_ = goog.net.XhrIo.ResponseType.DEFAULT; 7780 this.useXhr2Timeout_ = this.progressEventsEnabled_ = this.withCredentials_ = !1; 7781}; 7782goog.inherits(goog.net.XhrIo, goog.events.EventTarget); 7783goog.net.XhrIo.ResponseType = {DEFAULT:"", TEXT:"text", DOCUMENT:"document", BLOB:"blob", ARRAY_BUFFER:"arraybuffer"}; 7784goog.net.XhrIo.prototype.logger_ = goog.log.getLogger("goog.net.XhrIo"); 7785goog.net.XhrIo.CONTENT_TYPE_HEADER = "Content-Type"; 7786goog.net.XhrIo.CONTENT_TRANSFER_ENCODING = "Content-Transfer-Encoding"; 7787goog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i; 7788goog.net.XhrIo.METHODS_WITH_FORM_DATA = ["POST", "PUT"]; 7789goog.net.XhrIo.FORM_CONTENT_TYPE = "application/x-www-form-urlencoded;charset=utf-8"; 7790goog.net.XhrIo.XHR2_TIMEOUT_ = "timeout"; 7791goog.net.XhrIo.XHR2_ON_TIMEOUT_ = "ontimeout"; 7792goog.net.XhrIo.sendInstances_ = []; 7793goog.net.XhrIo.send = function(c, d, e, f, g, h, k) { 7794 var l = new goog.net.XhrIo; 7795 goog.net.XhrIo.sendInstances_.push(l); 7796 d && l.listen(goog.net.EventType.COMPLETE, d); 7797 l.listenOnce(goog.net.EventType.READY, l.cleanupSend_); 7798 h && l.setTimeoutInterval(h); 7799 k && l.setWithCredentials(k); 7800 l.send(c, e, f, g); 7801 return l; 7802}; 7803goog.net.XhrIo.cleanup = function() { 7804 for (var c = goog.net.XhrIo.sendInstances_; c.length;) { 7805 c.pop().dispose(); 7806 } 7807}; 7808goog.net.XhrIo.protectEntryPoints = function(c) { 7809 goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = c.protectEntryPoint(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_); 7810}; 7811goog.net.XhrIo.prototype.cleanupSend_ = function() { 7812 this.dispose(); 7813 goog.array.remove(goog.net.XhrIo.sendInstances_, this); 7814}; 7815goog.net.XhrIo.prototype.getTimeoutInterval = function() { 7816 return this.timeoutInterval_; 7817}; 7818goog.net.XhrIo.prototype.setTimeoutInterval = function(c) { 7819 this.timeoutInterval_ = Math.max(0, c); 7820}; 7821goog.net.XhrIo.prototype.setResponseType = function(c) { 7822 this.responseType_ = c; 7823}; 7824goog.net.XhrIo.prototype.getResponseType = function() { 7825 return this.responseType_; 7826}; 7827goog.net.XhrIo.prototype.setWithCredentials = function(c) { 7828 this.withCredentials_ = c; 7829}; 7830goog.net.XhrIo.prototype.getWithCredentials = function() { 7831 return this.withCredentials_; 7832}; 7833goog.net.XhrIo.prototype.setProgressEventsEnabled = function(c) { 7834 this.progressEventsEnabled_ = c; 7835}; 7836goog.net.XhrIo.prototype.getProgressEventsEnabled = function() { 7837 return this.progressEventsEnabled_; 7838}; 7839goog.net.XhrIo.prototype.send = function(c, d, e, f) { 7840 if (this.xhr_) { 7841 throw Error("[goog.net.XhrIo] Object is active with another request=" + this.lastUri_ + "; newUri=" + c); 7842 } 7843 d = d ? d.toUpperCase() : "GET"; 7844 this.lastUri_ = c; 7845 this.lastError_ = ""; 7846 this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR; 7847 this.lastMethod_ = d; 7848 this.errorDispatched_ = !1; 7849 this.active_ = !0; 7850 this.xhr_ = this.createXhr(); 7851 this.xhrOptions_ = this.xmlHttpFactory_ ? this.xmlHttpFactory_.getOptions() : goog.net.XmlHttp.getOptions(); 7852 this.xhr_.onreadystatechange = goog.bind(this.onReadyStateChange_, this); 7853 this.getProgressEventsEnabled() && "onprogress" in this.xhr_ && (this.xhr_.onprogress = goog.bind(function(c) { 7854 this.onProgressHandler_(c, !0); 7855 }, this), this.xhr_.upload && (this.xhr_.upload.onprogress = goog.bind(this.onProgressHandler_, this))); 7856 try { 7857 goog.log.fine(this.logger_, this.formatMsg_("Opening Xhr")), this.inOpen_ = !0, this.xhr_.open(d, String(c), !0), this.inOpen_ = !1; 7858 } catch (h) { 7859 goog.log.fine(this.logger_, this.formatMsg_("Error opening Xhr: " + h.message)); 7860 this.error_(goog.net.ErrorCode.EXCEPTION, h); 7861 return; 7862 } 7863 c = e || ""; 7864 var g = this.headers.clone();
7865 f && goog.structs.forEach(f, function(c, d) { 7866 g.set(d, c); 7867 }); 7868 f = goog.array.find(g.getKeys(), goog.net.XhrIo.isContentTypeHeader_); 7869 e = goog.global.FormData && c instanceof goog.global.FormData; 7870 !goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA, d) || f || e || g.set(goog.net.XhrIo.CONTENT_TYPE_HEADER, goog.net.XhrIo.FORM_CONTENT_TYPE); 7871 g.forEach(function(c, d) { 7872 this.xhr_.setRequestHeader(d, c); 7873 }, this); 7874 this.responseType_ && (this.xhr_.responseType = this.responseType_); 7875 "withCredentials" in this.xhr_ && this.xhr_.withCredentials !== this.withCredentials_ && (this.xhr_.withCredentials = this.withCredentials_); 7876 try { 7877 this.cleanUpTimeoutTimer_(), 0 < this.timeoutInterval_ && (this.useXhr2Timeout_ = goog.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_), goog.log.fine(this.logger_, this.formatMsg_("Will abort after " + this.timeoutInterval_ + "ms if incomplete, xhr2 " + this.useXhr2Timeout_)), this.useXhr2Timeout_ ? (this.xhr_[goog.net.XhrIo.XHR2_TIMEOUT_] = this.timeoutInterval_, this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = goog.bind(this.timeout_, this)) : this.timeoutId_ = goog.Timer.callOnce(this.timeout_, this.timeoutInterval_, 7878 this)), goog.log.fine(this.logger_, this.formatMsg_("Sending request")), this.inSend_ = !0, this.xhr_.send(c), this.inSend_ = !1; 7879 } catch (h) { 7880 goog.log.fine(this.logger_, this.formatMsg_("Send error: " + h.message)), this.error_(goog.net.ErrorCode.EXCEPTION, h); 7881 } 7882}; 7883goog.net.XhrIo.shouldUseXhr2Timeout_ = function(c) { 7884 return goog.userAgent.IE && goog.userAgent.isVersionOrHigher(9) && goog.isNumber(c[goog.net.XhrIo.XHR2_TIMEOUT_]) && goog.isDef(c[goog.net.XhrIo.XHR2_ON_TIMEOUT_]); 7885}; 7886goog.net.XhrIo.isContentTypeHeader_ = function(c) { 7887 return goog.string.caseInsensitiveEquals(goog.net.XhrIo.CONTENT_TYPE_HEADER, c); 7888}; 7889goog.net.XhrIo.prototype.createXhr = function() { 7890 return this.xmlHttpFactory_ ? this.xmlHttpFactory_.createInstance() : goog.net.XmlHttp(); 7891}; 7892goog.net.XhrIo.prototype.timeout_ = function() { 7893 "undefined" != typeof goog && this.xhr_ && (this.lastError_ = "Timed out after " + this.timeoutInterval_ + "ms, aborting", this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT, goog.log.fine(this.logger_, this.formatMsg_(this.lastError_)), this.dispatchEvent(goog.net.EventType.TIMEOUT), this.abort(goog.net.ErrorCode.TIMEOUT)); 7894}; 7895goog.net.XhrIo.prototype.error_ = function(c, d) { 7896 this.active_ = !1; 7897 this.xhr_ && (this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1); 7898 this.lastError_ = d; 7899 this.lastErrorCode_ = c; 7900 this.dispatchErrors_(); 7901 this.cleanUpXhr_(); 7902}; 7903goog.net.XhrIo.prototype.dispatchErrors_ = function() { 7904 this.errorDispatched_ || (this.errorDispatched_ = !0, this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.ERROR)); 7905}; 7906goog.net.XhrIo.prototype.abort = function(c) { 7907 this.xhr_ && this.active_ && (goog.log.fine(this.logger_, this.formatMsg_("Aborting")), this.active_ = !1, this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1, this.lastErrorCode_ = c || goog.net.ErrorCode.ABORT, this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.ABORT), this.cleanUpXhr_()); 7908}; 7909goog.net.XhrIo.prototype.disposeInternal = function() { 7910 this.xhr_ && (this.active_ && (this.active_ = !1, this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1), this.cleanUpXhr_(!0)); 7911 goog.net.XhrIo.superClass_.disposeInternal.call(this); 7912}; 7913goog.net.XhrIo.prototype.onReadyStateChange_ = function() { 7914 if (!this.isDisposed()) { 7915 if (this.inOpen_ || this.inSend_ || this.inAbort_) { 7916 this.onReadyStateChangeHelper_(); 7917 } else { 7918 this.onReadyStateChangeEntryPoint_(); 7919 } 7920 } 7921}; 7922goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() { 7923 this.onReadyStateChangeHelper_(); 7924}; 7925goog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() { 7926 if (this.active_ && "undefined" != typeof goog) { 7927 if (this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] && this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE && 2 == this.getStatus()) { 7928 goog.log.fine(this.logger_, this.formatMsg_("Local request error detected and ignored")); 7929 } else { 7930 if (this.inSend_ && this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) { 7931 goog.Timer.callOnce(this.onReadyStateChange_, 0, this); 7932 } else { 7933 if (this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE), this.isComplete()) { 7934 goog.log.fine(this.logger_, this.formatMsg_("Request complete")); 7935 this.active_ = !1; 7936 try { 7937 this.isSuccess() ? (this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.SUCCESS)) : (this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR, this.lastError_ = this.get
7937StatusText() + " [" + this.getStatus() + "]", this.dispatchErrors_()); 7938 } finally { 7939 this.cleanUpXhr_(); 7940 } 7941 } 7942 } 7943 } 7944 } 7945}; 7946goog.net.XhrIo.prototype.onProgressHandler_ = function(c, d) { 7947 goog.asserts.assert(c.type === goog.net.EventType.PROGRESS, "goog.net.EventType.PROGRESS is of the same type as raw XHR progress."); 7948 this.dispatchEvent(goog.net.XhrIo.buildProgressEvent_(c, goog.net.EventType.PROGRESS)); 7949 this.dispatchEvent(goog.net.XhrIo.buildProgressEvent_(c, d ? goog.net.EventType.DOWNLOAD_PROGRESS : goog.net.EventType.UPLOAD_PROGRESS)); 7950}; 7951goog.net.XhrIo.buildProgressEvent_ = function(c, d) { 7952 return {type:d, lengthComputable:c.lengthComputable, loaded:c.loaded, total:c.total}; 7953}; 7954goog.net.XhrIo.prototype.cleanUpXhr_ = function(c) { 7955 if (this.xhr_) { 7956 this.cleanUpTimeoutTimer_(); 7957 var d = this.xhr_, e = this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] ? goog.nullFunction : null; 7958 this.xhrOptions_ = this.xhr_ = null; 7959 c || this.dispatchEvent(goog.net.EventType.READY); 7960 try { 7961 d.onreadystatechange = e; 7962 } catch (f) { 7963 goog.log.error(this.logger_, "Problem encountered resetting onreadystatechange: " + f.message); 7964 } 7965 } 7966}; 7967goog.net.XhrIo.prototype.cleanUpTimeoutTimer_ = function() { 7968 this.xhr_ && this.useXhr2Timeout_ && (this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = null); 7969 this.timeoutId_ && (goog.Timer.clear(this.timeoutId_), this.timeoutId_ = null); 7970}; 7971goog.net.XhrIo.prototype.isActive = function() { 7972 return !!this.xhr_; 7973}; 7974goog.net.XhrIo.prototype.isComplete = function() { 7975 return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE; 7976}; 7977goog.net.XhrIo.prototype.isSuccess = function() { 7978 var c = this.getStatus(); 7979 return goog.net.HttpStatus.isSuccess(c) || 0 === c && !this.isLastUriEffectiveSchemeHttp_(); 7980}; 7981goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() { 7982 var c = goog.uri.utils.getEffectiveScheme(String(this.lastUri_)); 7983 return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(c); 7984}; 7985goog.net.XhrIo.prototype.getReadyState = function() { 7986 return this.xhr_ ? this.xhr_.readyState : goog.net.XmlHttp.ReadyState.UNINITIALIZED; 7987}; 7988goog.net.XhrIo.prototype.getStatus = function() { 7989 try { 7990 return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ? this.xhr_.status : -1; 7991 } catch (c) { 7992 return -1; 7993 } 7994}; 7995goog.net.XhrIo.prototype.getStatusText = function() { 7996 try { 7997 return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ? this.xhr_.statusText : ""; 7998 } catch (c) { 7999 return goog.log.fine(this.logger_, "Can not get status: " + c.message), ""; 8000 } 8001}; 8002goog.net.XhrIo.prototype.getLastUri = function() { 8003 return String(this.lastUri_); 8004}; 8005goog.net.XhrIo.prototype.getResponseText = function() { 8006 try { 8007 return this.xhr_ ? this.xhr_.responseText : ""; 8008 } catch (c) { 8009 return goog.log.fine(this.logger_, "Can not get responseText: " + c.message), ""; 8010 } 8011}; 8012goog.net.XhrIo.prototype.getResponseBody = function() { 8013 try { 8014 if (this.xhr_ && "responseBody" in this.xhr_) { 8015 return this.xhr_.responseBody; 8016 } 8017 } catch (c) { 8018 goog.log.fine(this.logger_, "Can not get responseBody: " + c.message); 8019 } 8020 return null; 8021}; 8022goog.net.XhrIo.prototype.getResponseXml = function() { 8023 try { 8024 return this.xhr_ ? this.xhr_.responseXML : null; 8025 } catch (c) { 8026 return goog.log.fine(this.logger_, "Can not get responseXML: " + c.message), null; 8027 } 8028}; 8029goog.net.XhrIo.prototype.getResponseJson = function(c) { 8030 if (this.xhr_) { 8031 var d = this.xhr_.responseText; 8032 c && 0 == d.indexOf(c) && (d = d.substring(c.length)); 8033 return goog.json.hybrid.parse(d); 8034 } 8035}; 8036goog.net.XhrIo.prototype.getResponse = function() { 8037 try { 8038 if (!this.xhr_) { 8039 return null; 8040 } 8041 if ("response" in this.xhr_) { 8042 return this.xhr_.response; 8043 } 8044 switch(this.responseType_) { 8045 case goog.net.XhrIo.ResponseType.DEFAULT: 8046 case goog.net.XhrIo.ResponseType.TEXT: 8047 return this.xhr_.responseText; 8048 case goog.net.XhrIo.ResponseType.ARRAY_BUFFER: 8049 if ("mozResponseArrayBuffer" in this.xhr_) { 8050 return this.xhr_.mozResponseArrayBuffer; 8051 } 8052 } 8053 goog.log.error(this.logger_, "Response type " + this.responseType_ + " is not supported on this browser"); 8054 return null; 8055 } catch (c) { 8056 return goog.log.fine(this.logger_, "Can not get response: " + c.message), null; 8057 } 8058}; 8059goog.net.XhrIo.prototype.getResponseHeader = function(c) { 8060 if (this.xhr_ && this.isComplete()) { 8061 return c = this.xhr_.getResponseHeader(c), goog.isNull(c) ? void 0 : c; 8062 } 8063}; 8064goog.net.XhrIo.prototype.getAllResponseHeaders = function() { 8065 return this.xhr_ && this.isComplete() ? this.xhr_.getAllResponseHeaders() || "" : ""; 8066}; 8067goog.net.XhrIo.prototype.getResponseHeaders = function() { 8068 for (var c = {}, d = this.getAllResponseHeaders().split("\r\n"), e = 0; e < d.length; e++) { 8069 if (!goog.string.isEmptyOrWhitespace(d[e])) { 8070 var f = goog.string.splitLimit(d[e], ": ", 2); 8071 c[f[0]] = c[f[0]] ? c[f[0]] + (", " + f[1]) : f[1]; 8072 } 8073 } 8074 return c; 8075}; 8076goog.net.XhrIo.prototype.getStreamingResponseHeader = function(c) { 8077 return this.xhr_ ? this.xhr_.getResponseHeader(c) : null; 8078}; 8079goog.net.XhrIo.prototype.getAllStreamingResponseHeaders = function() { 8080 return this.xhr_ ? this.xhr_.getAllResponseHeaders() : ""; 8081}; 8082goog.net.XhrIo.prototype.getLastErrorCode = function() { 8083 return this.lastErrorCode_; 8084}; 8085goog.net.XhrIo.prototype.getLastError = function() { 8086 return goog.isString(this.lastError_) ? this.lastError_ : String(this.lastError_); 8087}; 8088goog.net.XhrIo.prototype.formatMsg_ = function(c) { 8089 return c + " [" + this.lastMethod_ + " " + this.lastUri_ + " " + this.get
8089Status() + "]"; 8090}; 8091goog.debug.entryPointRegistry.register(function(c) { 8092 goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = c(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_); 8093}); 8094Matrix.mxXHR = {}; 8095var mxXHR = function(c, d) { 8096 d = void 0 === d ? {send:!0, delay:0, responseType:"json"} : d; 8097 Model.call(this, null, "mxXhr", {uri:cI(c), xhr:cI(null), okResult:cI(null, {observer:d.okHandler})}); 8098 this.responseType = d.responseType; 8099 d.send && this.send(d.delay); 8100}; 8101$jscomp.inherits(mxXHR, Model); 8102mxXHR.cname = Model.cname; 8103mxXHR.prototype.send = function(c) { 8104 var d = this, e = function() { 8105 d.sent = Date.now(); 8106 goog.net.XhrIo.send(d.uri, function(c) { 8107 c = c.target; 8108 d.xhr = c; 8109 d.recd = Date.now(); 8110 d.verbose && clg("xhr responded after", Date.now() - d.sent); 8111 if (c.isSuccess()) { 8112 if ("json" === d.responseType) { 8113 d.okResult = c.getResponseJson(); 8114 } else { 8115 if ("xml" === d.responseType) { 8116 d.okResult = c.getResponseXML(); 8117 } else { 8118 if ("test" === d.responseType) { 8119 d.okResult = c.getResponseText(); 8120 } else { 8121 throw "Invalid XHR responseType=" + d.responseType; 8122 } 8123 } 8124 } 8125 } else { 8126 if (c.isActive()) { 8127 clg("xhr still active", d.uri); 8128 } else { 8129 if (c.isComplete()) { 8130 clg("xhr complete", d.uri, c.getLastError()); 8131 } else { 8132 throw clg("send XHR uh-oh", d.uri), "getXHR error " + c.getLastError() + " on xhr " + d.uri; 8133 } 8134 } 8135 } 8136 }); 8137 }; 8138 c ? setTimeout(e, c) : e(); 8139 return d; 8140}; 8141window.mxXHR = mxXHR; 8142function getXHR_JSON(c) { 8143 goog.net.XhrIo.send(c, function(c) { 8144 c = c.target; 8145 if (c.isSuccess()) { 8146 return c.getResponseJson(); 8147 } 8148 throw "getXHR_JSONxhr last error: " + c.getLastError(); 8149 }); 8150} 8151function xhrJson(c, d) { 8152 d = void 0 === d ? {} : d; 8153 return new mxXHR(c, Object.assign({send:!0, delay:0, responseType:"json"}, d)); 8154} 8155function testXHR() { 8156 clg("testXHR"); 8157 var c = mkm(null, "testX", {lookup:cF(function(c) { 8158 clg("lookup"); 8159 return new mxXHR("https://api.fda.gov/drug/event.json?search=patient.drug.openfda.brand_name:adderall&limit=3"); 8160 }), result:cF(function(c) { 8161 clg("res"); 8162 c = c.md.lookup; 8163 clg("result sees lookup", c, c.hunh, c.xhr); 8164 return c.xhr; 8165 }), stuff:cF(function(c) { 8166 clg("stuff"); 8167 if (c = c.md.result) { 8168 if (c.isSuccess()) { 8169 return c = c.getResponseJson(), clg("total AEs!!!!!!", c.meta.results.total), c.meta.results.total + "AEs found"; 8170 } 8171 clg("xhr last error", c.getLastError()); 8172 return "Error " + c.getLastError(); 8173 } 8174 clg("No result!!!"); 8175 })}); 8176 c.lookup.send(); 8177 console.log("test result " + c.lookup.result); 8178} 8179function getabm() { 8180 clg("getabm!!!!!!!!!!!"); 8181} 8182function xhraw(c) { 8183 var d = new XMLHttpRequest; 8184 d.addEventListener("load", function(c) { 8185 clg("load", c.target.response); 8186 debugger; 8187 }); 8188 d.addEventListener("abort", function(c) { 8189 return clg("abort", d == c.target); 8190 }); 8191 d.addEventListener("error", function(c) { 8192 return clg("error", d == c.target); 8193 }); 8194 d.open("GET", c); 8195 d.responseType = "json"; 8196 d.send(); 8197} 8198;var Hiring = {utility:{}}; 8199function toggleChar(c, d, e, f, g, h, k, l) { 8200 h = void 0 === h ? {} : h; 8201 k = void 0 === k ? {} : k; 8202 return span(Object.assign({style:"font-weight:bold; cursor:pointer; margin-left:9px; font-family:Arial; font-size:1em;" + (void 0 === l ? "" : l), onclick:function(c) { 8203 return c.onOff = !c.onOff; 8204 }, title:d, content:cF(function(c) { 8205 return c.md.onOff ? f : g; 8206 })}, h), Object.assign({name:c, onOff:cI(e)}, k)); 8207} 8208function slideInRule(c, d) { 8209 return c.pv === kUnbound ? d ? "slideIn" : "" : d ? "slideIn" : "slideOut"; 8210} 8211function openShutCase(c, d, e, f, g) { 8212 for (var h = [], k = 4; k < arguments.length; ++k) { 8213 h[k - 4] = arguments[k]; 8214 } 8215 var l = c + "-toggle"; 8216 return div(div({class:"selector"}, span(d), toggleChar(l, "Show/hide " + d, e, "▾", "▸"), f), div({class:cF(function(c) { 8217 return "osBody " + slideInRule(c, c.md.fmUp(l).onOff); 8218 }), style:cF(function(c) { 8219 return "background:#ff6600;display:" + (c.md.fmUp(l).onOff ? "block" : "none"); 8220 })}, h.map(function(c) { 8221 return c(); 8222 }))); 8223} 8224function openCase(c, d, e) { 8225 for (var f = [], g = 2; g < arguments.length; ++g) { 8226 f[g - 2] = arguments[g]; 8227 } 8228 return div(span({style:"margin-left:24px;min-width:48px"}, d), f.map(function(c) { 8229 return c(); 8230 })); 8231} 8232function onOffCheckbox(c) { 8233 var d = $jscomp.makeIterator(c); 8234 c = d.next().value; 8235 var e = d.next().value; 8236 d = d.next().value; 8237 var f = Math.randomInt(100000); 8238 return div(input({id:c + "ID" + f, type:"checkbox", style:"margin-left:18px", checked:cF(function(c) { 8239 return c.md.onOff; 8240 }), title:d, onclick:function(c) { 8241 return c.onOff = !c.onOff; 8242 }}, {name:c, onOff:cI(!1)}), label({for:name + "ID" + f, title:d}, e)); 8243} 8244var hzFlexWrap = {display:"flex", flex_wrap:"wrap"}, hzFlexWrapCentered = {display:"flex", flex_wrap:"wrap", align_items:"center"}, hzFlexWrapBottom = {display:"flex", flex_wrap:"wrap", align_items:"bottom"}; 8245function helpToggle(c, d, e) { 8246 e = void 0 === e ? {} : e; 8247 return b(merge({style:"color:white; cursor:pointer; margin-left:9px;", onclick:function(c) { 8248 return c.onOff = !c.onOff; 8249 }, title:d, content:cF(function(c) { 8250 return c.md.onOff ? "hide" : "help"; 8251 })}, e), {name:c, onOff:cI(!1)}); 8252} 8253function viewOnHN(c, d) { 8254 d = void 0 === d ? {} : d; 8255 return a(merge({href:c, title:"View on the HN site"}, d), img({src:"dist/hn24.png"})); 8256} 8257function myRange(c, d) { 8258 if (void 0 === c) { 8259 return []; 8260 } 8261 if (void 0 === d) { 8262 return myRange(0, c); 8263 } 8264 var e = []; 8265 for (n = c; n < d; ++n) { 8266 e.push(n); 8267 } 8268 return e; 8269} 8270function merge(c) { 8271 for (var d = [], e = 0; e < arguments.length; ++e) { 8272 d[e - 0] = arguments[e]; 8273 } 8274 return Object.assign.apply(Object, [{}].concat($jscomp.arrayFromIterable(d))); 8275} 8276function mobileCheck() { 8277 var c = !1, d = navigator.userAgent || navigator.vendor || window.opera; 8278 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(d) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
8278sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(d.substr(0, 8279 4))) { 8280 c = !0; 8281 } 8282 return c; 8283} 8284function pnow() { 8285 return performance.now(); 8286} 8287function plaps(c, d) { 8288} 8289function helpOff(c, d, e) { 8290 c.fmUp(d).onOff = !1; 8291} 8292function helpList(c, d) { 8293 return div({class:cF(function(c) { 8294 return "help " + slideInRule(c, c.md.fmUp(d).onOff); 8295 }), style:cF(function(c) { 8296 return "display:" + (c.md.fmUp(d).onOff ? "block" : "none"); 8297 }), onclick:function(c) { 8298 return helpOff(c, d, "outerdiv"); 8299 }}, div({style:"cursor:pointer;text-align: right;margin-right:18px;", onclick:function(c) { 8300 return helpOff(c, d, "Xchar"); 8301 }}, "X"), ul({style:"list-style:none; margin-left:0;padding 6px"}, c.map(function(c) { 8302 return li({class:"helpli"}, c); 8303 }))); 8304} 8305function getParameterByName(c, d) { 8306 d || (d = window.location.href); 8307 c = c.replace(/[\[\]]/g, "\\$&"); 8308 return (c = (new RegExp("[?&]" + c + "(=([^&#]*)|&|#|$)")).exec(d)) ? c[2] ? decodeURIComponent(c[2].replace(/\+/g, " ")) : "" : null; 8309} 8310window.getParameterByName = getParameterByName; 8311Hiring.usernote = {}; 8312var UNOTE = "whoishiring.unote.", UserNotes = function(c) { 8313 MXStorable.call(this, Object.assign({lsPrefix:UNOTE}, c, {hnId:c.hnId, stars:cI(c.stars || 0), hidden:cI(c.hidden || !1), excluded:cI(c.excluded || !1), applied:cI(c.applied || !1), notes:cI(c.notes)})); 8314}; 8315$jscomp.inherits(UserNotes, MXStorable); 8316UserNotes.cname = MXStorable.cname; 8317UserNotes.removeAllItems = MXStorable.removeAllItems; 8318UserNotes.loadAllItems = MXStorable.loadAllItems; 8319UserNotes.countAllItems = MXStorable.countAllItems; 8320UserNotes.storeObject = MXStorable.storeObject; 8321UserNotes.obsAnyChange = MXStorable.obsAnyChange; 8322UserNotes.load = MXStorable.load; 8323UserNotes.storableProperties = function() { 8324 return "id hnId excluded stars hidden applied notes".split(" ").concat(MXStorable.storableProperties.call(this)); 8325}; 8326UserNotes.loadFromStorage = function() { 8327 return mkm(null, "JobList", {dict:cF(function(c) { 8328 c = {}; 8329 for (var d = MXStorable.loadAllItems(UserNotes, UNOTE) || [], e = 0; e < d.length; ++e) { 8330 var f = d[e]; 8331 c[f.hnId] = f; 8332 } 8333 return c; 8334 })}); 8335}; 8336var UNote = UserNotes.loadFromStorage(); 8337function userAnnotations(c) { 8338 return div({style:"display:flex; flex-direction: column"}, div({class:"userAnnotations"}, jobStars(c), applied(c), noteToggle(c), excludeJob(c)), noteEditor(c)); 8339} 8340function noteToggle(c) { 8341 var d = UNote.dict[c.hnId]; 8342 return span({style:cF(function(c) { 8343 return "margin-left:18px; cursor:pointer;color:" + (d.notes && 0 < d.notes.length ? "#f00" : "#000"); 8344 }), title:"Show/hide editor for your own notes", onclick:function(c) { 8345 return c.editing = !c.editing; 8346 }}, {name:"note-toggle", editing:cI(0 < (d.notes || "").length)}, "Notes"); 8347} 8348function noteEditor(c) { 8349 var d = UNote.dict[c.hnId]; 8350 return textarea({class:cF(function(c) { 8351 return slideInRule(c, c.md.fmUp("note-toggle").editing); 8352 }), style:cF(function(c) { 8353 return "padding:8px;margin-left:12px;margin-right:12px;display:" + (c.md.fmUp("note-toggle").editing ? "flex" : "none"); 8354 }), placeholder:"Your notes here", onchange:function(c, f) { 8355 return d.notes = f.target.value; 8356 }}, d.notes || ""); 8357} 8358var MAX_STARS = 3; 8359function jobStars(c) { 8360 return div({style:hzFlexWrapBottom}, function(d) { 8361 d = []; 8362 for (var e = UNote.dict[c.hnId], f = 0; f < MAX_STARS; ++f) { 8363 d.push(span({content:"★", style:cF(function(c) { 8364 return "margin-top:0px;cursor:pointer;color:" + (e.stars >= c.md.starN ? "red;" : "gray;"); 8365 }), onclick:function(c) { 8366 c.fmUp("job-listing"); 8367 e.stars = e.stars === c.starN ? 0 : c.starN; 8368 }}, {starN:f + 1})); 8369 } 8370 return d; 8371 }); 8372} 8373function excludeJob(c) { 8374 return span({content:"⃠", title:"Exclude from view (reversible)", style:cF(function(d) { 8375 return "margin:4px 4px 8px 0;min-width:1em;font-size:1em;" + (UNote.dict[c.hnId].excluded ? "color:red;font-weight:bolder" : "color:black"); 8376 }), onclick:function(d) { 8377 d = UNote.dict[c.hnId]; 8378 d.excluded = !d.excluded; 8379 }}, {name:"excluded?"}); 8380} 8381function applied(c) { 8382 return div({style:"display:flex; flex-wrap: wrap; align-items:center"}, input({id:"applied?" + c.hnId, type:"checkbox", style:"margin-left:18px", checked:cF(function(d) { 8383 return UNote.dict[c.hnId].applied || !1; 8384 }), onclick:function(d) { 8385 d = UNote.dict[c.hnId]; 8386 d.applied = !d.applied; 8387 }}, {name:"applied?"}), label({for:"applied?" + c.hnId, style:cF(function(d) { 8388 return "color:" + (UNote.dict[c.hnId].applied ? "red" : "black"); 8389 })}, "Applied")); 8390} 8391;Hiring.filtering = {}; 8392function jobListFilter(c, d) { 8393 if (!d) { 8394 return []; 8395 } 8396 var e = c.fmUp("REMOTE").onOff, f = c.fmUp("ONSITE").onOff, g = c.fmUp("VISA").onOff, h = c.fmUp("INTERNS").onOff, k = c.fmUp("Excluded").onOff, l = c.fmUp("Starred").onOff, m = c.fmUp("Applied").onOff, r = c.fmUp("Noted").onOff, t = c.fmUp("Unreviewed").onOff; 8397 c.fmUp("sortby"); 8398 var x = c.fmUp("titlergx").rgxTree, v = c.fmUp("listingrgx").rgxTree; 8399 return d.filter(function(c) { 8400 return !e || c.remote; 8401 }).filter(function(c) { 8402 return !f || c.onsite; 8403 }).filter(function(c) { 8404 return !g || c.visa; 8405 }).filter(function(c) { 8406 return !h || c.intern; 8407 }).filter(function(c) { 8408 return !m || UNote.dict[c.hnId].applied; 8409 }).filter(function(c) { 8410 return !k || UNote.dict[c.hnId].excluded; 8411 }).filter(function(c) { 8412 return !l || 0 < UNote.dict[c.hnId].stars; 8413 }).filter(function(c) { 8414 return !t || !(UNote.dict[c.hnId].applied || UNote.dict[c.hnId].excluded || UNote.dict[c.hnId].stars || UNote.dict[c.hnId].notes); 8415 }).filter(function(c) { 8416 return !r || UNote.dict[c.hnId].notes; 8417 }).filter(function(c) { 8418 return !x || rgxTreeMatch(c.titlesearch, x); 8419 }).filter(function(c) { 8420 return !v || rgxTreeMatch(c.titlesearch, v) || rgxTreeMatch(c.bodysearch, v); 8421 }); 8422} 8423function rgxTreeMatch(c, d) { 8424 return d.some(function(d) { 8425 return d.every(function(d) { 8426 return c.match(d); 8427 }); 8428 }); 8429}
8430var uDefault = [["udshowDetails", "Expand listings", "Show full listing or just the title"]]; 8431function mkUserDefaults() { 8432 return div({style:hzFlexWrap}, span({style:"min-width:80px"}, "Defaults"), div({style:hzFlexWrap}, uDefault.map(function(c) { 8433 return onOffCheckbox(c); 8434 }))); 8435} 8436var titleSelects = [[["REMOTE", "Does regex search of title for remote jobs"], ["ONSITE", "Does regex search of title for on-site jobs"]], [["INTERNS", "Does regex search of title for internships"], ["VISA", "Does regex search of title for Visa sponsors"]]], userSelects = [[["Starred", "Show only jobs you have rated with stars"], ["Noted", "Show only jobs on which you have made a note"]], [["Applied", "Show only jobs you have marked as applied to"], ["Excluded", "Show jobs you exluded from view"], 8437["Unreviewed", "Show only jobs you have not annotated in any way"]]]; 8438function mkTitleSelects() { 8439 return mkJobSelectsEx("title", "Title selects", titleSelects); 8440} 8441function mkUserSelects() { 8442 return mkJobSelectsEx("user", "User selects", userSelects); 8443} 8444function mkJobSelectsEx(c, d, e, f) { 8445 f = void 0 === f ? {} : f; 8446 return div({style:merge(hzFlexWrap, {margin:"8px 0 8px 24px"}, f)}, e.map(function(d) { 8447 return div({style:"display:flex; flex:nowrap;"}, d.map(function(d) { 8448 return mkJobSelect(c, d); 8449 })); 8450 })); 8451} 8452function mkJobSelect(c, d) { 8453 return div({style:"color: white; min-width:96px; display:flex; align-items:center"}, input({id:d[0] + "ID", class:c + "-jSelect", style:"background:#eee", type:"checkbox", checked:cF(function(c) { 8454 return c.md.onOff; 8455 }), title:d[1], onclick:function(c) { 8456 c.dom.checked = !c.onOff; 8457 setTimeout(function() { 8458 return c.onOff = !c.onOff; 8459 }, 0); 8460 }}, {name:d[0], onOff:cI(!1)}), label({for:d[0] + "ID", title:d[1]}, d[0])); 8461} 8462;Hiring.jobDomParse = {}; 8463var internOK = new RegExp(/((internship|intern)(?=|s,\)))/i), nointernOK = new RegExp(/((no internship|no intern)(?
8463=|s,\)))/i), visaOK = new RegExp(/((visa|visas)(?=|s,\)))/i), novisaOK = new RegExp(/((no visa|no visas)(?=|s,\)))/i), onsiteOK = new RegExp(/(on.?site)/i), remoteOK = new RegExp(/(remote)/i), noremoteOK = new RegExp(/(no remote)/i); 8464function jobSpec(c) { 8465 for (var d = {hnId:c.id, body:[]}, e = 0; e < c.children.length; ++e) { 8466 jobSpecExtend(d, c.children[e], 0); 8467 } 8468 return d; 8469} 8470function charCount(c, d) { 8471 for (var e = 0, f = 0; f < c.length; ++f) { 8472 c[f] === d && ++e; 8473 } 8474 return e; 8475} 8476var hdrClass = "c5a cae c00 c9c cdd c73 c88".split(" "); 8477function jobSpecExtend(c, d, e) { 8478 var f = d.className; 8479 if (hdrClass.some(function(c) { 8480 return d.classList.contains(c); 8481 })) { 8482 var g = d.getElementsByClassName("reply"); 8483 Array.prototype.map.call(g, function(c) { 8484 c.remove(); 8485 }); 8486 g = d.childNodes; 8487 for (var h = !0, k = 0, l = !1, m = [], r = 0; r < g.length; r++) { 8488 if (w = g[r], h) { 8489 if (1 === w.nodeType && "P" === w.nodeName) { 8490 var t = m.map(function(c) { 8491 return c.textContent; 8492 }).join(" | "), x = t.split("|").map(function(c) { 8493 return c.trim(); 8494 }), v = function(c) { 8495 return x.some(function(d) { 8496 return null !== d.match(c); 8497 }); 8498 }; 8499 h = !1; 8500 c.onsite = v(onsiteOK); 8501 c.remote = v(remoteOK) && !v(noremoteOK); 8502 c.visa = v(visaOK) && !v(novisaOK); 8503 c.intern = v(internOK) && !v(nointernOK); 8504 if (!(l || k || c.onsite || c.remote || c.visa || c.intern)) { 8505 break; 8506 } 8507 c.OK = !0; 8508 c.body.push(w); 8509 c.company = x[0]; 8510 c.titlesearch = t; 8511 c.title = m; 8512 } else { 8513 k += charCount(w.textContent, "|"), 1 === w.nodeType && "A" === w.nodeName && (l = !0), m.push(w); 8514 } 8515 } else { 8516 c.body.push(w); 8517 } 8518 } 8519 c.OK && (c.bodysearch = c.body.map(function(c) { 8520 return c.textContent; 8521 }).join("*4*2*")); 8522 } 8523 if ("reply" !== f) { 8524 for (var w = 0; w < d.children.length; ++w) { 8525 jobSpecExtend(c, d.children[w], e + 1); 8526 } 8527 } 8528} 8529;Hiring.jobLoader = {}; 8530var SEARCH_MO_IDX = 0; 8531function pickAMonth() { 8532 return div({class:"pickAMonth"}, select({name:"searchMonth", class:"searchMonth", value:cI(gMonthlies[SEARCH_MO_IDX].hnId), onchange:function(c, d) { 8533 var e = c.fmUp("progress"); 8534 ast(e); 8535 e.value = 0; 8536 e.maxN = 0; 8537 e.seen = new Set; 8538 e.hidden = !1; 8539 c.value = d.target.value; 8540 }}, gMonthlies.map(function(c, d) { 8541 return option({value:c.hnId, selected:d === SEARCH_MO_IDX ? "selected" : null}, c.desc); 8542 })), div({style:hzFlexWrapCentered}, viewOnHN(cF(function(c) { 8543 return "https://news.ycombinator.com/item?id=" + c.md.fmUp("searchMonth").value; 8544 }), {hidden:cF(function(c) { 8545 return !c.md.fmUp("searchMonth").value; 8546 })}), span({style:"color: #fcfcfc; margin: 0 12px 0 12px", hidden:cF(function(c) { 8547 return !c.md.fmUp("searchMonth").value; 8548 }), content:cF(function(c) { 8549 var d = c.md.fmUp("progress"); 8550 c = c.md.fmUp("jobLoader").jobs || []; 8551 return d.hidden ? "Total jobs: " + c.length : "Parsing: " + PARSE_CHUNK_SIZE * d.value; 8552 })}), progress({max:cF(function(c) { 8553 return c.md.maxN + ""; 8554 }), hidden:cF(function(c) { 8555 return !c.md.fmUp("searchMonth").value; 8556 }), value:cI(0)}, {name:"progress", maxN:cI(0), seen:cI(new Set)}))); 8557} 8558var startLoad; 8559function jobListingLoader() { 8560 return div({style:"visibility:collapsed;"}, {name:"jobLoader", jobs:cF(function(c) { 8561 c = c.md.kids.map(function(c) { 8562 return c.jobs; 8563 }); 8564 return c.every(function(c) { 8565 return null !== c; 8566 }) ? (clg("all jobs resolved!!!!", c.map(function(c) { 8567 return c.length; 8568 })), c.reduce(function(c, e) { 8569 return c.concat(e); 8570 })) : null; 8571 }, {observer:function(c, d, e) { 8572 e && (d.fmUp("progress").hidden = !0); 8573 }})}, function(c) { 8574 startLoad = Date.now(); 8575 var d = c.md.fmUp("searchMonth").value, e = gMonthlies.find(function(c) { 8576 return c.hnId === d; 8577 }), f = e.pgCount, g = []; 8578 0 < e.pgCount ? myRange(f).map(function(d) { 8579 g.push(mkPageLoader(c.md, e.hnId, d + 1)); 8580 }) : g.push(mkPageLoader(c.md, e.hnId)); 8581 // g.push(mkExtraJobLoader("triplebytefull")); 8582 return g; 8583 }); 8584} 8585function mkPageLoader(c, d, e) {
8586 clg("mkPageLoader entry", d, e); 8587 return iframe({src:cF(function(c) { 8588 return null === d ? "" : void 0 === e ? "files/" + d + "/" + d + ".html" : "files/" + d + "/" + e + ".html"; 8589 }), style:"display: none", onload:function(c) { 8590 return jobsCollect(c, e); 8591 }}, {jobs:cI(null), pgNo:e}); 8592} 8593function mkExtraJobLoader(c) { 8594 return iframe({src:"dist/extras/" + c + ".html", style:"display: none", onload:function(d) { 8595 return extraJobParse(d, c); 8596 }}, {name:c + "loader", jobs:cI(null)}); 8597} 8598function extraJobParse(c, d) { 8599 c.jobs = null; 8600 if (c.dom.contentDocument) { 8601 hnBody = c.dom.contentDocument.getElementsByTagName("body")[0]; 8602 var e = Array.prototype.slice.call(hnBody.querySelectorAll(".athing")); 8603 0 < e.length ? (e[0].id = d, d = jobSpec(e[0]), d.OK ? (e = d.hnId, UNote.dict[e] = new UserNotes({hnId:e}), UNote.dict[e] || (UNote.dict[e] = new UserNotes({hnId:e})), c.jobs = [d]) : clg("extra not OK")) : clg("no job!!!!!!!!!"); 8604 } else { 8605 clg("no content!!!!!!!!!"); 8606 } 8607} 8608var PARSE_CHUNK_SIZE = 100, PAGE_JOBS_MAX = 1000; 8609function jobsCollect(c, d) { 8610 clg("collecting!!!", d); 8611 if (c.dom.contentDocument) { 8612 hnBody = c.dom.contentDocument.getElementsByTagName("body")[0]; 8613 var e = Array.prototype.slice.call(hnBody.querySelectorAll(".athing")), f = [], g = c.fmUp("progress"); 8614 0 < e.length ? (g.maxN += Math.floor(e.length / PARSE_CHUNK_SIZE), parseListings(c, e, f, PARSE_CHUNK_SIZE, g), c.jobs && clg("jobs found", c.jobs.length, "page", d)) : c.jobs = []; 8615 } else { 8616 c.jobs = []; 8617 } 8618} 8619var dbg = !1; 8620function parseListings(c, d, e, f, g) { 8621 var h = d.length, k = function(l) { 8622 var m = Math.min(h - l, f); 8623 if (0 < m) { 8624 for (jn = 0; jn < m; ++jn) { 8625 var r = d[l + jn]; 8626 if (!g.seen.has(r.id) && (g.seen.add(r.id), r = jobSpec(d[l + jn]), r.OK)) { 8627 var t = r.hnId; 8628 r.pgNo = c.pgNo; 8629 UNote.dict[t] || (UNote.dict[t] = new UserNotes({hnId:t})); 8630 e.push(r); 8631 } 8632 } 8633 g.value += 1; 8634 e.length < PAGE_JOBS_MAX ? window.requestAnimationFrame(function() { 8635 return k(l + m); 8636 }) : (c.jobs = e, clg("page loaded 1", c.pgNo, e.length, "elapsed=", Date.now() - startLoad), frameZap(c)); 8637 } else { 8638 c.jobs = e, clg("page loaded 2", c.pgNo, e.length, "elapsed=", Date.now() - startLoad), frameZap(c); 8639 } 8640 }; 8641 k(0); 8642} 8643function frameZap(c) { 8644 b = c.dom.contentDocument.getElementsByTagName("body")[0]; 8645 b.innerHTML = ""; 8646} 8647;Hiring.controlPanel = {}; 8648function controlPanel() { 8649 return div({style:"background-color:#ffb57d"}, openShutCase("os-filters", "Filters", !0, i({style:"margin-left:12px", content:cF(function(c) { 8650 if (c.md.fmUp("os-filters-toggle").onOff) { 8651 return ""; 8652 } 8653 c = document.getElementsByClassName("title-jSelect"); 8654 var d = document.getElementsByClassName("user-jSelect"), e = [], f = function(c) { 8655 Array.prototype.map.call(c, function(c) { 8656 c.checked && e.push(dom2mx(c).name); 8657 }); 8658 }; 8659 f(c); 8660 f(d); 8661 return e.join(" "); 8662 })}), mkTitleSelects, mkUserSelects), openCase("rgx-filters", "Search", mkTitleRgx, mkFullRgx, mkRgxOptions), sortBar, jobListingControlBar); 8663} 8664window.controlPanel = controlPanel; 8665var jobSorts = [{title:"Creation", keyFn:jobHnIdKey, defaultOrder:-1}, {title:"Stars", compFn:jobStarsCompare, defaultOrder:-1}, {title:"Company", keyFn:jobCompanyKey, defaultOrder:1}]; 8666function sortBar() { 8667 return div({style:{padding:"0 0 0 0", margin:"15px 0 0 24px", display:"flex"}}, span("Sort  "), ul({style:merge(hzFlexWrap, {padding:"0 0 0 0", margin:"0 0 0 0"})}, {name:"sortby", order:cI(jobSorts[0].defaultOrder), selection:cI(jobSorts[0]), sortSpec:cF(function(c) { 8668 return merge(c.md.selection, {order:c.md.order}); 8669 })}, jobSorts.map(function(c) { 8670 return button({style:cF(function(c) { 8671 return "color:" + (c.md.selected ? "blue" : "#222"); 8672 }), class:"sortOption", selected:cF(function(d) { 8673 return d.md.par.selection.title === c.title; 8674 }), onclick:function(d) { 8675 d.par.selection.title === c.title ? d.par.order = -d.par.order : d.par.selection = c; 8676 }, content:cF(function(d) { 8677 d = d.md.par.sortSpec; 8678 return d.title === c.title ? c.title + (-1 === d.order ? " ➘" : " ➚") : c.title + " "; 8679 })}); 8680 }))); 8681} 8682function excludedp(c) { 8683 return UNote.dict[c.hnId].excluded; 8684} 8685function jobListingControlBar() { 8686 return div({style:merge(hzFlexWrapCentered, {margin:"12px 0 0 0px", font_size:"1em", padding:"4px", border_style:"groove", border_color:"khaki", border_width:"2px", background:"PAPAYAWHIP", justify_content:"space-between", align_items:"center"})}, div({style:merge(hzFlexWrapCentered, {flex_wrap:"wrap"})}, span({style:"font-size:1em;margin-right:12px", content:cF(function(c) { 8687 return "Jobs: " + c.md.fmUp("job-list").selectedJobs.length; 8688 })}), span({style:cF(function(c) { 8689 return "padding-bottom:4px;cursor:pointer;display:flex;align-items:center;font-size:1em;visibility:" + (0 < c.md.excludedCt ? "visible;" : "hidden;") + "border:" + (c.md.onOff ? "thin solid red;" : "none;"); 8690 }), content:cF(function(c) { 8691 return "⃠: " + c.md.excludedCt; 8692 }), onclick:function(c) { 8693 return c.onOff = !c.onOff; 8694 }, title:"Show/hide items you have excluded"}, {name:"showExcluded", onOff:cI(!1), excludedCt:cF(function(c) { 8695 return c.md.fmUp("job-list").selectedJobs.filter(function(c) { 8696 return excludedp(c); 8697 }).length; 8698 })})), resultMax(), button({style:cF(function(c) { 8699 return "font-size:1em; min-width:96px; display:" + (c.md.fmUp("progress").hidden ? "block" : "none"); 8700 }), onclick:function(c) { 8701 var d = document.getElementsByClassName("listing-toggle"); 8702 Array.prototype.map.call(d, function(d) { 8703 return d.onOff = !c.expanded; 8704 }); 8705 c.expanded = !c.expanded; 8706 }
8706, content:cF(function(c) { 8707 return c.md.expanded ? "Collapse All" : "Expand All"; 8708 })}, {name:"expander", expanded:cI(!mobileCheck())})); 8709} 8710var RESULT_MAX = 42; 8711function resultMax() { 8712 return div({style:merge(hzFlexWrapCentered, {margin_right:"6px"})}, span({}, "Show:"), input({value:cF(function(c) { 8713 return c.md.results; 8714 }), style:"font-size:1em;max-width:48px;margin-left:6px;margin-right:6px", onchange:function(c, d) { 8715 return c.results = parseInt(d.target.value); 8716 }}, {name:"resultmax", results:cI(RESULT_MAX)})); 8717} 8718;Hiring.jobListItem = {}; 8719function jobList() { 8720 return ul({style:"list-style-type: none; background-color:#eee; padding:0; margin:0;"}, {name:"job-list", selectedJobs:cF(function(c) { 8721 var d = c.md.fmUp("jobLoader").jobs; 8722 return jobListFilter(c.md, d); 8723 }), kidValues:cF(function(c) { 8724 var d = pnow(), e = jobListSort(c.md, c.md.selectedJobs) || []; 8725 c = c.md.fmUp("resultmax"); 8726 plaps("got new sort afetr ", d); 8727 return e.slice(0, c.results); 8728 }), kidKey:function(c) { 8729 return c.job.hnId; 8730 }, kidValueKey:function(c) { 8731 return c.hnId; 8732 }, kidFactory:jobListItem}, function(c) { 8733 return c.kidValuesKids(); 8734 }); 8735} 8736var jumpToHN = function(c) { 8737 return window.open("https://news.ycombinator.com/item?id=" + c, "_blank"); 8738}; 8739function jobListItem(c, d) { 8740 return li({class:"jobli", style:cF(function(c) { 8741 return "cursor:pointer;padding:12px;display:" + (!UNote.dict[d.hnId].excluded || c.md.fmUp("showExcluded").onOff || c.md.fmUp("Excluded").onOff ? "block;" : "none;") + ";"; 8742 }), onclick:function(c) { 8743 c = c.fmDown("showDetails"); 8744 c.onOff = !c.onOff; 8745 }}, {name:"job-listing", job:d}, jobHeader(d), jobDetails(d)); 8746} 8747function jobHeader(c) { 8748 return div({style:"cursor:pointer; display:flex", onclick:function(c) { 8749 c = c.fmDown("showDetails"); 8750 c.onOff = !c.onOff; 8751 }}, toggleFullListing(), span({style:cF(function(d) { 8752 var e = UNote.dict[c.hnId]; 8753 return "color:red;max-height:16px;margin-right:9px; display:" + (!d.md.fmUp("showDetails").onOff && e && e.stars && 0 !== e.stars ? "block" : "none"); 8754 })}, "⭑"), div(function(d) { 8755 return c.title.map(function(c) { 8756 if (1 === c.nodeType) { 8757 if ("A" === c.tagName) { 8758 return "<a href=" + c.href + ">" + c.textContent + "</a>"; 8759 } 8760 clg("title punting on tag", c.tagName, c.textContent); 8761 return c.textContent; 8762 } 8763 return 3 === c.nodeType ? "<span>" + c.textContent + "</span>" : ""; 8764 }); 8765 })); 8766} 8767function jobDetails(c) { 8768 return div({onclick:function(c) { 8769 }, class:cF(function(c) { 8770 var d = c.md.fmUp("showDetails").onOff; 8771 return c.pv === kUnbound ? d ? "slideIn" : "" : d ? "slideIn" : "slideOut"; 8772 }), style:cF(function(c) { 8773 return "margin:6px;background:#fff; display:" + (c.md.fmUp("showDetails").onOff ? "block" : "none"); 8774 })}, userAnnotations(c), div({style:"margin:6px;overflow:auto;", ondblclick:function(d) { 8775 "triplebytefull" === c.hnId ? window.open("https://triplebyte.com/a/R1E80IU/d", "_blank") : jumpToHN(c.hnId
8775); 8776 }}, function(d) { 8777 return d.md.fmUp("showDetails") ? c.body.map(function(c, d) { 8778 if (1 === c.nodeType) { 8779 return "<p>" + c.innerHTML + "</p>"; 8780 } 8781 if (3 === c.nodeType) { 8782 return "<p>" + c.textContent + "</p>"; 8783 } 8784 clg("UNEXPECTED Node type", c.nodeType, c.nodeName, c.textContent); 8785 }) : null; 8786 })); 8787} 8788function toggleFullListing() { 8789 return toggleChar("showDetails", "Show/hide full listing", !1, "", "", {class:"listing-toggle"}, {onOff:cFI(function(c) { 8790 return c.md.fmUp("expander").expanded; 8791 })}, "margin-right:9px;"); 8792} 8793function jobListSort(c, d) { 8794 var e = c.fmUp("sortby").sortSpec; 8795 return d.sort(function(c, d) { 8796 var f = e.keyFn, g = e.compFn, l = e.order; 8797 return g ? g(l, c, d) : l * (f(c) < f(d) ? -1 : 1); 8798 }); 8799} 8800function jobHnIdKey(c) { 8801 return c.hnId; 8802} 8803function jobCompanyKey(c) { 8804 return c.company || ""; 8805} 8806function jobStarsCompare(c, d, e) { 8807 d = UNote.dict[d.hnId]; 8808 e = UNote.dict[e.hnId]; 8809 return 0 < d.stars ? 0 < e.stars ? c * (d.stars < e.stars ? -1 : d.stars > e.stars ? 1 : d.hnId < e.hnId ? -1 : 1) : -1 : 0 < e.stars ? 1 : d.hnId < e.hnId ? -1 : 1; 8810} 8811;Hiring.regexSearch = {}; 8812function mkTitleRgx() { 8813 return mkListingRgx("title", "Title Only", "title"); 8814} 8815function mkFullRgx() { 8816 return mkListingRgx("listing", "Full Listing", "title and listing"); 8817} 8818function mkListingRgx(c, d, e, f) { 8819 return labeledRow(d, input({placeholder:"Regex for " + e + " search", list:c + "list", onchange:buildRgxTree, onfocus:function(c) { 8820 return c.dom.setSelectionRange(0, c.dom.value.length); 8821 }, value:f || "", style:"min-width:72px;font-size:1em; height:2em"}, {name:c + "rgx", rgxRaw:cI(null), rgxTree:cI(null), history:cI([])}), datalist({id:c + "list"}, function(d) { 8822 return d.md.fmUp(c + "rgx").history.map(function(c) { 8823 return option({value:c}); 8824 }); 8825 })); 8826} 8827function labeledRow(c, d) { 8828 for (var e = [], f = 1; f < arguments.length; ++f) { 8829 e[f - 1] = arguments[f]; 8830 } 8831 return div({style:{display:"flex", flex_direction:"column", margin:"6px 18px 0px 30px"}}, span({style:"color:white;font-size:0.7em"}, c), e); 8832} 8833function mkRgxOptions() { 8834 return div(div({style:merge(hzFlexWrapCentered, {padding_right:"12px", margin:"4px 0 9px 30px"})}, mkRgxMatchCase(), mkRgxOrAnd(), helpToggle("rgxHelpToggle", "Show/hide RegExp help")), helpList(regexHelp, "rgxHelpToggle")); 8835} 8836function mkRgxMatchCase() { 8837 return div({style:"color: #fcfcfc; margin:0 9px 0 0; display:flex; flex-wrap: wrap; align-items:center"}, input({id:"rgxMatchCase", type:"checkbox", onclick:function(c) { 8838 return c.value = !c.value; 8839 }, onchange:rebuildRgxTrees}, {name:"rgxMatchCase", value:cI(!1)}), label({for:"rgxMatchCase"}, "match case")); 8840} 8841function mkRgxOrAnd() { 8842 return div({style:"color: white; margin:0 9px 0 0; display:flex; flex-wrap: wrap; align-items:center", title:"Replace 'or/and' with '||/&&' for easier mobile entry."}, input({id:"rgxOrAnd", type:"checkbox", checked:cF(function(c) { 8843 return c.md.value; 8844 }), onclick:function(c) { 8845 return c.value = !c.value; 8846 }, onchange:rebuildRgxTrees, title:"Replace 'or/and' with '||/&&' for easier mobile entry."}, {name:"rgxOrAnd", value:cI(!0)}), label({for:"rgxOrAnd", title:"Replace 'or/and' with '||/&&' for easier mobile entry."}, "allow or/and")); 8847} 8848var regexHelp = ["Press <kbd style='background:cornsilk;font-size:1em'>Enter</kbd> or <kbd style='background:cornsilk;font-size:1em'>Tab</kbd> to activate, including after clearing.", "Separate <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions'>JS RegExp-legal</a> terms with <b>||</b> or <b>&&</b> (higher priority) to combine expressions.", "'Allow or/and' option treats those as ||/&& for easier mobile entry.", "Regex terms are split on comma and passed to <code>new RegExp(pattern,flags)</code>.", 8849"e.g. Enter <b>taipei,i</b> for case-insensitive search."]; 8850function buildRgxTree(c, d) { 8851 c.rgxRaw = d.target.value.trim(); 8852 "" === c.rgxRaw ? c.rgxTree = null : (-1 === c.history.indexOf(c.rgxRaw) && (c.history = c.history.concat(c.rgxRaw)), rebuildRgxTree(c)); 8853} 8854function rebuildRgxTrees(c) { 8855 ["titlergx", "listingrgx"].map(function(d) { 8856 d = c.fmUp(d); 8857 d.rgxTree && rebuildRgxTree(d); 8858 }); 8859} 8860function rebuildRgxTree(c) { 8861 var d = c.fmUp("rgxMatchCase").value, e = / or /g, f = / and /g; 8862 e = c.fmUp("rgxOrAnd").value ? c.rgxRaw.replace(e, " || ").replace(f, " && ") : c.rgxRaw; 8863 c.rgxTree = e.split("||").map(function(c) { 8864 return c.trim().split("&&").map(function(c) {
8865 try { 8866 var e = $jscomp.makeIterator(c.trim().split(",")), f = e.next().value, g = e.next().value; 8867 e = void 0 === g ? "" : g; 8868 d || -1 !== e.search("i") || (e += "i"); 8869 return new RegExp(f, e); 8870 } catch (r) { 8871 alert(r.toString() + ": <" + c.trim() + ">"); 8872 } 8873 }); 8874 }); 8875} 8876;function WhoIsHiring() { 8877 return div(appBanner(), div({style:"margin:0px; background:#ffb57d"}, pickAMonth(), jobListingLoader(), controlPanel(), jobList())); 8878} 8879window.WhoIsHiring = WhoIsHiring; 8880function appBanner() { 8881 return div(header(div({class:"about", onclick:function(c) { 8882 return c.onOff = !c.onOff; 8883 }, title:"Usage hints, and credit where due.", content:cF(function(c) { 8884 return c.md.onOff ? "hide" : "Pro tips"; 8885 })}, {name:"appHelpToggle", onOff:cI(!1)}), div({class:"headermain"}, span({class:"askhn"}, "Ask HN:"), span({class:"who"}, "Who Is Hiring?"))), helpList(appHelpEntry, "appHelpToggle")); 8886} 8887var appHelpEntry = "Click any job header to show or hide the full listing.{Once visible, double-click the job description to open the listing on HN in a new tab.{All filters are ANDed except as you direct within RegExp fields.{Your annotations are kept in local storage, so stick to one browser.{Works off page scrapes taken every couple of hours. E-mail <a href='mailto:[email protected]'>Kenny</a> if they seem stopped.{HIRERS! Not seeing your listing? Scraper determination is fuzzy. E-mail <a href='mailto:[email protected]'>Kenny</a> and we will sort it out.{RFEs welcome and can be raised <a href='https://github.com/kennytilton/whoshiring/issues'>here</a>. {This page is not affiliated with Hacker News, but thanks to the HN crew for their assistance. All screw-ups remain <a href='https://news.ycombinator.com/user?id=kennytilton'>kennytilton</a>'s.{Graphic design by <a href='https://www.mloboscoart.com'>Michael Lobosco</a>.{Built with <a href='https://github.com/kennytilton/matrix/blob/master/js/matrix/readme.md'>Matrix Inside</a>™.".split("{"); 8888
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.