1<!-- 2@license 3Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7Code distributed by Google as part of the polymer project is also 8subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9--><script>(function () { 10function resolve() { 11document.body.removeAttribute('unresolved'); 12} 13if (window.WebComponents) { 14addEventListener('WebComponentsReady', resolve); 15} else { 16if (document.readyState === 'interactive' || document.readyState === 'complete') { 17resolve(); 18} else { 19addEventListener('DOMContentLoaded', resolve); 20} 21} 22}());window.Polymer = { 23Settings: function () { 24var settings = window.Polymer || {}; 25if (!settings.noUrlSettings) { 26var parts = location.search.slice(1).split('&'); 27for (var i = 0, o; i < parts.length && (o = parts[i]); i++) { 28o = o.split('='); 29o[0] && (settings[o[0]] = o[1] || true); 30} 31} 32settings.wantShadow = settings.dom === 'shadow'; 33settings.hasShadow = Boolean(Element.prototype.createShadowRoot); 34settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill; 35settings.useShadow = settings.wantShadow && settings.hasShadow; 36settings.hasNativeImports = Boolean('import' in document.createElement('link')); 37settings.useNativeImports = settings.hasNativeImports; 38settings.useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative; 39settings.useNativeShadow = settings.useShadow && settings.nativeShadow; 40settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__; 41settings.hasNativeCSSProperties = !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'); 42settings.useNativeCSSProperties = settings.hasNativeCSSProperties && settings.lazyRegister && settings.useNativeCSSProperties; 43settings.isIE = navigator.userAgent.match('Trident'); 44settings.passiveTouchGestures = settings.passiveTouchGestures || false; 45return settings; 46}() 47};(function () { 48var userPolymer = window.Polymer; 49window.Polymer = function (prototype) { 50if (typeof prototype === 'function') { 51prototype = prototype.prototype; 52} 53if (!prototype) { 54prototype = {}; 55} 56prototype = desugar(prototype); 57var customCtor = prototype === prototype.constructor.prototype ? prototype.constructor : null; 58var options = { prototype: prototype }; 59if (prototype.extends) { 60options.extends = prototype.extends; 61} 62Polymer.telemetry._registrate(prototype); 63var ctor = document.registerElement(prototype.is, options); 64return customCtor || ctor; 65}; 66var desugar = function (prototype) { 67var base = Polymer.Base; 68if (prototype.extends) { 69base = Polymer.Base._getExtendedPrototype(prototype.extends); 70} 71prototype = Polymer.Base.chainObject(prototype, base); 72prototype.registerCallback(); 73return prototype; 74}; 75if (userPolymer) { 76for (var i in userPolymer) { 77Polymer[i] = userPolymer[i]; 78} 79} 80Polymer.Class = function (prototype) { 81if (!prototype.factoryImpl) { 82prototype.factoryImpl = function () { 83}; 84} 85return desugar(prototype).constructor; 86}; 87}()); 88Polymer.telemetry = { 89registrations: [], 90_regLog: function (prototype) { 91console.log('[' + prototype.is + ']: registered'); 92}, 93_registrate: function (prototype) { 94this.registrations.push(prototype); 95Polymer.log && this._regLog(prototype); 96}, 97dumpRegistrations: function () { 98this.registrations.forEach(this._regLog); 99} 100};Object.defineProperty(window, 'currentImport', { 101enumerable: true, 102configurable: true, 103get: function () { 104return (document._currentScript || document.currentScript || {}).ownerDocument; 105} 106});Polymer.RenderStatus = { 107_ready: false, 108_callbacks: [], 109whenReady: function (cb) { 110if (this._ready) { 111cb(); 112} else { 113this._callbacks.push(cb); 114} 115}, 116_makeReady: function () { 117this._ready = true; 118for (var i = 0; i < this._callbacks.length; i++) { 119this._callbacks[i](); 120} 121this._callbacks = []; 122}, 123_catchFirstRender: function () { 124requestAnimationFrame(function () { 125Polymer.RenderStatus._makeReady(); 126}); 127}, 128_afterNextRenderQueue: [], 129_waitingNextRender: false, 130afterNextRender: function (element, fn, args) { 131this._watchNextRender(); 132this._afterNextRenderQueue.push([ 133element, 134fn, 135args 136]); 137}, 138hasRendered: function () { 139return this._ready; 140}, 141_watchNextRender: function () { 142if (!this._waitingNextRender) { 143this._waitingNextRender = true; 144var fn = function () { 145Polymer.RenderStatus._flushNextRender(); 146}; 147if (!this._ready) { 148this.whenReady(fn); 149} else { 150requestAnimationFrame(fn); 151} 152} 153}, 154_flushNextRender: function () { 155var self = this; 156setTimeout(function () { 157self._flushRenderCallbacks(self._afterNextRenderQueue); 158self._afterNextRenderQueue = []; 159self._waitingNextRender = false; 160}); 161}, 162_flushRenderCallbacks: function (callbacks) { 163for (var i = 0, h; i < callbacks.length; i++) { 164h = callbacks[i]; 165h[1].apply(h[0], h[2] || Polymer.nar); 166} 167} 168}; 169if (window.HTMLImports) { 170HTMLImports.whenReady(function () { 171Polymer.RenderStatus._catchFirstRender(); 172}); 173} else { 174Polymer.RenderStatus._catchFirstRender(); 175} 176Polymer.ImportStatus = Polymer.RenderStatus; 177Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;(function () { 178'use strict'; 179var settings = Polymer.Settings; 180Polymer.Base = { 181__isPolymerInstance__: true, 182_addFeature: function (feature) { 183this.mixin(this, feature); 184}, 185registerCallback: function () { 186if (settings.lazyRegister === 'max') { 187if (this.beforeRegister) { 188this.beforeRegister(); 189} 190} else { 191this._desugarBehaviors(); 192for (var i = 0, b; i < this.behaviors.length; i++) { 193b = this.behaviors[i]; 194if (b.beforeRegister) { 195b.beforeRegister.call(this); 196} 197} 198if (this.beforeRegister) { 199this.beforeRegister(); 200} 201} 202this._registerFeatures(); 203if (!settings.lazyRegister) { 204this.ensureRegisterFinished(); 205} 206}, 207createdCallback: function () { 208if (settings.disableUpgradeEnabled) { 209if (this.hasAttribute('disable-upgrade')) { 210this._propertySetter = disableUpgradePropertySetter; 211this._configValue = null; 212this.__data__ = {}; 213return; 214} else { 215this.__hasInitialized = true; 216} 217} 218this.__initialize(); 219}, 220__initialize: function () { 221if (!this.__hasRegisterFinished) { 222this._ensureRegisterFinished(this.__proto__); 223} 224Polymer.telemetry.instanceCount++; 225this.root = this; 226for (var i = 0, b; i < this.behaviors.length; i++) { 227b = this.behaviors[i]; 228if (b.created) { 229b.created.call(this); 230} 231} 232if (this.created) { 233this.created(); 234} 235this._initFeatures(); 236}, 237ensureRegisterFinished: function () { 238this._ensureRegisterFinished(this); 239}, 240_ensureRegisterFinished: function (proto) { 241if (proto.__hasRegisterFinished !== proto.is || !proto.is) { 242if (settings.lazyRegister === 'max') { 243proto._desugarBehaviors(); 244for (var i = 0, b; i < proto.behaviors.length; i++) { 245b = proto.behaviors[i]; 246if (b.beforeRegister) { 247b.beforeRegister.call(proto); 248} 249} 250} 251proto.__hasRegisterFinished = proto.is; 252if (proto._finishRegisterFeatures) { 253proto._finishRegisterFeatures(); 254} 255for (var j = 0, pb; j < proto.behaviors.length; j++) { 256pb = proto.behaviors[j]; 257if (pb.registered) { 258pb.registered.call(proto); 259} 260} 261if (proto.registered) { 262proto.registered(); 263} 264if (settings.usePolyfillProto && proto !== this) { 265proto.extend(this, proto); 266} 267} 268}, 269attachedCallback: function () { 270var self = this; 271Polymer.RenderStatus.whenReady(function () { 272self.isAttached = true; 273for (var i = 0, b; i < self.behaviors.length; i++) { 274b = self.behaviors[i]; 275if (b.attached) { 276b.attached.call(self); 277} 278} 279if (self.attached) { 280self.attached(); 281} 282}); 283}, 284detachedCallback: function () { 285var self = this; 286Polymer.RenderStatus.whenReady(function () { 287self.isAttached = false; 288for (var i = 0, b; i < self.behaviors.length; i++) { 289b = self.behaviors[i]; 290if (b.detached) { 291b.detached.call(self); 292} 293} 294if (self.detached) { 295self.detached(); 296} 297}); 298}, 299attributeChangedCallback: function (name, oldValue, newValue) { 300this._attributeChangedImpl(name); 301for (var i = 0, b; i < this.behaviors.length; i++) { 302b = this.behaviors[i]; 303if (b.attributeChanged) { 304b.attributeChanged.call(this, name, oldValue, newValue); 305} 306} 307if (this.attributeChanged) { 308this.attributeChanged(name, oldValue, newValue); 309} 310}, 311_attributeChangedImpl: function (name) { 312this._setAttributeToProperty(this, name); 313}, 314extend: function (target, source) { 315if (target && source) { 316var n$ = Object.getOwnPropertyNames(source); 317for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { 318this.copyOwnProperty(n, source, target); 319} 320} 321return target || source; 322}, 323mixin: function (target, source) { 324for (var i in source) { 325target[i] = source[i]; 326} 327return target; 328}, 329copyOwnProperty: function (name, source, target) { 330var pd = Object.getOwnPropertyDescriptor(source, name); 331if (pd) { 332Object.defineProperty(target, name, pd); 333} 334}, 335_logger: function (level, args) { 336if (args.length === 1 && Array.isArray(args[0])) { 337args = args[0]; 338} 339switch (level) { 340case 'log': 341case 'warn': 342case 'error': 343console[level].apply(console, args); 344break; 345} 346}, 347_log: function () { 348var args = Array.prototype.slice.call(arguments, 0); 349this._logger('log', args); 350}, 351_warn: function () { 352var args = Array.prototype.slice.call(arguments, 0); 353this._logger('warn', args); 354}, 355_error: function () { 356var args = Array.prototype.slice.call(arguments, 0); 357this._logger('error', args); 358}, 359_logf: function () { 360return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments, 0)); 361} 362}; 363Polymer.Base._logPrefix = function () { 364var color = window.chrome && !/edge/i.test(navigator.userAgent) || /firefox/i.test(navigator.userAgent); 365return color ? [ 366'%c[%s::%s]:', 367'font-weight: bold; background-color:#EEEE00;' 368] : ['[%s::%s]:']; 369}(); 370Polymer.Base.chainObject = function (object, inherited) { 371if (object && inherited && object !== inherited) { 372if (!Object.__proto__) { 373object = Polymer.Base.extend(Object.create(inherited), object); 374} 375object.__proto__ = inherited; 376} 377return object; 378}; 379Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype); 380Polymer.BaseDescriptors = {}; 381var disableUpgradePropertySetter; 382if (settings.disableUpgradeEnabled) { 383disableUpgradePropertySetter = function (property, value) { 384this.__data__[property] = value; 385}; 386var origAttributeChangedCallback = Polymer.Base.attributeChangedCallback; 387Polymer.Base.attributeChangedCallback = function (name, oldValue, newValue) { 388if (!this.__hasInitialized && name === 'disable-upgrade') { 389this.__hasInitialized = true; 390this._propertySetter = Polymer.Bind._modelApi._propertySetter; 391this._configValue = Polymer.Base._configValue; 392this.__initialize(); 393} 394origAttributeChangedCallback.call(this, name, oldValue, newValue); 395}; 396} 397if (window.CustomElements) { 398Polymer.instanceof = CustomElements.instanceof; 399} else { 400Polymer.instanceof = function (obj, ctor) { 401return obj instanceof ctor; 402}; 403} 404Polymer.isInstance = function (obj) { 405return Boolean(obj && obj.__isPolymerInstance__); 406}; 407Polymer.telemetry.instanceCount = 0; 408}());(function () { 409var modules = {}; 410var lcModules = {}; 411var findModule = function (id) { 412return modules[id] || lcModules[id.toLowerCase()]; 413}; 414var DomModule = function () { 415return document.createElement('dom-module'); 416}; 417DomModule.prototype = Object.create(HTMLElement.prototype); 418Polymer.Base.mixin(DomModule.prototype, { 419createdCallback: function () { 420this.register(); 421}, 422register: function (id) { 423id = id || this.id || this.getAttribute('name') || this.getAttribute('is'); 424if (id) { 425this.id = id; 426modules[id] = this; 427lcModules[id.toLowerCase()] = this; 428} 429}, 430import: function (id, selector) { 431if (id) { 432var m = findModule(id); 433if (!m) { 434forceDomModulesUpgrade(); 435m = findModule(id); 436} 437if (m && selector) { 438m = m.querySelector(selector); 439} 440return m; 441} 442} 443}); 444Object.defineProperty(DomModule.prototype, 'constructor', { 445value: DomModule, 446configurable: true, 447writable: true 448}); 449var cePolyfill = window.CustomElements && !CustomElements.useNative; 450document.registerElement('dom-module', DomModule); 451function forceDomModulesUpgrade() { 452if (cePolyfill) { 453var script = document._currentScript || document.currentScript; 454var doc = script && script.ownerDocument || document; 455var modules = doc.querySelectorAll('dom-module'); 456for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) { 457if (m.__upgraded__) { 458return; 459} else { 460CustomElements.upgrade(m); 461} 462} 463} 464} 465}());Polymer.Base._addFeature({ 466_prepIs: function () { 467if (!this.is) { 468var module = (document._currentScript || document.currentScript).parentNode; 469if (module.localName === 'dom-module') { 470var id = module.id || module.getAttribute('name') || module.getAttribute('is'); 471this.is = id; 472} 473} 474if (this.is) { 475this.is = this.is.toLowerCase(); 476} 477} 478});Polymer.Base._addFeature({ 479behaviors: [], 480_desugarBehaviors: function () { 481if (this.behaviors.length) { 482this.behaviors = this._desugarSomeBehaviors(this.behaviors); 483} 484}, 485_desugarSomeBehaviors: function (behaviors) { 486var behaviorSet = []; 487behaviors = this._flattenBehaviorsList(behaviors); 488for (var i = behaviors.length - 1; i >= 0; i--) { 489var b = behaviors[i]; 490if (behaviorSet.indexOf(b) === -1) { 491this._mixinBehavior(b); 492behaviorSet.unshift(b); 493} 494} 495return behaviorSet; 496}, 497_flattenBehaviorsList: function (behaviors) { 498var flat = []; 499for (var i = 0; i < behaviors.length; i++) { 500var b = behaviors[i]; 501if (b instanceof Array) { 502flat = flat.concat(this._flattenBehaviorsList(b)); 503} else if (b) { 504flat.push(b); 505} else { 506this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import')); 507} 508} 509return flat; 510}, 511_mixinBehavior: function (b) { 512var n$ = Object.getOwnPropertyNames(b); 513var useAssignment = b._noAccessors; 514for (var i = 0, n; i < n$.length && (n = n$[i]); i++) { 515if (!Polymer.Base._behaviorProperties[n] && !this.hasOwnProperty(n)) { 516if (useAssignment) { 517this[n] = b[n]; 518} else { 519this.copyOwnProperty(n, b, this); 520} 521} 522} 523}, 524_prepBehaviors: function () { 525this._prepFlattenedBehaviors(this.behaviors); 526}, 527_prepFlattenedBehaviors: function (behaviors) { 528for (var i = 0, l = behaviors.length; i < l; i++) { 529this._prepBehavior(behaviors[i]); 530} 531this._prepBehavior(this); 532}, 533_marshalBehaviors: function () { 534for (var i = 0; i < this.behaviors.length; i++) { 535this._marshalBehavior(this.behaviors[i]); 536} 537this._marshalBehavior(this); 538} 539}); 540Polymer.Base._behaviorProperties = { 541hostAttributes: true, 542beforeRegister: true, 543registered: true, 544properties: true, 545observers: true, 546listeners: true, 547created: true, 548attached: true, 549detached: true, 550attributeChanged: true, 551ready: true, 552_noAccessors: true 553};Polymer.Base._addFeature({ 554_getExtendedPrototype: function (tag) { 555return this._getExtendedNativePrototype(tag); 556}, 557_nativePrototypes: {}, 558_getExtendedNativePrototype: function (tag) { 559var p = this._nativePrototypes[tag]; 560if (!p) { 561p = Object.create(this.getNativePrototype(tag)); 562var p$ = Object.getOwnPropertyNames(Polymer.Base); 563for (var i = 0, n; i < p$.length && (n = p$[i]); i++) { 564if (!Polymer.BaseDescriptors[n]) { 565p[n] = Polymer.Base[n]; 566} 567} 568Object.defineProperties(p, Polymer.BaseDescriptors); 569this._nativePrototypes[tag] = p; 570} 571return p; 572}, 573getNativePrototype: function (tag) { 574return Object.getPrototypeOf(document.createElement(tag)); 575} 576});Polymer.Base._addFeature({ 577_prepConstructor: function () { 578this._factoryArgs = this.extends ? [ 579this.extends, 580this.is 581] : [this.is]; 582var ctor = function () { 583return this._factory(arguments); 584}; 585if (this.hasOwnProperty('extends')) { 586ctor.extends = this.extends; 587} 588Object.defineProperty(this, 'constructor', { 589value: ctor, 590writable: true, 591configurable: true 592}); 593ctor.prototype = this; 594}, 595_factory: function (args) { 596var elt = document.createElement.apply(document, this._factoryArgs); 597if (this.factoryImpl) { 598this.factoryImpl.apply(elt, args); 599} 600return elt; 601} 602});Polymer.nob = Object.create(null); 603Polymer.Base._addFeature({ 604getPropertyInfo: function (property) { 605var info = this._getPropertyInfo(property, this.properties); 606if (!info) { 607for (var i = 0; i < this.behaviors.length; i++) { 608info = this._getPropertyInfo(property, this.behaviors[i].properties); 609if (info) { 610return info; 611} 612} 613} 614return info || Polymer.nob; 615}, 616_getPropertyInfo: function (property, properties) { 617var p = properties && properties[property]; 618if (typeof p === 'function') { 619p = properties[property] = { type: p }; 620} 621if (p) { 622p.defined = true; 623} 624return p; 625}, 626_prepPropertyInfo: function () { 627this._propertyInfo = {}; 628for (var i = 0; i < this.behaviors.length; i++) { 629this._addPropertyInfo(this._propertyInfo, this.behaviors[i].properties); 630} 631this._addPropertyInfo(this._propertyInfo, this.properties); 632this._addPropertyInfo(this._propertyInfo, this._propertyEffects); 633}, 634_addPropertyInfo: function (target, source) { 635if (source) { 636var t, s; 637for (var i in source) { 638t = target[i]; 639s = source[i]; 640if (i[0] === '_' && !s.readOnly) { 641continue; 642} 643if (!target[i]) { 644target[i] = { 645type: typeof s === 'function' ? s : s.type, 646readOnly: s.readOnly, 647attribute: Polymer.CaseMap.camelToDashCase(i) 648}; 649} else { 650if (!t.type) { 651t.type = s.type; 652} 653if (!t.readOnly) { 654t.readOnly = s.readOnly; 655} 656} 657} 658} 659} 660}); 661(function () { 662var propertiesDesc = { 663configurable: true, 664writable: true, 665enumerable: true, 666value: {} 667}; 668Polymer.BaseDescriptors.properties = propertiesDesc; 669Object.defineProperty(Polymer.Base, 'properties', propertiesDesc); 670}());Polymer.CaseMap = { 671_caseMap: {}, 672_rx: { 673dashToCamel: /-[a-z]/g, 674camelToDash: /([A-Z])/g 675}, 676dashToCamelCase: function (dash) { 677return this._caseMap[dash] || (this._caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(this._rx.dashToCamel, function (m) { 678return m[1].toUpperCase(); 679})); 680}, 681camelToDashCase: function (camel) { 682return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.camelToDash, '-$1').toLowerCase()); 683} 684};Polymer.Base._addFeature({ 685_addHostAttributes: function (attributes) { 686if (!this._aggregatedAttributes) { 687this._aggregatedAttributes = {}; 688} 689if (attributes) { 690this.mixin(this._aggregatedAttributes, attributes); 691} 692}, 693_marshalHostAttributes: function () { 694if (this._aggregatedAttributes) { 695this._applyAttributes(this, this._aggregatedAttributes); 696} 697}, 698_applyAttributes: function (node, attr$) { 699for (var n in attr$) { 700if (!this.hasAttribute(n) && n !== 'class') { 701var v = attr$[n]; 702this.serializeValueToAttribute(v, n, this); 703} 704} 705}, 706_marshalAttributes: function () { 707this._takeAttributesToModel(this); 708}, 709_takeAttributesToModel: function (model) { 710if (this.hasAttributes()) { 711for (var i in this._propertyInfo) { 712var info = this._propertyInfo[i]; 713if (this.hasAttribute(info.attribute)) { 714this._setAttributeToProperty(model, info.attribute, i, info); 715} 716} 717} 718}, 719_setAttributeToProperty: function (model, attribute, property, info) { 720if (!this._serializing) { 721property = property || Polymer.CaseMap.dashToCamelCase(attribute); 722info = info || this._propertyInfo && this._propertyInfo[property]; 723if (info && !info.readOnly) { 724var v = this.getAttribute(attribute); 725model[property] = this.deserialize(v, info.type); 726} 727} 728}, 729_serializing: false, 730reflectPropertyToAttribute: function (property, attribute, value) { 731this._serializing = true; 732value = value === undefined ? this[property] : value; 733this.serializeValueToAttribute(value, attribute || Polymer.CaseMap.camelToDashCase(property)); 734this._serializing = false; 735}, 736serializeValueToAttribute: function (value, attribute, node) { 737var str = this.serialize(value); 738node = node || this; 739if (str === undefined) { 740node.removeAttribute(attribute); 741} else { 742node.setAttribute(attribute, str); 743} 744}, 745deserialize: function (value, type) { 746switch (type) { 747case Number: 748value = Number(value); 749break; 750case Boolean: 751value = value != null; 752break; 753case Object: 754try { 755value = JSON.parse(value); 756} catch (x) { 757} 758break; 759case Array: 760try { 761value = JSON.parse(value); 762} catch (x) { 763value = null; 764console.warn('Polymer::Attributes: couldn`t decode Array as JSON'); 765} 766break; 767case Date: 768value = new Date(value); 769break; 770case String: 771default: 772break; 773} 774return value; 775}, 776serialize: function (value) { 777switch (typeof value) { 778case 'boolean': 779return value ? '' : undefined; 780case 'object': 781if (value instanceof Date) { 782return value.toString(); 783} else if (value) { 784try { 785return JSON.stringify(value); 786} catch (x) { 787return ''; 788} 789} 790default: 791return value != null ? value : undefined; 792} 793} 794});Polymer.version = "1.11.3";Polymer.Base._addFeature({ 795_registerFeatures: function () { 796this._prepIs(); 797this._prepBehaviors(); 798this._prepConstructor(); 799this._prepPropertyInfo(); 800}, 801_prepBehavior: function (b) { 802this._addHostAttributes(b.hostAttributes); 803}, 804_marshalBehavior: function (b) { 805}, 806_initFeatures: function () { 807this._marshalHostAttributes(); 808this._marshalBehaviors(); 809} 810});</script> 811 812 813 814 815 816 817 818 819 820 821 822