concerto_frontend 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +13 -0
- data/README.md +6 -0
- data/Rakefile +37 -0
- data/app/views/concerto_frontend/_frontend.html +13 -0
- data/config/routes.rb +2 -0
- data/lib/concerto_frontend/engine.rb +14 -0
- data/lib/concerto_frontend/version.rb +3 -0
- data/lib/concerto_frontend.rb +4 -0
- metadata +79 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 53415754bafa30d25a4e330a0ca205d584792019
|
4
|
+
data.tar.gz: fd3e24fb50c29e2f67336879f10c002b7bb636db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 30c7ab447a864330e847ef66e889db9b7c521c4072de143935fce3331b84c60e4e7babc105b0b647ff4c506d7ea6b72e51bffeb59b5e88be4f26039377b28a6d
|
7
|
+
data.tar.gz: c1326f4e9f43b02b02a73d78467fa0cfff964575fa37b4eb153df8a19ecf7d35dddbe214be2cd00d8b95e92726fac512dcc0d085e04e0af73326961ae6f97130
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2014 Concerto Authors
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
Concerto Frontend Plugin
|
2
|
+
========================
|
3
|
+
|
4
|
+
Concerto plugin containing the vulcanized Polymer frontend.
|
5
|
+
|
6
|
+
After following the steps from our [Concerto Frontend Polymer Repository](https://github.com/concerto/concerto-frontend), copy the vulcanized frontend.html output file to this gem under app/views/concerto_frontend and rename it to _frontend.html.
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ConcertoFrontend'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!DOCTYPE html><html><head><title>Concerto Frontend Demo</title><script>window.Platform=window.Platform||{},window.logFlags=window.logFlags||{},function(a){var b=a.flags||{};location.search.slice(1).split("&").forEach(function(a){a=a.split("="),a[0]&&(b[a[0]]=a[1]||!0)});var c=document.currentScript||document.querySelector('script[src*="platform.js"]');if(c)for(var d,e=c.attributes,f=0;f<e.length;f++)d=e[f],"src"!==d.name&&(b[d.name]=d.value||!0);b.log&&b.log.split(",").forEach(function(a){window.logFlags[a]=!0}),b.shadow=b.shadow||b.shadowdom||b.polyfill,b.shadow="native"===b.shadow?!1:b.shadow||!HTMLElement.prototype.createShadowRoot,b.shadow&&document.querySelectorAll("script").length>1&&console.log("Warning: platform.js is not the first script on the page. See http://www.polymer-project.org/docs/start/platform.html#setup for details."),b.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=b.register),b.imports&&(window.HTMLImports=window.HTMLImports||{flags:{}},window.HTMLImports.flags.imports=b.imports),a.flags=b}(Platform),"undefined"==typeof WeakMap&&!function(){var a=Object.defineProperty,b=Date.now()%1e9,c=function(){this.name="__st"+(1e9*Math.random()>>>0)+(b++ +"__")};c.prototype={set:function(b,c){var d=b[this.name];return d&&d[0]===b?d[1]=c:a(b,this.name,{value:[b,c],writable:!0}),this},get:function(a){var b;return(b=a[this.name])&&b[0]===a?b[1]:void 0},"delete":function(a){var b=a[this.name];if(!b)return!1;var c=b[0]===a;return b[0]=b[1]=void 0,c},has:function(a){var b=a[this.name];return b?b[0]===a:!1}},window.WeakMap=c}(),Platform.flags.shadow?(!function(a){"use strict";function b(){function a(a){b=a}if("function"!=typeof Object.observe||"function"!=typeof Array.observe)return!1;var b=[],c={},d=[];return Object.observe(c,a),Array.observe(d,a),c.id=1,c.id=2,delete c.id,d.push(1,2),d.length=0,Object.deliverChangeRecords(a),5!==b.length?!1:"add"!=b[0].type||"update"!=b[1].type||"delete"!=b[2].type||"splice"!=b[3].type||"splice"!=b[4].type?!1:(Object.unobserve(c,a),Array.unobserve(d,a),!0)}function c(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)return!1;if("undefined"!=typeof navigator&&navigator.getDeviceStorage)return!1;try{var a=new Function("","return true;");return a()}catch(b){return!1}}function d(a){return+a===a>>>0&&""!==a}function e(a){return+a}function f(a){return a===Object(a)}function g(a,b){return a===b?0!==a||1/a===1/b:R(a)&&R(b)?!0:a!==a&&b!==b}function h(a){if(void 0===a)return"eof";var b=a.charCodeAt(0);switch(b){case 91:case 93:case 46:case 34:case 39:case 48:return a;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return b>=97&&122>=b||b>=65&&90>=b?"ident":b>=49&&57>=b?"number":"else"}function i(){}function j(a){function b(){if(!(m>=a.length)){var b=a[m+1];return"inSingleQuote"==n&&"'"==b||"inDoubleQuote"==n&&'"'==b?(m++,d=b,o.append(),!0):void 0}}for(var c,d,e,f,g,j,k,l=[],m=-1,n="beforePath",o={push:function(){void 0!==e&&(l.push(e),e=void 0)},append:function(){void 0===e?e=d:e+=d}};n;)if(m++,c=a[m],"\\"!=c||!b(n)){if(f=h(c),k=W[n],g=k[f]||k["else"]||"error","error"==g)return;if(n=g[0],j=o[g[1]]||i,d=void 0===g[2]?c:g[2],j(),"afterPath"===n)return l}}function k(a){return V.test(a)}function l(a,b){if(b!==X)throw Error("Use Path.get to retrieve path objects");for(var c=0;c<a.length;c++)this.push(String(a[c]));Q&&this.length&&(this.getValueFrom=this.compiledGetValueFromFn())}function m(a){if(a instanceof l)return a;if((null==a||0==a.length)&&(a=""),"string"!=typeof a){if(d(a.length))return new l(a,X);a=String(a)}var b=Y[a];if(b)return b;var c=j(a);if(!c)return Z;var b=new l(c,X);return Y[a]=b,b}function n(a){return d(a)?"["+a+"]":'["'+a.replace(/"/g,'\\"')+'"]'}function o(b){for(var c=0;_>c&&b.check_();)c++;return O&&(a.dirtyCheckCycleCount=c),c>0}function p(a){for(var b in a)return!1;return!0}function q(a){return p(a.added)&&p(a.removed)&&p(a.changed)}function r(a,b){var c={},d={},e={};for(var f in b){var g=a[f];(void 0===g||g!==b[f])&&(f in a?g!==b[f]&&(e[f]=g):d[f]=void 0)}for(var f in a)f in b||(c[f]=a[f]);return Array.isArray(a)&&a.length!==b.length&&(e.length=a.length),{added:c,removed:d,changed:e}}function s(){if(!ab.length)return!1;for(var a=0;a<ab.length;a++)ab[a]();return ab.length=0,!0}function t(){function a(a){b&&b.state_===fb&&!d&&b.check_(a)}var b,c,d=!1,e=!0;return{open:function(c){if(b)throw Error("ObservedObject in use");e||Object.deliverChangeRecords(a),b=c,e=!1},observe:function(b,d){c=b,d?Array.observe(c,a):Object.observe(c,a)},deliver:function(b){d=b,Object.deliverChangeRecords(a),d=!1},close:function(){b=void 0,Object.unobserve(c,a),cb.push(this)}}}function u(a,b,c){var d=cb.pop()||t();return d.open(a),d.observe(b,c),d}function v(){function a(b,f){b&&(b===d&&(e[f]=!0),h.indexOf(b)<0&&(h.push(b),Object.observe(b,c)),a(Object.getPrototypeOf(b),f))}function b(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.object!==d||e[c.name]||"setPrototype"===c.type)return!1}return!0}function c(c){if(!b(c)){for(var d,e=0;e<g.length;e++)d=g[e],d.state_==fb&&d.iterateObjects_(a);for(var e=0;e<g.length;e++)d=g[e],d.state_==fb&&d.check_()}}var d,e,f=0,g=[],h=[],i={object:void 0,objects:h,open:function(b,c){d||(d=c,e={}),g.push(b),f++,b.iterateObjects_(a)},close:function(){if(f--,!(f>0)){for(var a=0;a<h.length;a++)Object.unobserve(h[a],c),x.unobservedCount++;g.length=0,h.length=0,d=void 0,e=void 0,db.push(this)}}};return i}function w(a,b){return $&&$.object===b||($=db.pop()||v(),$.object=b),$.open(a,b),$}function x(){this.state_=eb,this.callback_=void 0,this.target_=void 0,this.directObserver_=void 0,this.value_=void 0,this.id_=ib++}function y(a){x._allObserversCount++,kb&&jb.push(a)}function z(){x._allObserversCount--}function A(a){x.call(this),this.value_=a,this.oldObject_=void 0}function B(a){if(!Array.isArray(a))throw Error("Provided object is not an Array");A.call(this,a)}function C(a,b){x.call(this),this.object_=a,this.path_=m(b),this.directObserver_=void 0}function D(a){x.call(this),this.reportChangesOnOpen_=a,this.value_=[],this.directObserver_=void 0,this.observed_=[]}function E(a){return a}function F(a,b,c,d){this.callback_=void 0,this.target_=void 0,this.value_=void 0,this.observable_=a,this.getValueFn_=b||E,this.setValueFn_=c||E,this.dontPassThroughSet_=d}function G(a,b,c){for(var d={},e={},f=0;f<b.length;f++){var g=b[f];nb[g.type]?(g.name in c||(c[g.name]=g.oldValue),"update"!=g.type&&("add"!=g.type?g.name in d?(delete d[g.name],delete c[g.name]):e[g.name]=!0:g.name in e?delete e[g.name]:d[g.name]=!0)):(console.error("Unknown changeRecord type: "+g.type),console.error(g))}for(var h in d)d[h]=a[h];for(var h in e)e[h]=void 0;var i={};for(var h in c)if(!(h in d||h in e)){var j=a[h];c[h]!==j&&(i[h]=j)}return{added:d,removed:e,changed:i}}function H(a,b,c){return{index:a,removed:b,addedCount:c}}function I(){}function J(a,b,c,d,e,f){return sb.calcSplices(a,b,c,d,e,f)}function K(a,b,c,d){return c>b||a>d?-1:b==c||d==a?0:c>a?d>b?b-c:d-c:b>d?d-a:b-a}function L(a,b,c,d){for(var e=H(b,c,d),f=!1,g=0,h=0;h<a.length;h++){var i=a[h];if(i.index+=g,!f){var j=K(e.index,e.index+e.removed.length,i.index,i.index+i.addedCount);if(j>=0){a.splice(h,1),h--,g-=i.addedCount-i.removed.length,e.addedCount+=i.addedCount-j;var k=e.removed.length+i.removed.length-j;if(e.addedCount||k){var c=i.removed;if(e.index<i.index){var l=e.removed.slice(0,i.index-e.index);Array.prototype.push.apply(l,c),c=l}if(e.index+e.removed.length>i.index+i.addedCount){var m=e.removed.slice(i.index+i.addedCount-e.index);Array.prototype.push.apply(c,m)}e.removed=c,i.index<e.index&&(e.index=i.index)}else f=!0}else if(e.index<i.index){f=!0,a.splice(h,0,e),h++;var n=e.addedCount-e.removed.length;i.index+=n,g+=n}}}f||a.push(e)}function M(a,b){for(var c=[],f=0;f<b.length;f++){var g=b[f];switch(g.type){case"splice":L(c,g.index,g.removed.slice(),g.addedCount);break;case"add":case"update":case"delete":if(!d(g.name))continue;var h=e(g.name);if(0>h)continue;L(c,h,[g.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(g))}}return c}function N(a,b){var c=[];return M(a,b).forEach(function(b){return 1==b.addedCount&&1==b.removed.length?void(b.removed[0]!==a[b.index]&&c.push(b)):void(c=c.concat(J(a,b.index,b.index+b.addedCount,b.removed,0,b.removed.length)))}),c}var O=a.testingExposeCycleCount,P=b(),Q=c(),R=a.Number.isNaN||function(b){return"number"==typeof b&&a.isNaN(b)},S="__proto__"in{}?function(a){return a}:function(a){var b=a.__proto__;if(!b)return a;var c=Object.create(b);return Object.getOwnPropertyNames(a).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(a,b))}),c},T="[$_a-zA-Z]",U="[$_a-zA-Z0-9]",V=new RegExp("^"+T+"+"+U+"*$"),W={beforePath:{ws:["beforePath"],ident:["inIdent","append"],"[":["beforeElement"],eof:["afterPath"]},inPath:{ws:["inPath"],".":["beforeIdent"],"[":["beforeElement"],eof:["afterPath"]},beforeIdent:{ws:["beforeIdent"],ident:["inIdent","append"]},inIdent:{ident:["inIdent","append"],0:["inIdent","append"],number:["inIdent","append"],ws:["inPath","push"],".":["beforeIdent","push"],"[":["beforeElement","push"],eof:["afterPath","push"]},beforeElement:{ws:["beforeElement"],0:["afterZero","append"],number:["inIndex","append"],"'":["inSingleQuote","append",""],'"':["inDoubleQuote","append",""]},afterZero:{ws:["afterElement","push"],"]":["inPath","push"]},inIndex:{0:["inIndex","append"],number:["inIndex","append"],ws:["afterElement"],"]":["inPath","push"]},inSingleQuote:{"'":["afterElement"],eof:["error"],"else":["inSingleQuote","append"]},inDoubleQuote:{'"':["afterElement"],eof:["error"],"else":["inDoubleQuote","append"]},afterElement:{ws:["afterElement"],"]":["inPath","push"]}},X={},Y={};l.get=m,l.prototype=S({__proto__:[],valid:!0,toString:function(){for(var a="",b=0;b<this.length;b++){var c=this[b];a+=k(c)?b?"."+c:c:n(c)}return a},getValueFrom:function(a){for(var b=0;b<this.length;b++){if(null==a)return;a=a[this[b]]}return a},iterateObjects:function(a,b){for(var c=0;c<this.length;c++){if(c&&(a=a[this[c-1]]),!f(a))return;b(a,this[0])}},compiledGetValueFromFn:function(){var a="",b="obj";a+="if (obj != null";for(var c,d=0;d<this.length-1;d++)c=this[d],b+=k(c)?"."+c:n(c),a+=" &&\n "+b+" != null";a+=")\n";var c=this[d];return b+=k(c)?"."+c:n(c),a+=" return "+b+";\nelse\n return undefined;",new Function("obj",a)},setValueFrom:function(a,b){if(!this.length)return!1;for(var c=0;c<this.length-1;c++){if(!f(a))return!1;a=a[this[c]]}return f(a)?(a[this[c]]=b,!0):!1}});var Z=new l("",X);Z.valid=!1,Z.getValueFrom=Z.setValueFrom=function(){};var $,_=1e3,ab=[],bb=P?function(){var a={pingPong:!0},b=!1;return Object.observe(a,function(){s(),b=!1}),function(c){ab.push(c),b||(b=!0,a.pingPong=!a.pingPong)}}():function(){return function(a){ab.push(a)}}(),cb=[],db=[],eb=0,fb=1,gb=2,hb=3,ib=1;x.prototype={open:function(a,b){if(this.state_!=eb)throw Error("Observer has already been opened.");return y(this),this.callback_=a,this.target_=b,this.connect_(),this.state_=fb,this.value_},close:function(){this.state_==fb&&(z(this),this.disconnect_(),this.value_=void 0,this.callback_=void 0,this.target_=void 0,this.state_=gb)},deliver:function(){this.state_==fb&&o(this)},report_:function(a){try{this.callback_.apply(this.target_,a)}catch(b){x._errorThrownDuringCallback=!0,console.error("Exception caught during observer callback: "+(b.stack||b))}},discardChanges:function(){return this.check_(void 0,!0),this.value_}};var jb,kb=!P;x._allObserversCount=0,kb&&(jb=[]);var lb=!1;a.Platform=a.Platform||{},a.Platform.performMicrotaskCheckpoint=function(){if(!lb&&kb){lb=!0;var b,c,d=0;do{d++,c=jb,jb=[],b=!1;for(var e=0;e<c.length;e++){var f=c[e];f.state_==fb&&(f.check_()&&(b=!0),jb.push(f))}s()&&(b=!0)}while(_>d&&b);O&&(a.dirtyCheckCycleCount=d),lb=!1}},kb&&(a.Platform.clearObservers=function(){jb=[]}),A.prototype=S({__proto__:x.prototype,arrayObserve:!1,connect_:function(){P?this.directObserver_=u(this,this.value_,this.arrayObserve):this.oldObject_=this.copyObject(this.value_)},copyObject:function(a){var b=Array.isArray(a)?[]:{};for(var c in a)b[c]=a[c];return Array.isArray(a)&&(b.length=a.length),b},check_:function(a){var b,c;if(P){if(!a)return!1;c={},b=G(this.value_,a,c)}else c=this.oldObject_,b=r(this.value_,this.oldObject_);return q(b)?!1:(P||(this.oldObject_=this.copyObject(this.value_)),this.report_([b.added||{},b.removed||{},b.changed||{},function(a){return c[a]}]),!0)},disconnect_:function(){P?(this.directObserver_.close(),this.directObserver_=void 0):this.oldObject_=void 0},deliver:function(){this.state_==fb&&(P?this.directObserver_.deliver(!1):o(this))},discardChanges:function(){return this.directObserver_?this.directObserver_.deliver(!0):this.oldObject_=this.copyObject(this.value_),this.value_}}),B.prototype=S({__proto__:A.prototype,arrayObserve:!0,copyObject:function(a){return a.slice()},check_:function(a){var b;if(P){if(!a)return!1;b=N(this.value_,a)}else b=J(this.value_,0,this.value_.length,this.oldObject_,0,this.oldObject_.length);return b&&b.length?(P||(this.oldObject_=this.copyObject(this.value_)),this.report_([b]),!0):!1}}),B.applySplices=function(a,b,c){c.forEach(function(c){for(var d=[c.index,c.removed.length],e=c.index;e<c.index+c.addedCount;)d.push(b[e]),e++;Array.prototype.splice.apply(a,d)})},C.prototype=S({__proto__:x.prototype,get path(){return this.path_},connect_:function(){P&&(this.directObserver_=w(this,this.object_)),this.check_(void 0,!0)},disconnect_:function(){this.value_=void 0,this.directObserver_&&(this.directObserver_.close(this),this.directObserver_=void 0)},iterateObjects_:function(a){this.path_.iterateObjects(this.object_,a)},check_:function(a,b){var c=this.value_;return this.value_=this.path_.getValueFrom(this.object_),b||g(this.value_,c)?!1:(this.report_([this.value_,c,this]),!0)},setValue:function(a){this.path_&&this.path_.setValueFrom(this.object_,a)}});var mb={};D.prototype=S({__proto__:x.prototype,connect_:function(){if(P){for(var a,b=!1,c=0;c<this.observed_.length;c+=2)if(a=this.observed_[c],a!==mb){b=!0;break}b&&(this.directObserver_=w(this,a))}this.check_(void 0,!this.reportChangesOnOpen_)},disconnect_:function(){for(var a=0;a<this.observed_.length;a+=2)this.observed_[a]===mb&&this.observed_[a+1].close();this.observed_.length=0,this.value_.length=0,this.directObserver_&&(this.directObserver_.close(this),this.directObserver_=void 0)},addPath:function(a,b){if(this.state_!=eb&&this.state_!=hb)throw Error("Cannot add paths once started.");var b=m(b);if(this.observed_.push(a,b),this.reportChangesOnOpen_){var c=this.observed_.length/2-1;this.value_[c]=b.getValueFrom(a)}},addObserver:function(a){if(this.state_!=eb&&this.state_!=hb)throw Error("Cannot add observers once started.");if(this.observed_.push(mb,a),this.reportChangesOnOpen_){var b=this.observed_.length/2-1;this.value_[b]=a.open(this.deliver,this)}},startReset:function(){if(this.state_!=fb)throw Error("Can only reset while open");this.state_=hb,this.disconnect_()},finishReset:function(){if(this.state_!=hb)throw Error("Can only finishReset after startReset");return this.state_=fb,this.connect_(),this.value_},iterateObjects_:function(a){for(var b,c=0;c<this.observed_.length;c+=2)b=this.observed_[c],b!==mb&&this.observed_[c+1].iterateObjects(b,a)},check_:function(a,b){for(var c,d=0;d<this.observed_.length;d+=2){var e,f=this.observed_[d],h=this.observed_[d+1];if(f===mb){var i=h;e=this.state_===eb?i.open(this.deliver,this):i.discardChanges()}else e=h.getValueFrom(f);b?this.value_[d/2]=e:g(e,this.value_[d/2])||(c=c||[],c[d/2]=this.value_[d/2],this.value_[d/2]=e)}return c?(this.report_([this.value_,c,this.observed_]),!0):!1}}),F.prototype={open:function(a,b){return this.callback_=a,this.target_=b,this.value_=this.getValueFn_(this.observable_.open(this.observedCallback_,this)),this.value_},observedCallback_:function(a){if(a=this.getValueFn_(a),!g(a,this.value_)){var b=this.value_;this.value_=a,this.callback_.call(this.target_,this.value_,b)}},discardChanges:function(){return this.value_=this.getValueFn_(this.observable_.discardChanges()),this.value_},deliver:function(){return this.observable_.deliver()},setValue:function(a){return a=this.setValueFn_(a),!this.dontPassThroughSet_&&this.observable_.setValue?this.observable_.setValue(a):void 0},close:function(){this.observable_&&this.observable_.close(),this.callback_=void 0,this.target_=void 0,this.observable_=void 0,this.value_=void 0,this.getValueFn_=void 0,this.setValueFn_=void 0}};var nb={add:!0,update:!0,"delete":!0},ob=0,pb=1,qb=2,rb=3;I.prototype={calcEditDistances:function(a,b,c,d,e,f){for(var g=f-e+1,h=c-b+1,i=new Array(g),j=0;g>j;j++)i[j]=new Array(h),i[j][0]=j;for(var k=0;h>k;k++)i[0][k]=k;for(var j=1;g>j;j++)for(var k=1;h>k;k++)if(this.equals(a[b+k-1],d[e+j-1]))i[j][k]=i[j-1][k-1];else{var l=i[j-1][k]+1,m=i[j][k-1]+1;i[j][k]=m>l?l:m}return i},spliceOperationsFromEditDistances:function(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];b>0||c>0;)if(0!=b)if(0!=c){var f,g=a[b-1][c-1],h=a[b-1][c],i=a[b][c-1];f=i>h?g>h?h:g:g>i?i:g,f==g?(g==d?e.push(ob):(e.push(pb),d=g),b--,c--):f==h?(e.push(rb),b--,d=h):(e.push(qb),c--,d=i)}else e.push(rb),b--;else e.push(qb),c--;return e.reverse(),e},calcSplices:function(a,b,c,d,e,f){var g=0,h=0,i=Math.min(c-b,f-e);if(0==b&&0==e&&(g=this.sharedPrefix(a,d,i)),c==a.length&&f==d.length&&(h=this.sharedSuffix(a,d,i-g)),b+=g,e+=g,c-=h,f-=h,c-b==0&&f-e==0)return[];if(b==c){for(var j=H(b,[],0);f>e;)j.removed.push(d[e++]);return[j]}if(e==f)return[H(b,[],c-b)];for(var k=this.spliceOperationsFromEditDistances(this.calcEditDistances(a,b,c,d,e,f)),j=void 0,l=[],m=b,n=e,o=0;o<k.length;o++)switch(k[o]){case ob:j&&(l.push(j),j=void 0),m++,n++;break;case pb:j||(j=H(m,[],0)),j.addedCount++,m++,j.removed.push(d[n]),n++;break;case qb:j||(j=H(m,[],0)),j.addedCount++,m++;break;case rb:j||(j=H(m,[],0)),j.removed.push(d[n]),n++}return j&&l.push(j),l},sharedPrefix:function(a,b,c){for(var d=0;c>d;d++)if(!this.equals(a[d],b[d]))return d;return c},sharedSuffix:function(a,b,c){for(var d=a.length,e=b.length,f=0;c>f&&this.equals(a[--d],b[--e]);)f++;return f},calculateSplices:function(a,b){return this.calcSplices(a,0,a.length,b,0,b.length)},equals:function(a,b){return a===b}};var sb=new I;a.Observer=x,a.Observer.runEOM_=bb,a.Observer.observerSentinel_=mb,a.Observer.hasObjectObserve=P,a.ArrayObserver=B,a.ArrayObserver.calculateSplices=function(a,b){return sb.calculateSplices(a,b)},a.ArraySplice=I,a.ObjectObserver=A,a.PathObserver=C,a.CompoundObserver=D,a.Path=l,a.ObserverTransform=F}("undefined"!=typeof global&&global&&"undefined"!=typeof module&&module?global:this||window),window.ShadowDOMPolyfill={},function(a){"use strict";function b(){if("undefined"!=typeof chrome&&chrome.app&&chrome.app.runtime)return!1;if(navigator.getDeviceStorage)return!1;try{var a=new Function("return true;");return a()}catch(b){return!1}}function c(a){if(!a)throw new Error("Assertion failed")}function d(a,b){for(var c=N(b),d=0;d<c.length;d++){var e=c[d];M(a,e,O(b,e))}return a}function e(a,b){for(var c=N(b),d=0;d<c.length;d++){var e=c[d];switch(e){case"arguments":case"caller":case"length":case"name":case"prototype":case"toString":continue}M(a,e,O(b,e))}return a}function f(a,b){for(var c=0;c<b.length;c++)if(b[c]in a)return b[c]}function g(a,b,c){P.value=c,M(a,b,P)}function h(a){var b=a.__proto__||Object.getPrototypeOf(a),c=I.get(b);if(c)return c;var d=h(b),e=v(d);return s(b,e,a),e}function i(a,b){q(a,b,!0)}function j(a,b){q(b,a,!1)}function k(a){return/^on[a-z]+$/.test(a)}function l(a){return/^\w[a-zA-Z_0-9]*$/.test(a)}function m(a){return L&&l(a)?new Function("return this.__impl4cf1e782hg__."+a):function(){return this.__impl4cf1e782hg__[a]}}function n(a){return L&&l(a)?new Function("v","this.__impl4cf1e782hg__."+a+" = v"):function(b){this.__impl4cf1e782hg__[a]=b}}function o(a){return L&&l(a)?new Function("return this.__impl4cf1e782hg__."+a+".apply(this.__impl4cf1e782hg__, arguments)"):function(){return this.__impl4cf1e782hg__[a].apply(this.__impl4cf1e782hg__,arguments)}}function p(a,b){try{return Object.getOwnPropertyDescriptor(a,b)}catch(c){return R}}function q(b,c,d){for(var e=N(b),f=0;f<e.length;f++){var g=e[f];if("polymerBlackList_"!==g&&!(g in c||b.polymerBlackList_&&b.polymerBlackList_[g])){Q&&b.__lookupGetter__(g);var h,i,j=p(b,g);if(d&&"function"==typeof j.value)c[g]=o(g);else{var l=k(g);h=l?a.getEventHandlerGetter(g):m(g),(j.writable||j.set||S)&&(i=l?a.getEventHandlerSetter(g):n(g)),M(c,g,{get:h,set:i,configurable:j.configurable,enumerable:j.enumerable})}}}}function r(a,b,c){var d=a.prototype;s(d,b,c),e(b,a)}function s(a,b,d){var e=b.prototype;c(void 0===I.get(a)),I.set(a,b),J.set(e,a),i(a,e),d&&j(e,d),g(e,"constructor",b),b.prototype=e}function t(a,b){return I.get(b.prototype)===a}function u(a){var b=Object.getPrototypeOf(a),c=h(b),d=v(c);return s(b,d,a),d}function v(a){function b(b){a.call(this,b)}var c=Object.create(a.prototype);return c.constructor=b,b.prototype=c,b}function w(a){return a&&a.__impl4cf1e782hg__}function x(a){return!w(a)}function y(a){return null===a?null:(c(x(a)),a.__wrapper8e3dd93a60__||(a.__wrapper8e3dd93a60__=new(h(a))(a)))}function z(a){return null===a?null:(c(w(a)),a.__impl4cf1e782hg__)}function A(a){return a.__impl4cf1e782hg__}function B(a,b){b.__impl4cf1e782hg__=a,a.__wrapper8e3dd93a60__=b}function C(a){return a&&w(a)?z(a):a}function D(a){return a&&!w(a)?y(a):a}function E(a,b){null!==b&&(c(x(a)),c(void 0===b||w(b)),a.__wrapper8e3dd93a60__=b)}function F(a,b,c){T.get=c,M(a.prototype,b,T)}function G(a,b){F(a,b,function(){return y(this.__impl4cf1e782hg__[b])})}function H(a,b){a.forEach(function(a){b.forEach(function(b){a.prototype[b]=function(){var a=D(this);return a[b].apply(a,arguments)}})})}var I=new WeakMap,J=new WeakMap,K=Object.create(null),L=b(),M=Object.defineProperty,N=Object.getOwnPropertyNames,O=Object.getOwnPropertyDescriptor,P={value:void 0,configurable:!0,enumerable:!1,writable:!0};N(window);var Q=/Firefox/.test(navigator.userAgent),R={get:function(){},set:function(){},configurable:!0,enumerable:!0},S=function(){var a=Object.getOwnPropertyDescriptor(Node.prototype,"nodeType");return!!a&&"set"in a}(),T={get:void 0,configurable:!0,enumerable:!0};a.assert=c,a.constructorTable=I,a.defineGetter=F,a.defineWrapGetter=G,a.forwardMethodsToWrapper=H,a.isWrapper=w,a.isWrapperFor=t,a.mixin=d,a.nativePrototypeTable=J,a.oneOf=f,a.registerObject=u,a.registerWrapper=r,a.rewrap=E,a.setWrapper=B,a.unsafeUnwrap=A,a.unwrap=z,a.unwrapIfNeeded=C,a.wrap=y,a.wrapIfNeeded=D,a.wrappers=K}(window.ShadowDOMPolyfill),function(a){"use strict";function b(){g=!1;var a=f.slice(0);f=[];for(var b=0;b<a.length;b++)a[b]()}function c(a){f.push(a),g||(g=!0,d(b,0))}var d,e=window.MutationObserver,f=[],g=!1;if(e){var h=1,i=new e(b),j=document.createTextNode(h);i.observe(j,{characterData:!0}),d=function(){h=(h+1)%2,j.data=h}}else d=window.setImmediate||window.setTimeout;a.setEndOfMicrotask=c}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.scheduled_||(a.scheduled_=!0,o.push(a),p||(k(c),p=!0))}function c(){for(p=!1;o.length;){var a=o;o=[],a.sort(function(a,b){return a.uid_-b.uid_});for(var b=0;b<a.length;b++){var c=a[b];c.scheduled_=!1;var d=c.takeRecords();f(c),d.length&&c.callback_(d,c)}}}function d(a,b){this.type=a,this.target=b,this.addedNodes=new m.NodeList,this.removedNodes=new m.NodeList,this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function e(a,b){for(;a;a=a.parentNode){var c=n.get(a);if(c)for(var d=0;d<c.length;d++){var e=c[d];e.options.subtree&&e.addTransientObserver(b)}}}function f(a){for(var b=0;b<a.nodes_.length;b++){var c=a.nodes_[b],d=n.get(c);if(!d)return;for(var e=0;e<d.length;e++){var f=d[e];f.observer===a&&f.removeTransientObservers()}}}function g(a,c,e){for(var f=Object.create(null),g=Object.create(null),h=a;h;h=h.parentNode){var i=n.get(h);if(i)for(var j=0;j<i.length;j++){var k=i[j],l=k.options;if((h===a||l.subtree)&&!("attributes"===c&&!l.attributes||"attributes"===c&&l.attributeFilter&&(null!==e.namespace||-1===l.attributeFilter.indexOf(e.name))||"characterData"===c&&!l.characterData||"childList"===c&&!l.childList)){var m=k.observer;f[m.uid_]=m,("attributes"===c&&l.attributeOldValue||"characterData"===c&&l.characterDataOldValue)&&(g[m.uid_]=e.oldValue)}}}for(var o in f){var m=f[o],p=new d(c,a);"name"in e&&"namespace"in e&&(p.attributeName=e.name,p.attributeNamespace=e.namespace),e.addedNodes&&(p.addedNodes=e.addedNodes),e.removedNodes&&(p.removedNodes=e.removedNodes),e.previousSibling&&(p.previousSibling=e.previousSibling),e.nextSibling&&(p.nextSibling=e.nextSibling),void 0!==g[o]&&(p.oldValue=g[o]),b(m),m.records_.push(p)}}function h(a){if(this.childList=!!a.childList,this.subtree=!!a.subtree,this.attributes="attributes"in a||!("attributeOldValue"in a||"attributeFilter"in a)?!!a.attributes:!0,this.characterData="characterDataOldValue"in a&&!("characterData"in a)?!0:!!a.characterData,!this.attributes&&(a.attributeOldValue||"attributeFilter"in a)||!this.characterData&&a.characterDataOldValue)throw new TypeError;if(this.characterData=!!a.characterData,this.attributeOldValue=!!a.attributeOldValue,this.characterDataOldValue=!!a.characterDataOldValue,"attributeFilter"in a){if(null==a.attributeFilter||"object"!=typeof a.attributeFilter)throw new TypeError;this.attributeFilter=q.call(a.attributeFilter)}else this.attributeFilter=null}function i(a){this.callback_=a,this.nodes_=[],this.records_=[],this.uid_=++r,this.scheduled_=!1}function j(a,b,c){this.observer=a,this.target=b,this.options=c,this.transientObservedNodes=[]}var k=a.setEndOfMicrotask,l=a.wrapIfNeeded,m=a.wrappers,n=new WeakMap,o=[],p=!1,q=Array.prototype.slice,r=0;i.prototype={constructor:i,observe:function(a,b){a=l(a);var c,d=new h(b),e=n.get(a);e||n.set(a,e=[]);for(var f=0;f<e.length;f++)e[f].observer===this&&(c=e[f],c.removeTransientObservers(),c.options=d);c||(c=new j(this,a,d),e.push(c),this.nodes_.push(a))},disconnect:function(){this.nodes_.forEach(function(a){for(var b=n.get(a),c=0;c<b.length;c++){var d=b[c];if(d.observer===this){b.splice(c,1);break}}},this),this.records_=[]},takeRecords:function(){var a=this.records_;return this.records_=[],a}},j.prototype={addTransientObserver:function(a){if(a!==this.target){b(this.observer),this.transientObservedNodes.push(a);var c=n.get(a);c||n.set(a,c=[]),c.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[];for(var b=0;b<a.length;b++)for(var c=a[b],d=n.get(c),e=0;e<d.length;e++)if(d[e]===this){d.splice(e,1);break}}},a.enqueueMutation=g,a.registerTransientObservers=e,a.wrappers.MutationObserver=i,a.wrappers.MutationRecord=d}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a,b){this.root=a,this.parent=b}function c(a,b){if(a.treeScope_!==b){a.treeScope_=b;for(var d=a.shadowRoot;d;d=d.olderShadowRoot)d.treeScope_.parent=b;for(var e=a.firstChild;e;e=e.nextSibling)c(e,b)}}function d(c){if(c instanceof a.wrappers.Window,c.treeScope_)return c.treeScope_;var e,f=c.parentNode;return e=f?d(f):new b(c,null),c.treeScope_=e}b.prototype={get renderer(){return this.root instanceof a.wrappers.ShadowRoot?a.getRendererForHost(this.root.host):null},contains:function(a){for(;a;a=a.parent)if(a===this)return!0;return!1}},a.TreeScope=b,a.getTreeScope=d,a.setTreeScope=c}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a instanceof T.ShadowRoot}function c(a){return M(a).root}function d(a,d){var h=[],i=a;for(h.push(i);i;){var j=g(i);if(j&&j.length>0){for(var k=0;k<j.length;k++){var m=j[k];if(f(m)){var n=c(m),o=n.olderShadowRoot;o&&h.push(o)}h.push(m)}i=j[j.length-1]}else if(b(i)){if(l(a,i)&&e(d))break;i=i.host,h.push(i)}else i=i.parentNode,i&&h.push(i)}return h}function e(a){if(!a)return!1;switch(a.type){case"abort":case"error":case"select":case"change":case"load":case"reset":case"resize":case"scroll":case"selectstart":return!0}return!1}function f(a){return a instanceof HTMLShadowElement}function g(b){return a.getDestinationInsertionPoints(b)}function h(a,b){if(0===a.length)return b;b instanceof T.Window&&(b=b.document);for(var c=M(b),d=a[0],e=M(d),f=j(c,e),g=0;g<a.length;g++){var h=a[g];if(M(h)===f)return h}return a[a.length-1]}function i(a){for(var b=[];a;a=a.parent)b.push(a);return b}function j(a,b){for(var c=i(a),d=i(b),e=null;c.length>0&&d.length>0;){var f=c.pop(),g=d.pop();if(f!==g)break;e=f}return e}function k(a,b,c){b instanceof T.Window&&(b=b.document);var e,f=M(b),g=M(c),h=d(c,a),e=j(f,g);e||(e=g.root);for(var i=e;i;i=i.parent)for(var k=0;k<h.length;k++){var l=h[k];if(M(l)===i)return l}return null}function l(a,b){return M(a)===M(b)}function m(a){if(!V.get(a)&&(V.set(a,!0),o(S(a),S(a.target)),K)){var b=K;throw K=null,b}}function n(a){switch(a.type){case"load":case"beforeunload":case"unload":return!0}return!1}function o(b,c){if(W.get(b))throw new Error("InvalidStateError");W.set(b,!0),a.renderAllPending();var e,f,g;if(n(b)&&!b.bubbles){var h=c;h instanceof T.Document&&(g=h.defaultView)&&(f=h,e=[])}if(!e)if(c instanceof T.Window)g=c,e=[];else if(e=d(c,b),!n(b)){var h=e[e.length-1];h instanceof T.Document&&(g=h.defaultView)}return cb.set(b,e),p(b,e,g,f)&&q(b,e,g,f)&&r(b,e,g,f),$.set(b,db),Y.delete(b,null),W.delete(b),b.defaultPrevented}function p(a,b,c,d){var e=eb;if(c&&!s(c,a,e,b,d))return!1;for(var f=b.length-1;f>0;f--)if(!s(b[f],a,e,b,d))return!1;return!0}function q(a,b,c,d){var e=fb,f=b[0]||c;return s(f,a,e,b,d)}function r(a,b,c,d){for(var e=gb,f=1;f<b.length;f++)if(!s(b[f],a,e,b,d))return;c&&b.length>0&&s(c,a,e,b,d)}function s(a,b,c,d,e){var f=U.get(a);if(!f)return!0;var g=e||h(d,a);if(g===a){if(c===eb)return!0;c===gb&&(c=fb)}else if(c===gb&&!b.bubbles)return!0;if("relatedTarget"in b){var i=R(b),j=i.relatedTarget;if(j){if(j instanceof Object&&j.addEventListener){var l=S(j),m=k(b,a,l);if(m===g)return!0}else m=null;Z.set(b,m)}}$.set(b,c);var n=b.type,o=!1;X.set(b,g),Y.set(b,a),f.depth++;for(var p=0,q=f.length;q>p;p++){var r=f[p];if(r.removed)o=!0;else if(!(r.type!==n||!r.capture&&c===eb||r.capture&&c===gb))try{if("function"==typeof r.handler?r.handler.call(a,b):r.handler.handleEvent(b),ab.get(b))return!1}catch(s){K||(K=s)}}if(f.depth--,o&&0===f.depth){var t=f.slice();f.length=0;for(var p=0;p<t.length;p++)t[p].removed||f.push(t[p])}return!_.get(b)}function t(a,b,c){this.type=a,this.handler=b,this.capture=Boolean(c)}function u(a,b){if(!(a instanceof hb))return S(y(hb,"Event",a,b));var c=a;return sb||"beforeunload"!==c.type||this instanceof z?void P(c,this):new z(c)}function v(a){return a&&a.relatedTarget?Object.create(a,{relatedTarget:{value:R(a.relatedTarget)}}):a}function w(a,b,c){var d=window[a],e=function(b,c){return b instanceof d?void P(b,this):S(y(d,a,b,c))};if(e.prototype=Object.create(b.prototype),c&&N(e.prototype,c),d)try{O(d,e,new d("temp"))}catch(f){O(d,e,document.createEvent(a))}return e}function x(a,b){return function(){arguments[b]=R(arguments[b]);var c=R(this);c[a].apply(c,arguments)}}function y(a,b,c,d){if(qb)return new a(c,v(d));var e=R(document.createEvent(b)),f=pb[b],g=[c];return Object.keys(f).forEach(function(a){var b=null!=d&&a in d?d[a]:f[a];"relatedTarget"===a&&(b=R(b)),g.push(b)}),e["init"+b].apply(e,g),e}function z(a){u.call(this,a)}function A(a){return"function"==typeof a?!0:a&&a.handleEvent}function B(a){switch(a){case"DOMAttrModified":case"DOMAttributeNameChanged":case"DOMCharacterDataModified":case"DOMElementNameChanged":case"DOMNodeInserted":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemoved":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":return!0}return!1}function C(a){P(a,this)}function D(a){return a instanceof T.ShadowRoot&&(a=a.host),R(a)}function E(a,b){var c=U.get(a);if(c)for(var d=0;d<c.length;d++)if(!c[d].removed&&c[d].type===b)return!0;return!1}function F(a,b){for(var c=R(a);c;c=c.parentNode)if(E(S(c),b))return!0;return!1}function G(a){L(a,ub)}function H(b,c,e,f){a.renderAllPending();var g=S(vb.call(Q(c),e,f));if(!g)return null;var i=d(g,null),j=i.lastIndexOf(b);return-1==j?null:(i=i.slice(0,j),h(i,b))}function I(a){return function(){var b=bb.get(this);
|
2
|
+
return b&&b[a]&&b[a].value||null}}function J(a){var b=a.slice(2);return function(c){var d=bb.get(this);d||(d=Object.create(null),bb.set(this,d));var e=d[a];if(e&&this.removeEventListener(b,e.wrapped,!1),"function"==typeof c){var f=function(b){var d=c.call(this,b);d===!1?b.preventDefault():"onbeforeunload"===a&&"string"==typeof d&&(b.returnValue=d)};this.addEventListener(b,f,!1),d[a]={value:c,wrapped:f}}}}var K,L=a.forwardMethodsToWrapper,M=a.getTreeScope,N=a.mixin,O=a.registerWrapper,P=a.setWrapper,Q=a.unsafeUnwrap,R=a.unwrap,S=a.wrap,T=a.wrappers,U=(new WeakMap,new WeakMap),V=new WeakMap,W=new WeakMap,X=new WeakMap,Y=new WeakMap,Z=new WeakMap,$=new WeakMap,_=new WeakMap,ab=new WeakMap,bb=new WeakMap,cb=new WeakMap,db=0,eb=1,fb=2,gb=3;t.prototype={equals:function(a){return this.handler===a.handler&&this.type===a.type&&this.capture===a.capture},get removed(){return null===this.handler},remove:function(){this.handler=null}};var hb=window.Event;hb.prototype.polymerBlackList_={returnValue:!0,keyLocation:!0},u.prototype={get target(){return X.get(this)},get currentTarget(){return Y.get(this)},get eventPhase(){return $.get(this)},get path(){var a=cb.get(this);return a?a.slice():[]},stopPropagation:function(){_.set(this,!0)},stopImmediatePropagation:function(){_.set(this,!0),ab.set(this,!0)}},O(hb,u,document.createEvent("Event"));var ib=w("UIEvent",u),jb=w("CustomEvent",u),kb={get relatedTarget(){var a=Z.get(this);return void 0!==a?a:S(R(this).relatedTarget)}},lb=N({initMouseEvent:x("initMouseEvent",14)},kb),mb=N({initFocusEvent:x("initFocusEvent",5)},kb),nb=w("MouseEvent",ib,lb),ob=w("FocusEvent",ib,mb),pb=Object.create(null),qb=function(){try{new window.FocusEvent("focus")}catch(a){return!1}return!0}();if(!qb){var rb=function(a,b,c){if(c){var d=pb[c];b=N(N({},d),b)}pb[a]=b};rb("Event",{bubbles:!1,cancelable:!1}),rb("CustomEvent",{detail:null},"Event"),rb("UIEvent",{view:null,detail:0},"Event"),rb("MouseEvent",{screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},"UIEvent"),rb("FocusEvent",{relatedTarget:null},"UIEvent")}var sb=window.BeforeUnloadEvent;z.prototype=Object.create(u.prototype),N(z.prototype,{get returnValue(){return Q(this).returnValue},set returnValue(a){Q(this).returnValue=a}}),sb&&O(sb,z);var tb=window.EventTarget,ub=["addEventListener","removeEventListener","dispatchEvent"];[Node,Window].forEach(function(a){var b=a.prototype;ub.forEach(function(a){Object.defineProperty(b,a+"_",{value:b[a]})})}),C.prototype={addEventListener:function(a,b,c){if(A(b)&&!B(a)){var d=new t(a,b,c),e=U.get(this);if(e){for(var f=0;f<e.length;f++)if(d.equals(e[f]))return}else e=[],e.depth=0,U.set(this,e);e.push(d);var g=D(this);g.addEventListener_(a,m,!0)}},removeEventListener:function(a,b,c){c=Boolean(c);var d=U.get(this);if(d){for(var e=0,f=!1,g=0;g<d.length;g++)d[g].type===a&&d[g].capture===c&&(e++,d[g].handler===b&&(f=!0,d[g].remove()));if(f&&1===e){var h=D(this);h.removeEventListener_(a,m,!0)}}},dispatchEvent:function(b){var c=R(b),d=c.type;V.set(c,!1),a.renderAllPending();var e;F(this,d)||(e=function(){},this.addEventListener(d,e,!0));try{return R(this).dispatchEvent_(c)}finally{e&&this.removeEventListener(d,e,!0)}}},tb&&O(tb,C);var vb=document.elementFromPoint;a.elementFromPoint=H,a.getEventHandlerGetter=I,a.getEventHandlerSetter=J,a.wrapEventTargetMethods=G,a.wrappers.BeforeUnloadEvent=z,a.wrappers.CustomEvent=jb,a.wrappers.Event=u,a.wrappers.EventTarget=C,a.wrappers.FocusEvent=ob,a.wrappers.MouseEvent=nb,a.wrappers.UIEvent=ib}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a,b){Object.defineProperty(a,b,p)}function c(a){j(a,this)}function d(){this.length=0,b(this,"length")}function e(a){for(var b=new d,e=0;e<a.length;e++)b[e]=new c(a[e]);return b.length=e,b}function f(a){g.call(this,a)}var g=a.wrappers.UIEvent,h=a.mixin,i=a.registerWrapper,j=a.setWrapper,k=a.unsafeUnwrap,l=a.wrap,m=window.TouchEvent;if(m){var n;try{n=document.createEvent("TouchEvent")}catch(o){return}var p={enumerable:!1};c.prototype={get target(){return l(k(this).target)}};var q={configurable:!0,enumerable:!0,get:null};["clientX","clientY","screenX","screenY","pageX","pageY","identifier","webkitRadiusX","webkitRadiusY","webkitRotationAngle","webkitForce"].forEach(function(a){q.get=function(){return k(this)[a]},Object.defineProperty(c.prototype,a,q)}),d.prototype={item:function(a){return this[a]}},f.prototype=Object.create(g.prototype),h(f.prototype,{get touches(){return e(k(this).touches)},get targetTouches(){return e(k(this).targetTouches)},get changedTouches(){return e(k(this).changedTouches)},initTouchEvent:function(){throw new Error("Not implemented")}}),i(m,f,n),a.wrappers.Touch=c,a.wrappers.TouchEvent=f,a.wrappers.TouchList=d}}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a,b){Object.defineProperty(a,b,h)}function c(){this.length=0,b(this,"length")}function d(a){if(null==a)return a;for(var b=new c,d=0,e=a.length;e>d;d++)b[d]=g(a[d]);return b.length=e,b}function e(a,b){a.prototype[b]=function(){return d(f(this)[b].apply(f(this),arguments))}}var f=a.unsafeUnwrap,g=a.wrap,h={enumerable:!1};c.prototype={item:function(a){return this[a]}},b(c.prototype,"item"),a.wrappers.NodeList=c,a.addWrapNodeListMethod=e,a.wrapNodeList=d}(window.ShadowDOMPolyfill),function(a){"use strict";a.wrapHTMLCollection=a.wrapNodeList,a.wrappers.HTMLCollection=a.wrappers.NodeList}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){A(a instanceof w)}function c(a){var b=new y;return b[0]=a,b.length=1,b}function d(a,b,c){C(b,"childList",{removedNodes:c,previousSibling:a.previousSibling,nextSibling:a.nextSibling})}function e(a,b){C(a,"childList",{removedNodes:b})}function f(a,b,d,e){if(a instanceof DocumentFragment){var f=h(a);P=!0;for(var g=f.length-1;g>=0;g--)a.removeChild(f[g]),f[g].parentNode_=b;P=!1;for(var g=0;g<f.length;g++)f[g].previousSibling_=f[g-1]||d,f[g].nextSibling_=f[g+1]||e;return d&&(d.nextSibling_=f[0]),e&&(e.previousSibling_=f[f.length-1]),f}var f=c(a),i=a.parentNode;return i&&i.removeChild(a),a.parentNode_=b,a.previousSibling_=d,a.nextSibling_=e,d&&(d.nextSibling_=a),e&&(e.previousSibling_=a),f}function g(a){if(a instanceof DocumentFragment)return h(a);var b=c(a),e=a.parentNode;return e&&d(a,e,b),b}function h(a){for(var b=new y,c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b.length=c,e(a,b),b}function i(a){return a}function j(a,b){I(a,b),a.nodeIsInserted_()}function k(a,b){for(var c=D(b),d=0;d<a.length;d++)j(a[d],c)}function l(a){I(a,new z(a,null))}function m(a){for(var b=0;b<a.length;b++)l(a[b])}function n(a,b){var c=a.nodeType===w.DOCUMENT_NODE?a:a.ownerDocument;c!==b.ownerDocument&&c.adoptNode(b)}function o(b,c){if(c.length){var d=b.ownerDocument;if(d!==c[0].ownerDocument)for(var e=0;e<c.length;e++)a.adoptNodeNoRemove(c[e],d)}}function p(a,b){o(a,b);var c=b.length;if(1===c)return K(b[0]);for(var d=K(a.ownerDocument.createDocumentFragment()),e=0;c>e;e++)d.appendChild(K(b[e]));return d}function q(a){if(void 0!==a.firstChild_)for(var b=a.firstChild_;b;){var c=b;b=b.nextSibling_,c.parentNode_=c.previousSibling_=c.nextSibling_=void 0}a.firstChild_=a.lastChild_=void 0}function r(a){if(a.invalidateShadowRenderer()){for(var b=a.firstChild;b;){A(b.parentNode===a);var c=b.nextSibling,d=K(b),e=d.parentNode;e&&W.call(e,d),b.previousSibling_=b.nextSibling_=b.parentNode_=null,b=c}a.firstChild_=a.lastChild_=null}else for(var c,f=K(a),g=f.firstChild;g;)c=g.nextSibling,W.call(f,g),g=c}function s(a){var b=a.parentNode;return b&&b.invalidateShadowRenderer()}function t(a){for(var b,c=0;c<a.length;c++)b=a[c],b.parentNode.removeChild(b)}function u(a,b,c){var d;if(d=M(c?Q.call(c,J(a),!1):R.call(J(a),!1)),b){for(var e=a.firstChild;e;e=e.nextSibling)d.appendChild(u(e,!0,c));if(a instanceof O.HTMLTemplateElement)for(var f=d.content,e=a.content.firstChild;e;e=e.nextSibling)f.appendChild(u(e,!0,c))}return d}function v(a,b){if(!b||D(a)!==D(b))return!1;for(var c=b;c;c=c.parentNode)if(c===a)return!0;return!1}function w(a){A(a instanceof S),x.call(this,a),this.parentNode_=void 0,this.firstChild_=void 0,this.lastChild_=void 0,this.nextSibling_=void 0,this.previousSibling_=void 0,this.treeScope_=void 0}var x=a.wrappers.EventTarget,y=a.wrappers.NodeList,z=a.TreeScope,A=a.assert,B=a.defineWrapGetter,C=a.enqueueMutation,D=a.getTreeScope,E=a.isWrapper,F=a.mixin,G=a.registerTransientObservers,H=a.registerWrapper,I=a.setTreeScope,J=a.unsafeUnwrap,K=a.unwrap,L=a.unwrapIfNeeded,M=a.wrap,N=a.wrapIfNeeded,O=a.wrappers,P=!1,Q=document.importNode,R=window.Node.prototype.cloneNode,S=window.Node,T=window.DocumentFragment,U=(S.prototype.appendChild,S.prototype.compareDocumentPosition),V=S.prototype.insertBefore,W=S.prototype.removeChild,X=S.prototype.replaceChild,Y=/Trident/.test(navigator.userAgent),Z=Y?function(a,b){try{W.call(a,b)}catch(c){if(!(a instanceof T))throw c}}:function(a,b){W.call(a,b)};w.prototype=Object.create(x.prototype),F(w.prototype,{appendChild:function(a){return this.insertBefore(a,null)},insertBefore:function(a,c){b(a);var d;c?E(c)?d=K(c):(d=c,c=M(d)):(c=null,d=null),c&&A(c.parentNode===this);var e,h=c?c.previousSibling:this.lastChild,i=!this.invalidateShadowRenderer()&&!s(a);if(e=i?g(a):f(a,this,h,c),i)n(this,a),q(this),V.call(J(this),K(a),d);else{h||(this.firstChild_=e[0]),c||(this.lastChild_=e[e.length-1],void 0===this.firstChild_&&(this.firstChild_=this.firstChild));var j=d?d.parentNode:J(this);j?V.call(j,p(this,e),d):o(this,e)}return C(this,"childList",{addedNodes:e,nextSibling:c,previousSibling:h}),k(e,this),a},removeChild:function(a){if(b(a),a.parentNode!==this){for(var d=!1,e=(this.childNodes,this.firstChild);e;e=e.nextSibling)if(e===a){d=!0;break}if(!d)throw new Error("NotFoundError")}var f=K(a),g=a.nextSibling,h=a.previousSibling;if(this.invalidateShadowRenderer()){var i=this.firstChild,j=this.lastChild,k=f.parentNode;k&&Z(k,f),i===a&&(this.firstChild_=g),j===a&&(this.lastChild_=h),h&&(h.nextSibling_=g),g&&(g.previousSibling_=h),a.previousSibling_=a.nextSibling_=a.parentNode_=void 0}else q(this),Z(J(this),f);return P||C(this,"childList",{removedNodes:c(a),nextSibling:g,previousSibling:h}),G(this,a),a},replaceChild:function(a,d){b(a);var e;if(E(d)?e=K(d):(e=d,d=M(e)),d.parentNode!==this)throw new Error("NotFoundError");var h,i=d.nextSibling,j=d.previousSibling,m=!this.invalidateShadowRenderer()&&!s(a);return m?h=g(a):(i===a&&(i=a.nextSibling),h=f(a,this,j,i)),m?(n(this,a),q(this),X.call(J(this),K(a),e)):(this.firstChild===d&&(this.firstChild_=h[0]),this.lastChild===d&&(this.lastChild_=h[h.length-1]),d.previousSibling_=d.nextSibling_=d.parentNode_=void 0,e.parentNode&&X.call(e.parentNode,p(this,h),e)),C(this,"childList",{addedNodes:h,removedNodes:c(d),nextSibling:i,previousSibling:j}),l(d),k(h,this),d},nodeIsInserted_:function(){for(var a=this.firstChild;a;a=a.nextSibling)a.nodeIsInserted_()},hasChildNodes:function(){return null!==this.firstChild},get parentNode(){return void 0!==this.parentNode_?this.parentNode_:M(J(this).parentNode)},get firstChild(){return void 0!==this.firstChild_?this.firstChild_:M(J(this).firstChild)},get lastChild(){return void 0!==this.lastChild_?this.lastChild_:M(J(this).lastChild)},get nextSibling(){return void 0!==this.nextSibling_?this.nextSibling_:M(J(this).nextSibling)},get previousSibling(){return void 0!==this.previousSibling_?this.previousSibling_:M(J(this).previousSibling)},get parentElement(){for(var a=this.parentNode;a&&a.nodeType!==w.ELEMENT_NODE;)a=a.parentNode;return a},get textContent(){for(var a="",b=this.firstChild;b;b=b.nextSibling)b.nodeType!=w.COMMENT_NODE&&(a+=b.textContent);return a},set textContent(a){var b=i(this.childNodes);if(this.invalidateShadowRenderer()){if(r(this),""!==a){var c=J(this).ownerDocument.createTextNode(a);this.appendChild(c)}}else q(this),J(this).textContent=a;var d=i(this.childNodes);C(this,"childList",{addedNodes:d,removedNodes:b}),m(b),k(d,this)},get childNodes(){for(var a=new y,b=0,c=this.firstChild;c;c=c.nextSibling)a[b++]=c;return a.length=b,a},cloneNode:function(a){return u(this,a)},contains:function(a){return v(this,N(a))},compareDocumentPosition:function(a){return U.call(J(this),L(a))},normalize:function(){for(var a,b,c=i(this.childNodes),d=[],e="",f=0;f<c.length;f++)b=c[f],b.nodeType===w.TEXT_NODE?a||b.data.length?a?(e+=b.data,d.push(b)):a=b:this.removeNode(b):(a&&d.length&&(a.data+=e,t(d)),d=[],e="",a=null,b.childNodes.length&&b.normalize());a&&d.length&&(a.data+=e,t(d))}}),B(w,"ownerDocument"),H(S,w,document.createDocumentFragment()),delete w.prototype.querySelector,delete w.prototype.querySelectorAll,w.prototype=F(Object.create(x.prototype),w.prototype),a.cloneNode=u,a.nodeWasAdded=j,a.nodeWasRemoved=l,a.nodesWereAdded=k,a.nodesWereRemoved=m,a.originalInsertBefore=V,a.originalRemoveChild=W,a.snapshotNodeList=i,a.wrappers.Node=w}(window.ShadowDOMPolyfill),function(a){"use strict";function b(b,c,d,e){for(var f=null,g=null,h=0,i=b.length;i>h;h++)f=s(b[h]),!e&&(g=q(f).root)&&g instanceof a.wrappers.ShadowRoot||(d[c++]=f);return c}function c(a){return String(a).replace(/\/deep\//g," ")}function d(a,b){for(var c,e=a.firstElementChild;e;){if(e.matches(b))return e;if(c=d(e,b))return c;e=e.nextElementSibling}return null}function e(a,b){return a.matches(b)}function f(a,b,c){var d=a.localName;return d===b||d===c&&a.namespaceURI===D}function g(){return!0}function h(a,b,c){return a.localName===c}function i(a,b){return a.namespaceURI===b}function j(a,b,c){return a.namespaceURI===b&&a.localName===c}function k(a,b,c,d,e,f){for(var g=a.firstElementChild;g;)d(g,e,f)&&(c[b++]=g),b=k(g,b,c,d,e,f),g=g.nextElementSibling;return b}function l(c,d,e,f,g){var h,i=r(this),j=q(this).root;if(j instanceof a.wrappers.ShadowRoot)return k(this,d,e,c,f,null);if(i instanceof B)h=w.call(i,f);else{if(!(i instanceof C))return k(this,d,e,c,f,null);h=v.call(i,f)}return b(h,d,e,g)}function m(c,d,e,f,g){var h,i=r(this),j=q(this).root;if(j instanceof a.wrappers.ShadowRoot)return k(this,d,e,c,f,g);if(i instanceof B)h=y.call(i,f,g);else{if(!(i instanceof C))return k(this,d,e,c,f,g);h=x.call(i,f,g)}return b(h,d,e,!1)}function n(c,d,e,f,g){var h,i=r(this),j=q(this).root;if(j instanceof a.wrappers.ShadowRoot)return k(this,d,e,c,f,g);if(i instanceof B)h=A.call(i,f,g);else{if(!(i instanceof C))return k(this,d,e,c,f,g);h=z.call(i,f,g)}return b(h,d,e,!1)}var o=a.wrappers.HTMLCollection,p=a.wrappers.NodeList,q=a.getTreeScope,r=a.unsafeUnwrap,s=a.wrap,t=document.querySelector,u=document.documentElement.querySelector,v=document.querySelectorAll,w=document.documentElement.querySelectorAll,x=document.getElementsByTagName,y=document.documentElement.getElementsByTagName,z=document.getElementsByTagNameNS,A=document.documentElement.getElementsByTagNameNS,B=window.Element,C=window.HTMLDocument||window.Document,D="http://www.w3.org/1999/xhtml",E={querySelector:function(b){var e=c(b),f=e!==b;b=e;var g,h=r(this),i=q(this).root;if(i instanceof a.wrappers.ShadowRoot)return d(this,b);if(h instanceof B)g=s(u.call(h,b));else{if(!(h instanceof C))return d(this,b);g=s(t.call(h,b))}return g&&!f&&(i=q(g).root)&&i instanceof a.wrappers.ShadowRoot?d(this,b):g},querySelectorAll:function(a){var b=c(a),d=b!==a;a=b;var f=new p;return f.length=l.call(this,e,0,f,a,d),f}},F={getElementsByTagName:function(a){var b=new o,c="*"===a?g:f;return b.length=m.call(this,c,0,b,a,a.toLowerCase()),b},getElementsByClassName:function(a){return this.querySelectorAll("."+a)},getElementsByTagNameNS:function(a,b){var c=new o,d=null;return d="*"===a?"*"===b?g:h:"*"===b?i:j,c.length=n.call(this,d,0,c,a||null,b),c}};a.GetElementsByInterface=F,a.SelectorsInterface=E}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){for(;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}function c(a){for(;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}var d=a.wrappers.NodeList,e={get firstElementChild(){return b(this.firstChild)},get lastElementChild(){return c(this.lastChild)},get childElementCount(){for(var a=0,b=this.firstElementChild;b;b=b.nextElementSibling)a++;return a},get children(){for(var a=new d,b=0,c=this.firstElementChild;c;c=c.nextElementSibling)a[b++]=c;return a.length=b,a},remove:function(){var a=this.parentNode;a&&a.removeChild(this)}},f={get nextElementSibling(){return b(this.nextSibling)},get previousElementSibling(){return c(this.previousSibling)}};a.ChildNodeInterface=f,a.ParentNodeInterface=e}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){d.call(this,a)}var c=a.ChildNodeInterface,d=a.wrappers.Node,e=a.enqueueMutation,f=a.mixin,g=a.registerWrapper,h=a.unsafeUnwrap,i=window.CharacterData;b.prototype=Object.create(d.prototype),f(b.prototype,{get textContent(){return this.data},set textContent(a){this.data=a},get data(){return h(this).data},set data(a){var b=h(this).data;e(this,"characterData",{oldValue:b}),h(this).data=a}}),f(b.prototype,c),g(i,b,document.createTextNode("")),a.wrappers.CharacterData=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a>>>0}function c(a){d.call(this,a)}var d=a.wrappers.CharacterData,e=(a.enqueueMutation,a.mixin),f=a.registerWrapper,g=window.Text;c.prototype=Object.create(d.prototype),e(c.prototype,{splitText:function(a){a=b(a);var c=this.data;if(a>c.length)throw new Error("IndexSizeError");var d=c.slice(0,a),e=c.slice(a);this.data=d;var f=this.ownerDocument.createTextNode(e);return this.parentNode&&this.parentNode.insertBefore(f,this.nextSibling),f}}),f(g,c,document.createTextNode("")),a.wrappers.Text=c}(window.ShadowDOMPolyfill),function(a){"use strict";function b(b){a.invalidateRendererBasedOnAttribute(b,"class")}function c(a,b){d(a,this),this.ownerElement_=b}var d=a.setWrapper,e=a.unsafeUnwrap;c.prototype={constructor:c,get length(){return e(this).length},item:function(a){return e(this).item(a)},contains:function(a){return e(this).contains(a)},add:function(){e(this).add.apply(e(this),arguments),b(this.ownerElement_)},remove:function(){e(this).remove.apply(e(this),arguments),b(this.ownerElement_)},toggle:function(){var a=e(this).toggle.apply(e(this),arguments);return b(this.ownerElement_),a},toString:function(){return e(this).toString()}},a.wrappers.DOMTokenList=c}(window.ShadowDOMPolyfill),function(a){"use strict";function b(b,c){var d=b.parentNode;if(d&&d.shadowRoot){var e=a.getRendererForHost(d);e.dependsOnAttribute(c)&&e.invalidate()}}function c(a,b,c){k(a,"attributes",{name:b,namespace:null,oldValue:c})}function d(a){g.call(this,a)}var e=a.ChildNodeInterface,f=a.GetElementsByInterface,g=a.wrappers.Node,h=a.wrappers.DOMTokenList,i=a.ParentNodeInterface,j=a.SelectorsInterface,k=(a.addWrapNodeListMethod,a.enqueueMutation),l=a.mixin,m=(a.oneOf,a.registerWrapper),n=a.unsafeUnwrap,o=a.wrappers,p=window.Element,q=["matches","mozMatchesSelector","msMatchesSelector","webkitMatchesSelector"].filter(function(a){return p.prototype[a]}),r=q[0],s=p.prototype[r],t=new WeakMap;d.prototype=Object.create(g.prototype),l(d.prototype,{createShadowRoot:function(){var b=new o.ShadowRoot(this);n(this).polymerShadowRoot_=b;var c=a.getRendererForHost(this);return c.invalidate(),b},get shadowRoot(){return n(this).polymerShadowRoot_||null},setAttribute:function(a,d){var e=n(this).getAttribute(a);n(this).setAttribute(a,d),c(this,a,e),b(this,a)},removeAttribute:function(a){var d=n(this).getAttribute(a);n(this).removeAttribute(a),c(this,a,d),b(this,a)},matches:function(a){return s.call(n(this),a)},get classList(){var a=t.get(this);return a||t.set(this,a=new h(n(this).classList,this)),a},get className(){return n(this).className},set className(a){this.setAttribute("class",a)},get id(){return n(this).id},set id(a){this.setAttribute("id",a)}}),q.forEach(function(a){"matches"!==a&&(d.prototype[a]=function(a){return this.matches(a)})}),p.prototype.webkitCreateShadowRoot&&(d.prototype.webkitCreateShadowRoot=d.prototype.createShadowRoot),l(d.prototype,e),l(d.prototype,f),l(d.prototype,i),l(d.prototype,j),m(p,d,document.createElementNS(null,"x")),a.invalidateRendererBasedOnAttribute=b,a.matchesNames=q,a.wrappers.Element=d}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case" ":return" "}}function c(a){return a.replace(A,b)}function d(a){return a.replace(B,b)}function e(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}function f(a,b){switch(a.nodeType){case Node.ELEMENT_NODE:for(var e,f=a.tagName.toLowerCase(),h="<"+f,i=a.attributes,j=0;e=i[j];j++)h+=" "+e.name+'="'+c(e.value)+'"';return h+=">",C[f]?h:h+g(a)+"</"+f+">";case Node.TEXT_NODE:var k=a.data;return b&&D[b.localName]?k:d(k);case Node.COMMENT_NODE:return"<!--"+a.data+"-->";default:throw console.error(a),new Error("not implemented")}}function g(a){a instanceof z.HTMLTemplateElement&&(a=a.content);for(var b="",c=a.firstChild;c;c=c.nextSibling)b+=f(c,a);return b}function h(a,b,c){var d=c||"div";a.textContent="";var e=x(a.ownerDocument.createElement(d));e.innerHTML=b;for(var f;f=e.firstChild;)a.appendChild(y(f))}function i(a){o.call(this,a)}function j(a,b){var c=x(a.cloneNode(!1));c.innerHTML=b;for(var d,e=x(document.createDocumentFragment());d=c.firstChild;)e.appendChild(d);return y(e)}function k(b){return function(){return a.renderAllPending(),w(this)[b]}}function l(a){p(i,a,k(a))}function m(b){Object.defineProperty(i.prototype,b,{get:k(b),set:function(c){a.renderAllPending(),w(this)[b]=c},configurable:!0,enumerable:!0})}function n(b){Object.defineProperty(i.prototype,b,{value:function(){return a.renderAllPending(),w(this)[b].apply(w(this),arguments)},configurable:!0,enumerable:!0})}var o=a.wrappers.Element,p=a.defineGetter,q=a.enqueueMutation,r=a.mixin,s=a.nodesWereAdded,t=a.nodesWereRemoved,u=a.registerWrapper,v=a.snapshotNodeList,w=a.unsafeUnwrap,x=a.unwrap,y=a.wrap,z=a.wrappers,A=/[&\u00A0"]/g,B=/[&\u00A0<>]/g,C=e(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),D=e(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]),E=/MSIE/.test(navigator.userAgent),F=window.HTMLElement,G=window.HTMLTemplateElement;i.prototype=Object.create(o.prototype),r(i.prototype,{get innerHTML(){return g(this)},set innerHTML(a){if(E&&D[this.localName])return void(this.textContent=a);var b=v(this.childNodes);this.invalidateShadowRenderer()?this instanceof z.HTMLTemplateElement?h(this.content,a):h(this,a,this.tagName):!G&&this instanceof z.HTMLTemplateElement?h(this.content,a):w(this).innerHTML=a;var c=v(this.childNodes);q(this,"childList",{addedNodes:c,removedNodes:b}),t(b),s(c,this)},get outerHTML(){return f(this,this.parentNode)},set outerHTML(a){var b=this.parentNode;if(b){b.invalidateShadowRenderer();var c=j(b,a);b.replaceChild(c,this)}},insertAdjacentHTML:function(a,b){var c,d;switch(String(a).toLowerCase()){case"beforebegin":c=this.parentNode,d=this;break;case"afterend":c=this.parentNode,d=this.nextSibling;break;case"afterbegin":c=this,d=this.firstChild;break;case"beforeend":c=this,d=null;break;default:return}var e=j(c,b);c.insertBefore(e,d)},get hidden(){return this.hasAttribute("hidden")},set hidden(a){a?this.setAttribute("hidden",""):this.removeAttribute("hidden")}}),["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetTop","offsetWidth","scrollHeight","scrollWidth"].forEach(l),["scrollLeft","scrollTop"].forEach(m),["getBoundingClientRect","getClientRects","scrollIntoView"].forEach(n),u(F,i,document.createElement("b")),a.wrappers.HTMLElement=i,a.getInnerHTML=g,a.setInnerHTML=h}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.unsafeUnwrap,g=a.wrap,h=window.HTMLCanvasElement;b.prototype=Object.create(c.prototype),d(b.prototype,{getContext:function(){var a=f(this).getContext.apply(f(this),arguments);return a&&g(a)}}),e(h,b,document.createElement("canvas")),a.wrappers.HTMLCanvasElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=window.HTMLContentElement;b.prototype=Object.create(c.prototype),d(b.prototype,{constructor:b,get select(){return this.getAttribute("select")},set select(a){this.setAttribute("select",a)},setAttribute:function(a,b){c.prototype.setAttribute.call(this,a,b),"select"===String(a).toLowerCase()&&this.invalidateShadowRenderer(!0)}}),f&&e(f,b),a.wrappers.HTMLContentElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.wrapHTMLCollection,g=a.unwrap,h=window.HTMLFormElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get elements(){return f(g(this).elements)}}),e(h,b,document.createElement("form")),a.wrappers.HTMLFormElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){d.call(this,a)}function c(a,b){if(!(this instanceof c))throw new TypeError("DOM object constructor cannot be called as a function.");var e=f(document.createElement("img"));d.call(this,e),g(e,this),void 0!==a&&(e.width=a),void 0!==b&&(e.height=b)}var d=a.wrappers.HTMLElement,e=a.registerWrapper,f=a.unwrap,g=a.rewrap,h=window.HTMLImageElement;b.prototype=Object.create(d.prototype),e(h,b,document.createElement("img")),c.prototype=b.prototype,a.wrappers.HTMLImageElement=b,a.wrappers.Image=c}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=(a.mixin,a.wrappers.NodeList,a.registerWrapper),e=window.HTMLShadowElement;b.prototype=Object.create(c.prototype),b.prototype.constructor=b,e&&d(e,b),a.wrappers.HTMLShadowElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){if(!a.defaultView)return a;var b=l.get(a);if(!b){for(b=a.implementation.createHTMLDocument("");b.lastChild;)b.removeChild(b.lastChild);l.set(a,b)}return b}function c(a){for(var c,d=b(a.ownerDocument),e=i(d.createDocumentFragment());c=a.firstChild;)e.appendChild(c);return e}function d(a){if(e.call(this,a),!m){var b=c(a);k.set(this,j(b))}}var e=a.wrappers.HTMLElement,f=a.mixin,g=a.registerWrapper,h=a.unsafeUnwrap,i=a.unwrap,j=a.wrap,k=new WeakMap,l=new WeakMap,m=window.HTMLTemplateElement;d.prototype=Object.create(e.prototype),f(d.prototype,{constructor:d,get content(){return m?j(h(this).content):k.get(this)}}),m&&g(m,d),a.wrappers.HTMLTemplateElement=d}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.registerWrapper,e=window.HTMLMediaElement;e&&(b.prototype=Object.create(c.prototype),d(e,b,document.createElement("audio")),a.wrappers.HTMLMediaElement=b)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){d.call(this,a)}function c(a){if(!(this instanceof c))throw new TypeError("DOM object constructor cannot be called as a function.");var b=f(document.createElement("audio"));d.call(this,b),g(b,this),b.setAttribute("preload","auto"),void 0!==a&&b.setAttribute("src",a)}var d=a.wrappers.HTMLMediaElement,e=a.registerWrapper,f=a.unwrap,g=a.rewrap,h=window.HTMLAudioElement;h&&(b.prototype=Object.create(d.prototype),e(h,b,document.createElement("audio")),c.prototype=b.prototype,a.wrappers.HTMLAudioElement=b,a.wrappers.Audio=c)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){return a.replace(/\s+/g," ").trim()}function c(a){e.call(this,a)}function d(a,b,c,f){if(!(this instanceof d))throw new TypeError("DOM object constructor cannot be called as a function.");var g=i(document.createElement("option"));e.call(this,g),h(g,this),void 0!==a&&(g.text=a),void 0!==b&&g.setAttribute("value",b),c===!0&&g.setAttribute("selected",""),g.selected=f===!0}var e=a.wrappers.HTMLElement,f=a.mixin,g=a.registerWrapper,h=a.rewrap,i=a.unwrap,j=a.wrap,k=window.HTMLOptionElement;c.prototype=Object.create(e.prototype),f(c.prototype,{get text(){return b(this.textContent)},set text(a){this.textContent=b(String(a))},get form(){return j(i(this).form)}}),g(k,c,document.createElement("option")),d.prototype=c.prototype,a.wrappers.HTMLOptionElement=c,a.wrappers.Option=d}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.unwrap,g=a.wrap,h=window.HTMLSelectElement;b.prototype=Object.create(c.prototype),d(b.prototype,{add:function(a,b){"object"==typeof b&&(b=f(b)),f(this).add(f(a),b)},remove:function(a){return void 0===a?void c.prototype.remove.call(this):("object"==typeof a&&(a=f(a)),void f(this).remove(a))},get form(){return g(f(this).form)}}),e(h,b,document.createElement("select")),a.wrappers.HTMLSelectElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.unwrap,g=a.wrap,h=a.wrapHTMLCollection,i=window.HTMLTableElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get caption(){return g(f(this).caption)},createCaption:function(){return g(f(this).createCaption())},get tHead(){return g(f(this).tHead)},createTHead:function(){return g(f(this).createTHead())},createTFoot:function(){return g(f(this).createTFoot())},get tFoot(){return g(f(this).tFoot)},get tBodies(){return h(f(this).tBodies)},createTBody:function(){return g(f(this).createTBody())},get rows(){return h(f(this).rows)},insertRow:function(a){return g(f(this).insertRow(a))}}),e(i,b,document.createElement("table")),a.wrappers.HTMLTableElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.wrapHTMLCollection,g=a.unwrap,h=a.wrap,i=window.HTMLTableSectionElement;b.prototype=Object.create(c.prototype),d(b.prototype,{constructor:b,get rows(){return f(g(this).rows)},insertRow:function(a){return h(g(this).insertRow(a))}}),e(i,b,document.createElement("thead")),a.wrappers.HTMLTableSectionElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.HTMLElement,d=a.mixin,e=a.registerWrapper,f=a.wrapHTMLCollection,g=a.unwrap,h=a.wrap,i=window.HTMLTableRowElement;b.prototype=Object.create(c.prototype),d(b.prototype,{get cells(){return f(g(this).cells)},insertCell:function(a){return h(g(this).insertCell(a))}}),e(i,b,document.createElement("tr")),a.wrappers.HTMLTableRowElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){switch(a.localName){case"content":return new c(a);case"shadow":return new e(a);case"template":return new f(a)}d.call(this,a)}var c=a.wrappers.HTMLContentElement,d=a.wrappers.HTMLElement,e=a.wrappers.HTMLShadowElement,f=a.wrappers.HTMLTemplateElement,g=(a.mixin,a.registerWrapper),h=window.HTMLUnknownElement;b.prototype=Object.create(d.prototype),g(h,b),a.wrappers.HTMLUnknownElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.wrappers.Element,c=a.wrappers.HTMLElement,d=a.registerObject,e="http://www.w3.org/2000/svg",f=document.createElementNS(e,"title"),g=d(f),h=Object.getPrototypeOf(g.prototype).constructor;if(!("classList"in f)){var i=Object.getOwnPropertyDescriptor(b.prototype,"classList");Object.defineProperty(c.prototype,"classList",i),delete b.prototype.classList}a.wrappers.SVGElement=h}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){m.call(this,a)}var c=a.mixin,d=a.registerWrapper,e=a.unwrap,f=a.wrap,g=window.SVGUseElement,h="http://www.w3.org/2000/svg",i=f(document.createElementNS(h,"g")),j=document.createElementNS(h,"use"),k=i.constructor,l=Object.getPrototypeOf(k.prototype),m=l.constructor;b.prototype=Object.create(l),"instanceRoot"in j&&c(b.prototype,{get instanceRoot(){return f(e(this).instanceRoot)},get animatedInstanceRoot(){return f(e(this).animatedInstanceRoot)}}),d(g,b,j),a.wrappers.SVGUseElement=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.EventTarget,d=a.mixin,e=a.registerWrapper,f=a.unsafeUnwrap,g=a.wrap,h=window.SVGElementInstance;h&&(b.prototype=Object.create(c.prototype),d(b.prototype,{get correspondingElement(){return g(f(this).correspondingElement)
|
3
|
+
},get correspondingUseElement(){return g(f(this).correspondingUseElement)},get parentNode(){return g(f(this).parentNode)},get childNodes(){throw new Error("Not implemented")},get firstChild(){return g(f(this).firstChild)},get lastChild(){return g(f(this).lastChild)},get previousSibling(){return g(f(this).previousSibling)},get nextSibling(){return g(f(this).nextSibling)}}),e(h,b),a.wrappers.SVGElementInstance=b)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){e(a,this)}var c=a.mixin,d=a.registerWrapper,e=a.setWrapper,f=a.unsafeUnwrap,g=a.unwrap,h=a.unwrapIfNeeded,i=a.wrap,j=window.CanvasRenderingContext2D;c(b.prototype,{get canvas(){return i(f(this).canvas)},drawImage:function(){arguments[0]=h(arguments[0]),f(this).drawImage.apply(f(this),arguments)},createPattern:function(){return arguments[0]=g(arguments[0]),f(this).createPattern.apply(f(this),arguments)}}),d(j,b,document.createElement("canvas").getContext("2d")),a.wrappers.CanvasRenderingContext2D=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){e(a,this)}var c=a.mixin,d=a.registerWrapper,e=a.setWrapper,f=a.unsafeUnwrap,g=a.unwrapIfNeeded,h=a.wrap,i=window.WebGLRenderingContext;if(i){c(b.prototype,{get canvas(){return h(f(this).canvas)},texImage2D:function(){arguments[5]=g(arguments[5]),f(this).texImage2D.apply(f(this),arguments)},texSubImage2D:function(){arguments[6]=g(arguments[6]),f(this).texSubImage2D.apply(f(this),arguments)}});var j=/WebKit/.test(navigator.userAgent)?{drawingBufferHeight:null,drawingBufferWidth:null}:{};d(i,b,j),a.wrappers.WebGLRenderingContext=b}}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){d(a,this)}var c=a.registerWrapper,d=a.setWrapper,e=a.unsafeUnwrap,f=a.unwrap,g=a.unwrapIfNeeded,h=a.wrap,i=window.Range;b.prototype={get startContainer(){return h(e(this).startContainer)},get endContainer(){return h(e(this).endContainer)},get commonAncestorContainer(){return h(e(this).commonAncestorContainer)},setStart:function(a,b){e(this).setStart(g(a),b)},setEnd:function(a,b){e(this).setEnd(g(a),b)},setStartBefore:function(a){e(this).setStartBefore(g(a))},setStartAfter:function(a){e(this).setStartAfter(g(a))},setEndBefore:function(a){e(this).setEndBefore(g(a))},setEndAfter:function(a){e(this).setEndAfter(g(a))},selectNode:function(a){e(this).selectNode(g(a))},selectNodeContents:function(a){e(this).selectNodeContents(g(a))},compareBoundaryPoints:function(a,b){return e(this).compareBoundaryPoints(a,f(b))},extractContents:function(){return h(e(this).extractContents())},cloneContents:function(){return h(e(this).cloneContents())},insertNode:function(a){e(this).insertNode(g(a))},surroundContents:function(a){e(this).surroundContents(g(a))},cloneRange:function(){return h(e(this).cloneRange())},isPointInRange:function(a,b){return e(this).isPointInRange(g(a),b)},comparePoint:function(a,b){return e(this).comparePoint(g(a),b)},intersectsNode:function(a){return e(this).intersectsNode(g(a))},toString:function(){return e(this).toString()}},i.prototype.createContextualFragment&&(b.prototype.createContextualFragment=function(a){return h(e(this).createContextualFragment(a))}),c(window.Range,b,document.createRange()),a.wrappers.Range=b}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.GetElementsByInterface,c=a.ParentNodeInterface,d=a.SelectorsInterface,e=a.mixin,f=a.registerObject,g=f(document.createDocumentFragment());e(g.prototype,c),e(g.prototype,d),e(g.prototype,b);var h=f(document.createComment(""));a.wrappers.Comment=h,a.wrappers.DocumentFragment=g}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=l(k(a).ownerDocument.createDocumentFragment());c.call(this,b),i(b,this);var e=a.shadowRoot;n.set(this,e),this.treeScope_=new d(this,g(e||a)),m.set(this,a)}var c=a.wrappers.DocumentFragment,d=a.TreeScope,e=a.elementFromPoint,f=a.getInnerHTML,g=a.getTreeScope,h=a.mixin,i=a.rewrap,j=a.setInnerHTML,k=a.unsafeUnwrap,l=a.unwrap,m=new WeakMap,n=new WeakMap,o=/[ \t\n\r\f]/;b.prototype=Object.create(c.prototype),h(b.prototype,{constructor:b,get innerHTML(){return f(this)},set innerHTML(a){j(this,a),this.invalidateShadowRenderer()},get olderShadowRoot(){return n.get(this)||null},get host(){return m.get(this)||null},invalidateShadowRenderer:function(){return m.get(this).invalidateShadowRenderer()},elementFromPoint:function(a,b){return e(this,this.ownerDocument,a,b)},getElementById:function(a){return o.test(a)?null:this.querySelector('[id="'+a+'"]')}}),a.wrappers.ShadowRoot=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){a.previousSibling_=a.previousSibling,a.nextSibling_=a.nextSibling,a.parentNode_=a.parentNode}function c(c,e,f){var g=H(c),h=H(e),i=f?H(f):null;if(d(e),b(e),f)c.firstChild===f&&(c.firstChild_=f),f.previousSibling_=f.previousSibling;else{c.lastChild_=c.lastChild,c.lastChild===c.firstChild&&(c.firstChild_=c.firstChild);var j=I(g.lastChild);j&&(j.nextSibling_=j.nextSibling)}a.originalInsertBefore.call(g,h,i)}function d(c){var d=H(c),e=d.parentNode;if(e){var f=I(e);b(c),c.previousSibling&&(c.previousSibling.nextSibling_=c),c.nextSibling&&(c.nextSibling.previousSibling_=c),f.lastChild===c&&(f.lastChild_=c),f.firstChild===c&&(f.firstChild_=c),a.originalRemoveChild.call(e,d)}}function e(a){J.set(a,[])}function f(a){var b=J.get(a);return b||J.set(a,b=[]),b}function g(a){for(var b=[],c=0,d=a.firstChild;d;d=d.nextSibling)b[c++]=d;return b}function h(){for(var a=0;a<N.length;a++){var b=N[a],c=b.parentRenderer;c&&c.dirty||b.render()}N=[]}function i(){y=null,h()}function j(a){var b=L.get(a);return b||(b=new n(a),L.set(a,b)),b}function k(a){var b=E(a).root;return b instanceof D?b:null}function l(a){return j(a.host)}function m(a){this.skip=!1,this.node=a,this.childNodes=[]}function n(a){this.host=a,this.dirty=!1,this.invalidateAttributes(),this.associateNode(a)}function o(a){for(var b=[],c=a.firstChild;c;c=c.nextSibling)v(c)?b.push.apply(b,f(c)):b.push(c);return b}function p(a){if(a instanceof B)return a;if(a instanceof A)return null;for(var b=a.firstChild;b;b=b.nextSibling){var c=p(b);if(c)return c}return null}function q(a,b){f(b).push(a);var c=K.get(a);c?c.push(b):K.set(a,[b])}function r(a){return K.get(a)}function s(a){K.set(a,void 0)}function t(a,b){var c=b.getAttribute("select");if(!c)return!0;if(c=c.trim(),!c)return!0;if(!(a instanceof z))return!1;if(!P.test(c))return!1;try{return a.matches(c)}catch(d){return!1}}function u(a,b){var c=r(b);return c&&c[c.length-1]===a}function v(a){return a instanceof A||a instanceof B}function w(a){return a.shadowRoot}function x(a){for(var b=[],c=a.shadowRoot;c;c=c.olderShadowRoot)b.push(c);return b}var y,z=a.wrappers.Element,A=a.wrappers.HTMLContentElement,B=a.wrappers.HTMLShadowElement,C=a.wrappers.Node,D=a.wrappers.ShadowRoot,E=(a.assert,a.getTreeScope),F=(a.mixin,a.oneOf),G=a.unsafeUnwrap,H=a.unwrap,I=a.wrap,J=new WeakMap,K=new WeakMap,L=new WeakMap,M=F(window,["requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","setTimeout"]),N=[],O=new ArraySplice;O.equals=function(a,b){return H(a.node)===b},m.prototype={append:function(a){var b=new m(a);return this.childNodes.push(b),b},sync:function(a){if(!this.skip){for(var b=this.node,e=this.childNodes,f=g(H(b)),h=a||new WeakMap,i=O.calculateSplices(e,f),j=0,k=0,l=0,m=0;m<i.length;m++){for(var n=i[m];l<n.index;l++)k++,e[j++].sync(h);for(var o=n.removed.length,p=0;o>p;p++){var q=I(f[k++]);h.get(q)||d(q)}for(var r=n.addedCount,s=f[k]&&I(f[k]),p=0;r>p;p++){var t=e[j++],u=t.node;c(b,u,s),h.set(u,!0),t.sync(h)}l+=r}for(var m=l;m<e.length;m++)e[m].sync(h)}}},n.prototype={render:function(a){if(this.dirty){this.invalidateAttributes();var b=this.host;this.distribution(b);var c=a||new m(b);this.buildRenderTree(c,b);var d=!a;d&&c.sync(),this.dirty=!1}},get parentRenderer(){return E(this.host).renderer},invalidate:function(){if(!this.dirty){this.dirty=!0;var a=this.parentRenderer;if(a&&a.invalidate(),N.push(this),y)return;y=window[M](i,0)}},distribution:function(a){this.resetAllSubtrees(a),this.distributionResolution(a)},resetAll:function(a){v(a)?e(a):s(a),this.resetAllSubtrees(a)},resetAllSubtrees:function(a){for(var b=a.firstChild;b;b=b.nextSibling)this.resetAll(b);a.shadowRoot&&this.resetAll(a.shadowRoot),a.olderShadowRoot&&this.resetAll(a.olderShadowRoot)},distributionResolution:function(a){if(w(a)){for(var b=a,c=o(b),d=x(b),e=0;e<d.length;e++)this.poolDistribution(d[e],c);for(var e=d.length-1;e>=0;e--){var f=d[e],g=p(f);if(g){var h=f.olderShadowRoot;h&&(c=o(h));for(var i=0;i<c.length;i++)q(c[i],g)}this.distributionResolution(f)}}for(var j=a.firstChild;j;j=j.nextSibling)this.distributionResolution(j)},poolDistribution:function(a,b){if(!(a instanceof B))if(a instanceof A){var c=a;this.updateDependentAttributes(c.getAttribute("select"));for(var d=!1,e=0;e<b.length;e++){var a=b[e];a&&t(a,c)&&(q(a,c),b[e]=void 0,d=!0)}if(!d)for(var f=c.firstChild;f;f=f.nextSibling)q(f,c)}else for(var f=a.firstChild;f;f=f.nextSibling)this.poolDistribution(f,b)},buildRenderTree:function(a,b){for(var c=this.compose(b),d=0;d<c.length;d++){var e=c[d],f=a.append(e);this.buildRenderTree(f,e)}if(w(b)){var g=j(b);g.dirty=!1}},compose:function(a){for(var b=[],c=a.shadowRoot||a,d=c.firstChild;d;d=d.nextSibling)if(v(d)){this.associateNode(c);for(var e=f(d),g=0;g<e.length;g++){var h=e[g];u(d,h)&&b.push(h)}}else b.push(d);return b},invalidateAttributes:function(){this.attributes=Object.create(null)},updateDependentAttributes:function(a){if(a){var b=this.attributes;/\.\w+/.test(a)&&(b["class"]=!0),/#\w+/.test(a)&&(b.id=!0),a.replace(/\[\s*([^\s=\|~\]]+)/g,function(a,c){b[c]=!0})}},dependsOnAttribute:function(a){return this.attributes[a]},associateNode:function(a){G(a).polymerShadowRenderer_=this}};var P=/^(:not\()?[*.#[a-zA-Z_|]/;C.prototype.invalidateShadowRenderer=function(){var a=G(this).polymerShadowRenderer_;return a?(a.invalidate(),!0):!1},A.prototype.getDistributedNodes=B.prototype.getDistributedNodes=function(){return h(),f(this)},z.prototype.getDestinationInsertionPoints=function(){return h(),r(this)||[]},A.prototype.nodeIsInserted_=B.prototype.nodeIsInserted_=function(){this.invalidateShadowRenderer();var a,b=k(this);b&&(a=l(b)),G(this).polymerShadowRenderer_=a,a&&a.invalidate()},a.getRendererForHost=j,a.getShadowTrees=x,a.renderAllPending=h,a.getDestinationInsertionPoints=r,a.visual={insertBefore:c,remove:d}}(window.ShadowDOMPolyfill),function(a){"use strict";function b(b){if(window[b]){d(!a.wrappers[b]);var i=function(a){c.call(this,a)};i.prototype=Object.create(c.prototype),e(i.prototype,{get form(){return h(g(this).form)}}),f(window[b],i,document.createElement(b.slice(4,-7))),a.wrappers[b]=i}}var c=a.wrappers.HTMLElement,d=a.assert,e=a.mixin,f=a.registerWrapper,g=a.unwrap,h=a.wrap,i=["HTMLButtonElement","HTMLFieldSetElement","HTMLInputElement","HTMLKeygenElement","HTMLLabelElement","HTMLLegendElement","HTMLObjectElement","HTMLOutputElement","HTMLTextAreaElement"];i.forEach(b)}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){d(a,this)}{var c=a.registerWrapper,d=a.setWrapper,e=a.unsafeUnwrap,f=a.unwrap,g=a.unwrapIfNeeded,h=a.wrap;window.Selection}b.prototype={get anchorNode(){return h(e(this).anchorNode)},get focusNode(){return h(e(this).focusNode)},addRange:function(a){e(this).addRange(f(a))},collapse:function(a,b){e(this).collapse(g(a),b)},containsNode:function(a,b){return e(this).containsNode(g(a),b)},extend:function(a,b){e(this).extend(g(a),b)},getRangeAt:function(a){return h(e(this).getRangeAt(a))},removeRange:function(a){e(this).removeRange(f(a))},selectAllChildren:function(a){e(this).selectAllChildren(g(a))},toString:function(){return e(this).toString()}},c(window.Selection,b,window.getSelection()),a.wrappers.Selection=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){k.call(this,a),this.treeScope_=new p(this,null)}function c(a){var c=document[a];b.prototype[a]=function(){return C(c.apply(A(this),arguments))}}function d(a,b){F.call(A(b),B(a)),e(a,b)}function e(a,b){a.shadowRoot&&b.adoptNode(a.shadowRoot),a instanceof o&&f(a,b);for(var c=a.firstChild;c;c=c.nextSibling)e(c,b)}function f(a,b){var c=a.olderShadowRoot;c&&b.adoptNode(c)}function g(a){z(a,this)}function h(a,b){var c=document.implementation[b];a.prototype[b]=function(){return C(c.apply(A(this),arguments))}}function i(a,b){var c=document.implementation[b];a.prototype[b]=function(){return c.apply(A(this),arguments)}}var j=a.GetElementsByInterface,k=a.wrappers.Node,l=a.ParentNodeInterface,m=a.wrappers.Selection,n=a.SelectorsInterface,o=a.wrappers.ShadowRoot,p=a.TreeScope,q=a.cloneNode,r=a.defineWrapGetter,s=a.elementFromPoint,t=a.forwardMethodsToWrapper,u=a.matchesNames,v=a.mixin,w=a.registerWrapper,x=a.renderAllPending,y=a.rewrap,z=a.setWrapper,A=a.unsafeUnwrap,B=a.unwrap,C=a.wrap,D=a.wrapEventTargetMethods,E=(a.wrapNodeList,new WeakMap);b.prototype=Object.create(k.prototype),r(b,"documentElement"),r(b,"body"),r(b,"head"),["createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","getElementById"].forEach(c);var F=document.adoptNode,G=document.getSelection;if(v(b.prototype,{adoptNode:function(a){return a.parentNode&&a.parentNode.removeChild(a),d(a,this),a},elementFromPoint:function(a,b){return s(this,this,a,b)},importNode:function(a,b){return q(a,b,A(this))},getSelection:function(){return x(),new m(G.call(B(this)))},getElementsByName:function(a){return n.querySelectorAll.call(this,"[name="+JSON.stringify(String(a))+"]")}}),document.registerElement){var H=document.registerElement;b.prototype.registerElement=function(b,c){function d(a){return a?void z(a,this):f?document.createElement(f,b):document.createElement(b)}var e,f;if(void 0!==c&&(e=c.prototype,f=c.extends),e||(e=Object.create(HTMLElement.prototype)),a.nativePrototypeTable.get(e))throw new Error("NotSupportedError");for(var g,h=Object.getPrototypeOf(e),i=[];h&&!(g=a.nativePrototypeTable.get(h));)i.push(h),h=Object.getPrototypeOf(h);if(!g)throw new Error("NotSupportedError");for(var j=Object.create(g),k=i.length-1;k>=0;k--)j=Object.create(j);["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"].forEach(function(a){var b=e[a];b&&(j[a]=function(){C(this)instanceof d||y(this),b.apply(C(this),arguments)})});var l={prototype:j};f&&(l.extends=f),d.prototype=e,d.prototype.constructor=d,a.constructorTable.set(j,d),a.nativePrototypeTable.set(e,j);H.call(B(this),b,l);return d},t([window.HTMLDocument||window.Document],["registerElement"])}t([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement,window.HTMLHtmlElement],["appendChild","compareDocumentPosition","contains","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","insertBefore","querySelector","querySelectorAll","removeChild","replaceChild"].concat(u)),t([window.HTMLDocument||window.Document],["adoptNode","importNode","contains","createComment","createDocumentFragment","createElement","createElementNS","createEvent","createEventNS","createRange","createTextNode","elementFromPoint","getElementById","getElementsByName","getSelection"]),v(b.prototype,j),v(b.prototype,l),v(b.prototype,n),v(b.prototype,{get implementation(){var a=E.get(this);return a?a:(a=new g(B(this).implementation),E.set(this,a),a)},get defaultView(){return C(B(this).defaultView)}}),w(window.Document,b,document.implementation.createHTMLDocument("")),window.HTMLDocument&&w(window.HTMLDocument,b),D([window.HTMLBodyElement,window.HTMLDocument||window.Document,window.HTMLHeadElement]),h(g,"createDocumentType"),h(g,"createDocument"),h(g,"createHTMLDocument"),i(g,"hasFeature"),w(window.DOMImplementation,g),t([window.DOMImplementation],["createDocumentType","createDocument","createHTMLDocument","hasFeature"]),a.adoptNodeNoRemove=d,a.wrappers.DOMImplementation=g,a.wrappers.Document=b}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){c.call(this,a)}var c=a.wrappers.EventTarget,d=a.wrappers.Selection,e=a.mixin,f=a.registerWrapper,g=a.renderAllPending,h=a.unwrap,i=a.unwrapIfNeeded,j=a.wrap,k=window.Window,l=window.getComputedStyle,m=window.getDefaultComputedStyle,n=window.getSelection;b.prototype=Object.create(c.prototype),k.prototype.getComputedStyle=function(a,b){return j(this||window).getComputedStyle(i(a),b)},m&&(k.prototype.getDefaultComputedStyle=function(a,b){return j(this||window).getDefaultComputedStyle(i(a),b)}),k.prototype.getSelection=function(){return j(this||window).getSelection()},delete window.getComputedStyle,delete window.getDefaultComputedStyle,delete window.getSelection,["addEventListener","removeEventListener","dispatchEvent"].forEach(function(a){k.prototype[a]=function(){var b=j(this||window);return b[a].apply(b,arguments)},delete window[a]}),e(b.prototype,{getComputedStyle:function(a,b){return g(),l.call(h(this),i(a),b)},getSelection:function(){return g(),new d(n.call(h(this)))},get document(){return j(h(this).document)}}),m&&(b.prototype.getDefaultComputedStyle=function(a,b){return g(),m.call(h(this),i(a),b)}),f(k,b,window),a.wrappers.Window=b}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.unwrap,c=window.DataTransfer||window.Clipboard,d=c.prototype.setDragImage;d&&(c.prototype.setDragImage=function(a,c,e){d.call(this,b(a),c,e)})}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b;b=a instanceof f?a:new f(a&&e(a)),d(b,this)}var c=a.registerWrapper,d=a.setWrapper,e=a.unwrap,f=window.FormData;f&&(c(f,b,new f),a.wrappers.FormData=b)}(window.ShadowDOMPolyfill),function(a){"use strict";var b=a.unwrapIfNeeded,c=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(a){return c.call(this,b(a))}}(window.ShadowDOMPolyfill),function(a){"use strict";function b(a){var b=c[a],d=window[b];if(d){var e=document.createElement(a),f=e.constructor;window[b]=f}}var c=(a.isWrapperFor,{a:"HTMLAnchorElement",area:"HTMLAreaElement",audio:"HTMLAudioElement",base:"HTMLBaseElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",col:"HTMLTableColElement",content:"HTMLContentElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",del:"HTMLModElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",font:"HTMLFontElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",head:"HTMLHeadElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",keygen:"HTMLKeygenElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",map:"HTMLMapElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",menuitem:"HTMLMenuItemElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",script:"HTMLScriptElement",select:"HTMLSelectElement",shadow:"HTMLShadowElement",source:"HTMLSourceElement",span:"HTMLSpanElement",style:"HTMLStyleElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",ul:"HTMLUListElement",video:"HTMLVideoElement"});Object.keys(c).forEach(b),Object.getOwnPropertyNames(a.wrappers).forEach(function(b){window[b]=a.wrappers[b]})}(window.ShadowDOMPolyfill),function(a){function b(a,c){var d,e,f,g,h=a.firstElementChild;for(e=[],f=a.shadowRoot;f;)e.push(f),f=f.olderShadowRoot;for(g=e.length-1;g>=0;g--)if(d=e[g].querySelector(c))return d;for(;h;){if(d=b(h,c))return d;h=h.nextElementSibling}return null}function c(a,b,d){var e,f,g,h,i,j=a.firstElementChild;for(g=[],f=a.shadowRoot;f;)g.push(f),f=f.olderShadowRoot;for(h=g.length-1;h>=0;h--)for(e=g[h].querySelectorAll(b),i=0;i<e.length;i++)d.push(e[i]);for(;j;)c(j,b,d),j=j.nextElementSibling;return d}window.wrap=ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=ShadowDOMPolyfill.unwrapIfNeeded,Object.defineProperty(Element.prototype,"webkitShadowRoot",Object.getOwnPropertyDescriptor(Element.prototype,"shadowRoot"));var d=Element.prototype.createShadowRoot;Element.prototype.createShadowRoot=function(){var a=d.call(this);return CustomElements.watchShadow(this),a},Element.prototype.webkitCreateShadowRoot=Element.prototype.createShadowRoot,a.queryAllShadows=function(a,d,e){return e?c(a,d,[]):b(a,d)}}(window.Platform),function(a){function b(a,b){var c="";return Array.prototype.forEach.call(a,function(a){c+=a.textContent+"\n\n"}),b||(c=c.replace(l,"")),c}function c(a){var b=document.createElement("style");return b.textContent=a,b}function d(a){var b=c(a);document.head.appendChild(b);var d=[];if(b.sheet)try{d=b.sheet.cssRules}catch(e){}else console.warn("sheet not found",b);return b.parentNode.removeChild(b),d}function e(){v.initialized=!0,document.body.appendChild(v);var a=v.contentDocument,b=a.createElement("base");b.href=document.baseURI,a.head.appendChild(b)}function f(a){v.initialized||e(),document.body.appendChild(v),a(v.contentDocument),document.body.removeChild(v)}function g(a,b){if(b){var e;if(a.match("@import")&&x){var g=c(a);f(function(a){a.head.appendChild(g.impl),e=Array.prototype.slice.call(g.sheet.cssRules,0),b(e)})}else e=d(a),b(e)}}function h(a){a&&j().appendChild(document.createTextNode(a))}function i(a,b){var d=c(a);d.setAttribute(b,""),d.setAttribute(z,""),document.head.appendChild(d)}function j(){return w||(w=document.createElement("style"),w.setAttribute(z,""),w[z]=!0),w}var k={strictStyling:!1,registry:{},shimStyling:function(a,c,d){var e=this.prepareRoot(a,c,d),f=this.isTypeExtension(d),g=this.makeScopeSelector(c,f),h=b(e,!0);h=this.scopeCssText(h,g),a&&(a.shimmedStyle=h),this.addCssToDocument(h,c)},shimStyle:function(a,b){return this.shimCssText(a.textContent,b)},shimCssText:function(a,b){return a=this.insertDirectives(a),this.scopeCssText(a,b)},makeScopeSelector:function(a,b){return a?b?"[is="+a+"]":a:""},isTypeExtension:function(a){return a&&a.indexOf("-")<0},prepareRoot:function(a,b,c){var d=this.registerRoot(a,b,c);return this.replaceTextInStyles(d.rootStyles,this.insertDirectives),this.removeStyles(a,d.rootStyles),this.strictStyling&&this.applyScopeToContent(a,b),d.scopeStyles},removeStyles:function(a,b){for(var c,d=0,e=b.length;e>d&&(c=b[d]);d++)c.parentNode.removeChild(c)},registerRoot:function(a,b,c){var d=this.registry[b]={root:a,name:b,extendsName:c},e=this.findStyles(a);d.rootStyles=e,d.scopeStyles=d.rootStyles;var f=this.registry[d.extendsName];return f&&(d.scopeStyles=f.scopeStyles.concat(d.scopeStyles)),d},findStyles:function(a){if(!a)return[];var b=a.querySelectorAll("style");return Array.prototype.filter.call(b,function(a){return!a.hasAttribute(A)})},applyScopeToContent:function(a,b){a&&(Array.prototype.forEach.call(a.querySelectorAll("*"),function(a){a.setAttribute(b,"")}),Array.prototype.forEach.call(a.querySelectorAll("template"),function(a){this.applyScopeToContent(a.content,b)},this))},insertDirectives:function(a){return a=this.insertPolyfillDirectivesInCssText(a),this.insertPolyfillRulesInCssText(a)},insertPolyfillDirectivesInCssText:function(a){return a=a.replace(m,function(a,b){return b.slice(0,-2)+"{"}),a.replace(n,function(a,b){return b+" {"})},insertPolyfillRulesInCssText:function(a){return a=a.replace(o,function(a,b){return b.slice(0,-1)}),a.replace(p,function(a,b,c,d){var e=a.replace(b,"").replace(c,"");return d+e})},scopeCssText:function(a,b){var c=this.extractUnscopedRulesFromCssText(a);if(a=this.insertPolyfillHostInCssText(a),a=this.convertColonHost(a),a=this.convertColonHostContext(a),a=this.convertShadowDOMSelectors(a),b){var a,d=this;g(a,function(c){a=d.scopeRules(c,b)})}return a=a+"\n"+c,a.trim()},extractUnscopedRulesFromCssText:function(a){for(var b,c="";b=q.exec(a);)c+=b[1].slice(0,-1)+"\n\n";for(;b=r.exec(a);)c+=b[0].replace(b[2],"").replace(b[1],b[3])+"\n\n";return c},convertColonHost:function(a){return this.convertColonRule(a,cssColonHostRe,this.colonHostPartReplacer)},convertColonHostContext:function(a){return this.convertColonRule(a,cssColonHostContextRe,this.colonHostContextPartReplacer)},convertColonRule:function(a,b,c){return a.replace(b,function(a,b,d,e){if(b=polyfillHostNoCombinator,d){for(var f,g=d.split(","),h=[],i=0,j=g.length;j>i&&(f=g[i]);i++)f=f.trim(),h.push(c(b,f,e));return h.join(",")}return b+e})},colonHostContextPartReplacer:function(a,b,c){return b.match(s)?this.colonHostPartReplacer(a,b,c):a+b+c+", "+b+" "+a+c},colonHostPartReplacer:function(a,b,c){return a+b.replace(s,"")+c},convertShadowDOMSelectors:function(a){for(var b=0;b<shadowDOMSelectorsRe.length;b++)a=a.replace(shadowDOMSelectorsRe[b]," ");return a},scopeRules:function(a,b){var c="";return a&&Array.prototype.forEach.call(a,function(a){if(a.selectorText&&a.style&&void 0!==a.style.cssText)c+=this.scopeSelector(a.selectorText,b,this.strictStyling)+" {\n ",c+=this.propertiesFromRule(a)+"\n}\n\n";else if(a.type===CSSRule.MEDIA_RULE)c+="@media "+a.media.mediaText+" {\n",c+=this.scopeRules(a.cssRules,b),c+="\n}\n\n";else try{a.cssText&&(c+=a.cssText+"\n\n")}catch(d){a.type===CSSRule.KEYFRAMES_RULE&&a.cssRules&&(c+=this.ieSafeCssTextFromKeyFrameRule(a))}},this),c},ieSafeCssTextFromKeyFrameRule:function(a){var b="@keyframes "+a.name+" {";return Array.prototype.forEach.call(a.cssRules,function(a){b+=" "+a.keyText+" {"+a.style.cssText+"}"}),b+=" }"},scopeSelector:function(a,b,c){var d=[],e=a.split(",");return e.forEach(function(a){a=a.trim(),this.selectorNeedsScoping(a,b)&&(a=c&&!a.match(polyfillHostNoCombinator)?this.applyStrictSelectorScope(a,b):this.applySelectorScope(a,b)),d.push(a)},this),d.join(", ")},selectorNeedsScoping:function(a,b){if(Array.isArray(b))return!0;var c=this.makeScopeMatcher(b);return!a.match(c)},makeScopeMatcher:function(a){return a=a.replace(/\[/g,"\\[").replace(/\[/g,"\\]"),new RegExp("^("+a+")"+selectorReSuffix,"m")},applySelectorScope:function(a,b){return Array.isArray(b)?this.applySelectorScopeList(a,b):this.applySimpleSelectorScope(a,b)},applySelectorScopeList:function(a,b){for(var c,d=[],e=0;c=b[e];e++)d.push(this.applySimpleSelectorScope(a,c));return d.join(", ")},applySimpleSelectorScope:function(a,b){return a.match(polyfillHostRe)?(a=a.replace(polyfillHostNoCombinator,b),a.replace(polyfillHostRe,b+" ")):b+" "+a},applyStrictSelectorScope:function(a,b){b=b.replace(/\[is=([^\]]*)\]/g,"$1");var c=[" ",">","+","~"],d=a,e="["+b+"]";return c.forEach(function(a){var b=d.split(a);d=b.map(function(a){var b=a.trim().replace(polyfillHostRe,"");return b&&c.indexOf(b)<0&&b.indexOf(e)<0&&(a=b.replace(/([^:]*)(:*)(.*)/,"$1"+e+"$2$3")),a}).join(a)}),d},insertPolyfillHostInCssText:function(a){return a.replace(colonHostContextRe,t).replace(colonHostRe,s)},propertiesFromRule:function(a){var b=a.style.cssText;a.style.content&&!a.style.content.match(/['"]+|attr/)&&(b=b.replace(/content:[^;]*;/g,"content: '"+a.style.content+"';"));var c=a.style;for(var d in c)"initial"===c[d]&&(b+=d+": initial; ");return b},replaceTextInStyles:function(a,b){a&&b&&(a instanceof Array||(a=[a]),Array.prototype.forEach.call(a,function(a){a.textContent=b.call(this,a.textContent)},this))},addCssToDocument:function(a,b){a.match("@import")?i(a,b):h(a)}},l=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,m=/\/\*\s*@polyfill ([^*]*\*+([^/*][^*]*\*+)*\/)([^{]*?){/gim,n=/polyfill-next-selector[^}]*content\:[\s]*?['"](.*?)['"][;\s]*}([^{]*?){/gim,o=/\/\*\s@polyfill-rule([^*]*\*+([^/*][^*]*\*+)*)\//gim,p=/(polyfill-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,q=/\/\*\s@polyfill-unscoped-rule([^*]*\*+([^/*][^*]*\*+)*)\//gim,r=/(polyfill-unscoped-rule)[^}]*(content\:[\s]*['"](.*?)['"])[;\s]*[^}]*}/gim,s="-shadowcsshost",t="-shadowcsscontext",u=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";cssColonHostRe=new RegExp("("+s+u,"gim"),cssColonHostContextRe=new RegExp("("+t+u,"gim"),selectorReSuffix="([>\\s~+[.,{:][\\s\\S]*)?$",colonHostRe=/\:host/gim,colonHostContextRe=/\:host-context/gim,polyfillHostNoCombinator=s+"-no-combinator",polyfillHostRe=new RegExp(s,"gim"),polyfillHostContextRe=new RegExp(t,"gim"),shadowDOMSelectorsRe=[/\^\^/g,/\^/g,/\/shadow\//g,/\/shadow-deep\//g,/::shadow/g,/\/deep\//g,/::content/g];var v=document.createElement("iframe");v.style.display="none";var w,x=navigator.userAgent.match("Chrome"),y="shim-shadowdom",z="shim-shadowdom-css",A="no-shim";if(window.ShadowDOMPolyfill){h("style { display: none !important; }\n");var B=wrap(document),C=B.querySelector("head");C.insertBefore(j(),C.childNodes[0]),document.addEventListener("DOMContentLoaded",function(){a.urlResolver;if(window.HTMLImports&&!HTMLImports.useNative){var b="link[rel=stylesheet]["+y+"]",c="style["+y+"]";HTMLImports.importer.documentPreloadSelectors+=","+b,HTMLImports.importer.importsPreloadSelectors+=","+b,HTMLImports.parser.documentSelectors=[HTMLImports.parser.documentSelectors,b,c].join(",");var d=HTMLImports.parser.parseGeneric;HTMLImports.parser.parseGeneric=function(a){if(!a[z]){var b=a.__importElement||a;if(!b.hasAttribute(y))return void d.call(this,a);a.__resource&&(b=a.ownerDocument.createElement("style"),b.textContent=a.__resource),HTMLImports.path.resolveUrlsInStyle(b),b.textContent=k.shimStyle(b),b.removeAttribute(y,""),b.setAttribute(z,""),b[z]=!0,b.parentNode!==C&&(a.parentNode===C?C.replaceChild(b,a):this.addElementToDocument(b)),b.__importParsed=!0,this.markParsingComplete(a),this.parseNext()}};var e=HTMLImports.parser.hasResource;HTMLImports.parser.hasResource=function(a){return"link"===a.localName&&"stylesheet"===a.rel&&a.hasAttribute(y)?a.__resource:e.call(this,a)}}})}a.ShadowCSS=k}(window.Platform)):!function(){window.wrap=window.unwrap=function(a){return a},addEventListener("DOMContentLoaded",function(){if(CustomElements.useNative===!1){var a=Element.prototype.createShadowRoot;Element.prototype.createShadowRoot=function(){var b=a.call(this);return CustomElements.watchShadow(this),b}}})}(window.Platform),function(a){"use strict";function b(a){return void 0!==m[a]}function c(){h.call(this),this._isInvalid=!0}function d(a){return""==a&&c.call(this),a.toLowerCase()}function e(a){var b=a.charCodeAt(0);return b>32&&127>b&&-1==[34,35,60,62,63,96].indexOf(b)?a:encodeURIComponent(a)}function f(a){var b=a.charCodeAt(0);return b>32&&127>b&&-1==[34,35,60,62,96].indexOf(b)?a:encodeURIComponent(a)}function g(a,g,h){function i(a){t.push(a)}var j=g||"scheme start",k=0,l="",r=!1,s=!1,t=[];a:for(;(a[k-1]!=o||0==k)&&!this._isInvalid;){var u=a[k];switch(j){case"scheme start":if(!u||!p.test(u)){if(g){i("Invalid scheme.");break a}l="",j="no scheme";continue}l+=u.toLowerCase(),j="scheme";break;case"scheme":if(u&&q.test(u))l+=u.toLowerCase();else{if(":"!=u){if(g){if(o==u)break a;i("Code point not allowed in scheme: "+u);break a}l="",k=0,j="no scheme";continue}if(this._scheme=l,l="",g)break a;b(this._scheme)&&(this._isRelative=!0),j="file"==this._scheme?"relative":this._isRelative&&h&&h._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==u?(query="?",j="query"):"#"==u?(this._fragment="#",j="fragment"):o!=u&&" "!=u&&"\n"!=u&&"\r"!=u&&(this._schemeData+=e(u));break;case"no scheme":if(h&&b(h._scheme)){j="relative";continue}i("Missing scheme."),c.call(this);break;case"relative or authority":if("/"!=u||"/"!=a[k+1]){i("Expected /, got: "+u),j="relative";continue}j="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=h._scheme),o==u){this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query=h._query;break a}if("/"==u||"\\"==u)"\\"==u&&i("\\ is an invalid code point."),j="relative slash";else if("?"==u)this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query="?",j="query";
|
4
|
+
else{if("#"!=u){var v=a[k+1],w=a[k+2];("file"!=this._scheme||!p.test(u)||":"!=v&&"|"!=v||o!=w&&"/"!=w&&"\\"!=w&&"?"!=w&&"#"!=w)&&(this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._path.pop()),j="relative path";continue}this._host=h._host,this._port=h._port,this._path=h._path.slice(),this._query=h._query,this._fragment="#",j="fragment"}break;case"relative slash":if("/"!=u&&"\\"!=u){"file"!=this._scheme&&(this._host=h._host,this._port=h._port),j="relative path";continue}"\\"==u&&i("\\ is an invalid code point."),j="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=u){i("Expected '/', got: "+u),j="authority ignore slashes";continue}j="authority second slash";break;case"authority second slash":if(j="authority ignore slashes","/"!=u){i("Expected '/', got: "+u);continue}break;case"authority ignore slashes":if("/"!=u&&"\\"!=u){j="authority";continue}i("Expected authority, got: "+u);break;case"authority":if("@"==u){r&&(i("@ already seen."),l+="%40"),r=!0;for(var x=0;x<l.length;x++){var y=l[x];if(" "!=y&&"\n"!=y&&"\r"!=y)if(":"!=y||null!==this._password){var z=e(y);null!==this._password?this._password+=z:this._username+=z}else this._password="";else i("Invalid whitespace in authority.")}l=""}else{if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u){k-=l.length,l="",j="host";continue}l+=u}break;case"file host":if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u){2!=l.length||!p.test(l[0])||":"!=l[1]&&"|"!=l[1]?0==l.length?j="relative path start":(this._host=d.call(this,l),l="",j="relative path start"):j="relative path";continue}" "==u||"\n"==u||"\r"==u?i("Invalid whitespace in file host."):l+=u;break;case"host":case"hostname":if(":"!=u||s){if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u){if(this._host=d.call(this,l),l="",j="relative path start",g)break a;continue}" "!=u&&"\n"!=u&&"\r"!=u?("["==u?s=!0:"]"==u&&(s=!1),l+=u):i("Invalid code point in host/hostname: "+u)}else if(this._host=d.call(this,l),l="",j="port","hostname"==g)break a;break;case"port":if(/[0-9]/.test(u))l+=u;else{if(o==u||"/"==u||"\\"==u||"?"==u||"#"==u||g){if(""!=l){var A=parseInt(l,10);A!=m[this._scheme]&&(this._port=A+""),l=""}if(g)break a;j="relative path start";continue}" "==u||"\n"==u||"\r"==u?i("Invalid code point in port: "+u):c.call(this)}break;case"relative path start":if("\\"==u&&i("'\\' not allowed in path."),j="relative path","/"!=u&&"\\"!=u)continue;break;case"relative path":if(o!=u&&"/"!=u&&"\\"!=u&&(g||"?"!=u&&"#"!=u))" "!=u&&"\n"!=u&&"\r"!=u&&(l+=e(u));else{"\\"==u&&i("\\ not allowed in relative path.");var B;(B=n[l.toLowerCase()])&&(l=B),".."==l?(this._path.pop(),"/"!=u&&"\\"!=u&&this._path.push("")):"."==l&&"/"!=u&&"\\"!=u?this._path.push(""):"."!=l&&("file"==this._scheme&&0==this._path.length&&2==l.length&&p.test(l[0])&&"|"==l[1]&&(l=l[0]+":"),this._path.push(l)),l="","?"==u?(this._query="?",j="query"):"#"==u&&(this._fragment="#",j="fragment")}break;case"query":g||"#"!=u?o!=u&&" "!=u&&"\n"!=u&&"\r"!=u&&(this._query+=f(u)):(this._fragment="#",j="fragment");break;case"fragment":o!=u&&" "!=u&&"\n"!=u&&"\r"!=u&&(this._fragment+=u)}k++}}function h(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function i(a,b){void 0===b||b instanceof i||(b=new i(String(b))),this._url=a,h.call(this);var c=a.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");g.call(this,c,null,b)}var j=!1;if(!a.forceJURL)try{var k=new URL("b","http://a");j="http://a/b"===k.href}catch(l){}if(!j){var m=Object.create(null);m.ftp=21,m.file=0,m.gopher=70,m.http=80,m.https=443,m.ws=80,m.wss=443;var n=Object.create(null);n["%2e"]=".",n[".%2e"]="..",n["%2e."]="..",n["%2e%2e"]="..";var o=void 0,p=/[a-zA-Z]/,q=/[a-zA-Z0-9\+\-\.]/;i.prototype={get href(){if(this._isInvalid)return this._url;var a="";return(""!=this._username||null!=this._password)&&(a=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+a+this.host:"")+this.pathname+this._query+this._fragment},set href(a){h.call(this),g.call(this,a)},get protocol(){return this._scheme+":"},set protocol(a){this._isInvalid||g.call(this,a+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(a){!this._isInvalid&&this._isRelative&&g.call(this,a,"host")},get hostname(){return this._host},set hostname(a){!this._isInvalid&&this._isRelative&&g.call(this,a,"hostname")},get port(){return this._port},set port(a){!this._isInvalid&&this._isRelative&&g.call(this,a,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(a){!this._isInvalid&&this._isRelative&&(this._path=[],g.call(this,a,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(a){!this._isInvalid&&this._isRelative&&(this._query="?","?"==a[0]&&(a=a.slice(1)),g.call(this,a,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(a){this._isInvalid||(this._fragment="#","#"==a[0]&&(a=a.slice(1)),g.call(this,a,"fragment"))},get origin(){var a;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return a=this.host,a?this._scheme+"://"+a:""}};var r=a.URL;r&&(i.createObjectURL=function(){return r.createObjectURL.apply(r,arguments)},i.revokeObjectURL=function(a){r.revokeObjectURL(a)}),a.URL=i}}(this),function(){Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();return d.push.apply(d,arguments),b.apply(a,d)}})}(window.Platform),function(a){function b(a){u.push(a),t||(t=!0,q(d))}function c(a){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(a)||a}function d(){t=!1;var a=u;u=[],a.sort(function(a,b){return a.uid_-b.uid_});var b=!1;a.forEach(function(a){var c=a.takeRecords();e(a),c.length&&(a.callback_(c,a),b=!0)}),b&&d()}function e(a){a.nodes_.forEach(function(b){var c=p.get(b);c&&c.forEach(function(b){b.observer===a&&b.removeTransientObservers()})})}function f(a,b){for(var c=a;c;c=c.parentNode){var d=p.get(c);if(d)for(var e=0;e<d.length;e++){var f=d[e],g=f.options;if(c===a||g.subtree){var h=b(g);h&&f.enqueue(h)}}}}function g(a){this.callback_=a,this.nodes_=[],this.records_=[],this.uid_=++v}function h(a,b){this.type=a,this.target=b,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function i(a){var b=new h(a.type,a.target);return b.addedNodes=a.addedNodes.slice(),b.removedNodes=a.removedNodes.slice(),b.previousSibling=a.previousSibling,b.nextSibling=a.nextSibling,b.attributeName=a.attributeName,b.attributeNamespace=a.attributeNamespace,b.oldValue=a.oldValue,b}function j(a,b){return w=new h(a,b)}function k(a){return x?x:(x=i(w),x.oldValue=a,x)}function l(){w=x=void 0}function m(a){return a===x||a===w}function n(a,b){return a===b?a:x&&m(a)?x:null}function o(a,b,c){this.observer=a,this.target=b,this.options=c,this.transientObservedNodes=[]}var p=new WeakMap,q=window.msSetImmediate;if(!q){var r=[],s=String(Math.random());window.addEventListener("message",function(a){if(a.data===s){var b=r;r=[],b.forEach(function(a){a()})}}),q=function(a){r.push(a),window.postMessage(s,"*")}}var t=!1,u=[],v=0;g.prototype={observe:function(a,b){if(a=c(a),!b.childList&&!b.attributes&&!b.characterData||b.attributeOldValue&&!b.attributes||b.attributeFilter&&b.attributeFilter.length&&!b.attributes||b.characterDataOldValue&&!b.characterData)throw new SyntaxError;var d=p.get(a);d||p.set(a,d=[]);for(var e,f=0;f<d.length;f++)if(d[f].observer===this){e=d[f],e.removeListeners(),e.options=b;break}e||(e=new o(this,a,b),d.push(e),this.nodes_.push(a)),e.addListeners()},disconnect:function(){this.nodes_.forEach(function(a){for(var b=p.get(a),c=0;c<b.length;c++){var d=b[c];if(d.observer===this){d.removeListeners(),b.splice(c,1);break}}},this),this.records_=[]},takeRecords:function(){var a=this.records_;return this.records_=[],a}};var w,x;o.prototype={enqueue:function(a){var c=this.observer.records_,d=c.length;if(c.length>0){var e=c[d-1],f=n(e,a);if(f)return void(c[d-1]=f)}else b(this.observer);c[d]=a},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(a){var b=this.options;b.attributes&&a.addEventListener("DOMAttrModified",this,!0),b.characterData&&a.addEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.addEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(a){var b=this.options;b.attributes&&a.removeEventListener("DOMAttrModified",this,!0),b.characterData&&a.removeEventListener("DOMCharacterDataModified",this,!0),b.childList&&a.removeEventListener("DOMNodeInserted",this,!0),(b.childList||b.subtree)&&a.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(a){if(a!==this.target){this.addListeners_(a),this.transientObservedNodes.push(a);var b=p.get(a);b||p.set(a,b=[]),b.push(this)}},removeTransientObservers:function(){var a=this.transientObservedNodes;this.transientObservedNodes=[],a.forEach(function(a){this.removeListeners_(a);for(var b=p.get(a),c=0;c<b.length;c++)if(b[c]===this){b.splice(c,1);break}},this)},handleEvent:function(a){switch(a.stopImmediatePropagation(),a.type){case"DOMAttrModified":var b=a.attrName,c=a.relatedNode.namespaceURI,d=a.target,e=new j("attributes",d);e.attributeName=b,e.attributeNamespace=c;var g=a.attrChange===MutationEvent.ADDITION?null:a.prevValue;f(d,function(a){return!a.attributes||a.attributeFilter&&a.attributeFilter.length&&-1===a.attributeFilter.indexOf(b)&&-1===a.attributeFilter.indexOf(c)?void 0:a.attributeOldValue?k(g):e});break;case"DOMCharacterDataModified":var d=a.target,e=j("characterData",d),g=a.prevValue;f(d,function(a){return a.characterData?a.characterDataOldValue?k(g):e:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(a.target);case"DOMNodeInserted":var h,i,d=a.relatedNode,m=a.target;"DOMNodeInserted"===a.type?(h=[m],i=[]):(h=[],i=[m]);var n=m.previousSibling,o=m.nextSibling,e=j("childList",d);e.addedNodes=h,e.removedNodes=i,e.previousSibling=n,e.nextSibling=o,f(d,function(a){return a.childList?e:void 0})}l()}},a.JsMutationObserver=g,a.MutationObserver||(a.MutationObserver=g)}(this),window.HTMLImports=window.HTMLImports||{flags:{}},function(a){function b(a,b){b=b||q,d(function(){f(a,b)},b)}function c(a){return"complete"===a.readyState||a.readyState===s}function d(a,b){if(c(b))a&&a();else{var e=function(){("complete"===b.readyState||b.readyState===s)&&(b.removeEventListener(t,e),d(a,b))};b.addEventListener(t,e)}}function e(a){a.target.__loaded=!0}function f(a,b){function c(){h==i&&a&&a()}function d(a){e(a),h++,c()}var f=b.querySelectorAll("link[rel=import]"),h=0,i=f.length;if(i)for(var j,k=0;i>k&&(j=f[k]);k++)g(j)?d.call(j,{target:j}):(j.addEventListener("load",d),j.addEventListener("error",d));else c()}function g(a){return m?a.__loaded||a.import&&"loading"!==a.import.readyState:a.__importParsed}function h(a){for(var b,c=0,d=a.length;d>c&&(b=a[c]);c++)i(b)&&j(b)}function i(a){return"link"===a.localName&&"import"===a.rel}function j(a){var b=a.import;b?e({target:a}):(a.addEventListener("load",e),a.addEventListener("error",e))}var k="import",l=k in document.createElement("link"),m=l,n=/Trident/.test(navigator.userAgent),o=Boolean(window.ShadowDOMPolyfill),p=function(a){return o?ShadowDOMPolyfill.wrapIfNeeded(a):a},q=p(document),r={get:function(){var a=HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return p(a)},configurable:!0};Object.defineProperty(document,"_currentScript",r),Object.defineProperty(q,"_currentScript",r);var s=n?"complete":"interactive",t="readystatechange";m&&(new MutationObserver(function(a){for(var b,c=0,d=a.length;d>c&&(b=a[c]);c++)b.addedNodes&&h(b.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var a,b=document.querySelectorAll("link[rel=import]"),c=0,d=b.length;d>c&&(a=b[c]);c++)j(a)}()),b(function(){HTMLImports.ready=!0,HTMLImports.readyTime=(new Date).getTime(),q.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:!0}))}),a.useNative=m,a.isImportLoaded=g,a.whenReady=b,a.rootDocument=q,a.IMPORT_LINK_TYPE=k,a.isIE=n}(window.HTMLImports),function(a){var b=(a.path,a.xhr),c=a.flags,d=function(a,b){this.cache={},this.onload=a,this.oncomplete=b,this.inflight=0,this.pending={}};d.prototype={addNodes:function(a){this.inflight+=a.length;for(var b,c=0,d=a.length;d>c&&(b=a[c]);c++)this.require(b);this.checkDone()},addNode:function(a){this.inflight++,this.require(a),this.checkDone()},require:function(a){var b=a.src||a.href;a.__nodeUrl=b,this.dedupe(b,a)||this.fetch(b,a)},dedupe:function(a,b){if(this.pending[a])return this.pending[a].push(b),!0;return this.cache[a]?(this.onload(a,b,this.cache[a]),this.tail(),!0):(this.pending[a]=[b],!1)},fetch:function(a,d){if(c.load&&console.log("fetch",a,d),a.match(/^data:/)){var e=a.split(","),f=e[0],g=e[1];g=f.indexOf(";base64")>-1?atob(g):decodeURIComponent(g),setTimeout(function(){this.receive(a,d,null,g)}.bind(this),0)}else{var h=function(b,c,e){this.receive(a,d,b,c,e)}.bind(this);b.load(a,h)}},receive:function(a,b,c,d,e){this.cache[a]=d;for(var f,g=this.pending[a],h=0,i=g.length;i>h&&(f=g[h]);h++)this.onload(a,f,d,c,e),this.tail();this.pending[a]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},b=b||{async:!0,ok:function(a){return a.status>=200&&a.status<300||304===a.status||0===a.status},load:function(c,d,e){var f=new XMLHttpRequest;return(a.flags.debug||a.flags.bust)&&(c+="?"+Math.random()),f.open("GET",c,b.async),f.addEventListener("readystatechange",function(){if(4===f.readyState){var a=f.getResponseHeader("Location"),c=null;if(a)var c="/"===a.substr(0,1)?location.origin+a:a;d.call(e,!b.ok(f)&&f,f.response||f.responseText,c)}}),f.send(),f},loadDocument:function(a,b,c){this.load(a,b,c).responseType="document"}},a.xhr=b,a.Loader=d}(window.HTMLImports),function(a){function b(a){return"link"===a.localName&&a.rel===j}function c(a){var b=d(a);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(b)}function d(a){return a.textContent+e(a)}function e(a){var b=a.__nodeUrl;if(!b){b=a.ownerDocument.baseURI;var c="["+Math.floor(1e3*(Math.random()+1))+"]",d=a.textContent.match(/Polymer\(['"]([^'"]*)/);c=d&&d[1]||c,b+="/"+c+".js"}return"\n//# sourceURL="+b+"\n"}function f(a){var b=a.ownerDocument.createElement("style");return b.textContent=a.textContent,n.resolveUrlsInStyle(b),b}var g=a.rootDocument,h=a.flags,i=a.isIE,j=a.IMPORT_LINK_TYPE,k={documentSelectors:"link[rel="+j+"]",importsSelectors:["link[rel="+j+"]","link[rel=stylesheet]","style","script:not([type])",'script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var a=this.nextToParse();a&&this.parse(a)},parse:function(a){if(this.isParsed(a))return void(h.parse&&console.log("[%s] is already parsed",a.localName));var b=this[this.map[a.localName]];b&&(this.markParsing(a),b.call(this,a))},parseDynamic:function(a,b){this.dynamicElements.push(a),b||this.parseNext()},markParsing:function(a){h.parse&&console.log("parsing",a),this.parsingElement=a},markParsingComplete:function(a){a.__importParsed=!0,this.markDynamicParsingComplete(a),a.__importElement&&(a.__importElement.__importParsed=!0,this.markDynamicParsingComplete(a.__importElement)),this.parsingElement=null,h.parse&&console.log("completed",a)},markDynamicParsingComplete:function(a){var b=this.dynamicElements.indexOf(a);b>=0&&this.dynamicElements.splice(b,1)},parseImport:function(a){if(HTMLImports.__importsParsingHook&&HTMLImports.__importsParsingHook(a),a.import&&(a.import.__importParsed=!0),this.markParsingComplete(a),a.dispatchEvent(a.__resource&&!a.__error?new CustomEvent("load",{bubbles:!1}):new CustomEvent("error",{bubbles:!1})),a.__pending)for(var b;a.__pending.length;)b=a.__pending.shift(),b&&b({target:a});this.parseNext()},parseLink:function(a){b(a)?this.parseImport(a):(a.href=a.href,this.parseGeneric(a))},parseStyle:function(a){var b=a;a=f(a),a.__importElement=b,this.parseGeneric(a)},parseGeneric:function(a){this.trackElement(a),this.addElementToDocument(a)},rootImportForElement:function(a){for(var b=a;b.ownerDocument.__importLink;)b=b.ownerDocument.__importLink;return b},addElementToDocument:function(a){for(var b=this.rootImportForElement(a.__importElement||a),c=b.__insertedElements=b.__insertedElements||0,d=b.nextElementSibling,e=0;c>e;e++)d=d&&d.nextElementSibling;b.parentNode.insertBefore(a,d)},trackElement:function(a,b){var c=this,d=function(d){b&&b(d),c.markParsingComplete(a),c.parseNext()};if(a.addEventListener("load",d),a.addEventListener("error",d),i&&"style"===a.localName){var e=!1;if(-1==a.textContent.indexOf("@import"))e=!0;else if(a.sheet){e=!0;for(var f,g=a.sheet.cssRules,h=g?g.length:0,j=0;h>j&&(f=g[j]);j++)f.type===CSSRule.IMPORT_RULE&&(e=e&&Boolean(f.styleSheet))}e&&a.dispatchEvent(new CustomEvent("load",{bubbles:!1}))}},parseScript:function(b){var d=document.createElement("script");d.__importElement=b,d.src=b.src?b.src:c(b),a.currentScript=b,this.trackElement(d,function(){d.parentNode.removeChild(d),a.currentScript=null}),this.addElementToDocument(d)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(g)||this.nextToParseDynamic())},nextToParseInDoc:function(a,c){if(a&&this._mayParse.indexOf(a)<0){this._mayParse.push(a);for(var d,e=a.querySelectorAll(this.parseSelectorsForNode(a)),f=0,g=e.length;g>f&&(d=e[f]);f++)if(!this.isParsed(d))return this.hasResource(d)?b(d)?this.nextToParseInDoc(d.import,d):d:void 0}return c},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(a){var b=a.ownerDocument||a;return b===g?this.documentSelectors:this.importsSelectors},isParsed:function(a){return a.__importParsed},needsDynamicParsing:function(a){return this.dynamicElements.indexOf(a)>=0},hasResource:function(a){return b(a)&&void 0===a.import?!1:!0}},l=/(url\()([^)]*)(\))/g,m=/(@import[\s]+(?!url\())([^;]*)(;)/g,n={resolveUrlsInStyle:function(a){var b=a.ownerDocument,c=b.createElement("a");return a.textContent=this.resolveUrlsInCssText(a.textContent,c),a},resolveUrlsInCssText:function(a,b){var c=this.replaceUrls(a,b,l);return c=this.replaceUrls(c,b,m)},replaceUrls:function(a,b,c){return a.replace(c,function(a,c,d,e){var f=d.replace(/["']/g,"");return b.href=f,f=b.href,c+"'"+f+"'"+e})}};a.parser=k,a.path=n}(HTMLImports),function(a){function b(a){return c(a,g)}function c(a,b){return"link"===a.localName&&a.getAttribute("rel")===b}function d(a,b){var c=a;c instanceof Document||(c=document.implementation.createHTMLDocument(g)),c._URL=b;var d=c.createElement("base");d.setAttribute("href",b),c.baseURI||(c.baseURI=b);var e=c.createElement("meta");return e.setAttribute("charset","utf-8"),c.head.appendChild(e),c.head.appendChild(d),a instanceof Document||(c.body.innerHTML=a),window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(c),c}var e=a.useNative,f=a.flags,g=a.IMPORT_LINK_TYPE;if(e)var h={};else{var i=a.rootDocument,j=(a.xhr,a.Loader),k=a.parser,h={documents:{},documentPreloadSelectors:"link[rel="+g+"]",importsPreloadSelectors:["link[rel="+g+"]"].join(","),loadNode:function(a){l.addNode(a)},loadSubtree:function(a){var b=this.marshalNodes(a);l.addNodes(b)},marshalNodes:function(a){return a.querySelectorAll(this.loadSelectorsForNode(a))},loadSelectorsForNode:function(a){var b=a.ownerDocument||a;return b===i?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(a,c,e,g,h){if(f.load&&console.log("loaded",a,c),c.__resource=e,c.__error=g,b(c)){var i=this.documents[a];void 0===i&&(i=g?null:d(e,h||a),i&&(i.__importLink=c,this.bootDocument(i)),this.documents[a]=i),c.import=i}k.parseNext()},bootDocument:function(a){this.loadSubtree(a),this.observe(a),k.parseNext()},loadedAll:function(){k.parseNext()}},l=new j(h.loaded.bind(h),h.loadedAll.bind(h));if(!document.baseURI){var m={get:function(){var a=document.querySelector("base");return a?a.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",m),Object.defineProperty(i,"baseURI",m)}"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a,b){var c=document.createEvent("HTMLEvents");return c.initEvent(a,b.bubbles===!1?!1:!0,b.cancelable===!1?!1:!0,b.detail),c})}a.importer=h,a.IMPORT_LINK_TYPE=g,a.importLoader=l}(window.HTMLImports),function(a){function b(a){for(var b,d=0,e=a.length;e>d&&(b=a[d]);d++)"childList"===b.type&&b.addedNodes.length&&c(b.addedNodes)}function c(a){for(var b,f,i,j,k=0,l=a.length;l>k&&(i=a[k]);k++)b||(b=i.ownerDocument,f=h.isParsed(b)),j=d(i),j&&g.loadNode(i),e(i)&&f&&h.parseDynamic(i,j),i.children&&i.children.length&&c(i.children)}function d(a){return 1===a.nodeType&&i.call(a,g.loadSelectorsForNode(a))}function e(a){return 1===a.nodeType&&i.call(a,h.parseSelectorsForNode(a))}function f(a){j.observe(a,{childList:!0,subtree:!0})}var g=(a.IMPORT_LINK_TYPE,a.importer),h=a.parser,i=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector,j=new MutationObserver(b);a.observe=f,g.observe=f}(HTMLImports),function(){function a(){HTMLImports.importer.bootDocument(b)}var b=window.ShadowDOMPolyfill?window.ShadowDOMPolyfill.wrapIfNeeded(document):document;HTMLImports.useNative||("complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?a():document.addEventListener("DOMContentLoaded",a))}(),window.CustomElements=window.CustomElements||{flags:{}},function(a){function b(a,c,d){var e=a.firstElementChild;if(!e)for(e=a.firstChild;e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.nextSibling;for(;e;)c(e,d)!==!0&&b(e,c,d),e=e.nextElementSibling;return null}function c(a,b){for(var c=a.shadowRoot;c;)d(c,b),c=c.olderShadowRoot}function d(a,d){b(a,function(a){return d(a)?!0:void c(a,d)}),c(a,d)}function e(a){return h(a)?(i(a),!0):void l(a)}function f(a){d(a,function(a){return e(a)?!0:void 0})}function g(a){return e(a)||f(a)}function h(b){if(!b.__upgraded__&&b.nodeType===Node.ELEMENT_NODE){var c=b.getAttribute("is")||b.localName,d=a.registry[c];if(d)return B.dom&&console.group("upgrade:",b.localName),a.upgrade(b),B.dom&&console.groupEnd(),!0}}function i(a){l(a),r(a)&&d(a,function(a){l(a)})}function j(a){if(G.push(a),!F){F=!0;var b=window.Platform&&window.Platform.endOfMicrotask||setTimeout;b(k)}}function k(){F=!1;for(var a,b=G,c=0,d=b.length;d>c&&(a=b[c]);c++)a();G=[]}function l(a){D?j(function(){m(a)}):m(a)}function m(a){(a.attachedCallback||a.detachedCallback||a.__upgraded__&&B.dom)&&(B.dom&&console.group("inserted:",a.localName),r(a)&&(a.__inserted=(a.__inserted||0)+1,a.__inserted<1&&(a.__inserted=1),a.__inserted>1?B.dom&&console.warn("inserted:",a.localName,"insert/remove count:",a.__inserted):a.attachedCallback&&(B.dom&&console.log("inserted:",a.localName),a.attachedCallback())),B.dom&&console.groupEnd())}function n(a){o(a),d(a,function(a){o(a)})}function o(a){D?j(function(){p(a)}):p(a)}function p(a){(a.attachedCallback||a.detachedCallback||a.__upgraded__&&B.dom)&&(B.dom&&console.group("removed:",a.localName),r(a)||(a.__inserted=(a.__inserted||0)-1,a.__inserted>0&&(a.__inserted=0),a.__inserted<0?B.dom&&console.warn("removed:",a.localName,"insert/remove count:",a.__inserted):a.detachedCallback&&a.detachedCallback()),B.dom&&console.groupEnd())}function q(a){return window.ShadowDOMPolyfill?ShadowDOMPolyfill.wrapIfNeeded(a):a}function r(a){for(var b=a,c=q(document);b;){if(b==c)return!0;b=b.parentNode||b.host}}function s(a){if(a.shadowRoot&&!a.shadowRoot.__watched){B.dom&&console.log("watching shadow-root for: ",a.localName);for(var b=a.shadowRoot;b;)t(b),b=b.olderShadowRoot}}function t(a){w(a)}function u(a){if(B.dom){var b=a[0];if(b&&"childList"===b.type&&b.addedNodes&&b.addedNodes){for(var c=b.addedNodes[0];c&&c!==document&&!c.host;)c=c.parentNode;var d=c&&(c.URL||c._URL||c.host&&c.host.localName)||"";d=d.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",a.length,d||"")}a.forEach(function(a){"childList"===a.type&&(H(a.addedNodes,function(a){a.localName&&g(a)}),H(a.removedNodes,function(a){a.localName&&n(a)}))}),B.dom&&console.groupEnd()}function v(a){for(a||(a=q(document));a.parentNode;)a=a.parentNode;var b=a.__observer;b&&(u(b.takeRecords()),k())}function w(a){if(!a.__observer){var b=new MutationObserver(u);b.observe(a,{childList:!0,subtree:!0}),a.__observer=b}}function x(a){w(a)}function y(a){B.dom&&console.group("upgradeDocument: ",a.baseURI.split("/").pop()),g(a),B.dom&&console.groupEnd()}function z(a){E=[],A(a),E=null}function A(a){if(a=q(a),!(E.indexOf(a)>=0)){E.push(a);for(var b,c=a.querySelectorAll("link[rel="+C+"]"),d=0,e=c.length;e>d&&(b=c[d]);d++)b.import&&b.import.__parsed&&A(b.import);y(a)}}var B=window.logFlags||{},C=window.HTMLImports?HTMLImports.IMPORT_LINK_TYPE:"none",D=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;a.hasPolyfillMutations=D;var E,F=!1,G=[],H=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.IMPORT_LINK_TYPE=C,a.watchShadow=s,a.upgradeDocumentTree=z,a.upgradeAll=g,a.upgradeSubtree=f,a.insertedNode=i,a.observeDocument=x,a.upgradeDocument=y,a.takeRecords=v}(window.CustomElements),function(a){function b(b,g){var h=g||{};if(!b)throw new Error("document.registerElement: first argument `name` must not be empty");if(b.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(b)+"'.");if(c(b))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(b)+"'. The type name is invalid.");if(n(b))throw new Error("DuplicateDefinitionError: a type with name '"+String(b)+"' is already registered");if(!h.prototype)throw new Error("Options missing required prototype property");return h.__name=b.toLowerCase(),h.lifecycle=h.lifecycle||{},h.ancestry=d(h.extends),e(h),f(h),l(h.prototype),o(h.__name,h),h.ctor=p(h),h.ctor.prototype=h.prototype,h.prototype.constructor=h.ctor,a.ready&&a.upgradeDocumentTree(document),h.ctor}function c(a){for(var b=0;b<y.length;b++)if(a===y[b])return!0}function d(a){var b=n(a);return b?d(b.extends).concat([b]):[]}function e(a){for(var b,c=a.extends,d=0;b=a.ancestry[d];d++)c=b.is&&b.tag;a.tag=c||a.__name,c&&(a.is=a.__name)}function f(a){if(!Object.__proto__){var b=HTMLElement.prototype;if(a.is){var c=document.createElement(a.tag),d=Object.getPrototypeOf(c);d===a.prototype&&(b=d)}for(var e,f=a.prototype;f&&f!==b;)e=Object.getPrototypeOf(f),f.__proto__=e,f=e;a.native=b}}function g(a){return h(B(a.tag),a)}function h(b,c){return c.is&&b.setAttribute("is",c.is),i(b,c),b.__upgraded__=!0,k(b),a.insertedNode(b),a.upgradeSubtree(b),b}function i(a,b){Object.__proto__?a.__proto__=b.prototype:(j(a,b.prototype,b.native),a.__proto__=b.prototype)}function j(a,b,c){for(var d={},e=b;e!==c&&e!==HTMLElement.prototype;){for(var f,g=Object.getOwnPropertyNames(e),h=0;f=g[h];h++)d[f]||(Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(e,f)),d[f]=1);e=Object.getPrototypeOf(e)}}function k(a){a.createdCallback&&a.createdCallback()}function l(a){if(!a.setAttribute._polyfilled){var b=a.setAttribute;a.setAttribute=function(a,c){m.call(this,a,c,b)};var c=a.removeAttribute;a.removeAttribute=function(a){m.call(this,a,null,c)},a.setAttribute._polyfilled=!0}}function m(a,b,c){a=a.toLowerCase();var d=this.getAttribute(a);c.apply(this,arguments);var e=this.getAttribute(a);this.attributeChangedCallback&&e!==d&&this.attributeChangedCallback(a,d,e)}function n(a){return a?z[a.toLowerCase()]:void 0}function o(a,b){z[a]=b}function p(a){return function(){return g(a)}}function q(a,b,c){return a===A?r(b,c):C(a,b)}function r(a,b){var c=n(b||a);if(c){if(a==c.tag&&b==c.is)return new c.ctor;if(!b&&!c.is)return new c.ctor}if(b){var d=r(a);return d.setAttribute("is",b),d}var d=B(a);return a.indexOf("-")>=0&&i(d,HTMLElement),d}function s(a){if(!a.__upgraded__&&a.nodeType===Node.ELEMENT_NODE){var b=a.getAttribute("is"),c=n(b||a.localName);if(c){if(b&&c.tag==a.localName)return h(a,c);if(!b&&!c.extends)return h(a,c)}}}function t(b){var c=D.call(this,b);return a.upgradeAll(c),c}a||(a=window.CustomElements={flags:{}});var u=a.flags,v=Boolean(document.registerElement),w=!u.register&&v&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||HTMLImports.useNative);if(w){var x=function(){};a.registry={},a.upgradeElement=x,a.watchShadow=x,a.upgrade=x,a.upgradeAll=x,a.upgradeSubtree=x,a.observeDocument=x,a.upgradeDocument=x,a.upgradeDocumentTree=x,a.takeRecords=x,a.reservedTagList=[]}else{var y=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],z={},A="http://www.w3.org/1999/xhtml",B=document.createElement.bind(document),C=document.createElementNS.bind(document),D=Node.prototype.cloneNode;document.registerElement=b,document.createElement=r,document.createElementNS=q,Node.prototype.cloneNode=t,a.registry=z,a.upgrade=s}var E;E=Object.__proto__||w?function(a,b){return a instanceof b}:function(a,b){for(var c=a;c;){if(c===b.prototype)return!0;c=c.__proto__}return!1},a.instanceof=E,a.reservedTagList=y,document.register=document.registerElement,a.hasNative=v,a.useNative=w}(window.CustomElements),function(a){function b(a){return"link"===a.localName&&a.getAttribute("rel")===c}var c=a.IMPORT_LINK_TYPE,d={selectors:["link[rel="+c+"]"],map:{link:"parseLink"},parse:function(a){if(!a.__parsed){a.__parsed=!0;var b=a.querySelectorAll(d.selectors);e(b,function(a){d[d.map[a.localName]](a)}),CustomElements.upgradeDocument(a),CustomElements.observeDocument(a)}},parseLink:function(a){b(a)&&this.parseImport(a)},parseImport:function(a){a.import&&d.parse(a.import)}},e=Array.prototype.forEach.call.bind(Array.prototype.forEach);a.parser=d,a.IMPORT_LINK_TYPE=c}(window.CustomElements),function(a){function b(){CustomElements.parser.parse(document),CustomElements.upgradeDocument(document),window.HTMLImports&&(HTMLImports.__importsParsingHook=function(a){CustomElements.parser.parse(a.import)}),CustomElements.ready=!0,setTimeout(function(){CustomElements.readyTime=Date.now(),window.HTMLImports&&(CustomElements.elapsed=CustomElements.readyTime-HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})}if("function"!=typeof window.CustomEvent&&(window.CustomEvent=function(a,b){b=b||{};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,Boolean(b.bubbles),Boolean(b.cancelable),b.detail),c},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||a.flags.eager)b();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var c=window.HTMLImports&&!HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(c,b)}else b()}(window.CustomElements),function(){if(window.ShadowDOMPolyfill){var a=["upgradeAll","upgradeSubtree","observeDocument","upgradeDocument"],b={};a.forEach(function(a){b[a]=CustomElements[a]}),a.forEach(function(a){CustomElements[a]=function(c){return b[a](wrap(c))}})}}(),function(a){"use strict";function b(){window.Polymer===e&&(window.Polymer=function(){throw new Error('You tried to use polymer without loading it first. To load polymer, <link rel="import" href="components/polymer/polymer.html">')})}if(!window.performance){var c=Date.now();window.performance={now:function(){return Date.now()-c
|
5
|
+
}}}window.requestAnimationFrame||(window.requestAnimationFrame=function(){var a=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return a?function(b){return a(function(){b(performance.now())})}:function(a){return window.setTimeout(a,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(){return window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(a){clearTimeout(a)}}());var d=[],e=function(a){"string"!=typeof a&&1===arguments.length&&Array.prototype.push.call(arguments,document._currentScript),d.push(arguments)};window.Polymer=e,a.consumeDeclarations=function(b){a.consumeDeclarations=function(){throw"Possible attempt to load Polymer twice"},b&&b(d),d=null},HTMLImports.useNative?b():addEventListener("DOMContentLoaded",b)}(window.Platform),function(){var a=document.createElement("style");a.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n";var b=document.querySelector("head");b.insertBefore(a,b.firstChild)}(Platform),function(a){function b(a,b){return b=b||[],b.map||(b=[b]),a.apply(this,b.map(d))}function c(a,c,d){var e;switch(arguments.length){case 0:return;case 1:e=null;break;case 2:e=c.apply(this);break;default:e=b(d,c)}f[a]=e}function d(a){return f[a]}function e(a,c){HTMLImports.whenImportsReady(function(){b(c,a)})}var f={};a.marshal=d,a.modularize=c,a.using=e}(window);</script><script>var concerto=concerto||{};concerto.contentFactory=function(){var types={};var normalizeTypeName=function(typeName){var basicName=typeName.replace(/\W/g,"");return basicName.toLowerCase()};return{getType:function(typeName){typeName=normalizeTypeName(typeName);return types[typeName]?new types[typeName]:undefined},registerType:function(typeName,ContentType){if(!ContentType){return}var proto=ContentType.prototype;if("contentId"in proto&&"title"in proto){typeName=normalizeTypeName(typeName);types[typeName]=ContentType}}}}();</script><style shim-shadowdom="">html /deep/ [layout][horizontal], html /deep/ [layout][vertical] { display: -ms-flexbox; display: -webkit-flex; display: flex;}html /deep/ [layout][horizontal][inline], html /deep/ [layout][vertical][inline] { display: -ms-inline-flexbox; display: -webkit-inline-flex; display: inline-flex;}html /deep/ [layout][horizontal] { -ms-flex-direction: row; -webkit-flex-direction: row; flex-direction: row;}html /deep/ [layout][horizontal][reverse] { -ms-flex-direction: row-reverse; -webkit-flex-direction: row-reverse; flex-direction: row-reverse;}html /deep/ [layout][vertical] { -ms-flex-direction: column; -webkit-flex-direction: column; flex-direction: column;}html /deep/ [layout][vertical][reverse] { -ms-flex-direction: column-reverse; -webkit-flex-direction: column-reverse; flex-direction: column-reverse;}html /deep/ [layout][wrap] { -ms-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap;}html /deep/ [layout][wrap-reverse] { -ms-flex-wrap: wrap-reverse; -webkit-flex-wrap: wrap-reverse; flex-wrap: wrap-reverse;}html /deep/ [flex] { -ms-flex: 1 1 0.000000001px; -webkit-flex: 1; flex: 1; -webkit-flex-basis: 0.000000001px; flex-basis: 0.000000001px;}html /deep/ [vertical][layout] > [flex][auto-vertical], html /deep/ [vertical][layout]::shadow [flex][auto-vertical] { -ms-flex: 1 1 auto; -webkit-flex-basis: auto; flex-basis: auto;}html /deep/ [flex][auto] { -ms-flex: 1 1 auto; -webkit-flex-basis: auto; flex-basis: auto;}html /deep/ [flex][none] { -ms-flex: none; -webkit-flex: none; flex: none;}html /deep/ [flex][one] { -ms-flex: 1; -webkit-flex: 1; flex: 1;}html /deep/ [flex][two] { -ms-flex: 2; -webkit-flex: 2; flex: 2;}html /deep/ [flex][three] { -ms-flex: 3; -webkit-flex: 3; flex: 3;}html /deep/ [flex][four] { -ms-flex: 4; -webkit-flex: 4; flex: 4;}html /deep/ [flex][five] { -ms-flex: 5; -webkit-flex: 5; flex: 5;}html /deep/ [flex][six] { -ms-flex: 6; -webkit-flex: 6; flex: 6;}html /deep/ [flex][seven] { -ms-flex: 7; -webkit-flex: 7; flex: 7;}html /deep/ [flex][eight] { -ms-flex: 8; -webkit-flex: 8; flex: 8;}html /deep/ [flex][nine] { -ms-flex: 9; -webkit-flex: 9; flex: 9;}html /deep/ [flex][ten] { -ms-flex: 10; -webkit-flex: 10; flex: 10;}html /deep/ [flex][eleven] { -ms-flex: 11; -webkit-flex: 11; flex: 11;}html /deep/ [flex][twelve] { -ms-flex: 12; -webkit-flex: 12; flex: 12;}html /deep/ [layout][start] { -ms-flex-align: start; -webkit-align-items: flex-start; align-items: flex-start;}html /deep/ [layout][center], html /deep/ [layout][center-center] { -ms-flex-align: center; -webkit-align-items: center; align-items: center;}html /deep/ [layout][end] { -ms-flex-align: end; -webkit-align-items: flex-end; align-items: flex-end;}html /deep/ [layout][start-justified] { -ms-flex-pack: start; -webkit-justify-content: flex-start; justify-content: flex-start;}html /deep/ [layout][center-justified], html /deep/ [layout][center-center] { -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center;}html /deep/ [layout][end-justified] { -ms-flex-pack: end; -webkit-justify-content: flex-end; justify-content: flex-end;}html /deep/ [layout][around-justified] { -ms-flex-pack: distribute; -webkit-justify-content: space-around; justify-content: space-around;}html /deep/ [layout][justified] { -ms-flex-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;}html /deep/ [self-start] { -ms-align-self: flex-start; -webkit-align-self: flex-start; align-self: flex-start;}html /deep/ [self-center] { -ms-align-self: center; -webkit-align-self: center; align-self: center;}html /deep/ [self-end] { -ms-align-self: flex-end; -webkit-align-self: flex-end; align-self: flex-end;}html /deep/ [self-stretch] { -ms-align-self: stretch; -webkit-align-self: stretch; align-self: stretch;}html /deep/ [block] { display: block;}html /deep/ [hidden] { display: none !important;}html /deep/ [relative] { position: relative;}html /deep/ [fit] { position: absolute; top: 0; right: 0; bottom: 0; left: 0;}body[fullbleed] { margin: 0; height: 100vh;}html /deep/ [segment], html /deep/ segment { display: block; position: relative; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; margin: 1em 0.5em; padding: 1em; background-color: white; -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1); border-radius: 5px 5px 5px 5px;}</style><script>window.PolymerGestures={};(function(scope){var HAS_FULL_PATH=false;var pathTest=document.createElement("meta");if(pathTest.createShadowRoot){var sr=pathTest.createShadowRoot();var s=document.createElement("span");sr.appendChild(s);pathTest.addEventListener("testpath",function(ev){if(ev.path){HAS_FULL_PATH=ev.path[0]===s}ev.stopPropagation()});var ev=new CustomEvent("testpath",{bubbles:true});document.head.appendChild(pathTest);s.dispatchEvent(ev);pathTest.parentNode.removeChild(pathTest);sr=s=null}pathTest=null;var target={shadow:function(inEl){if(inEl){return inEl.shadowRoot||inEl.webkitShadowRoot}},canTarget:function(shadow){return shadow&&Boolean(shadow.elementFromPoint)},targetingShadow:function(inEl){var s=this.shadow(inEl);if(this.canTarget(s)){return s}},olderShadow:function(shadow){var os=shadow.olderShadowRoot;if(!os){var se=shadow.querySelector("shadow");if(se){os=se.olderShadowRoot}}return os},allShadows:function(element){var shadows=[],s=this.shadow(element);while(s){shadows.push(s);s=this.olderShadow(s)}return shadows},searchRoot:function(inRoot,x,y){var t,st,sr,os;if(inRoot){t=inRoot.elementFromPoint(x,y);if(t){sr=this.targetingShadow(t)}else if(inRoot!==document){sr=this.olderShadow(inRoot)}return this.searchRoot(sr,x,y)||t}},owner:function(element){if(!element){return document}var s=element;while(s.parentNode){s=s.parentNode}if(s.nodeType!=Node.DOCUMENT_NODE&&s.nodeType!=Node.DOCUMENT_FRAGMENT_NODE){s=document}return s},findTarget:function(inEvent){if(HAS_FULL_PATH&&inEvent.path&&inEvent.path.length){return inEvent.path[0]}var x=inEvent.clientX,y=inEvent.clientY;var s=this.owner(inEvent.target);if(!s.elementFromPoint(x,y)){s=document}return this.searchRoot(s,x,y)},findTouchAction:function(inEvent){var n;if(HAS_FULL_PATH&&inEvent.path&&inEvent.path.length){var path=inEvent.path;for(var i=0;i<path.length;i++){n=path[i];if(n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute("touch-action")){return n.getAttribute("touch-action")}}}else{n=inEvent.target;while(n){if(n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute("touch-action")){return n.getAttribute("touch-action")}n=n.parentNode||n.host}}return"auto"},LCA:function(a,b){if(a===b){return a}if(a&&!b){return a}if(b&&!a){return b}if(!b&&!a){return document}if(a.contains&&a.contains(b)){return a}if(b.contains&&b.contains(a)){return b}var adepth=this.depth(a);var bdepth=this.depth(b);var d=adepth-bdepth;if(d>=0){a=this.walk(a,d)}else{b=this.walk(b,-d)}while(a&&b&&a!==b){a=a.parentNode||a.host;b=b.parentNode||b.host}return a},walk:function(n,u){for(var i=0;n&&i<u;i++){n=n.parentNode||n.host}return n},depth:function(n){var d=0;while(n){d++;n=n.parentNode||n.host}return d},deepContains:function(a,b){var common=this.LCA(a,b);return common===a},insideNode:function(node,x,y){var rect=node.getBoundingClientRect();return rect.left<=x&&x<=rect.right&&rect.top<=y&&y<=rect.bottom},path:function(event){var p;if(HAS_FULL_PATH&&event.path&&event.path.length){p=event.path}else{p=[];var n=this.findTarget(event);while(n){p.push(n);n=n.parentNode||n.host}}return p}};scope.targetFinding=target;scope.findTarget=target.findTarget.bind(target);scope.deepContains=target.deepContains.bind(target);scope.insideNode=target.insideNode})(window.PolymerGestures);(function(){function shadowSelector(v){return"html /deep/ "+selector(v)}function selector(v){return'[touch-action="'+v+'"]'}function rule(v){return"{ -ms-touch-action: "+v+"; touch-action: "+v+";}"}var attrib2css=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]},"manipulation"];var styles="";var hasTouchAction=typeof document.head.style.touchAction==="string";var hasShadowRoot=!window.ShadowDOMPolyfill&&document.head.createShadowRoot;if(hasTouchAction){attrib2css.forEach(function(r){if(String(r)===r){styles+=selector(r)+rule(r)+"\n";if(hasShadowRoot){styles+=shadowSelector(r)+rule(r)+"\n"}}else{styles+=r.selectors.map(selector)+rule(r.rule)+"\n";if(hasShadowRoot){styles+=r.selectors.map(shadowSelector)+rule(r.rule)+"\n"}}});var el=document.createElement("style");el.textContent=styles;document.head.appendChild(el)}})();(function(scope){var MOUSE_PROPS=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"];var MOUSE_DEFAULTS=[false,false,null,null,0,0,0,0,false,false,false,false,0,null,0,0];var NOP_FACTORY=function(){return function(){}};var eventFactory={preventTap:NOP_FACTORY,makeBaseEvent:function(inType,inDict){var e=document.createEvent("Event");e.initEvent(inType,inDict.bubbles||false,inDict.cancelable||false);e.preventTap=eventFactory.preventTap(e);return e},makeGestureEvent:function(inType,inDict){inDict=inDict||Object.create(null);var e=this.makeBaseEvent(inType,inDict);for(var i=0,keys=Object.keys(inDict),k;i<keys.length;i++){k=keys[i];e[k]=inDict[k]}return e},makePointerEvent:function(inType,inDict){inDict=inDict||Object.create(null);var e=this.makeBaseEvent(inType,inDict);for(var i=0,p;i<MOUSE_PROPS.length;i++){p=MOUSE_PROPS[i];e[p]=inDict[p]||MOUSE_DEFAULTS[i]}e.buttons=inDict.buttons||0;var pressure=0;if(inDict.pressure){pressure=inDict.pressure}else{pressure=e.buttons?.5:0}e.x=e.clientX;e.y=e.clientY;e.pointerId=inDict.pointerId||0;e.width=inDict.width||0;e.height=inDict.height||0;e.pressure=pressure;e.tiltX=inDict.tiltX||0;e.tiltY=inDict.tiltY||0;e.pointerType=inDict.pointerType||"";e.hwTimestamp=inDict.hwTimestamp||0;e.isPrimary=inDict.isPrimary||false;e._source=inDict._source||"";return e}};scope.eventFactory=eventFactory})(window.PolymerGestures);(function(scope){var USE_MAP=window.Map&&window.Map.prototype.forEach;var POINTERS_FN=function(){return this.size};function PointerMap(){if(USE_MAP){var m=new Map;m.pointers=POINTERS_FN;return m}else{this.keys=[];this.values=[]}}PointerMap.prototype={set:function(inId,inEvent){var i=this.keys.indexOf(inId);if(i>-1){this.values[i]=inEvent}else{this.keys.push(inId);this.values.push(inEvent)}},has:function(inId){return this.keys.indexOf(inId)>-1},"delete":function(inId){var i=this.keys.indexOf(inId);if(i>-1){this.keys.splice(i,1);this.values.splice(i,1)}},get:function(inId){var i=this.keys.indexOf(inId);return this.values[i]},clear:function(){this.keys.length=0;this.values.length=0},forEach:function(callback,thisArg){this.values.forEach(function(v,i){callback.call(thisArg,v,this.keys[i],this)},this)},pointers:function(){return this.keys.length}};scope.PointerMap=PointerMap})(window.PolymerGestures);(function(scope){var CLONE_PROPS=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp","preventTap","tapPrevented","_source"];var CLONE_DEFAULTS=[false,false,null,null,0,0,0,0,false,false,false,false,0,null,0,0,0,0,0,0,0,"",0,false,"",null,null,0,0,0,0,function(){},false];var HAS_SVG_INSTANCE=typeof SVGElementInstance!=="undefined";var eventFactory=scope.eventFactory;var currentGestures;var dispatcher={IS_IOS:false,pointermap:new scope.PointerMap,requiredGestures:new scope.PointerMap,eventMap:Object.create(null),eventSources:Object.create(null),eventSourceList:[],gestures:[],dependencyMap:{down:{listeners:0,index:-1},up:{listeners:0,index:-1}},gestureQueue:[],registerSource:function(name,source){var s=source;var newEvents=s.events;if(newEvents){newEvents.forEach(function(e){if(s[e]){this.eventMap[e]=s[e].bind(s)}},this);this.eventSources[name]=s;this.eventSourceList.push(s)}},registerGesture:function(name,source){var obj=Object.create(null);obj.listeners=0;obj.index=this.gestures.length;for(var i=0,g;i<source.exposes.length;i++){g=source.exposes[i].toLowerCase();this.dependencyMap[g]=obj}this.gestures.push(source)},register:function(element,initial){var l=this.eventSourceList.length;for(var i=0,es;i<l&&(es=this.eventSourceList[i]);i++){es.register.call(es,element,initial)}},unregister:function(element){var l=this.eventSourceList.length;for(var i=0,es;i<l&&(es=this.eventSourceList[i]);i++){es.unregister.call(es,element)}},down:function(inEvent){this.requiredGestures.set(inEvent.pointerId,currentGestures);this.fireEvent("down",inEvent)},move:function(inEvent){inEvent.type="move";this.fillGestureQueue(inEvent)},up:function(inEvent){this.fireEvent("up",inEvent);this.requiredGestures.delete(inEvent.pointerId)},cancel:function(inEvent){inEvent.tapPrevented=true;this.fireEvent("up",inEvent);this.requiredGestures.delete(inEvent.pointerId)},addGestureDependency:function(node,currentGestures){var gesturesWanted=node._pgEvents;if(gesturesWanted&¤tGestures){var gk=Object.keys(gesturesWanted);for(var i=0,r,ri,g;i<gk.length;i++){g=gk[i];if(gesturesWanted[g]>0){r=this.dependencyMap[g];ri=r?r.index:-1;currentGestures[ri]=true}}}},eventHandler:function(inEvent){var type=inEvent.type;if(type==="touchstart"||type==="mousedown"||type==="pointerdown"||type==="MSPointerDown"){if(!inEvent._handledByPG){currentGestures={}}if(this.IS_IOS){var ev=inEvent;if(type==="touchstart"){var ct=inEvent.changedTouches[0];ev={target:inEvent.target,clientX:ct.clientX,clientY:ct.clientY,path:inEvent.path}}var nodes=inEvent.path||scope.targetFinding.path(ev);for(var i=0,n;i<nodes.length;i++){n=nodes[i];this.addGestureDependency(n,currentGestures)}}else{this.addGestureDependency(inEvent.currentTarget,currentGestures)}}if(inEvent._handledByPG){return}var fn=this.eventMap&&this.eventMap[type];if(fn){fn(inEvent)}inEvent._handledByPG=true},listen:function(target,events){for(var i=0,l=events.length,e;i<l&&(e=events[i]);i++){this.addEvent(target,e)}},unlisten:function(target,events){for(var i=0,l=events.length,e;i<l&&(e=events[i]);i++){this.removeEvent(target,e)}},addEvent:function(target,eventName){target.addEventListener(eventName,this.boundHandler)},removeEvent:function(target,eventName){target.removeEventListener(eventName,this.boundHandler)},makeEvent:function(inType,inEvent){var e=eventFactory.makePointerEvent(inType,inEvent);e.preventDefault=inEvent.preventDefault;e.tapPrevented=inEvent.tapPrevented;e._target=e._target||inEvent.target;return e},fireEvent:function(inType,inEvent){var e=this.makeEvent(inType,inEvent);return this.dispatchEvent(e)},cloneEvent:function(inEvent){var eventCopy=Object.create(null),p;for(var i=0;i<CLONE_PROPS.length;i++){p=CLONE_PROPS[i];eventCopy[p]=inEvent[p]||CLONE_DEFAULTS[i];if(p==="target"||p==="relatedTarget"){if(HAS_SVG_INSTANCE&&eventCopy[p]instanceof SVGElementInstance){eventCopy[p]=eventCopy[p].correspondingUseElement}}}eventCopy.preventDefault=function(){inEvent.preventDefault()};return eventCopy},dispatchEvent:function(inEvent){var t=inEvent._target;if(t){t.dispatchEvent(inEvent);var clone=this.cloneEvent(inEvent);clone.target=t;this.fillGestureQueue(clone)}},gestureTrigger:function(){for(var i=0,e,rg;i<this.gestureQueue.length;i++){e=this.gestureQueue[i];rg=e._requiredGestures;if(rg){for(var j=0,g,fn;j<this.gestures.length;j++){if(rg[j]){g=this.gestures[j];fn=g[e.type];if(fn){fn.call(g,e)}}}}}this.gestureQueue.length=0},fillGestureQueue:function(ev){if(!this.gestureQueue.length){requestAnimationFrame(this.boundGestureTrigger)}ev._requiredGestures=this.requiredGestures.get(ev.pointerId);this.gestureQueue.push(ev)}};dispatcher.boundHandler=dispatcher.eventHandler.bind(dispatcher);dispatcher.boundGestureTrigger=dispatcher.gestureTrigger.bind(dispatcher);scope.dispatcher=dispatcher;scope.activateGesture=function(node,gesture){var g=gesture.toLowerCase();var dep=dispatcher.dependencyMap[g];if(dep){var recognizer=dispatcher.gestures[dep.index];if(!node._pgListeners){dispatcher.register(node);node._pgListeners=0}if(recognizer){var touchAction=recognizer.defaultActions&&recognizer.defaultActions[g];var actionNode;switch(node.nodeType){case Node.ELEMENT_NODE:actionNode=node;break;case Node.DOCUMENT_FRAGMENT_NODE:actionNode=node.host;break;default:actionNode=null;break}if(touchAction&&actionNode&&!actionNode.hasAttribute("touch-action")){actionNode.setAttribute("touch-action",touchAction)}}if(!node._pgEvents){node._pgEvents={}}node._pgEvents[g]=(node._pgEvents[g]||0)+1;node._pgListeners++}return Boolean(dep)};scope.addEventListener=function(node,gesture,handler,capture){if(handler){scope.activateGesture(node,gesture);node.addEventListener(gesture,handler,capture)}};scope.deactivateGesture=function(node,gesture){var g=gesture.toLowerCase();var dep=dispatcher.dependencyMap[g];if(dep){if(node._pgListeners>0){node._pgListeners--}if(node._pgListeners===0){dispatcher.unregister(node)}if(node._pgEvents){if(node._pgEvents[g]>0){node._pgEvents[g]--}else{node._pgEvents[g]=0}}}return Boolean(dep)};scope.removeEventListener=function(node,gesture,handler,capture){if(handler){scope.deactivateGesture(node,gesture);node.removeEventListener(gesture,handler,capture)}}})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var pointermap=dispatcher.pointermap;var DEDUP_DIST=25;var WHICH_TO_BUTTONS=[0,1,4,2];var CURRENT_BUTTONS=0;var FIREFOX_LINUX=/Linux.*Firefox\//i;var HAS_BUTTONS=function(){if(FIREFOX_LINUX.test(navigator.userAgent)){return false}try{return new MouseEvent("test",{buttons:1}).buttons===1}catch(e){return false}}();var mouseEvents={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup"],exposes:["down","up","move"],register:function(target){dispatcher.listen(target,this.events)},unregister:function(target){if(target===document){return}dispatcher.unlisten(target,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(inEvent){var lts=this.lastTouches;var x=inEvent.clientX,y=inEvent.clientY;for(var i=0,l=lts.length,t;i<l&&(t=lts[i]);i++){var dx=Math.abs(x-t.x),dy=Math.abs(y-t.y);if(dx<=DEDUP_DIST&&dy<=DEDUP_DIST){return true}}},prepareEvent:function(inEvent){var e=dispatcher.cloneEvent(inEvent);e.pointerId=this.POINTER_ID;e.isPrimary=true;e.pointerType=this.POINTER_TYPE;e._source="mouse";if(!HAS_BUTTONS){var type=inEvent.type;var bit=WHICH_TO_BUTTONS[inEvent.which]||0;if(type==="mousedown"){CURRENT_BUTTONS|=bit}else if(type==="mouseup"){CURRENT_BUTTONS&=~bit}e.buttons=CURRENT_BUTTONS}return e},mousedown:function(inEvent){if(!this.isEventSimulatedFromTouch(inEvent)){var p=pointermap.has(this.POINTER_ID);var e=this.prepareEvent(inEvent);e.target=scope.findTarget(inEvent);pointermap.set(this.POINTER_ID,e.target);dispatcher.down(e)}},mousemove:function(inEvent){if(!this.isEventSimulatedFromTouch(inEvent)){var target=pointermap.get(this.POINTER_ID);if(target){var e=this.prepareEvent(inEvent);e.target=target;if((HAS_BUTTONS?e.buttons:e.which)===0){if(!HAS_BUTTONS){CURRENT_BUTTONS=e.buttons=0}dispatcher.cancel(e);this.cleanupMouse(e.buttons)}else{dispatcher.move(e)}}}},mouseup:function(inEvent){if(!this.isEventSimulatedFromTouch(inEvent)){var e=this.prepareEvent(inEvent);e.relatedTarget=scope.findTarget(inEvent);e.target=pointermap.get(this.POINTER_ID);dispatcher.up(e);this.cleanupMouse(e.buttons)}},cleanupMouse:function(buttons){if(buttons===0){pointermap.delete(this.POINTER_ID)}}};scope.mouseEvents=mouseEvents})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var allShadows=scope.targetFinding.allShadows.bind(scope.targetFinding);var pointermap=dispatcher.pointermap;var touchMap=Array.prototype.map.call.bind(Array.prototype.map);var DEDUP_TIMEOUT=2500;var DEDUP_DIST=25;var CLICK_COUNT_TIMEOUT=200;var HYSTERESIS=20;var ATTRIB="touch-action";var HAS_TOUCH_ACTION=false;var touchEvents={IS_IOS:false,events:["touchstart","touchmove","touchend","touchcancel"],exposes:["down","up","move"],register:function(target,initial){if(this.IS_IOS?initial:!initial){dispatcher.listen(target,this.events)}},unregister:function(target){if(!this.IS_IOS){dispatcher.unlisten(target,this.events)}},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y"},touchActionToScrollType:function(touchAction){var t=touchAction;var st=this.scrollTypes;if(t===st.EMITTER){return"none"}else if(t===st.XSCROLLER){return"X"}else if(t===st.YSCROLLER){return"Y"}else{return"XY"}},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(inTouch){return this.firstTouch===inTouch.identifier},setPrimaryTouch:function(inTouch){if(pointermap.pointers()===0||pointermap.pointers()===1&&pointermap.has(1)){this.firstTouch=inTouch.identifier;this.firstXY={X:inTouch.clientX,Y:inTouch.clientY};this.firstTarget=inTouch.target;this.scrolling=null;this.cancelResetClickCount()}},removePrimaryPointer:function(inPointer){if(inPointer.isPrimary){this.firstTouch=null;this.firstXY=null;this.resetClickCount()}},clickCount:0,resetId:null,resetClickCount:function(){var fn=function(){this.clickCount=0;this.resetId=null}.bind(this);this.resetId=setTimeout(fn,CLICK_COUNT_TIMEOUT)},cancelResetClickCount:function(){if(this.resetId){clearTimeout(this.resetId)}},typeToButtons:function(type){var ret=0;if(type==="touchstart"||type==="touchmove"){ret=1}return ret},findTarget:function(touch,id){if(this.currentTouchEvent.type==="touchstart"){if(this.isPrimaryTouch(touch)){var fastPath={clientX:touch.clientX,clientY:touch.clientY,path:this.currentTouchEvent.path,target:this.currentTouchEvent.target};return scope.findTarget(fastPath)}else{return scope.findTarget(touch)}}return pointermap.get(id)},touchToPointer:function(inTouch){var cte=this.currentTouchEvent;var e=dispatcher.cloneEvent(inTouch);var id=e.pointerId=inTouch.identifier+2;e.target=this.findTarget(inTouch,id);e.bubbles=true;e.cancelable=true;e.detail=this.clickCount;e.buttons=this.typeToButtons(cte.type);e.width=inTouch.webkitRadiusX||inTouch.radiusX||0;e.height=inTouch.webkitRadiusY||inTouch.radiusY||0;e.pressure=inTouch.webkitForce||inTouch.force||.5;e.isPrimary=this.isPrimaryTouch(inTouch);e.pointerType=this.POINTER_TYPE;e._source="touch";var self=this;e.preventDefault=function(){self.scrolling=false;self.firstXY=null;cte.preventDefault()};return e},processTouches:function(inEvent,inFunction){var tl=inEvent.changedTouches;this.currentTouchEvent=inEvent;for(var i=0,t,p;i<tl.length;i++){t=tl[i];p=this.touchToPointer(t);if(inEvent.type==="touchstart"){pointermap.set(p.pointerId,p.target)}if(pointermap.has(p.pointerId)){inFunction.call(this,p)}if(inEvent.type==="touchend"||inEvent._cancel){this.cleanUpPointer(p)}}},shouldScroll:function(inEvent){if(this.firstXY){var ret;var touchAction=scope.targetFinding.findTouchAction(inEvent);var scrollAxis=this.touchActionToScrollType(touchAction);if(scrollAxis==="none"){ret=false}else if(scrollAxis==="XY"){ret=true}else{var t=inEvent.changedTouches[0];var a=scrollAxis;var oa=scrollAxis==="Y"?"X":"Y";var da=Math.abs(t["client"+a]-this.firstXY[a]);var doa=Math.abs(t["client"+oa]-this.firstXY[oa]);ret=da>=doa}return ret}},findTouch:function(inTL,inId){for(var i=0,l=inTL.length,t;i<l&&(t=inTL[i]);i++){if(t.identifier===inId){return true}}},vacuumTouches:function(inEvent){var tl=inEvent.touches;if(pointermap.pointers()>=tl.length){var d=[];pointermap.forEach(function(value,key){if(key!==1&&!this.findTouch(tl,key-2)){var p=value;d.push(p)}},this);d.forEach(function(p){this.cancel(p);pointermap.delete(p.pointerId)},this)}},touchstart:function(inEvent){this.vacuumTouches(inEvent);this.setPrimaryTouch(inEvent.changedTouches[0]);this.dedupSynthMouse(inEvent);if(!this.scrolling){this.clickCount++;this.processTouches(inEvent,this.down)}},down:function(inPointer){dispatcher.down(inPointer)},touchmove:function(inEvent){if(HAS_TOUCH_ACTION){if(inEvent.cancelable){this.processTouches(inEvent,this.move)}}else{if(!this.scrolling){if(this.scrolling===null&&this.shouldScroll(inEvent)){this.scrolling=true}else{this.scrolling=false;inEvent.preventDefault();this.processTouches(inEvent,this.move)}}else if(this.firstXY){var t=inEvent.changedTouches[0];var dx=t.clientX-this.firstXY.X;var dy=t.clientY-this.firstXY.Y;var dd=Math.sqrt(dx*dx+dy*dy);if(dd>=HYSTERESIS){this.touchcancel(inEvent);this.scrolling=true;this.firstXY=null}}}},move:function(inPointer){dispatcher.move(inPointer)},touchend:function(inEvent){this.dedupSynthMouse(inEvent);this.processTouches(inEvent,this.up)},up:function(inPointer){inPointer.relatedTarget=scope.findTarget(inPointer);dispatcher.up(inPointer)},cancel:function(inPointer){dispatcher.cancel(inPointer)},touchcancel:function(inEvent){inEvent._cancel=true;this.processTouches(inEvent,this.cancel)},cleanUpPointer:function(inPointer){pointermap["delete"](inPointer.pointerId);this.removePrimaryPointer(inPointer)},dedupSynthMouse:function(inEvent){var lts=scope.mouseEvents.lastTouches;var t=inEvent.changedTouches[0];if(this.isPrimaryTouch(t)){var lt={x:t.clientX,y:t.clientY};lts.push(lt);var fn=function(lts,lt){var i=lts.indexOf(lt);if(i>-1){lts.splice(i,1)}}.bind(null,lts,lt);setTimeout(fn,DEDUP_TIMEOUT)}}};var STOP_PROP_FN=Event.prototype.stopImmediatePropagation||Event.prototype.stopPropagation;document.addEventListener("click",function(ev){var x=ev.clientX,y=ev.clientY;var closeTo=function(touch){var dx=Math.abs(x-touch.x),dy=Math.abs(y-touch.y);return dx<=DEDUP_DIST&&dy<=DEDUP_DIST};var wasTouched=scope.mouseEvents.lastTouches.some(closeTo);var path=scope.targetFinding.path(ev);if(wasTouched){for(var i=0;i<path.length;i++){if(path[i]===touchEvents.firstTarget){return}}ev.preventDefault();STOP_PROP_FN.call(ev)}},true);scope.touchEvents=touchEvents})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var pointermap=dispatcher.pointermap;var HAS_BITMAP_TYPE=window.MSPointerEvent&&typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE==="number";var msEvents={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerCancel"],register:function(target){dispatcher.listen(target,this.events)},unregister:function(target){if(target===document){return}dispatcher.unlisten(target,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(inEvent){var e=inEvent;e=dispatcher.cloneEvent(inEvent);if(HAS_BITMAP_TYPE){e.pointerType=this.POINTER_TYPES[inEvent.pointerType]}e._source="ms";return e},cleanup:function(id){pointermap["delete"](id)},MSPointerDown:function(inEvent){var e=this.prepareEvent(inEvent);e.target=scope.findTarget(inEvent);pointermap.set(inEvent.pointerId,e.target);dispatcher.down(e)},MSPointerMove:function(inEvent){var target=pointermap.get(inEvent.pointerId);if(target){var e=this.prepareEvent(inEvent);e.target=target;dispatcher.move(e)}},MSPointerUp:function(inEvent){var e=this.prepareEvent(inEvent);e.relatedTarget=scope.findTarget(inEvent);e.target=pointermap.get(e.pointerId);dispatcher.up(e);this.cleanup(inEvent.pointerId)},MSPointerCancel:function(inEvent){var e=this.prepareEvent(inEvent);e.relatedTarget=scope.findTarget(inEvent);e.target=pointermap.get(e.pointerId);dispatcher.cancel(e);this.cleanup(inEvent.pointerId)}};scope.msEvents=msEvents})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var pointermap=dispatcher.pointermap;var pointerEvents={events:["pointerdown","pointermove","pointerup","pointercancel"],prepareEvent:function(inEvent){var e=dispatcher.cloneEvent(inEvent);e._source="pointer";return e},register:function(target){dispatcher.listen(target,this.events)},unregister:function(target){if(target===document){return}dispatcher.unlisten(target,this.events)},cleanup:function(id){pointermap["delete"](id)},pointerdown:function(inEvent){var e=this.prepareEvent(inEvent);e.target=scope.findTarget(inEvent);pointermap.set(e.pointerId,e.target);dispatcher.down(e)},pointermove:function(inEvent){var target=pointermap.get(inEvent.pointerId);if(target){var e=this.prepareEvent(inEvent);e.target=target;dispatcher.move(e)}},pointerup:function(inEvent){var e=this.prepareEvent(inEvent);e.relatedTarget=scope.findTarget(inEvent);e.target=pointermap.get(e.pointerId);dispatcher.up(e);this.cleanup(inEvent.pointerId)},pointercancel:function(inEvent){var e=this.prepareEvent(inEvent);e.relatedTarget=scope.findTarget(inEvent);e.target=pointermap.get(e.pointerId);dispatcher.cancel(e);this.cleanup(inEvent.pointerId)}};scope.pointerEvents=pointerEvents})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var nav=window.navigator;if(window.PointerEvent){dispatcher.registerSource("pointer",scope.pointerEvents)}else if(nav.msPointerEnabled){dispatcher.registerSource("ms",scope.msEvents)}else{dispatcher.registerSource("mouse",scope.mouseEvents);if(window.ontouchstart!==undefined){dispatcher.registerSource("touch",scope.touchEvents)}}var ua=navigator.userAgent;var IS_IOS=ua.match(/iPad|iPhone|iPod/)&&"ontouchstart"in window;dispatcher.IS_IOS=IS_IOS;scope.touchEvents.IS_IOS=IS_IOS;dispatcher.register(document,true)})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var eventFactory=scope.eventFactory;var pointermap=new scope.PointerMap;var track={events:["down","move","up"],exposes:["trackstart","track","trackx","tracky","trackend"],defaultActions:{track:"none",trackx:"pan-y",tracky:"pan-x"},WIGGLE_THRESHOLD:4,clampDir:function(inDelta){return inDelta>0?1:-1},calcPositionDelta:function(inA,inB){var x=0,y=0;if(inA&&inB){x=inB.pageX-inA.pageX;y=inB.pageY-inA.pageY}return{x:x,y:y}},fireTrack:function(inType,inEvent,inTrackingData){var t=inTrackingData;var d=this.calcPositionDelta(t.downEvent,inEvent);var dd=this.calcPositionDelta(t.lastMoveEvent,inEvent);if(dd.x){t.xDirection=this.clampDir(dd.x)}else if(inType==="trackx"){return}if(dd.y){t.yDirection=this.clampDir(dd.y)}else if(inType==="tracky"){return}var gestureProto={bubbles:true,cancelable:true,trackInfo:t.trackInfo,relatedTarget:inEvent.relatedTarget,pointerType:inEvent.pointerType,pointerId:inEvent.pointerId,_source:"track"};if(inType!=="tracky"){gestureProto.x=inEvent.x;gestureProto.dx=d.x;gestureProto.ddx=dd.x;gestureProto.clientX=inEvent.clientX;gestureProto.pageX=inEvent.pageX;gestureProto.screenX=inEvent.screenX;gestureProto.xDirection=t.xDirection}if(inType!=="trackx"){gestureProto.dy=d.y;gestureProto.ddy=dd.y;gestureProto.y=inEvent.y;gestureProto.clientY=inEvent.clientY;gestureProto.pageY=inEvent.pageY;gestureProto.screenY=inEvent.screenY;gestureProto.yDirection=t.yDirection}var e=eventFactory.makeGestureEvent(inType,gestureProto);t.downTarget.dispatchEvent(e)},down:function(inEvent){if(inEvent.isPrimary&&(inEvent.pointerType==="mouse"?inEvent.buttons===1:true)){var p={downEvent:inEvent,downTarget:inEvent.target,trackInfo:{},lastMoveEvent:null,xDirection:0,yDirection:0,tracking:false};pointermap.set(inEvent.pointerId,p)}},move:function(inEvent){var p=pointermap.get(inEvent.pointerId);if(p){if(!p.tracking){var d=this.calcPositionDelta(p.downEvent,inEvent);var move=d.x*d.x+d.y*d.y;if(move>this.WIGGLE_THRESHOLD){p.tracking=true;p.lastMoveEvent=p.downEvent;this.fireTrack("trackstart",inEvent,p)}}if(p.tracking){this.fireTrack("track",inEvent,p);this.fireTrack("trackx",inEvent,p);this.fireTrack("tracky",inEvent,p)}p.lastMoveEvent=inEvent}},up:function(inEvent){var p=pointermap.get(inEvent.pointerId);if(p){if(p.tracking){this.fireTrack("trackend",inEvent,p)}pointermap.delete(inEvent.pointerId)}}};dispatcher.registerGesture("track",track)})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var eventFactory=scope.eventFactory;var hold={HOLD_DELAY:200,WIGGLE_THRESHOLD:16,events:["down","move","up"],exposes:["hold","holdpulse","release"],heldPointer:null,holdJob:null,pulse:function(){var hold=Date.now()-this.heldPointer.timeStamp;var type=this.held?"holdpulse":"hold";this.fireHold(type,hold);this.held=true},cancel:function(){clearInterval(this.holdJob);if(this.held){this.fireHold("release")}this.held=false;this.heldPointer=null;this.target=null;this.holdJob=null},down:function(inEvent){if(inEvent.isPrimary&&!this.heldPointer){this.heldPointer=inEvent;this.target=inEvent.target;this.holdJob=setInterval(this.pulse.bind(this),this.HOLD_DELAY)}},up:function(inEvent){if(this.heldPointer&&this.heldPointer.pointerId===inEvent.pointerId){this.cancel()}},move:function(inEvent){if(this.heldPointer&&this.heldPointer.pointerId===inEvent.pointerId){var x=inEvent.clientX-this.heldPointer.clientX;var y=inEvent.clientY-this.heldPointer.clientY;if(x*x+y*y>this.WIGGLE_THRESHOLD){this.cancel()}}},fireHold:function(inType,inHoldTime){var p={bubbles:true,cancelable:true,pointerType:this.heldPointer.pointerType,pointerId:this.heldPointer.pointerId,x:this.heldPointer.clientX,y:this.heldPointer.clientY,_source:"hold"};if(inHoldTime){p.holdTime=inHoldTime}var e=eventFactory.makeGestureEvent(inType,p);this.target.dispatchEvent(e)}};dispatcher.registerGesture("hold",hold)})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var eventFactory=scope.eventFactory;var pointermap=new scope.PointerMap;var tap={events:["down","up"],exposes:["tap"],down:function(inEvent){if(inEvent.isPrimary&&!inEvent.tapPrevented){pointermap.set(inEvent.pointerId,{target:inEvent.target,buttons:inEvent.buttons,x:inEvent.clientX,y:inEvent.clientY})}},shouldTap:function(e,downState){var tap=true;if(e.pointerType==="mouse"){tap=e.buttons^1&&downState.buttons&1}return tap&&!e.tapPrevented},up:function(inEvent){var start=pointermap.get(inEvent.pointerId);if(start&&this.shouldTap(inEvent,start)){var t=scope.targetFinding.LCA(start.target,inEvent.relatedTarget);if(t){var e=eventFactory.makeGestureEvent("tap",{bubbles:true,cancelable:true,x:inEvent.clientX,y:inEvent.clientY,detail:inEvent.detail,pointerType:inEvent.pointerType,pointerId:inEvent.pointerId,altKey:inEvent.altKey,ctrlKey:inEvent.ctrlKey,metaKey:inEvent.metaKey,shiftKey:inEvent.shiftKey,_source:"tap"});t.dispatchEvent(e)}}pointermap.delete(inEvent.pointerId)}};eventFactory.preventTap=function(e){return function(){e.tapPrevented=true;pointermap.delete(e.pointerId)}};dispatcher.registerGesture("tap",tap)})(window.PolymerGestures);(function(scope){var dispatcher=scope.dispatcher;var eventFactory=scope.eventFactory;var pointermap=new scope.PointerMap;var RAD_TO_DEG=180/Math.PI;var pinch={events:["down","up","move","cancel"],exposes:["pinchstart","pinch","pinchend","rotate"],defaultActions:{pinch:"none",rotate:"none"},reference:{},down:function(inEvent){pointermap.set(inEvent.pointerId,inEvent);if(pointermap.pointers()==2){var points=this.calcChord();var angle=this.calcAngle(points);this.reference={angle:angle,diameter:points.diameter,target:scope.targetFinding.LCA(points.a.target,points.b.target)};this.firePinch("pinchstart",points.diameter,points)}},up:function(inEvent){var p=pointermap.get(inEvent.pointerId);var num=pointermap.pointers();if(p){if(num===2){var points=this.calcChord();this.firePinch("pinchend",points.diameter,points)}pointermap.delete(inEvent.pointerId)}},move:function(inEvent){if(pointermap.has(inEvent.pointerId)){pointermap.set(inEvent.pointerId,inEvent);if(pointermap.pointers()>1){this.calcPinchRotate()}}},cancel:function(inEvent){this.up(inEvent)},firePinch:function(type,diameter,points){var zoom=diameter/this.reference.diameter;var e=eventFactory.makeGestureEvent(type,{bubbles:true,cancelable:true,scale:zoom,centerX:points.center.x,centerY:points.center.y,_source:"pinch"});this.reference.target.dispatchEvent(e)},fireRotate:function(angle,points){var diff=Math.round((angle-this.reference.angle)%360);var e=eventFactory.makeGestureEvent("rotate",{bubbles:true,cancelable:true,angle:diff,centerX:points.center.x,centerY:points.center.y,_source:"pinch"});this.reference.target.dispatchEvent(e)},calcPinchRotate:function(){var points=this.calcChord();var diameter=points.diameter;var angle=this.calcAngle(points);if(diameter!=this.reference.diameter){this.firePinch("pinch",diameter,points)}if(angle!=this.reference.angle){this.fireRotate(angle,points)}},calcChord:function(){var pointers=[];pointermap.forEach(function(p){pointers.push(p)});var dist=0;var points={a:pointers[0],b:pointers[1]};var x,y,d;for(var i=0;i<pointers.length;i++){var a=pointers[i];for(var j=i+1;j<pointers.length;j++){var b=pointers[j];x=Math.abs(a.clientX-b.clientX);y=Math.abs(a.clientY-b.clientY);
|
6
|
+
d=x+y;if(d>dist){dist=d;points={a:a,b:b}}}}x=Math.abs(points.a.clientX+points.b.clientX)/2;y=Math.abs(points.a.clientY+points.b.clientY)/2;points.center={x:x,y:y};points.diameter=dist;return points},calcAngle:function(points){var x=points.a.clientX-points.b.clientX;var y=points.a.clientY-points.b.clientY;return(360+Math.atan2(y,x)*RAD_TO_DEG)%360}};dispatcher.registerGesture("pinch",pinch)})(window.PolymerGestures);(function(global){"use strict";var Token,TokenName,Syntax,Messages,source,index,length,delegate,lookahead,state;Token={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8};TokenName={};TokenName[Token.BooleanLiteral]="Boolean";TokenName[Token.EOF]="<end>";TokenName[Token.Identifier]="Identifier";TokenName[Token.Keyword]="Keyword";TokenName[Token.NullLiteral]="Null";TokenName[Token.NumericLiteral]="Numeric";TokenName[Token.Punctuator]="Punctuator";TokenName[Token.StringLiteral]="String";Syntax={ArrayExpression:"ArrayExpression",BinaryExpression:"BinaryExpression",CallExpression:"CallExpression",ConditionalExpression:"ConditionalExpression",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",Identifier:"Identifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ThisExpression:"ThisExpression",UnaryExpression:"UnaryExpression"};Messages={UnexpectedToken:"Unexpected token %0",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared"};function assert(condition,message){if(!condition){throw new Error("ASSERT: "+message)}}function isDecimalDigit(ch){return ch>=48&&ch<=57}function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&" ".indexOf(String.fromCharCode(ch))>0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122}function isIdentifierPart(ch){return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57}function isKeyword(id){return id==="this"}function skipWhitespace(){while(index<length&&isWhiteSpace(source.charCodeAt(index))){++index}}function getIdentifier(){var start,ch;start=index++;while(index<length){ch=source.charCodeAt(index);if(isIdentifierPart(ch)){++index}else{break}}return source.slice(start,index)}function scanIdentifier(){var start,id,type;start=index;id=getIdentifier();if(id.length===1){type=Token.Identifier}else if(isKeyword(id)){type=Token.Keyword}else if(id==="null"){type=Token.NullLiteral}else if(id==="true"||id==="false"){type=Token.BooleanLiteral}else{type=Token.Identifier}return{type:type,value:id,range:[start,index]}}function scanPunctuator(){var start=index,code=source.charCodeAt(index),code2,ch1=source[index],ch2;switch(code){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:++index;return{type:Token.Punctuator,value:String.fromCharCode(code),range:[start,index]};default:code2=source.charCodeAt(index+1);if(code2===61){switch(code){case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 124:index+=2;return{type:Token.Punctuator,value:String.fromCharCode(code)+String.fromCharCode(code2),range:[start,index]};case 33:case 61:index+=2;if(source.charCodeAt(index)===61){++index}return{type:Token.Punctuator,value:source.slice(start,index),range:[start,index]};default:break}}break}ch2=source[index+1];if(ch1===ch2&&"&|".indexOf(ch1)>=0){index+=2;return{type:Token.Punctuator,value:ch1+ch2,range:[start,index]}}if("<>=!+-*%&|^/".indexOf(ch1)>=0){++index;return{type:Token.Punctuator,value:ch1,range:[start,index]}}throwError({},Messages.UnexpectedToken,"ILLEGAL")}function scanNumericLiteral(){var number,start,ch;ch=source[index];assert(isDecimalDigit(ch.charCodeAt(0))||ch===".","Numeric literal must start with a decimal digit or a decimal point");start=index;number="";if(ch!=="."){number=source[index++];ch=source[index];if(number==="0"){if(ch&&isDecimalDigit(ch.charCodeAt(0))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}}while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="."){number+=source[index++];while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}ch=source[index]}if(ch==="e"||ch==="E"){number+=source[index++];ch=source[index];if(ch==="+"||ch==="-"){number+=source[index++]}if(isDecimalDigit(source.charCodeAt(index))){while(isDecimalDigit(source.charCodeAt(index))){number+=source[index++]}}else{throwError({},Messages.UnexpectedToken,"ILLEGAL")}}if(isIdentifierStart(source.charCodeAt(index))){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.NumericLiteral,value:parseFloat(number),range:[start,index]}}function scanStringLiteral(){var str="",quote,start,ch,octal=false;quote=source[index];assert(quote==="'"||quote==='"',"String literal must starts with a quote");start=index;++index;while(index<length){ch=source[index++];if(ch===quote){quote="";break}else if(ch==="\\"){ch=source[index++];if(!ch||!isLineTerminator(ch.charCodeAt(0))){switch(ch){case"n":str+="\n";break;case"r":str+="\r";break;case"t":str+=" ";break;case"b":str+="\b";break;case"f":str+="\f";break;case"v":str+="";break;default:str+=ch;break}}else{if(ch==="\r"&&source[index]==="\n"){++index}}}else if(isLineTerminator(ch.charCodeAt(0))){break}else{str+=ch}}if(quote!==""){throwError({},Messages.UnexpectedToken,"ILLEGAL")}return{type:Token.StringLiteral,value:str,octal:octal,range:[start,index]}}function isIdentifierName(token){return token.type===Token.Identifier||token.type===Token.Keyword||token.type===Token.BooleanLiteral||token.type===Token.NullLiteral}function advance(){var ch;skipWhitespace();if(index>=length){return{type:Token.EOF,range:[index,index]}}ch=source.charCodeAt(index);if(ch===40||ch===41||ch===58){return scanPunctuator()}if(ch===39||ch===34){return scanStringLiteral()}if(isIdentifierStart(ch)){return scanIdentifier()}if(ch===46){if(isDecimalDigit(source.charCodeAt(index+1))){return scanNumericLiteral()}return scanPunctuator()}if(isDecimalDigit(ch)){return scanNumericLiteral()}return scanPunctuator()}function lex(){var token;token=lookahead;index=token.range[1];lookahead=advance();index=token.range[1];return token}function peek(){var pos;pos=index;lookahead=advance();index=pos}function throwError(token,messageFormat){var error,args=Array.prototype.slice.call(arguments,2),msg=messageFormat.replace(/%(\d)/g,function(whole,index){assert(index<args.length,"Message reference must be in range");return args[index]});error=new Error(msg);error.index=index;error.description=msg;throw error}function throwUnexpected(token){throwError(token,Messages.UnexpectedToken,token.value)}function expect(value){var token=lex();if(token.type!==Token.Punctuator||token.value!==value){throwUnexpected(token)}}function match(value){return lookahead.type===Token.Punctuator&&lookahead.value===value}function matchKeyword(keyword){return lookahead.type===Token.Keyword&&lookahead.value===keyword}function consumeSemicolon(){if(source.charCodeAt(index)===59){lex();return}skipWhitespace();if(match(";")){lex();return}if(lookahead.type!==Token.EOF&&!match("}")){throwUnexpected(lookahead)}}function parseArrayInitialiser(){var elements=[];expect("[");while(!match("]")){if(match(",")){lex();elements.push(null)}else{elements.push(parseExpression());if(!match("]")){expect(",")}}}expect("]");return delegate.createArrayExpression(elements)}function parseObjectPropertyKey(){var token;skipWhitespace();token=lex();if(token.type===Token.StringLiteral||token.type===Token.NumericLiteral){return delegate.createLiteral(token)}return delegate.createIdentifier(token.value)}function parseObjectProperty(){var token,key;token=lookahead;skipWhitespace();if(token.type===Token.EOF||token.type===Token.Punctuator){throwUnexpected(token)}key=parseObjectPropertyKey();expect(":");return delegate.createProperty("init",key,parseExpression())}function parseObjectInitialiser(){var properties=[];expect("{");while(!match("}")){properties.push(parseObjectProperty());if(!match("}")){expect(",")}}expect("}");return delegate.createObjectExpression(properties)}function parseGroupExpression(){var expr;expect("(");expr=parseExpression();expect(")");return expr}function parsePrimaryExpression(){var type,token,expr;if(match("(")){return parseGroupExpression()}type=lookahead.type;if(type===Token.Identifier){expr=delegate.createIdentifier(lex().value)}else if(type===Token.StringLiteral||type===Token.NumericLiteral){expr=delegate.createLiteral(lex())}else if(type===Token.Keyword){if(matchKeyword("this")){lex();expr=delegate.createThisExpression()}}else if(type===Token.BooleanLiteral){token=lex();token.value=token.value==="true";expr=delegate.createLiteral(token)}else if(type===Token.NullLiteral){token=lex();token.value=null;expr=delegate.createLiteral(token)}else if(match("[")){expr=parseArrayInitialiser()}else if(match("{")){expr=parseObjectInitialiser()}if(expr){return expr}throwUnexpected(lex())}function parseArguments(){var args=[];expect("(");if(!match(")")){while(index<length){args.push(parseExpression());if(match(")")){break}expect(",")}}expect(")");return args}function parseNonComputedProperty(){var token;token=lex();if(!isIdentifierName(token)){throwUnexpected(token)}return delegate.createIdentifier(token.value)}function parseNonComputedMember(){expect(".");return parseNonComputedProperty()}function parseComputedMember(){var expr;expect("[");expr=parseExpression();expect("]");return expr}function parseLeftHandSideExpression(){var expr,args,property;expr=parsePrimaryExpression();while(true){if(match("[")){property=parseComputedMember();expr=delegate.createMemberExpression("[",expr,property)}else if(match(".")){property=parseNonComputedMember();expr=delegate.createMemberExpression(".",expr,property)}else if(match("(")){args=parseArguments();expr=delegate.createCallExpression(expr,args)}else{break}}return expr}var parsePostfixExpression=parseLeftHandSideExpression;function parseUnaryExpression(){var token,expr;if(lookahead.type!==Token.Punctuator&&lookahead.type!==Token.Keyword){expr=parsePostfixExpression()}else if(match("+")||match("-")||match("!")){token=lex();expr=parseUnaryExpression();expr=delegate.createUnaryExpression(token.value,expr)}else if(matchKeyword("delete")||matchKeyword("void")||matchKeyword("typeof")){throwError({},Messages.UnexpectedToken)}else{expr=parsePostfixExpression()}return expr}function binaryPrecedence(token){var prec=0;if(token.type!==Token.Punctuator&&token.type!==Token.Keyword){return 0}switch(token.value){case"||":prec=1;break;case"&&":prec=2;break;case"==":case"!=":case"===":case"!==":prec=6;break;case"<":case">":case"<=":case">=":case"instanceof":prec=7;break;case"in":prec=7;break;case"+":case"-":prec=9;break;case"*":case"/":case"%":prec=11;break;default:break}return prec}function parseBinaryExpression(){var expr,token,prec,stack,right,operator,left,i;left=parseUnaryExpression();token=lookahead;prec=binaryPrecedence(token);if(prec===0){return left}token.prec=prec;lex();right=parseUnaryExpression();stack=[left,token,right];while((prec=binaryPrecedence(lookahead))>0){while(stack.length>2&&prec<=stack[stack.length-2].prec){right=stack.pop();operator=stack.pop().value;left=stack.pop();expr=delegate.createBinaryExpression(operator,left,right);stack.push(expr)}token=lex();token.prec=prec;stack.push(token);expr=parseUnaryExpression();stack.push(expr)}i=stack.length-1;expr=stack[i];while(i>1){expr=delegate.createBinaryExpression(stack[i-1].value,stack[i-2],expr);i-=2}return expr}function parseConditionalExpression(){var expr,consequent,alternate;expr=parseBinaryExpression();if(match("?")){lex();consequent=parseConditionalExpression();expect(":");alternate=parseConditionalExpression();expr=delegate.createConditionalExpression(expr,consequent,alternate)}return expr}var parseExpression=parseConditionalExpression;function parseFilter(){var identifier,args;identifier=lex();if(identifier.type!==Token.Identifier){throwUnexpected(identifier)}args=match("(")?parseArguments():[];return delegate.createFilter(identifier.value,args)}function parseFilters(){while(match("|")){lex();parseFilter()}}function parseTopLevel(){skipWhitespace();peek();var expr=parseExpression();if(expr){if(lookahead.value===","||lookahead.value=="in"&&expr.type===Syntax.Identifier){parseInExpression(expr)}else{parseFilters();if(lookahead.value==="as"){parseAsExpression(expr)}else{delegate.createTopLevel(expr)}}}if(lookahead.type!==Token.EOF){throwUnexpected(lookahead)}}function parseAsExpression(expr){lex();var identifier=lex().value;delegate.createAsExpression(expr,identifier)}function parseInExpression(identifier){var indexName;if(lookahead.value===","){lex();if(lookahead.type!==Token.Identifier)throwUnexpected(lookahead);indexName=lex().value}lex();var expr=parseExpression();parseFilters();delegate.createInExpression(identifier.name,indexName,expr)}function parse(code,inDelegate){delegate=inDelegate;source=code;index=0;length=source.length;lookahead=null;state={labelSet:{}};return parseTopLevel()}global.esprima={parse:parse}})(this);(function(global){"use strict";function prepareBinding(expressionText,name,node,filterRegistry){var expression;try{expression=getExpression(expressionText);if(expression.scopeIdent&&(node.nodeType!==Node.ELEMENT_NODE||node.tagName!=="TEMPLATE"||name!=="bind"&&name!=="repeat")){throw Error("as and in can only be used within <template bind/repeat>")}}catch(ex){console.error("Invalid expression syntax: "+expressionText,ex);return}return function(model,node,oneTime){var binding=expression.getBinding(model,filterRegistry,oneTime);if(expression.scopeIdent&&binding){node.polymerExpressionScopeIdent_=expression.scopeIdent;if(expression.indexIdent)node.polymerExpressionIndexIdent_=expression.indexIdent}return binding}}var expressionParseCache=Object.create(null);function getExpression(expressionText){var expression=expressionParseCache[expressionText];if(!expression){var delegate=new ASTDelegate;esprima.parse(expressionText,delegate);expression=new Expression(delegate);expressionParseCache[expressionText]=expression}return expression}function Literal(value){this.value=value;this.valueFn_=undefined}Literal.prototype={valueFn:function(){if(!this.valueFn_){var value=this.value;this.valueFn_=function(){return value}}return this.valueFn_}};function IdentPath(name){this.name=name;this.path=Path.get(name)}IdentPath.prototype={valueFn:function(){if(!this.valueFn_){var name=this.name;var path=this.path;this.valueFn_=function(model,observer){if(observer)observer.addPath(model,path);return path.getValueFrom(model)}}return this.valueFn_},setValue:function(model,newValue){if(this.path.length==1)model=findScope(model,this.path[0]);return this.path.setValueFrom(model,newValue)}};function MemberExpression(object,property,accessor){this.computed=accessor=="[";this.dynamicDeps=typeof object=="function"||object.dynamicDeps||this.computed&&!(property instanceof Literal);this.simplePath=!this.dynamicDeps&&(property instanceof IdentPath||property instanceof Literal)&&(object instanceof MemberExpression||object instanceof IdentPath);this.object=this.simplePath?object:getFn(object);this.property=!this.computed||this.simplePath?property:getFn(property)}MemberExpression.prototype={get fullPath(){if(!this.fullPath_){var parts=this.object instanceof MemberExpression?this.object.fullPath.slice():[this.object.name];parts.push(this.property instanceof IdentPath?this.property.name:this.property.value);this.fullPath_=Path.get(parts)}return this.fullPath_},valueFn:function(){if(!this.valueFn_){var object=this.object;if(this.simplePath){var path=this.fullPath;this.valueFn_=function(model,observer){if(observer)observer.addPath(model,path);return path.getValueFrom(model)}}else if(!this.computed){var path=Path.get(this.property.name);this.valueFn_=function(model,observer,filterRegistry){var context=object(model,observer,filterRegistry);if(observer)observer.addPath(context,path);return path.getValueFrom(context)}}else{var property=this.property;this.valueFn_=function(model,observer,filterRegistry){var context=object(model,observer,filterRegistry);var propName=property(model,observer,filterRegistry);if(observer)observer.addPath(context,[propName]);return context?context[propName]:undefined}}}return this.valueFn_},setValue:function(model,newValue){if(this.simplePath){this.fullPath.setValueFrom(model,newValue);return newValue}var object=this.object(model);var propName=this.property instanceof IdentPath?this.property.name:this.property(model);return object[propName]=newValue}};function Filter(name,args){this.name=name;this.args=[];for(var i=0;i<args.length;i++){this.args[i]=getFn(args[i])}}Filter.prototype={transform:function(model,observer,filterRegistry,toModelDirection,initialArgs){var fn=filterRegistry[this.name];var context=model;if(fn){context=undefined}else{fn=context[this.name];if(!fn){console.error("Cannot find function or filter: "+this.name);return}}if(toModelDirection){fn=fn.toModel}else if(typeof fn.toDOM=="function"){fn=fn.toDOM}if(typeof fn!="function"){console.error("Cannot find function or filter: "+this.name);return}var args=initialArgs||[];for(var i=0;i<this.args.length;i++){args.push(getFn(this.args[i])(model,observer,filterRegistry))}return fn.apply(context,args)}};function notImplemented(){throw Error("Not Implemented")}var unaryOperators={"+":function(v){return+v},"-":function(v){return-v},"!":function(v){return!v}};var binaryOperators={"+":function(l,r){return l+r},"-":function(l,r){return l-r},"*":function(l,r){return l*r},"/":function(l,r){return l/r},"%":function(l,r){return l%r},"<":function(l,r){return l<r},">":function(l,r){return l>r},"<=":function(l,r){return l<=r},">=":function(l,r){return l>=r},"==":function(l,r){return l==r},"!=":function(l,r){return l!=r},"===":function(l,r){return l===r},"!==":function(l,r){return l!==r},"&&":function(l,r){return l&&r},"||":function(l,r){return l||r}};function getFn(arg){return typeof arg=="function"?arg:arg.valueFn()}function ASTDelegate(){this.expression=null;this.filters=[];this.deps={};this.currentPath=undefined;this.scopeIdent=undefined;this.indexIdent=undefined;this.dynamicDeps=false}ASTDelegate.prototype={createUnaryExpression:function(op,argument){if(!unaryOperators[op])throw Error("Disallowed operator: "+op);argument=getFn(argument);return function(model,observer,filterRegistry){return unaryOperators[op](argument(model,observer,filterRegistry))}},createBinaryExpression:function(op,left,right){if(!binaryOperators[op])throw Error("Disallowed operator: "+op);left=getFn(left);right=getFn(right);switch(op){case"||":this.dynamicDeps=true;return function(model,observer,filterRegistry){return left(model,observer,filterRegistry)||right(model,observer,filterRegistry)};case"&&":this.dynamicDeps=true;return function(model,observer,filterRegistry){return left(model,observer,filterRegistry)&&right(model,observer,filterRegistry)}}return function(model,observer,filterRegistry){return binaryOperators[op](left(model,observer,filterRegistry),right(model,observer,filterRegistry))}},createConditionalExpression:function(test,consequent,alternate){test=getFn(test);consequent=getFn(consequent);alternate=getFn(alternate);this.dynamicDeps=true;return function(model,observer,filterRegistry){return test(model,observer,filterRegistry)?consequent(model,observer,filterRegistry):alternate(model,observer,filterRegistry)}},createIdentifier:function(name){var ident=new IdentPath(name);ident.type="Identifier";return ident},createMemberExpression:function(accessor,object,property){var ex=new MemberExpression(object,property,accessor);if(ex.dynamicDeps)this.dynamicDeps=true;return ex},createCallExpression:function(expression,args){if(!(expression instanceof IdentPath))throw Error("Only identifier function invocations are allowed");var filter=new Filter(expression.name,args);return function(model,observer,filterRegistry){return filter.transform(model,observer,filterRegistry,false)}},createLiteral:function(token){return new Literal(token.value)},createArrayExpression:function(elements){for(var i=0;i<elements.length;i++)elements[i]=getFn(elements[i]);return function(model,observer,filterRegistry){var arr=[];for(var i=0;i<elements.length;i++)arr.push(elements[i](model,observer,filterRegistry));return arr}},createProperty:function(kind,key,value){return{key:key instanceof IdentPath?key.name:key.value,value:value}},createObjectExpression:function(properties){for(var i=0;i<properties.length;i++)properties[i].value=getFn(properties[i].value);return function(model,observer,filterRegistry){var obj={};for(var i=0;i<properties.length;i++)obj[properties[i].key]=properties[i].value(model,observer,filterRegistry);return obj}},createFilter:function(name,args){this.filters.push(new Filter(name,args))},createAsExpression:function(expression,scopeIdent){this.expression=expression;this.scopeIdent=scopeIdent},createInExpression:function(scopeIdent,indexIdent,expression){this.expression=expression;this.scopeIdent=scopeIdent;this.indexIdent=indexIdent},createTopLevel:function(expression){this.expression=expression},createThisExpression:notImplemented};function ConstantObservable(value){this.value_=value}ConstantObservable.prototype={open:function(){return this.value_},discardChanges:function(){return this.value_},deliver:function(){},close:function(){}};function Expression(delegate){this.scopeIdent=delegate.scopeIdent;this.indexIdent=delegate.indexIdent;if(!delegate.expression)throw Error("No expression found.");this.expression=delegate.expression;getFn(this.expression);this.filters=delegate.filters;this.dynamicDeps=delegate.dynamicDeps}Expression.prototype={getBinding:function(model,filterRegistry,oneTime){if(oneTime)return this.getValue(model,undefined,filterRegistry);var observer=new CompoundObserver;var firstValue=this.getValue(model,observer,filterRegistry);var firstTime=true;var self=this;function valueFn(){if(firstTime){firstTime=false;return firstValue}if(self.dynamicDeps)observer.startReset();var value=self.getValue(model,self.dynamicDeps?observer:undefined,filterRegistry);if(self.dynamicDeps)observer.finishReset();return value}function setValueFn(newValue){self.setValue(model,newValue,filterRegistry);return newValue}return new ObserverTransform(observer,valueFn,setValueFn,true)},getValue:function(model,observer,filterRegistry){var value=getFn(this.expression)(model,observer,filterRegistry);for(var i=0;i<this.filters.length;i++){value=this.filters[i].transform(model,observer,filterRegistry,false,[value])}return value},setValue:function(model,newValue,filterRegistry){var count=this.filters?this.filters.length:0;while(count-->0){newValue=this.filters[count].transform(model,undefined,filterRegistry,true,[newValue])}if(this.expression.setValue)return this.expression.setValue(model,newValue)}};function convertStylePropertyName(name){return String(name).replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()})}var parentScopeName="@"+Math.random().toString(36).slice(2);function findScope(model,prop){while(model[parentScopeName]&&!Object.prototype.hasOwnProperty.call(model,prop)){model=model[parentScopeName]}return model}function isLiteralExpression(pathString){switch(pathString){case"":return false;case"false":case"null":case"true":return true}if(!isNaN(Number(pathString)))return true;return false}function PolymerExpressions(){}PolymerExpressions.prototype={styleObject:function(value){var parts=[];for(var key in value){parts.push(convertStylePropertyName(key)+": "+value[key])}return parts.join("; ")},tokenList:function(value){var tokens=[];for(var key in value){if(value[key])tokens.push(key)}return tokens.join(" ")},prepareInstancePositionChanged:function(template){var indexIdent=template.polymerExpressionIndexIdent_;if(!indexIdent)return;return function(templateInstance,index){templateInstance.model[indexIdent]=index}},prepareBinding:function(pathString,name,node){var path=Path.get(pathString);if(!isLiteralExpression(pathString)&&path.valid){if(path.length==1){return function(model,node,oneTime){if(oneTime)return path.getValueFrom(model);var scope=findScope(model,path[0]);return new PathObserver(scope,path)}}return}return prepareBinding(pathString,name,node,this)},prepareInstanceModel:function(template){var scopeName=template.polymerExpressionScopeIdent_;if(!scopeName)return;var parentScope=template.templateInstance?template.templateInstance.model:template.model;var indexName=template.polymerExpressionIndexIdent_;return function(model){return createScopeObject(parentScope,model,scopeName,indexName)}}};var createScopeObject="__proto__"in{}?function(parentScope,model,scopeName,indexName){var scope={};scope[scopeName]=model;scope[indexName]=undefined;scope[parentScopeName]=parentScope;scope.__proto__=parentScope;return scope}:function(parentScope,model,scopeName,indexName){var scope=Object.create(parentScope);Object.defineProperty(scope,scopeName,{value:model,configurable:true,writable:true});Object.defineProperty(scope,indexName,{value:undefined,configurable:true,writable:true});Object.defineProperty(scope,parentScopeName,{value:parentScope,configurable:true,writable:true});return scope};global.PolymerExpressions=PolymerExpressions;PolymerExpressions.getExpression=getExpression})(this);Polymer={version:"0.5.1"};if(typeof window.Polymer==="function"){Polymer={}}(function(scope){function withDependencies(task,depends){depends=depends||[];if(!depends.map){depends=[depends]}return task.apply(this,depends.map(marshal))}function module(name,dependsOrFactory,moduleFactory){var module;switch(arguments.length){case 0:return;case 1:module=null;break;case 2:module=dependsOrFactory.apply(this);break;default:module=withDependencies(moduleFactory,dependsOrFactory);break}modules[name]=module}function marshal(name){return modules[name]}var modules={};function using(depends,task){HTMLImports.whenImportsReady(function(){withDependencies(task,depends)})}scope.marshal=marshal;scope.modularize=module;scope.using=using})(window);if(!window.WebComponents){if(!window.WebComponents){WebComponents={flush:function(){},flags:{log:{}}};Platform=WebComponents;CustomElements={useNative:true,ready:true,takeRecords:function(){},"instanceof":function(obj,base){return obj instanceof base}};HTMLImports={useNative:true};addEventListener("HTMLImportsLoaded",function(){document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:true}))});ShadowDOMPolyfill=null;wrap=unwrap=function(n){return n}}window.HTMLImports=window.HTMLImports||{flags:{}};(function(scope){var IMPORT_LINK_TYPE="import";var useNative=Boolean(IMPORT_LINK_TYPE in document.createElement("link"));var hasShadowDOMPolyfill=Boolean(window.ShadowDOMPolyfill);var wrap=function(node){return hasShadowDOMPolyfill?ShadowDOMPolyfill.wrapIfNeeded(node):node};var rootDocument=wrap(document);var currentScriptDescriptor={get:function(){var script=HTMLImports.currentScript||document.currentScript||(document.readyState!=="complete"?document.scripts[document.scripts.length-1]:null);return wrap(script)},configurable:true};Object.defineProperty(document,"_currentScript",currentScriptDescriptor);Object.defineProperty(rootDocument,"_currentScript",currentScriptDescriptor);var isIE=/Trident/.test(navigator.userAgent);function whenReady(callback,doc){doc=doc||rootDocument;whenDocumentReady(function(){watchImportsLoad(callback,doc)},doc)}var requiredReadyState=isIE?"complete":"interactive";var READY_EVENT="readystatechange";function isDocumentReady(doc){return doc.readyState==="complete"||doc.readyState===requiredReadyState}function whenDocumentReady(callback,doc){if(!isDocumentReady(doc)){var checkReady=function(){if(doc.readyState==="complete"||doc.readyState===requiredReadyState){doc.removeEventListener(READY_EVENT,checkReady);whenDocumentReady(callback,doc)}};doc.addEventListener(READY_EVENT,checkReady)}else if(callback){callback()}}function markTargetLoaded(event){event.target.__loaded=true}function watchImportsLoad(callback,doc){var imports=doc.querySelectorAll("link[rel=import]");var loaded=0,l=imports.length;function checkDone(d){if(loaded==l&&callback){callback()}}function loadedImport(e){markTargetLoaded(e);loaded++;checkDone()}if(l){for(var i=0,imp;i<l&&(imp=imports[i]);i++){if(isImportLoaded(imp)){loadedImport.call(imp,{target:imp})}else{imp.addEventListener("load",loadedImport);imp.addEventListener("error",loadedImport)}}}else{checkDone()}}function isImportLoaded(link){return useNative?link.__loaded||link.import&&link.import.readyState!=="loading":link.__importParsed}if(useNative){new MutationObserver(function(mxns){for(var i=0,l=mxns.length,m;i<l&&(m=mxns[i]);i++){if(m.addedNodes){handleImports(m.addedNodes)}}}).observe(document.head,{childList:true});function handleImports(nodes){for(var i=0,l=nodes.length,n;i<l&&(n=nodes[i]);i++){if(isImport(n)){handleImport(n)}}}function isImport(element){return element.localName==="link"&&element.rel==="import"}function handleImport(element){var loaded=element.import;if(loaded){markTargetLoaded({target:element})}else{element.addEventListener("load",markTargetLoaded);element.addEventListener("error",markTargetLoaded)}}(function(){if(document.readyState==="loading"){var imports=document.querySelectorAll("link[rel=import]");for(var i=0,l=imports.length,imp;i<l&&(imp=imports[i]);i++){handleImport(imp)}}})()}whenReady(function(){HTMLImports.ready=true;HTMLImports.readyTime=(new Date).getTime();rootDocument.dispatchEvent(new CustomEvent("HTMLImportsLoaded",{bubbles:true}))});scope.IMPORT_LINK_TYPE=IMPORT_LINK_TYPE;scope.useNative=useNative;scope.rootDocument=rootDocument;scope.whenReady=whenReady;scope.isIE=isIE})(HTMLImports);(function(scope){var style=document.createElement("style");style.textContent=""+"body {"+"transition: opacity ease-in 0.2s;"+" } \n"+"body[unresolved] {"+"opacity: 0; display: block; overflow: hidden;"+" } \n";var head=document.querySelector("head");head.insertBefore(style,head.firstChild)})(Platform)}(function(global){"use strict";var testingExposeCycleCount=global.testingExposeCycleCount;function detectObjectObserve(){if(typeof Object.observe!=="function"||typeof Array.observe!=="function"){return false}var records=[];function callback(recs){records=recs}var test={};var arr=[];Object.observe(test,callback);Array.observe(arr,callback);test.id=1;test.id=2;delete test.id;arr.push(1,2);arr.length=0;Object.deliverChangeRecords(callback);if(records.length!==5)return false;if(records[0].type!="add"||records[1].type!="update"||records[2].type!="delete"||records[3].type!="splice"||records[4].type!="splice"){return false}Object.unobserve(test,callback);Array.unobserve(arr,callback);return true}var hasObserve=detectObjectObserve();function detectEval(){if(typeof chrome!=="undefined"&&chrome.app&&chrome.app.runtime){return false}if(typeof navigator!="undefined"&&navigator.getDeviceStorage){return false}try{var f=new Function("","return true;");return f()}catch(ex){return false}}var hasEval=detectEval();function isIndex(s){return+s===s>>>0&&s!==""}function toNumber(s){return+s}function isObject(obj){return obj===Object(obj)}var numberIsNaN=global.Number.isNaN||function(value){return typeof value==="number"&&global.isNaN(value)};function areSameValue(left,right){if(left===right)return left!==0||1/left===1/right;if(numberIsNaN(left)&&numberIsNaN(right))return true;return left!==left&&right!==right}var createObject="__proto__"in{}?function(obj){return obj}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name))});return newObject};var identStart="[$_a-zA-Z]";var identPart="[$_a-zA-Z0-9]";var identRegExp=new RegExp("^"+identStart+"+"+identPart+"*"+"$");function getPathCharType(char){if(char===undefined)return"eof";
|
7
|
+
var code=char.charCodeAt(0);switch(code){case 91:case 93:case 46:case 34:case 39:case 48:return char;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}if(97<=code&&code<=122||65<=code&&code<=90)return"ident";if(49<=code&&code<=57)return"number";return"else"}var pathStateMachine={beforePath:{ws:["beforePath"],ident:["inIdent","append"],"[":["beforeElement"],eof:["afterPath"]},inPath:{ws:["inPath"],".":["beforeIdent"],"[":["beforeElement"],eof:["afterPath"]},beforeIdent:{ws:["beforeIdent"],ident:["inIdent","append"]},inIdent:{ident:["inIdent","append"],0:["inIdent","append"],number:["inIdent","append"],ws:["inPath","push"],".":["beforeIdent","push"],"[":["beforeElement","push"],eof:["afterPath","push"]},beforeElement:{ws:["beforeElement"],0:["afterZero","append"],number:["inIndex","append"],"'":["inSingleQuote","append",""],'"':["inDoubleQuote","append",""]},afterZero:{ws:["afterElement","push"],"]":["inPath","push"]},inIndex:{0:["inIndex","append"],number:["inIndex","append"],ws:["afterElement"],"]":["inPath","push"]},inSingleQuote:{"'":["afterElement"],eof:["error"],"else":["inSingleQuote","append"]},inDoubleQuote:{'"':["afterElement"],eof:["error"],"else":["inDoubleQuote","append"]},afterElement:{ws:["afterElement"],"]":["inPath","push"]}};function noop(){}function parsePath(path){var keys=[];var index=-1;var c,newChar,key,type,transition,action,typeMap,mode="beforePath";var actions={push:function(){if(key===undefined)return;keys.push(key);key=undefined},append:function(){if(key===undefined)key=newChar;else key+=newChar}};function maybeUnescapeQuote(){if(index>=path.length)return;var nextChar=path[index+1];if(mode=="inSingleQuote"&&nextChar=="'"||mode=="inDoubleQuote"&&nextChar=='"'){index++;newChar=nextChar;actions.append();return true}}while(mode){index++;c=path[index];if(c=="\\"&&maybeUnescapeQuote(mode))continue;type=getPathCharType(c);typeMap=pathStateMachine[mode];transition=typeMap[type]||typeMap["else"]||"error";if(transition=="error")return;mode=transition[0];action=actions[transition[1]]||noop;newChar=transition[2]===undefined?c:transition[2];action();if(mode==="afterPath"){return keys}}return}function isIdent(s){return identRegExp.test(s)}var constructorIsPrivate={};function Path(parts,privateToken){if(privateToken!==constructorIsPrivate)throw Error("Use Path.get to retrieve path objects");for(var i=0;i<parts.length;i++){this.push(String(parts[i]))}if(hasEval&&this.length){this.getValueFrom=this.compiledGetValueFromFn()}}var pathCache={};function getPath(pathString){if(pathString instanceof Path)return pathString;if(pathString==null||pathString.length==0)pathString="";if(typeof pathString!="string"){if(isIndex(pathString.length)){return new Path(pathString,constructorIsPrivate)}pathString=String(pathString)}var path=pathCache[pathString];if(path)return path;var parts=parsePath(pathString);if(!parts)return invalidPath;var path=new Path(parts,constructorIsPrivate);pathCache[pathString]=path;return path}Path.get=getPath;function formatAccessor(key){if(isIndex(key)){return"["+key+"]"}else{return'["'+key.replace(/"/g,'\\"')+'"]'}}Path.prototype=createObject({__proto__:[],valid:true,toString:function(){var pathString="";for(var i=0;i<this.length;i++){var key=this[i];if(isIdent(key)){pathString+=i?"."+key:key}else{pathString+=formatAccessor(key)}}return pathString},getValueFrom:function(obj,directObserver){for(var i=0;i<this.length;i++){if(obj==null)return;obj=obj[this[i]]}return obj},iterateObjects:function(obj,observe){for(var i=0;i<this.length;i++){if(i)obj=obj[this[i-1]];if(!isObject(obj))return;observe(obj,this[i])}},compiledGetValueFromFn:function(){var str="";var pathString="obj";str+="if (obj != null";var i=0;var key;for(;i<this.length-1;i++){key=this[i];pathString+=isIdent(key)?"."+key:formatAccessor(key);str+=" &&\n "+pathString+" != null"}str+=")\n";var key=this[i];pathString+=isIdent(key)?"."+key:formatAccessor(key);str+=" return "+pathString+";\nelse\n return undefined;";return new Function("obj",str)},setValueFrom:function(obj,value){if(!this.length)return false;for(var i=0;i<this.length-1;i++){if(!isObject(obj))return false;obj=obj[this[i]]}if(!isObject(obj))return false;obj[this[i]]=value;return true}});var invalidPath=new Path("",constructorIsPrivate);invalidPath.valid=false;invalidPath.getValueFrom=invalidPath.setValueFrom=function(){};var MAX_DIRTY_CHECK_CYCLES=1e3;function dirtyCheck(observer){var cycles=0;while(cycles<MAX_DIRTY_CHECK_CYCLES&&observer.check_()){cycles++}if(testingExposeCycleCount)global.dirtyCheckCycleCount=cycles;return cycles>0}function objectIsEmpty(object){for(var prop in object)return false;return true}function diffIsEmpty(diff){return objectIsEmpty(diff.added)&&objectIsEmpty(diff.removed)&&objectIsEmpty(diff.changed)}function diffObjectFromOldObject(object,oldObject){var added={};var removed={};var changed={};for(var prop in oldObject){var newValue=object[prop];if(newValue!==undefined&&newValue===oldObject[prop])continue;if(!(prop in object)){removed[prop]=undefined;continue}if(newValue!==oldObject[prop])changed[prop]=newValue}for(var prop in object){if(prop in oldObject)continue;added[prop]=object[prop]}if(Array.isArray(object)&&object.length!==oldObject.length)changed.length=object.length;return{added:added,removed:removed,changed:changed}}var eomTasks=[];function runEOMTasks(){if(!eomTasks.length)return false;for(var i=0;i<eomTasks.length;i++){eomTasks[i]()}eomTasks.length=0;return true}var runEOM=hasObserve?function(){return function(fn){return Promise.resolve().then(fn)}}():function(){return function(fn){eomTasks.push(fn)}}();var observedObjectCache=[];function newObservedObject(){var observer;var object;var discardRecords=false;var first=true;function callback(records){if(observer&&observer.state_===OPENED&&!discardRecords)observer.check_(records)}return{open:function(obs){if(observer)throw Error("ObservedObject in use");if(!first)Object.deliverChangeRecords(callback);observer=obs;first=false},observe:function(obj,arrayObserve){object=obj;if(arrayObserve)Array.observe(object,callback);else Object.observe(object,callback)},deliver:function(discard){discardRecords=discard;Object.deliverChangeRecords(callback);discardRecords=false},close:function(){observer=undefined;Object.unobserve(object,callback);observedObjectCache.push(this)}}}function getObservedObject(observer,object,arrayObserve){var dir=observedObjectCache.pop()||newObservedObject();dir.open(observer);dir.observe(object,arrayObserve);return dir}var observedSetCache=[];function newObservedSet(){var observerCount=0;var observers=[];var objects=[];var rootObj;var rootObjProps;function observe(obj,prop){if(!obj)return;if(obj===rootObj)rootObjProps[prop]=true;if(objects.indexOf(obj)<0){objects.push(obj);Object.observe(obj,callback)}observe(Object.getPrototypeOf(obj),prop)}function allRootObjNonObservedProps(recs){for(var i=0;i<recs.length;i++){var rec=recs[i];if(rec.object!==rootObj||rootObjProps[rec.name]||rec.type==="setPrototype"){return false}}return true}function callback(recs){if(allRootObjNonObservedProps(recs))return;var observer;for(var i=0;i<observers.length;i++){observer=observers[i];if(observer.state_==OPENED){observer.iterateObjects_(observe)}}for(var i=0;i<observers.length;i++){observer=observers[i];if(observer.state_==OPENED){observer.check_()}}}var record={objects:objects,get rootObject(){return rootObj},set rootObject(value){rootObj=value;rootObjProps={}},open:function(obs,object){observers.push(obs);observerCount++;obs.iterateObjects_(observe)},close:function(obs){observerCount--;if(observerCount>0){return}for(var i=0;i<objects.length;i++){Object.unobserve(objects[i],callback);Observer.unobservedCount++}observers.length=0;objects.length=0;rootObj=undefined;rootObjProps=undefined;observedSetCache.push(this);if(lastObservedSet===this)lastObservedSet=null}};return record}var lastObservedSet;function getObservedSet(observer,obj){if(!lastObservedSet||lastObservedSet.rootObject!==obj){lastObservedSet=observedSetCache.pop()||newObservedSet();lastObservedSet.rootObject=obj}lastObservedSet.open(observer,obj);return lastObservedSet}var UNOPENED=0;var OPENED=1;var CLOSED=2;var RESETTING=3;var nextObserverId=1;function Observer(){this.state_=UNOPENED;this.callback_=undefined;this.target_=undefined;this.directObserver_=undefined;this.value_=undefined;this.id_=nextObserverId++}Observer.prototype={open:function(callback,target){if(this.state_!=UNOPENED)throw Error("Observer has already been opened.");addToAll(this);this.callback_=callback;this.target_=target;this.connect_();this.state_=OPENED;return this.value_},close:function(){if(this.state_!=OPENED)return;removeFromAll(this);this.disconnect_();this.value_=undefined;this.callback_=undefined;this.target_=undefined;this.state_=CLOSED},deliver:function(){if(this.state_!=OPENED)return;dirtyCheck(this)},report_:function(changes){try{this.callback_.apply(this.target_,changes)}catch(ex){Observer._errorThrownDuringCallback=true;console.error("Exception caught during observer callback: "+(ex.stack||ex))}},discardChanges:function(){this.check_(undefined,true);return this.value_}};var collectObservers=!hasObserve;var allObservers;Observer._allObserversCount=0;if(collectObservers){allObservers=[]}function addToAll(observer){Observer._allObserversCount++;if(!collectObservers)return;allObservers.push(observer)}function removeFromAll(observer){Observer._allObserversCount--}var runningMicrotaskCheckpoint=false;global.Platform=global.Platform||{};global.Platform.performMicrotaskCheckpoint=function(){if(runningMicrotaskCheckpoint)return;if(!collectObservers)return;runningMicrotaskCheckpoint=true;var cycles=0;var anyChanged,toCheck;do{cycles++;toCheck=allObservers;allObservers=[];anyChanged=false;for(var i=0;i<toCheck.length;i++){var observer=toCheck[i];if(observer.state_!=OPENED)continue;if(observer.check_())anyChanged=true;allObservers.push(observer)}if(runEOMTasks())anyChanged=true}while(cycles<MAX_DIRTY_CHECK_CYCLES&&anyChanged);if(testingExposeCycleCount)global.dirtyCheckCycleCount=cycles;runningMicrotaskCheckpoint=false};if(collectObservers){global.Platform.clearObservers=function(){allObservers=[]}}function ObjectObserver(object){Observer.call(this);this.value_=object;this.oldObject_=undefined}ObjectObserver.prototype=createObject({__proto__:Observer.prototype,arrayObserve:false,connect_:function(callback,target){if(hasObserve){this.directObserver_=getObservedObject(this,this.value_,this.arrayObserve)}else{this.oldObject_=this.copyObject(this.value_)}},copyObject:function(object){var copy=Array.isArray(object)?[]:{};for(var prop in object){copy[prop]=object[prop]}if(Array.isArray(object))copy.length=object.length;return copy},check_:function(changeRecords,skipChanges){var diff;var oldValues;if(hasObserve){if(!changeRecords)return false;oldValues={};diff=diffObjectFromChangeRecords(this.value_,changeRecords,oldValues)}else{oldValues=this.oldObject_;diff=diffObjectFromOldObject(this.value_,this.oldObject_)}if(diffIsEmpty(diff))return false;if(!hasObserve)this.oldObject_=this.copyObject(this.value_);this.report_([diff.added||{},diff.removed||{},diff.changed||{},function(property){return oldValues[property]}]);return true},disconnect_:function(){if(hasObserve){this.directObserver_.close();this.directObserver_=undefined}else{this.oldObject_=undefined}},deliver:function(){if(this.state_!=OPENED)return;if(hasObserve)this.directObserver_.deliver(false);else dirtyCheck(this)},discardChanges:function(){if(this.directObserver_)this.directObserver_.deliver(true);else this.oldObject_=this.copyObject(this.value_);return this.value_}});function ArrayObserver(array){if(!Array.isArray(array))throw Error("Provided object is not an Array");ObjectObserver.call(this,array)}ArrayObserver.prototype=createObject({__proto__:ObjectObserver.prototype,arrayObserve:true,copyObject:function(arr){return arr.slice()},check_:function(changeRecords){var splices;if(hasObserve){if(!changeRecords)return false;splices=projectArraySplices(this.value_,changeRecords)}else{splices=calcSplices(this.value_,0,this.value_.length,this.oldObject_,0,this.oldObject_.length)}if(!splices||!splices.length)return false;if(!hasObserve)this.oldObject_=this.copyObject(this.value_);this.report_([splices]);return true}});ArrayObserver.applySplices=function(previous,current,splices){splices.forEach(function(splice){var spliceArgs=[splice.index,splice.removed.length];var addIndex=splice.index;while(addIndex<splice.index+splice.addedCount){spliceArgs.push(current[addIndex]);addIndex++}Array.prototype.splice.apply(previous,spliceArgs)})};function PathObserver(object,path){Observer.call(this);this.object_=object;this.path_=getPath(path);this.directObserver_=undefined}PathObserver.prototype=createObject({__proto__:Observer.prototype,get path(){return this.path_},connect_:function(){if(hasObserve)this.directObserver_=getObservedSet(this,this.object_);this.check_(undefined,true)},disconnect_:function(){this.value_=undefined;if(this.directObserver_){this.directObserver_.close(this);this.directObserver_=undefined}},iterateObjects_:function(observe){this.path_.iterateObjects(this.object_,observe)},check_:function(changeRecords,skipChanges){var oldValue=this.value_;this.value_=this.path_.getValueFrom(this.object_);if(skipChanges||areSameValue(this.value_,oldValue))return false;this.report_([this.value_,oldValue,this]);return true},setValue:function(newValue){if(this.path_)this.path_.setValueFrom(this.object_,newValue)}});function CompoundObserver(reportChangesOnOpen){Observer.call(this);this.reportChangesOnOpen_=reportChangesOnOpen;this.value_=[];this.directObserver_=undefined;this.observed_=[]}var observerSentinel={};CompoundObserver.prototype=createObject({__proto__:Observer.prototype,connect_:function(){if(hasObserve){var object;var needsDirectObserver=false;for(var i=0;i<this.observed_.length;i+=2){object=this.observed_[i];if(object!==observerSentinel){needsDirectObserver=true;break}}if(needsDirectObserver)this.directObserver_=getObservedSet(this,object)}this.check_(undefined,!this.reportChangesOnOpen_)},disconnect_:function(){for(var i=0;i<this.observed_.length;i+=2){if(this.observed_[i]===observerSentinel)this.observed_[i+1].close()}this.observed_.length=0;this.value_.length=0;if(this.directObserver_){this.directObserver_.close(this);this.directObserver_=undefined}},addPath:function(object,path){if(this.state_!=UNOPENED&&this.state_!=RESETTING)throw Error("Cannot add paths once started.");var path=getPath(path);this.observed_.push(object,path);if(!this.reportChangesOnOpen_)return;var index=this.observed_.length/2-1;this.value_[index]=path.getValueFrom(object)},addObserver:function(observer){if(this.state_!=UNOPENED&&this.state_!=RESETTING)throw Error("Cannot add observers once started.");this.observed_.push(observerSentinel,observer);if(!this.reportChangesOnOpen_)return;var index=this.observed_.length/2-1;this.value_[index]=observer.open(this.deliver,this)},startReset:function(){if(this.state_!=OPENED)throw Error("Can only reset while open");this.state_=RESETTING;this.disconnect_()},finishReset:function(){if(this.state_!=RESETTING)throw Error("Can only finishReset after startReset");this.state_=OPENED;this.connect_();return this.value_},iterateObjects_:function(observe){var object;for(var i=0;i<this.observed_.length;i+=2){object=this.observed_[i];if(object!==observerSentinel)this.observed_[i+1].iterateObjects(object,observe)}},check_:function(changeRecords,skipChanges){var oldValues;for(var i=0;i<this.observed_.length;i+=2){var object=this.observed_[i];var path=this.observed_[i+1];var value;if(object===observerSentinel){var observable=path;value=this.state_===UNOPENED?observable.open(this.deliver,this):observable.discardChanges()}else{value=path.getValueFrom(object)}if(skipChanges){this.value_[i/2]=value;continue}if(areSameValue(value,this.value_[i/2]))continue;oldValues=oldValues||[];oldValues[i/2]=this.value_[i/2];this.value_[i/2]=value}if(!oldValues)return false;this.report_([this.value_,oldValues,this.observed_]);return true}});function identFn(value){return value}function ObserverTransform(observable,getValueFn,setValueFn,dontPassThroughSet){this.callback_=undefined;this.target_=undefined;this.value_=undefined;this.observable_=observable;this.getValueFn_=getValueFn||identFn;this.setValueFn_=setValueFn||identFn;this.dontPassThroughSet_=dontPassThroughSet}ObserverTransform.prototype={open:function(callback,target){this.callback_=callback;this.target_=target;this.value_=this.getValueFn_(this.observable_.open(this.observedCallback_,this));return this.value_},observedCallback_:function(value){value=this.getValueFn_(value);if(areSameValue(value,this.value_))return;var oldValue=this.value_;this.value_=value;this.callback_.call(this.target_,this.value_,oldValue)},discardChanges:function(){this.value_=this.getValueFn_(this.observable_.discardChanges());return this.value_},deliver:function(){return this.observable_.deliver()},setValue:function(value){value=this.setValueFn_(value);if(!this.dontPassThroughSet_&&this.observable_.setValue)return this.observable_.setValue(value)},close:function(){if(this.observable_)this.observable_.close();this.callback_=undefined;this.target_=undefined;this.observable_=undefined;this.value_=undefined;this.getValueFn_=undefined;this.setValueFn_=undefined}};var expectedRecordTypes={add:true,update:true,"delete":true};function diffObjectFromChangeRecords(object,changeRecords,oldValues){var added={};var removed={};for(var i=0;i<changeRecords.length;i++){var record=changeRecords[i];if(!expectedRecordTypes[record.type]){console.error("Unknown changeRecord type: "+record.type);console.error(record);continue}if(!(record.name in oldValues))oldValues[record.name]=record.oldValue;if(record.type=="update")continue;if(record.type=="add"){if(record.name in removed)delete removed[record.name];else added[record.name]=true;continue}if(record.name in added){delete added[record.name];delete oldValues[record.name]}else{removed[record.name]=true}}for(var prop in added)added[prop]=object[prop];for(var prop in removed)removed[prop]=undefined;var changed={};for(var prop in oldValues){if(prop in added||prop in removed)continue;var newValue=object[prop];if(oldValues[prop]!==newValue)changed[prop]=newValue}return{added:added,removed:removed,changed:changed}}function newSplice(index,removed,addedCount){return{index:index,removed:removed,addedCount:addedCount}}var EDIT_LEAVE=0;var EDIT_UPDATE=1;var EDIT_ADD=2;var EDIT_DELETE=3;function ArraySplice(){}ArraySplice.prototype={calcEditDistances:function(current,currentStart,currentEnd,old,oldStart,oldEnd){var rowCount=oldEnd-oldStart+1;var columnCount=currentEnd-currentStart+1;var distances=new Array(rowCount);for(var i=0;i<rowCount;i++){distances[i]=new Array(columnCount);distances[i][0]=i}for(var j=0;j<columnCount;j++)distances[0][j]=j;for(var i=1;i<rowCount;i++){for(var j=1;j<columnCount;j++){if(this.equals(current[currentStart+j-1],old[oldStart+i-1]))distances[i][j]=distances[i-1][j-1];else{var north=distances[i-1][j]+1;var west=distances[i][j-1]+1;distances[i][j]=north<west?north:west}}}return distances},spliceOperationsFromEditDistances:function(distances){var i=distances.length-1;var j=distances[0].length-1;var current=distances[i][j];var edits=[];while(i>0||j>0){if(i==0){edits.push(EDIT_ADD);j--;continue}if(j==0){edits.push(EDIT_DELETE);i--;continue}var northWest=distances[i-1][j-1];var west=distances[i-1][j];var north=distances[i][j-1];var min;if(west<north)min=west<northWest?west:northWest;else min=north<northWest?north:northWest;if(min==northWest){if(northWest==current){edits.push(EDIT_LEAVE)}else{edits.push(EDIT_UPDATE);current=northWest}i--;j--}else if(min==west){edits.push(EDIT_DELETE);i--;current=west}else{edits.push(EDIT_ADD);j--;current=north}}edits.reverse();return edits},calcSplices:function(current,currentStart,currentEnd,old,oldStart,oldEnd){var prefixCount=0;var suffixCount=0;var minLength=Math.min(currentEnd-currentStart,oldEnd-oldStart);if(currentStart==0&&oldStart==0)prefixCount=this.sharedPrefix(current,old,minLength);if(currentEnd==current.length&&oldEnd==old.length)suffixCount=this.sharedSuffix(current,old,minLength-prefixCount);currentStart+=prefixCount;oldStart+=prefixCount;currentEnd-=suffixCount;oldEnd-=suffixCount;if(currentEnd-currentStart==0&&oldEnd-oldStart==0)return[];if(currentStart==currentEnd){var splice=newSplice(currentStart,[],0);while(oldStart<oldEnd)splice.removed.push(old[oldStart++]);return[splice]}else if(oldStart==oldEnd)return[newSplice(currentStart,[],currentEnd-currentStart)];var ops=this.spliceOperationsFromEditDistances(this.calcEditDistances(current,currentStart,currentEnd,old,oldStart,oldEnd));var splice=undefined;var splices=[];var index=currentStart;var oldIndex=oldStart;for(var i=0;i<ops.length;i++){switch(ops[i]){case EDIT_LEAVE:if(splice){splices.push(splice);splice=undefined}index++;oldIndex++;break;case EDIT_UPDATE:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;splice.removed.push(old[oldIndex]);oldIndex++;break;case EDIT_ADD:if(!splice)splice=newSplice(index,[],0);splice.addedCount++;index++;break;case EDIT_DELETE:if(!splice)splice=newSplice(index,[],0);splice.removed.push(old[oldIndex]);oldIndex++;break}}if(splice){splices.push(splice)}return splices},sharedPrefix:function(current,old,searchLength){for(var i=0;i<searchLength;i++)if(!this.equals(current[i],old[i]))return i;return searchLength},sharedSuffix:function(current,old,searchLength){var index1=current.length;var index2=old.length;var count=0;while(count<searchLength&&this.equals(current[--index1],old[--index2]))count++;return count},calculateSplices:function(current,previous){return this.calcSplices(current,0,current.length,previous,0,previous.length)},equals:function(currentValue,previousValue){return currentValue===previousValue}};var arraySplice=new ArraySplice;function calcSplices(current,currentStart,currentEnd,old,oldStart,oldEnd){return arraySplice.calcSplices(current,currentStart,currentEnd,old,oldStart,oldEnd)}function intersect(start1,end1,start2,end2){if(end1<start2||end2<start1)return-1;if(end1==start2||end2==start1)return 0;if(start1<start2){if(end1<end2)return end1-start2;else return end2-start2}else{if(end2<end1)return end2-start1;else return end1-start1}}function mergeSplice(splices,index,removed,addedCount){var splice=newSplice(index,removed,addedCount);var inserted=false;var insertionOffset=0;for(var i=0;i<splices.length;i++){var current=splices[i];current.index+=insertionOffset;if(inserted)continue;var intersectCount=intersect(splice.index,splice.index+splice.removed.length,current.index,current.index+current.addedCount);if(intersectCount>=0){splices.splice(i,1);i--;insertionOffset-=current.addedCount-current.removed.length;splice.addedCount+=current.addedCount-intersectCount;var deleteCount=splice.removed.length+current.removed.length-intersectCount;if(!splice.addedCount&&!deleteCount){inserted=true}else{var removed=current.removed;if(splice.index<current.index){var prepend=splice.removed.slice(0,current.index-splice.index);Array.prototype.push.apply(prepend,removed);removed=prepend}if(splice.index+splice.removed.length>current.index+current.addedCount){var append=splice.removed.slice(current.index+current.addedCount-splice.index);Array.prototype.push.apply(removed,append)}splice.removed=removed;if(current.index<splice.index){splice.index=current.index}}}else if(splice.index<current.index){inserted=true;splices.splice(i,0,splice);i++;var offset=splice.addedCount-splice.removed.length;current.index+=offset;insertionOffset+=offset}}if(!inserted)splices.push(splice)}function createInitialSplices(array,changeRecords){var splices=[];for(var i=0;i<changeRecords.length;i++){var record=changeRecords[i];switch(record.type){case"splice":mergeSplice(splices,record.index,record.removed.slice(),record.addedCount);break;case"add":case"update":case"delete":if(!isIndex(record.name))continue;var index=toNumber(record.name);if(index<0)continue;mergeSplice(splices,index,[record.oldValue],1);break;default:console.error("Unexpected record type: "+JSON.stringify(record));break}}return splices}function projectArraySplices(array,changeRecords){var splices=[];createInitialSplices(array,changeRecords).forEach(function(splice){if(splice.addedCount==1&&splice.removed.length==1){if(splice.removed[0]!==array[splice.index])splices.push(splice);return}splices=splices.concat(calcSplices(array,splice.index,splice.index+splice.addedCount,splice.removed,0,splice.removed.length))});return splices}var expose=global;if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){expose=exports=module.exports}expose=exports}expose.Observer=Observer;expose.Observer.runEOM_=runEOM;expose.Observer.observerSentinel_=observerSentinel;expose.Observer.hasObjectObserve=hasObserve;expose.ArrayObserver=ArrayObserver;expose.ArrayObserver.calculateSplices=function(current,previous){return arraySplice.calculateSplices(current,previous)};expose.ArraySplice=ArraySplice;expose.ObjectObserver=ObjectObserver;expose.PathObserver=PathObserver;expose.CompoundObserver=CompoundObserver;expose.Path=Path;expose.ObserverTransform=ObserverTransform})(typeof global!=="undefined"&&global&&typeof module!=="undefined"&&module?global:this||window);(function(global){"use strict";var filter=Array.prototype.filter.call.bind(Array.prototype.filter);function getTreeScope(node){while(node.parentNode){node=node.parentNode}return typeof node.getElementById==="function"?node:null}Node.prototype.bind=function(name,observable){console.error("Unhandled binding to Node: ",this,name,observable)};Node.prototype.bindFinished=function(){};function updateBindings(node,name,binding){var bindings=node.bindings_;if(!bindings)bindings=node.bindings_={};if(bindings[name])binding[name].close();return bindings[name]=binding}function returnBinding(node,name,binding){return binding}function sanitizeValue(value){return value==null?"":value}function updateText(node,value){node.data=sanitizeValue(value)}function textBinding(node){return function(value){return updateText(node,value)}}var maybeUpdateBindings=returnBinding;Object.defineProperty(Platform,"enableBindingsReflection",{get:function(){return maybeUpdateBindings===updateBindings},set:function(enable){maybeUpdateBindings=enable?updateBindings:returnBinding;return enable},configurable:true});Text.prototype.bind=function(name,value,oneTime){if(name!=="textContent")return Node.prototype.bind.call(this,name,value,oneTime);if(oneTime)return updateText(this,value);var observable=value;updateText(this,observable.open(textBinding(this)));return maybeUpdateBindings(this,name,observable)};function updateAttribute(el,name,conditional,value){if(conditional){if(value)el.setAttribute(name,"");else el.removeAttribute(name);return}el.setAttribute(name,sanitizeValue(value))}function attributeBinding(el,name,conditional){return function(value){updateAttribute(el,name,conditional,value)}}Element.prototype.bind=function(name,value,oneTime){var conditional=name[name.length-1]=="?";if(conditional){this.removeAttribute(name);name=name.slice(0,-1)}if(oneTime)return updateAttribute(this,name,conditional,value);var observable=value;updateAttribute(this,name,conditional,observable.open(attributeBinding(this,name,conditional)));return maybeUpdateBindings(this,name,observable)};var checkboxEventType;(function(){var div=document.createElement("div");var checkbox=div.appendChild(document.createElement("input"));checkbox.setAttribute("type","checkbox");var first;var count=0;checkbox.addEventListener("click",function(e){count++;first=first||"click"});checkbox.addEventListener("change",function(){count++;first=first||"change"});var event=document.createEvent("MouseEvent");event.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);checkbox.dispatchEvent(event);checkboxEventType=count==1?"change":first})();function getEventForInputType(element){switch(element.type){case"checkbox":return checkboxEventType;case"radio":case"select-multiple":case"select-one":return"change";case"range":if(/Trident|MSIE/.test(navigator.userAgent))return"change";default:return"input"}}function updateInput(input,property,value,santizeFn){input[property]=(santizeFn||sanitizeValue)(value)}function inputBinding(input,property,santizeFn){return function(value){return updateInput(input,property,value,santizeFn)}}function noop(){}function bindInputEvent(input,property,observable,postEventFn){var eventType=getEventForInputType(input);function eventHandler(){observable.setValue(input[property]);observable.discardChanges();(postEventFn||noop)(input);Platform.performMicrotaskCheckpoint()}input.addEventListener(eventType,eventHandler);return{close:function(){input.removeEventListener(eventType,eventHandler);observable.close()},observable_:observable}}function booleanSanitize(value){return Boolean(value)}function getAssociatedRadioButtons(element){if(element.form){return filter(element.form.elements,function(el){return el!=element&&el.tagName=="INPUT"&&el.type=="radio"&&el.name==element.name})}else{var treeScope=getTreeScope(element);if(!treeScope)return[];var radios=treeScope.querySelectorAll('input[type="radio"][name="'+element.name+'"]');return filter(radios,function(el){return el!=element&&!el.form})}}function checkedPostEvent(input){if(input.tagName==="INPUT"&&input.type==="radio"){getAssociatedRadioButtons(input).forEach(function(radio){var checkedBinding=radio.bindings_.checked;if(checkedBinding){checkedBinding.observable_.setValue(false)}})}}HTMLInputElement.prototype.bind=function(name,value,oneTime){if(name!=="value"&&name!=="checked")return HTMLElement.prototype.bind.call(this,name,value,oneTime);this.removeAttribute(name);var sanitizeFn=name=="checked"?booleanSanitize:sanitizeValue;var postEventFn=name=="checked"?checkedPostEvent:noop;if(oneTime)return updateInput(this,name,value,sanitizeFn);var observable=value;var binding=bindInputEvent(this,name,observable,postEventFn);updateInput(this,name,observable.open(inputBinding(this,name,sanitizeFn)),sanitizeFn);return updateBindings(this,name,binding)};HTMLTextAreaElement.prototype.bind=function(name,value,oneTime){if(name!=="value")return HTMLElement.prototype.bind.call(this,name,value,oneTime);this.removeAttribute("value");if(oneTime)return updateInput(this,"value",value);var observable=value;var binding=bindInputEvent(this,"value",observable);updateInput(this,"value",observable.open(inputBinding(this,"value",sanitizeValue)));return maybeUpdateBindings(this,name,binding)};function updateOption(option,value){var parentNode=option.parentNode;var select;var selectBinding;var oldValue;if(parentNode instanceof HTMLSelectElement&&parentNode.bindings_&&parentNode.bindings_.value){select=parentNode;selectBinding=select.bindings_.value;oldValue=select.value}option.value=sanitizeValue(value);if(select&&select.value!=oldValue){selectBinding.observable_.setValue(select.value);selectBinding.observable_.discardChanges();Platform.performMicrotaskCheckpoint()}}function optionBinding(option){return function(value){updateOption(option,value)}}HTMLOptionElement.prototype.bind=function(name,value,oneTime){if(name!=="value")return HTMLElement.prototype.bind.call(this,name,value,oneTime);this.removeAttribute("value");if(oneTime)return updateOption(this,value);var observable=value;var binding=bindInputEvent(this,"value",observable);updateOption(this,observable.open(optionBinding(this)));return maybeUpdateBindings(this,name,binding)};HTMLSelectElement.prototype.bind=function(name,value,oneTime){if(name==="selectedindex")name="selectedIndex";if(name!=="selectedIndex"&&name!=="value")return HTMLElement.prototype.bind.call(this,name,value,oneTime);this.removeAttribute(name);if(oneTime)return updateInput(this,name,value);var observable=value;var binding=bindInputEvent(this,name,observable);updateInput(this,name,observable.open(inputBinding(this,name)));return updateBindings(this,name,binding)
|
8
|
+
}})(this);(function(global){"use strict";function assert(v){if(!v)throw new Error("Assertion failed")}var forEach=Array.prototype.forEach.call.bind(Array.prototype.forEach);function getFragmentRoot(node){var p;while(p=node.parentNode){node=p}return node}function searchRefId(node,id){if(!id)return;var ref;var selector="#"+id;while(!ref){node=getFragmentRoot(node);if(node.protoContent_)ref=node.protoContent_.querySelector(selector);else if(node.getElementById)ref=node.getElementById(id);if(ref||!node.templateCreator_)break;node=node.templateCreator_}return ref}function getInstanceRoot(node){while(node.parentNode){node=node.parentNode}return node.templateCreator_?node:null}var Map;if(global.Map&&typeof global.Map.prototype.forEach==="function"){Map=global.Map}else{Map=function(){this.keys=[];this.values=[]};Map.prototype={set:function(key,value){var index=this.keys.indexOf(key);if(index<0){this.keys.push(key);this.values.push(value)}else{this.values[index]=value}},get:function(key){var index=this.keys.indexOf(key);if(index<0)return;return this.values[index]},"delete":function(key,value){var index=this.keys.indexOf(key);if(index<0)return false;this.keys.splice(index,1);this.values.splice(index,1);return true},forEach:function(f,opt_this){for(var i=0;i<this.keys.length;i++)f.call(opt_this||this,this.values[i],this.keys[i],this)}}}var createObject="__proto__"in{}?function(obj){return obj}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name))});return newObject};if(typeof document.contains!="function"){Document.prototype.contains=function(node){if(node===this||node.parentNode===this)return true;return this.documentElement.contains(node)}}var BIND="bind";var REPEAT="repeat";var IF="if";var templateAttributeDirectives={template:true,repeat:true,bind:true,ref:true};var semanticTemplateElements={THEAD:true,TBODY:true,TFOOT:true,TH:true,TR:true,TD:true,COLGROUP:true,COL:true,CAPTION:true,OPTION:true,OPTGROUP:true};var hasTemplateElement=typeof HTMLTemplateElement!=="undefined";if(hasTemplateElement){(function(){var t=document.createElement("template");var d=t.content.ownerDocument;var html=d.appendChild(d.createElement("html"));var head=html.appendChild(d.createElement("head"));var base=d.createElement("base");base.href=document.baseURI;head.appendChild(base)})()}var allTemplatesSelectors="template, "+Object.keys(semanticTemplateElements).map(function(tagName){return tagName.toLowerCase()+"[template]"}).join(", ");function isSVGTemplate(el){return el.tagName=="template"&&el.namespaceURI=="http://www.w3.org/2000/svg"}function isHTMLTemplate(el){return el.tagName=="TEMPLATE"&&el.namespaceURI=="http://www.w3.org/1999/xhtml"}function isAttributeTemplate(el){return Boolean(semanticTemplateElements[el.tagName]&&el.hasAttribute("template"))}function isTemplate(el){if(el.isTemplate_===undefined)el.isTemplate_=el.tagName=="TEMPLATE"||isAttributeTemplate(el);return el.isTemplate_}document.addEventListener("DOMContentLoaded",function(e){bootstrapTemplatesRecursivelyFrom(document);Platform.performMicrotaskCheckpoint()},false);function forAllTemplatesFrom(node,fn){var subTemplates=node.querySelectorAll(allTemplatesSelectors);if(isTemplate(node))fn(node);forEach(subTemplates,fn)}function bootstrapTemplatesRecursivelyFrom(node){function bootstrap(template){if(!HTMLTemplateElement.decorate(template))bootstrapTemplatesRecursivelyFrom(template.content)}forAllTemplatesFrom(node,bootstrap)}if(!hasTemplateElement){global.HTMLTemplateElement=function(){throw TypeError("Illegal constructor")}}var hasProto="__proto__"in{};function mixin(to,from){Object.getOwnPropertyNames(from).forEach(function(name){Object.defineProperty(to,name,Object.getOwnPropertyDescriptor(from,name))})}function getOrCreateTemplateContentsOwner(template){var doc=template.ownerDocument;if(!doc.defaultView)return doc;var d=doc.templateContentsOwner_;if(!d){d=doc.implementation.createHTMLDocument("");while(d.lastChild){d.removeChild(d.lastChild)}doc.templateContentsOwner_=d}return d}function getTemplateStagingDocument(template){if(!template.stagingDocument_){var owner=template.ownerDocument;if(!owner.stagingDocument_){owner.stagingDocument_=owner.implementation.createHTMLDocument("");owner.stagingDocument_.isStagingDocument=true;var base=owner.stagingDocument_.createElement("base");base.href=document.baseURI;owner.stagingDocument_.head.appendChild(base);owner.stagingDocument_.stagingDocument_=owner.stagingDocument_}template.stagingDocument_=owner.stagingDocument_}return template.stagingDocument_}function extractTemplateFromAttributeTemplate(el){var template=el.ownerDocument.createElement("template");el.parentNode.insertBefore(template,el);var attribs=el.attributes;var count=attribs.length;while(count-->0){var attrib=attribs[count];if(templateAttributeDirectives[attrib.name]){if(attrib.name!=="template")template.setAttribute(attrib.name,attrib.value);el.removeAttribute(attrib.name)}}return template}function extractTemplateFromSVGTemplate(el){var template=el.ownerDocument.createElement("template");el.parentNode.insertBefore(template,el);var attribs=el.attributes;var count=attribs.length;while(count-->0){var attrib=attribs[count];template.setAttribute(attrib.name,attrib.value);el.removeAttribute(attrib.name)}el.parentNode.removeChild(el);return template}function liftNonNativeTemplateChildrenIntoContent(template,el,useRoot){var content=template.content;if(useRoot){content.appendChild(el);return}var child;while(child=el.firstChild){content.appendChild(child)}}var templateObserver;if(typeof MutationObserver=="function"){templateObserver=new MutationObserver(function(records){for(var i=0;i<records.length;i++){records[i].target.refChanged_()}})}HTMLTemplateElement.decorate=function(el,opt_instanceRef){if(el.templateIsDecorated_)return false;var templateElement=el;templateElement.templateIsDecorated_=true;var isNativeHTMLTemplate=isHTMLTemplate(templateElement)&&hasTemplateElement;var bootstrapContents=isNativeHTMLTemplate;var liftContents=!isNativeHTMLTemplate;var liftRoot=false;if(!isNativeHTMLTemplate){if(isAttributeTemplate(templateElement)){assert(!opt_instanceRef);templateElement=extractTemplateFromAttributeTemplate(el);templateElement.templateIsDecorated_=true;isNativeHTMLTemplate=hasTemplateElement;liftRoot=true}else if(isSVGTemplate(templateElement)){templateElement=extractTemplateFromSVGTemplate(el);templateElement.templateIsDecorated_=true;isNativeHTMLTemplate=hasTemplateElement}}if(!isNativeHTMLTemplate){fixTemplateElementPrototype(templateElement);var doc=getOrCreateTemplateContentsOwner(templateElement);templateElement.content_=doc.createDocumentFragment()}if(opt_instanceRef){templateElement.instanceRef_=opt_instanceRef}else if(liftContents){liftNonNativeTemplateChildrenIntoContent(templateElement,el,liftRoot)}else if(bootstrapContents){bootstrapTemplatesRecursivelyFrom(templateElement.content)}return true};HTMLTemplateElement.bootstrap=bootstrapTemplatesRecursivelyFrom;var htmlElement=global.HTMLUnknownElement||HTMLElement;var contentDescriptor={get:function(){return this.content_},enumerable:true,configurable:true};if(!hasTemplateElement){HTMLTemplateElement.prototype=Object.create(htmlElement.prototype);Object.defineProperty(HTMLTemplateElement.prototype,"content",contentDescriptor)}function fixTemplateElementPrototype(el){if(hasProto)el.__proto__=HTMLTemplateElement.prototype;else mixin(el,HTMLTemplateElement.prototype)}function ensureSetModelScheduled(template){if(!template.setModelFn_){template.setModelFn_=function(){template.setModelFnScheduled_=false;var map=getBindings(template,template.delegate_&&template.delegate_.prepareBinding);processBindings(template,map,template.model_)}}if(!template.setModelFnScheduled_){template.setModelFnScheduled_=true;Observer.runEOM_(template.setModelFn_)}}mixin(HTMLTemplateElement.prototype,{bind:function(name,value,oneTime){if(name!="ref")return Element.prototype.bind.call(this,name,value,oneTime);var self=this;var ref=oneTime?value:value.open(function(ref){self.setAttribute("ref",ref);self.refChanged_()});this.setAttribute("ref",ref);this.refChanged_();if(oneTime)return;if(!this.bindings_){this.bindings_={ref:value}}else{this.bindings_.ref=value}return value},processBindingDirectives_:function(directives){if(this.iterator_)this.iterator_.closeDeps();if(!directives.if&&!directives.bind&&!directives.repeat){if(this.iterator_){this.iterator_.close();this.iterator_=undefined}return}if(!this.iterator_){this.iterator_=new TemplateIterator(this)}this.iterator_.updateDependencies(directives,this.model_);if(templateObserver){templateObserver.observe(this,{attributes:true,attributeFilter:["ref"]})}return this.iterator_},createInstance:function(model,bindingDelegate,delegate_){if(bindingDelegate)delegate_=this.newDelegate_(bindingDelegate);else if(!delegate_)delegate_=this.delegate_;if(!this.refContent_)this.refContent_=this.ref_.content;var content=this.refContent_;if(content.firstChild===null)return emptyInstance;var map=getInstanceBindingMap(content,delegate_);var stagingDocument=getTemplateStagingDocument(this);var instance=stagingDocument.createDocumentFragment();instance.templateCreator_=this;instance.protoContent_=content;instance.bindings_=[];instance.terminator_=null;var instanceRecord=instance.templateInstance_={firstNode:null,lastNode:null,model:model};var i=0;var collectTerminator=false;for(var child=content.firstChild;child;child=child.nextSibling){if(child.nextSibling===null)collectTerminator=true;var clone=cloneAndBindInstance(child,instance,stagingDocument,map.children[i++],model,delegate_,instance.bindings_);clone.templateInstance_=instanceRecord;if(collectTerminator)instance.terminator_=clone}instanceRecord.firstNode=instance.firstChild;instanceRecord.lastNode=instance.lastChild;instance.templateCreator_=undefined;instance.protoContent_=undefined;return instance},get model(){return this.model_},set model(model){this.model_=model;ensureSetModelScheduled(this)},get bindingDelegate(){return this.delegate_&&this.delegate_.raw},refChanged_:function(){if(!this.iterator_||this.refContent_===this.ref_.content)return;this.refContent_=undefined;this.iterator_.valueChanged();this.iterator_.updateIteratedValue(this.iterator_.getUpdatedValue())},clear:function(){this.model_=undefined;this.delegate_=undefined;if(this.bindings_&&this.bindings_.ref)this.bindings_.ref.close();this.refContent_=undefined;if(!this.iterator_)return;this.iterator_.valueChanged();this.iterator_.close();this.iterator_=undefined},setDelegate_:function(delegate){this.delegate_=delegate;this.bindingMap_=undefined;if(this.iterator_){this.iterator_.instancePositionChangedFn_=undefined;this.iterator_.instanceModelFn_=undefined}},newDelegate_:function(bindingDelegate){if(!bindingDelegate)return;function delegateFn(name){var fn=bindingDelegate&&bindingDelegate[name];if(typeof fn!="function")return;return function(){return fn.apply(bindingDelegate,arguments)}}return{bindingMaps:{},raw:bindingDelegate,prepareBinding:delegateFn("prepareBinding"),prepareInstanceModel:delegateFn("prepareInstanceModel"),prepareInstancePositionChanged:delegateFn("prepareInstancePositionChanged")}},set bindingDelegate(bindingDelegate){if(this.delegate_){throw Error("Template must be cleared before a new bindingDelegate "+"can be assigned")}this.setDelegate_(this.newDelegate_(bindingDelegate))},get ref_(){var ref=searchRefId(this,this.getAttribute("ref"));if(!ref)ref=this.instanceRef_;if(!ref)return this;var nextRef=ref.ref_;return nextRef?nextRef:ref}});function parseMustaches(s,name,node,prepareBindingFn){if(!s||!s.length)return;var tokens;var length=s.length;var startIndex=0,lastIndex=0,endIndex=0;var onlyOneTime=true;while(lastIndex<length){var startIndex=s.indexOf("{{",lastIndex);var oneTimeStart=s.indexOf("[[",lastIndex);var oneTime=false;var terminator="}}";if(oneTimeStart>=0&&(startIndex<0||oneTimeStart<startIndex)){startIndex=oneTimeStart;oneTime=true;terminator="]]"}endIndex=startIndex<0?-1:s.indexOf(terminator,startIndex+2);if(endIndex<0){if(!tokens)return;tokens.push(s.slice(lastIndex));break}tokens=tokens||[];tokens.push(s.slice(lastIndex,startIndex));var pathString=s.slice(startIndex+2,endIndex).trim();tokens.push(oneTime);onlyOneTime=onlyOneTime&&oneTime;var delegateFn=prepareBindingFn&&prepareBindingFn(pathString,name,node);if(delegateFn==null){tokens.push(Path.get(pathString))}else{tokens.push(null)}tokens.push(delegateFn);lastIndex=endIndex+2}if(lastIndex===length)tokens.push("");tokens.hasOnePath=tokens.length===5;tokens.isSimplePath=tokens.hasOnePath&&tokens[0]==""&&tokens[4]=="";tokens.onlyOneTime=onlyOneTime;tokens.combinator=function(values){var newValue=tokens[0];for(var i=1;i<tokens.length;i+=4){var value=tokens.hasOnePath?values:values[(i-1)/4];if(value!==undefined)newValue+=value;newValue+=tokens[i+3]}return newValue};return tokens}function processOneTimeBinding(name,tokens,node,model){if(tokens.hasOnePath){var delegateFn=tokens[3];var value=delegateFn?delegateFn(model,node,true):tokens[2].getValueFrom(model);return tokens.isSimplePath?value:tokens.combinator(value)}var values=[];for(var i=1;i<tokens.length;i+=4){var delegateFn=tokens[i+2];values[(i-1)/4]=delegateFn?delegateFn(model,node):tokens[i+1].getValueFrom(model)}return tokens.combinator(values)}function processSinglePathBinding(name,tokens,node,model){var delegateFn=tokens[3];var observer=delegateFn?delegateFn(model,node,false):new PathObserver(model,tokens[2]);return tokens.isSimplePath?observer:new ObserverTransform(observer,tokens.combinator)}function processBinding(name,tokens,node,model){if(tokens.onlyOneTime)return processOneTimeBinding(name,tokens,node,model);if(tokens.hasOnePath)return processSinglePathBinding(name,tokens,node,model);var observer=new CompoundObserver;for(var i=1;i<tokens.length;i+=4){var oneTime=tokens[i];var delegateFn=tokens[i+2];if(delegateFn){var value=delegateFn(model,node,oneTime);if(oneTime)observer.addPath(value);else observer.addObserver(value);continue}var path=tokens[i+1];if(oneTime)observer.addPath(path.getValueFrom(model));else observer.addPath(model,path)}return new ObserverTransform(observer,tokens.combinator)}function processBindings(node,bindings,model,instanceBindings){for(var i=0;i<bindings.length;i+=2){var name=bindings[i];var tokens=bindings[i+1];var value=processBinding(name,tokens,node,model);var binding=node.bind(name,value,tokens.onlyOneTime);if(binding&&instanceBindings)instanceBindings.push(binding)}node.bindFinished();if(!bindings.isTemplate)return;node.model_=model;var iter=node.processBindingDirectives_(bindings);if(instanceBindings&&iter)instanceBindings.push(iter)}function parseWithDefault(el,name,prepareBindingFn){var v=el.getAttribute(name);return parseMustaches(v==""?"{{}}":v,name,el,prepareBindingFn)}function parseAttributeBindings(element,prepareBindingFn){assert(element);var bindings=[];var ifFound=false;var bindFound=false;for(var i=0;i<element.attributes.length;i++){var attr=element.attributes[i];var name=attr.name;var value=attr.value;while(name[0]==="_"){name=name.substring(1)}if(isTemplate(element)&&(name===IF||name===BIND||name===REPEAT)){continue}var tokens=parseMustaches(value,name,element,prepareBindingFn);if(!tokens)continue;bindings.push(name,tokens)}if(isTemplate(element)){bindings.isTemplate=true;bindings.if=parseWithDefault(element,IF,prepareBindingFn);bindings.bind=parseWithDefault(element,BIND,prepareBindingFn);bindings.repeat=parseWithDefault(element,REPEAT,prepareBindingFn);if(bindings.if&&!bindings.bind&&!bindings.repeat)bindings.bind=parseMustaches("{{}}",BIND,element,prepareBindingFn)}return bindings}function getBindings(node,prepareBindingFn){if(node.nodeType===Node.ELEMENT_NODE)return parseAttributeBindings(node,prepareBindingFn);if(node.nodeType===Node.TEXT_NODE){var tokens=parseMustaches(node.data,"textContent",node,prepareBindingFn);if(tokens)return["textContent",tokens]}return[]}function cloneAndBindInstance(node,parent,stagingDocument,bindings,model,delegate,instanceBindings,instanceRecord){var clone=parent.appendChild(stagingDocument.importNode(node,false));var i=0;for(var child=node.firstChild;child;child=child.nextSibling){cloneAndBindInstance(child,clone,stagingDocument,bindings.children[i++],model,delegate,instanceBindings)}if(bindings.isTemplate){HTMLTemplateElement.decorate(clone,node);if(delegate)clone.setDelegate_(delegate)}processBindings(clone,bindings,model,instanceBindings);return clone}function createInstanceBindingMap(node,prepareBindingFn){var map=getBindings(node,prepareBindingFn);map.children={};var index=0;for(var child=node.firstChild;child;child=child.nextSibling){map.children[index++]=createInstanceBindingMap(child,prepareBindingFn)}return map}var contentUidCounter=1;function getContentUid(content){var id=content.id_;if(!id)id=content.id_=contentUidCounter++;return id}function getInstanceBindingMap(content,delegate_){var contentId=getContentUid(content);if(delegate_){var map=delegate_.bindingMaps[contentId];if(!map){map=delegate_.bindingMaps[contentId]=createInstanceBindingMap(content,delegate_.prepareBinding)||[]}return map}var map=content.bindingMap_;if(!map){map=content.bindingMap_=createInstanceBindingMap(content,undefined)||[]}return map}Object.defineProperty(Node.prototype,"templateInstance",{get:function(){var instance=this.templateInstance_;return instance?instance:this.parentNode?this.parentNode.templateInstance:undefined}});var emptyInstance=document.createDocumentFragment();emptyInstance.bindings_=[];emptyInstance.terminator_=null;function TemplateIterator(templateElement){this.closed=false;this.templateElement_=templateElement;this.instances=[];this.deps=undefined;this.iteratedValue=[];this.presentValue=undefined;this.arrayObserver=undefined}TemplateIterator.prototype={closeDeps:function(){var deps=this.deps;if(deps){if(deps.ifOneTime===false)deps.ifValue.close();if(deps.oneTime===false)deps.value.close()}},updateDependencies:function(directives,model){this.closeDeps();var deps=this.deps={};var template=this.templateElement_;var ifValue=true;if(directives.if){deps.hasIf=true;deps.ifOneTime=directives.if.onlyOneTime;deps.ifValue=processBinding(IF,directives.if,template,model);ifValue=deps.ifValue;if(deps.ifOneTime&&!ifValue){this.valueChanged();return}if(!deps.ifOneTime)ifValue=ifValue.open(this.updateIfValue,this)}if(directives.repeat){deps.repeat=true;deps.oneTime=directives.repeat.onlyOneTime;deps.value=processBinding(REPEAT,directives.repeat,template,model)}else{deps.repeat=false;deps.oneTime=directives.bind.onlyOneTime;deps.value=processBinding(BIND,directives.bind,template,model)}var value=deps.value;if(!deps.oneTime)value=value.open(this.updateIteratedValue,this);if(!ifValue){this.valueChanged();return}this.updateValue(value)},getUpdatedValue:function(){var value=this.deps.value;if(!this.deps.oneTime)value=value.discardChanges();return value},updateIfValue:function(ifValue){if(!ifValue){this.valueChanged();return}this.updateValue(this.getUpdatedValue())},updateIteratedValue:function(value){if(this.deps.hasIf){var ifValue=this.deps.ifValue;if(!this.deps.ifOneTime)ifValue=ifValue.discardChanges();if(!ifValue){this.valueChanged();return}}this.updateValue(value)},updateValue:function(value){if(!this.deps.repeat)value=[value];var observe=this.deps.repeat&&!this.deps.oneTime&&Array.isArray(value);this.valueChanged(value,observe)},valueChanged:function(value,observeValue){if(!Array.isArray(value))value=[];if(value===this.iteratedValue)return;this.unobserve();this.presentValue=value;if(observeValue){this.arrayObserver=new ArrayObserver(this.presentValue);this.arrayObserver.open(this.handleSplices,this)}this.handleSplices(ArrayObserver.calculateSplices(this.presentValue,this.iteratedValue))},getLastInstanceNode:function(index){if(index==-1)return this.templateElement_;var instance=this.instances[index];var terminator=instance.terminator_;if(!terminator)return this.getLastInstanceNode(index-1);if(terminator.nodeType!==Node.ELEMENT_NODE||this.templateElement_===terminator){return terminator}var subtemplateIterator=terminator.iterator_;if(!subtemplateIterator)return terminator;return subtemplateIterator.getLastTemplateNode()},getLastTemplateNode:function(){return this.getLastInstanceNode(this.instances.length-1)},insertInstanceAt:function(index,fragment){var previousInstanceLast=this.getLastInstanceNode(index-1);var parent=this.templateElement_.parentNode;this.instances.splice(index,0,fragment);parent.insertBefore(fragment,previousInstanceLast.nextSibling)},extractInstanceAt:function(index){var previousInstanceLast=this.getLastInstanceNode(index-1);var lastNode=this.getLastInstanceNode(index);var parent=this.templateElement_.parentNode;var instance=this.instances.splice(index,1)[0];while(lastNode!==previousInstanceLast){var node=previousInstanceLast.nextSibling;if(node==lastNode)lastNode=previousInstanceLast;instance.appendChild(parent.removeChild(node))}return instance},getDelegateFn:function(fn){fn=fn&&fn(this.templateElement_);return typeof fn==="function"?fn:null},handleSplices:function(splices){if(this.closed||!splices.length)return;var template=this.templateElement_;if(!template.parentNode){this.close();return}ArrayObserver.applySplices(this.iteratedValue,this.presentValue,splices);var delegate=template.delegate_;if(this.instanceModelFn_===undefined){this.instanceModelFn_=this.getDelegateFn(delegate&&delegate.prepareInstanceModel)}if(this.instancePositionChangedFn_===undefined){this.instancePositionChangedFn_=this.getDelegateFn(delegate&&delegate.prepareInstancePositionChanged)}var instanceCache=new Map;var removeDelta=0;for(var i=0;i<splices.length;i++){var splice=splices[i];var removed=splice.removed;for(var j=0;j<removed.length;j++){var model=removed[j];var instance=this.extractInstanceAt(splice.index+removeDelta);if(instance!==emptyInstance){instanceCache.set(model,instance)}}removeDelta-=splice.addedCount}for(var i=0;i<splices.length;i++){var splice=splices[i];var addIndex=splice.index;for(;addIndex<splice.index+splice.addedCount;addIndex++){var model=this.iteratedValue[addIndex];var instance=instanceCache.get(model);if(instance){instanceCache.delete(model)}else{if(this.instanceModelFn_){model=this.instanceModelFn_(model)}if(model===undefined){instance=emptyInstance}else{instance=template.createInstance(model,undefined,delegate)}}this.insertInstanceAt(addIndex,instance)}}instanceCache.forEach(function(instance){this.closeInstanceBindings(instance)},this);if(this.instancePositionChangedFn_)this.reportInstancesMoved(splices)},reportInstanceMoved:function(index){var instance=this.instances[index];if(instance===emptyInstance)return;this.instancePositionChangedFn_(instance.templateInstance_,index)},reportInstancesMoved:function(splices){var index=0;var offset=0;for(var i=0;i<splices.length;i++){var splice=splices[i];if(offset!=0){while(index<splice.index){this.reportInstanceMoved(index);index++}}else{index=splice.index}while(index<splice.index+splice.addedCount){this.reportInstanceMoved(index);index++}offset+=splice.addedCount-splice.removed.length}if(offset==0)return;var length=this.instances.length;while(index<length){this.reportInstanceMoved(index);index++}},closeInstanceBindings:function(instance){var bindings=instance.bindings_;for(var i=0;i<bindings.length;i++){bindings[i].close()}},unobserve:function(){if(!this.arrayObserver)return;this.arrayObserver.close();this.arrayObserver=undefined},close:function(){if(this.closed)return;this.unobserve();for(var i=0;i<this.instances.length;i++){this.closeInstanceBindings(this.instances[i])}this.instances.length=0;this.closeDeps();this.templateElement_.iterator_=undefined;this.closed=true}};HTMLTemplateElement.forAllTemplatesFrom_=forAllTemplatesFrom})(this);(function(scope){"use strict";var hasWorkingUrl=false;if(!scope.forceJURL){try{var u=new URL("b","http://a");hasWorkingUrl=u.href==="http://a/b"}catch(e){}}if(hasWorkingUrl)return;var relative=Object.create(null);relative["ftp"]=21;relative["file"]=0;relative["gopher"]=70;relative["http"]=80;relative["https"]=443;relative["ws"]=80;relative["wss"]=443;var relativePathDotMapping=Object.create(null);relativePathDotMapping["%2e"]=".";relativePathDotMapping[".%2e"]="..";relativePathDotMapping["%2e."]="..";relativePathDotMapping["%2e%2e"]="..";function isRelativeScheme(scheme){return relative[scheme]!==undefined}function invalid(){clear.call(this);this._isInvalid=true}function IDNAToASCII(h){if(""==h){invalid.call(this)}return h.toLowerCase()}function percentEscape(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,63,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}function percentEscapeQuery(c){var unicode=c.charCodeAt(0);if(unicode>32&&unicode<127&&[34,35,60,62,96].indexOf(unicode)==-1){return c}return encodeURIComponent(c)}var EOF=undefined,ALPHA=/[a-zA-Z]/,ALPHANUMERIC=/[a-zA-Z0-9\+\-\.]/;function parse(input,stateOverride,base){function err(message){errors.push(message)}var state=stateOverride||"scheme start",cursor=0,buffer="",seenAt=false,seenBracket=false,errors=[];loop:while((input[cursor-1]!=EOF||cursor==0)&&!this._isInvalid){var c=input[cursor];switch(state){case"scheme start":if(c&&ALPHA.test(c)){buffer+=c.toLowerCase();state="scheme"}else if(!stateOverride){buffer="";state="no scheme";continue}else{err("Invalid scheme.");break loop}break;case"scheme":if(c&&ALPHANUMERIC.test(c)){buffer+=c.toLowerCase()}else if(":"==c){this._scheme=buffer;buffer="";if(stateOverride){break loop}if(isRelativeScheme(this._scheme)){this._isRelative=true}if("file"==this._scheme){state="relative"}else if(this._isRelative&&base&&base._scheme==this._scheme){state="relative or authority"}else if(this._isRelative){state="authority first slash"}else{state="scheme data"}}else if(!stateOverride){buffer="";cursor=0;state="no scheme";continue}else if(EOF==c){break loop}else{err("Code point not allowed in scheme: "+c);break loop}break;case"scheme data":if("?"==c){query="?";state="query"}else if("#"==c){this._fragment="#";state="fragment"}else{if(EOF!=c&&" "!=c&&"\n"!=c&&"\r"!=c){this._schemeData+=percentEscape(c)}}break;case"no scheme":if(!base||!isRelativeScheme(base._scheme)){err("Missing scheme.");invalid.call(this)}else{state="relative";continue}break;case"relative or authority":if("/"==c&&"/"==input[cursor+1]){state="authority ignore slashes"}else{err("Expected /, got: "+c);state="relative";continue}break;case"relative":this._isRelative=true;if("file"!=this._scheme)this._scheme=base._scheme;if(EOF==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;break loop}else if("/"==c||"\\"==c){if("\\"==c)err("\\ is an invalid code point.");state="relative slash"}else if("?"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query="?";state="query"}else if("#"==c){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._query=base._query;this._fragment="#";state="fragment"}else{var nextC=input[cursor+1];var nextNextC=input[cursor+2];if("file"!=this._scheme||!ALPHA.test(c)||nextC!=":"&&nextC!="|"||EOF!=nextNextC&&"/"!=nextNextC&&"\\"!=nextNextC&&"?"!=nextNextC&&"#"!=nextNextC){this._host=base._host;this._port=base._port;this._path=base._path.slice();this._path.pop()}state="relative path";continue}break;case"relative slash":if("/"==c||"\\"==c){if("\\"==c){err("\\ is an invalid code point.")}if("file"==this._scheme){state="file host"}else{state="authority ignore slashes"}}else{if("file"!=this._scheme){this._host=base._host;this._port=base._port}state="relative path";continue}break;case"authority first slash":if("/"==c){state="authority second slash"}else{err("Expected '/', got: "+c);state="authority ignore slashes";continue}break;case"authority second slash":state="authority ignore slashes";if("/"!=c){err("Expected '/', got: "+c);continue}break;case"authority ignore slashes":if("/"!=c&&"\\"!=c){state="authority";continue}else{err("Expected authority, got: "+c)}break;case"authority":if("@"==c){if(seenAt){err("@ already seen.");buffer+="%40"}seenAt=true;for(var i=0;i<buffer.length;i++){var cp=buffer[i];if(" "==cp||"\n"==cp||"\r"==cp){err("Invalid whitespace in authority.");continue}if(":"==cp&&null===this._password){this._password="";continue}var tempC=percentEscape(cp);null!==this._password?this._password+=tempC:this._username+=tempC}buffer=""}else if(EOF==c||"/"==c||"\\"==c||"?"==c||"#"==c){cursor-=buffer.length;buffer="";state="host";continue}else{buffer+=c}break;case"file host":if(EOF==c||"/"==c||"\\"==c||"?"==c||"#"==c){if(buffer.length==2&&ALPHA.test(buffer[0])&&(buffer[1]==":"||buffer[1]=="|")){state="relative path"}else if(buffer.length==0){state="relative path start"}else{this._host=IDNAToASCII.call(this,buffer);buffer="";state="relative path start"}continue}else if(" "==c||"\n"==c||"\r"==c){err("Invalid whitespace in file host.")}else{buffer+=c}break;case"host":case"hostname":if(":"==c&&!seenBracket){this._host=IDNAToASCII.call(this,buffer);buffer="";state="port";if("hostname"==stateOverride){break loop}}else if(EOF==c||"/"==c||"\\"==c||"?"==c||"#"==c){this._host=IDNAToASCII.call(this,buffer);buffer="";state="relative path start";if(stateOverride){break loop}continue}else if(" "!=c&&"\n"!=c&&"\r"!=c){if("["==c){seenBracket=true}else if("]"==c){seenBracket=false}buffer+=c}else{err("Invalid code point in host/hostname: "+c)}break;case"port":if(/[0-9]/.test(c)){buffer+=c}else if(EOF==c||"/"==c||"\\"==c||"?"==c||"#"==c||stateOverride){if(""!=buffer){var temp=parseInt(buffer,10);if(temp!=relative[this._scheme]){this._port=temp+""}buffer=""}if(stateOverride){break loop}state="relative path start";continue}else if(" "==c||"\n"==c||"\r"==c){err("Invalid code point in port: "+c)}else{invalid.call(this)}break;case"relative path start":if("\\"==c)err("'\\' not allowed in path.");state="relative path";if("/"!=c&&"\\"!=c){continue}break;case"relative path":if(EOF==c||"/"==c||"\\"==c||!stateOverride&&("?"==c||"#"==c)){if("\\"==c){err("\\ not allowed in relative path.")}var tmp;if(tmp=relativePathDotMapping[buffer.toLowerCase()]){buffer=tmp}if(".."==buffer){this._path.pop();if("/"!=c&&"\\"!=c){this._path.push("")}}else if("."==buffer&&"/"!=c&&"\\"!=c){this._path.push("")}else if("."!=buffer){if("file"==this._scheme&&this._path.length==0&&buffer.length==2&&ALPHA.test(buffer[0])&&buffer[1]=="|"){buffer=buffer[0]+":"}this._path.push(buffer)}buffer="";if("?"==c){this._query="?";state="query"}else if("#"==c){this._fragment="#";state="fragment"}}else if(" "!=c&&"\n"!=c&&"\r"!=c){buffer+=percentEscape(c)}break;case"query":if(!stateOverride&&"#"==c){this._fragment="#";state="fragment"}else if(EOF!=c&&" "!=c&&"\n"!=c&&"\r"!=c){this._query+=percentEscapeQuery(c)}break;case"fragment":if(EOF!=c&&" "!=c&&"\n"!=c&&"\r"!=c){this._fragment+=c}break}cursor++}}function clear(){this._scheme="";this._schemeData="";this._username="";this._password=null;this._host="";this._port="";this._path=[];this._query="";this._fragment="";this._isInvalid=false;this._isRelative=false}function jURL(url,base){if(base!==undefined&&!(base instanceof jURL))base=new jURL(String(base));this._url=url;clear.call(this);var input=url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");parse.call(this,input,null,base)}jURL.prototype={get href(){if(this._isInvalid)return this._url;var authority="";if(""!=this._username||null!=this._password){authority=this._username+(null!=this._password?":"+this._password:"")+"@"}return this.protocol+(this._isRelative?"//"+authority+this.host:"")+this.pathname+this._query+this._fragment},set href(href){clear.call(this);parse.call(this,href)},get protocol(){return this._scheme+":"},set protocol(protocol){if(this._isInvalid)return;parse.call(this,protocol+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(host){if(this._isInvalid||!this._isRelative)return;
|
9
|
+
parse.call(this,host,"host")},get hostname(){return this._host},set hostname(hostname){if(this._isInvalid||!this._isRelative)return;parse.call(this,hostname,"hostname")},get port(){return this._port},set port(port){if(this._isInvalid||!this._isRelative)return;parse.call(this,port,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(pathname){if(this._isInvalid||!this._isRelative)return;this._path=[];parse.call(this,pathname,"relative path start")},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(search){if(this._isInvalid||!this._isRelative)return;this._query="?";if("?"==search[0])search=search.slice(1);parse.call(this,search,"query")},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(hash){if(this._isInvalid)return;this._fragment="#";if("#"==hash[0])hash=hash.slice(1);parse.call(this,hash,"fragment")},get origin(){var host;if(this._isInvalid||!this._scheme){return""}switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}host=this.host;if(!host){return""}return this._scheme+"://"+host}};var OriginalURL=scope.URL;if(OriginalURL){jURL.createObjectURL=function(blob){return OriginalURL.createObjectURL.apply(OriginalURL,arguments)};jURL.revokeObjectURL=function(url){OriginalURL.revokeObjectURL(url)}}scope.URL=jURL})(this);(function(scope){var iterations=0;var callbacks=[];var twiddle=document.createTextNode("");function endOfMicrotask(callback){twiddle.textContent=iterations++;callbacks.push(callback)}function atEndOfMicrotask(){while(callbacks.length){callbacks.shift()()}}new(window.MutationObserver||JsMutationObserver)(atEndOfMicrotask).observe(twiddle,{characterData:true});scope.endOfMicrotask=endOfMicrotask;Platform.endOfMicrotask=endOfMicrotask})(Polymer);(function(scope){var endOfMicrotask=scope.endOfMicrotask;var log=window.WebComponents?WebComponents.flags.log:{};var style=document.createElement("style");style.textContent="template {display: none !important;} /* injected by platform.js */";var head=document.querySelector("head");head.insertBefore(style,head.firstChild);var flushing;function flush(){if(!flushing){flushing=true;endOfMicrotask(function(){flushing=false;log.data&&console.group("flush");Platform.performMicrotaskCheckpoint();log.data&&console.groupEnd()})}}if(!Observer.hasObjectObserve){var FLUSH_POLL_INTERVAL=125;window.addEventListener("WebComponentsReady",function(){flush();var visibilityHandler=function(){if(document.visibilityState==="hidden"){if(scope.flushPoll){clearInterval(scope.flushPoll)}}else{scope.flushPoll=setInterval(flush,FLUSH_POLL_INTERVAL)}};if(typeof document.visibilityState==="string"){document.addEventListener("visibilitychange",visibilityHandler)}visibilityHandler()})}else{flush=function(){}}if(window.CustomElements&&!CustomElements.useNative){var originalImportNode=Document.prototype.importNode;Document.prototype.importNode=function(node,deep){var imported=originalImportNode.call(this,node,deep);CustomElements.upgradeAll(imported);return imported}}scope.flush=flush;Platform.flush=flush})(window.Polymer);(function(scope){var urlResolver={resolveDom:function(root,url){url=url||baseUrl(root);this.resolveAttributes(root,url);this.resolveStyles(root,url);var templates=root.querySelectorAll("template");if(templates){for(var i=0,l=templates.length,t;i<l&&(t=templates[i]);i++){if(t.content){this.resolveDom(t.content,url)}}}},resolveTemplate:function(template){this.resolveDom(template.content,baseUrl(template))},resolveStyles:function(root,url){var styles=root.querySelectorAll("style");if(styles){for(var i=0,l=styles.length,s;i<l&&(s=styles[i]);i++){this.resolveStyle(s,url)}}},resolveStyle:function(style,url){url=url||baseUrl(style);style.textContent=this.resolveCssText(style.textContent,url)},resolveCssText:function(cssText,baseUrl,keepAbsolute){cssText=replaceUrlsInCssText(cssText,baseUrl,keepAbsolute,CSS_URL_REGEXP);return replaceUrlsInCssText(cssText,baseUrl,keepAbsolute,CSS_IMPORT_REGEXP)},resolveAttributes:function(root,url){if(root.hasAttributes&&root.hasAttributes()){this.resolveElementAttributes(root,url)}var nodes=root&&root.querySelectorAll(URL_ATTRS_SELECTOR);if(nodes){for(var i=0,l=nodes.length,n;i<l&&(n=nodes[i]);i++){this.resolveElementAttributes(n,url)}}},resolveElementAttributes:function(node,url){url=url||baseUrl(node);URL_ATTRS.forEach(function(v){var attr=node.attributes[v];var value=attr&&attr.value;var replacement;if(value&&value.search(URL_TEMPLATE_SEARCH)<0){if(v==="style"){replacement=replaceUrlsInCssText(value,url,false,CSS_URL_REGEXP)}else{replacement=resolveRelativeUrl(url,value)}attr.value=replacement}})}};var CSS_URL_REGEXP=/(url\()([^)]*)(\))/g;var CSS_IMPORT_REGEXP=/(@import[\s]+(?!url\())([^;]*)(;)/g;var URL_ATTRS=["href","src","action","style","url"];var URL_ATTRS_SELECTOR="["+URL_ATTRS.join("],[")+"]";var URL_TEMPLATE_SEARCH="{{.*}}";var URL_HASH="#";function baseUrl(node){var u=new URL(node.ownerDocument.baseURI);u.search="";u.hash="";return u}function replaceUrlsInCssText(cssText,baseUrl,keepAbsolute,regexp){return cssText.replace(regexp,function(m,pre,url,post){var urlPath=url.replace(/["']/g,"");urlPath=resolveRelativeUrl(baseUrl,urlPath,keepAbsolute);return pre+"'"+urlPath+"'"+post})}function resolveRelativeUrl(baseUrl,url,keepAbsolute){if(url&&url[0]==="/"){return url}var u=new URL(url,baseUrl);return keepAbsolute?u.href:makeDocumentRelPath(u.href)}function makeDocumentRelPath(url){var root=baseUrl(document.documentElement);var u=new URL(url,root);if(u.host===root.host&&u.port===root.port&&u.protocol===root.protocol){return makeRelPath(root,u)}else{return url}}function makeRelPath(sourceUrl,targetUrl){var source=sourceUrl.pathname;var target=targetUrl.pathname;var s=source.split("/");var t=target.split("/");while(s.length&&s[0]===t[0]){s.shift();t.shift()}for(var i=0,l=s.length-1;i<l;i++){t.unshift("..")}var hash=targetUrl.href.slice(-1)===URL_HASH?URL_HASH:targetUrl.hash;return t.join("/")+targetUrl.search+hash}scope.urlResolver=urlResolver})(Polymer);(function(scope){var endOfMicrotask=Polymer.endOfMicrotask;function Loader(regex){this.cache=Object.create(null);this.map=Object.create(null);this.requests=0;this.regex=regex}Loader.prototype={extractUrls:function(text,base){var matches=[];var matched,u;while(matched=this.regex.exec(text)){u=new URL(matched[1],base);matches.push({matched:matched[0],url:u.href})}return matches},process:function(text,root,callback){var matches=this.extractUrls(text,root);var done=callback.bind(null,this.map);this.fetch(matches,done)},fetch:function(matches,callback){var inflight=matches.length;if(!inflight){return callback()}var done=function(){if(--inflight===0){callback()}};var m,req,url;for(var i=0;i<inflight;i++){m=matches[i];url=m.url;req=this.cache[url];if(!req){req=this.xhr(url);req.match=m;this.cache[url]=req}req.wait(done)}},handleXhr:function(request){var match=request.match;var url=match.url;var response=request.response||request.responseText||"";this.map[url]=response;this.fetch(this.extractUrls(response,url),request.resolve)},xhr:function(url){this.requests++;var request=new XMLHttpRequest;request.open("GET",url,true);request.send();request.onerror=request.onload=this.handleXhr.bind(this,request);request.pending=[];request.resolve=function(){var pending=request.pending;for(var i=0;i<pending.length;i++){pending[i]()}request.pending=null};request.wait=function(fn){if(request.pending){request.pending.push(fn)}else{endOfMicrotask(fn)}};return request}};scope.Loader=Loader})(Polymer);(function(scope){var urlResolver=scope.urlResolver;var Loader=scope.Loader;function StyleResolver(){this.loader=new Loader(this.regex)}StyleResolver.prototype={regex:/@import\s+(?:url)?["'\(]*([^'"\)]*)['"\)]*;/g,resolve:function(text,url,callback){var done=function(map){callback(this.flatten(text,url,map))}.bind(this);this.loader.process(text,url,done)},resolveNode:function(style,url,callback){var text=style.textContent;var done=function(text){style.textContent=text;callback(style)};this.resolve(text,url,done)},flatten:function(text,base,map){var matches=this.loader.extractUrls(text,base);var match,url,intermediate;for(var i=0;i<matches.length;i++){match=matches[i];url=match.url;intermediate=urlResolver.resolveCssText(map[url],url,true);intermediate=this.flatten(intermediate,base,map);text=text.replace(match.matched,intermediate)}return text},loadStyles:function(styles,base,callback){var loaded=0,l=styles.length;function loadedStyle(style){loaded++;if(loaded===l&&callback){callback()}}for(var i=0,s;i<l&&(s=styles[i]);i++){this.resolveNode(s,base,loadedStyle)}}};var styleResolver=new StyleResolver;scope.styleResolver=styleResolver})(Polymer);(function(scope){function extend(prototype,api){if(prototype&&api){Object.getOwnPropertyNames(api).forEach(function(n){var pd=Object.getOwnPropertyDescriptor(api,n);if(pd){Object.defineProperty(prototype,n,pd);if(typeof pd.value=="function"){pd.value.nom=n}}})}return prototype}function mixin(inObj){var obj=inObj||{};for(var i=1;i<arguments.length;i++){var p=arguments[i];try{for(var n in p){copyProperty(n,p,obj)}}catch(x){}}return obj}function copyProperty(inName,inSource,inTarget){var pd=getPropertyDescriptor(inSource,inName);Object.defineProperty(inTarget,inName,pd)}function getPropertyDescriptor(inObject,inName){if(inObject){var pd=Object.getOwnPropertyDescriptor(inObject,inName);return pd||getPropertyDescriptor(Object.getPrototypeOf(inObject),inName)}}scope.extend=extend;scope.mixin=mixin;Platform.mixin=mixin})(Polymer);(function(scope){var Job=function(inContext){this.context=inContext;this.boundComplete=this.complete.bind(this)};Job.prototype={go:function(callback,wait){this.callback=callback;var h;if(!wait){h=requestAnimationFrame(this.boundComplete);this.handle=function(){cancelAnimationFrame(h)}}else{h=setTimeout(this.boundComplete,wait);this.handle=function(){clearTimeout(h)}}},stop:function(){if(this.handle){this.handle();this.handle=null}},complete:function(){if(this.handle){this.stop();this.callback.call(this.context)}}};function job(job,callback,wait){if(job){job.stop()}else{job=new Job(this)}job.go(callback,wait);return job}scope.job=job})(Polymer);(function(scope){var registry={};HTMLElement.register=function(tag,prototype){registry[tag]=prototype};HTMLElement.getPrototypeForTag=function(tag){var prototype=!tag?HTMLElement.prototype:registry[tag];return prototype||Object.getPrototypeOf(document.createElement(tag))};var originalStopPropagation=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){this.cancelBubble=true;originalStopPropagation.apply(this,arguments)};var add=DOMTokenList.prototype.add;var remove=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){for(var i=0;i<arguments.length;i++){add.call(this,arguments[i])}};DOMTokenList.prototype.remove=function(){for(var i=0;i<arguments.length;i++){remove.call(this,arguments[i])}};DOMTokenList.prototype.toggle=function(name,bool){if(arguments.length==1){bool=!this.contains(name)}bool?this.add(name):this.remove(name)};DOMTokenList.prototype.switch=function(oldName,newName){oldName&&this.remove(oldName);newName&&this.add(newName)};var ArraySlice=function(){return Array.prototype.slice.call(this)};var namedNodeMap=window.NamedNodeMap||window.MozNamedAttrMap||{};NodeList.prototype.array=ArraySlice;namedNodeMap.prototype.array=ArraySlice;HTMLCollection.prototype.array=ArraySlice;function createDOM(inTagOrNode,inHTML,inAttrs){var dom=typeof inTagOrNode=="string"?document.createElement(inTagOrNode):inTagOrNode.cloneNode(true);dom.innerHTML=inHTML;if(inAttrs){for(var n in inAttrs){dom.setAttribute(n,inAttrs[n])}}return dom}scope.createDOM=createDOM})(Polymer);(function(scope){function $super(arrayOfArgs){var caller=$super.caller;var nom=caller.nom;var _super=caller._super;if(!_super){if(!nom){nom=caller.nom=nameInThis.call(this,caller)}if(!nom){console.warn("called super() on a method not installed declaratively (has no .nom property)")}_super=memoizeSuper(caller,nom,getPrototypeOf(this))}var fn=_super[nom];if(fn){if(!fn._super){memoizeSuper(fn,nom,_super)}return fn.apply(this,arrayOfArgs||[])}}function nameInThis(value){var p=this.__proto__;while(p&&p!==HTMLElement.prototype){var n$=Object.getOwnPropertyNames(p);for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){var d=Object.getOwnPropertyDescriptor(p,n);if(typeof d.value==="function"&&d.value===value){return n}}p=p.__proto__}}function memoizeSuper(method,name,proto){var s=nextSuper(proto,name,method);if(s[name]){s[name].nom=name}return method._super=s}function nextSuper(proto,name,caller){while(proto){if(proto[name]!==caller&&proto[name]){return proto}proto=getPrototypeOf(proto)}return Object}function getPrototypeOf(prototype){return prototype.__proto__}function hintSuper(prototype){for(var n in prototype){var pd=Object.getOwnPropertyDescriptor(prototype,n);if(pd&&typeof pd.value==="function"){pd.value.nom=n}}}scope.super=$super})(Polymer);(function(scope){function noopHandler(value){return value}var typeHandlers={string:noopHandler,undefined:noopHandler,date:function(value){return new Date(Date.parse(value)||Date.now())},"boolean":function(value){if(value===""){return true}return value==="false"?false:!!value},number:function(value){var n=parseFloat(value);if(n===0){n=parseInt(value)}return isNaN(n)?value:n},object:function(value,currentValue){if(currentValue===null){return value}try{return JSON.parse(value.replace(/'/g,'"'))}catch(e){return value}},"function":function(value,currentValue){return currentValue}};function deserializeValue(value,currentValue){var inferredType=typeof currentValue;if(currentValue instanceof Date){inferredType="date"}return typeHandlers[inferredType](value,currentValue)}scope.deserializeValue=deserializeValue})(Polymer);(function(scope){var extend=scope.extend;var api={};api.declaration={};api.instance={};api.publish=function(apis,prototype){for(var n in apis){extend(prototype,apis[n])}};scope.api=api})(Polymer);(function(scope){var utils={async:function(method,args,timeout){Polymer.flush();args=args&&args.length?args:[args];var fn=function(){(this[method]||method).apply(this,args)}.bind(this);var handle=timeout?setTimeout(fn,timeout):requestAnimationFrame(fn);return timeout?handle:~handle},cancelAsync:function(handle){if(handle<0){cancelAnimationFrame(~handle)}else{clearTimeout(handle)}},fire:function(type,detail,onNode,bubbles,cancelable){var node=onNode||this;var detail=detail===null||detail===undefined?{}:detail;var event=new CustomEvent(type,{bubbles:bubbles!==undefined?bubbles:true,cancelable:cancelable!==undefined?cancelable:true,detail:detail});node.dispatchEvent(event);return event},asyncFire:function(){this.async("fire",arguments)},classFollows:function(anew,old,className){if(old){old.classList.remove(className)}if(anew){anew.classList.add(className)}},injectBoundHTML:function(html,element){var template=document.createElement("template");template.innerHTML=html;var fragment=this.instanceTemplate(template);if(element){element.textContent="";element.appendChild(fragment)}return fragment}};var nop=function(){};var nob={};utils.asyncMethod=utils.async;scope.api.instance.utils=utils;scope.nop=nop;scope.nob=nob})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var EVENT_PREFIX="on-";var events={EVENT_PREFIX:EVENT_PREFIX,addHostListeners:function(){var events=this.eventDelegates;log.events&&Object.keys(events).length>0&&console.log("[%s] addHostListeners:",this.localName,events);for(var type in events){var methodName=events[type];PolymerGestures.addEventListener(this,type,this.element.getEventHandler(this,this,methodName))}},dispatchMethod:function(obj,method,args){if(obj){log.events&&console.group("[%s] dispatch [%s]",obj.localName,method);var fn=typeof method==="function"?method:obj[method];if(fn){fn[args?"apply":"call"](obj,args)}log.events&&console.groupEnd();Polymer.flush()}}};scope.api.instance.events=events;scope.addEventListener=function(node,eventType,handlerFn,capture){PolymerGestures.addEventListener(wrap(node),eventType,handlerFn,capture)};scope.removeEventListener=function(node,eventType,handlerFn,capture){PolymerGestures.removeEventListener(wrap(node),eventType,handlerFn,capture)}})(Polymer);(function(scope){var attributes={copyInstanceAttributes:function(){var a$=this._instanceAttributes;for(var k in a$){if(!this.hasAttribute(k)){this.setAttribute(k,a$[k])}}},takeAttributes:function(){if(this._publishLC){for(var i=0,a$=this.attributes,l=a$.length,a;(a=a$[i])&&i<l;i++){this.attributeToProperty(a.name,a.value)}}},attributeToProperty:function(name,value){var name=this.propertyForAttribute(name);if(name){if(value&&value.search(scope.bindPattern)>=0){return}var currentValue=this[name];var value=this.deserializeValue(value,currentValue);if(value!==currentValue){this[name]=value}}},propertyForAttribute:function(name){var match=this._publishLC&&this._publishLC[name];return match},deserializeValue:function(stringValue,currentValue){return scope.deserializeValue(stringValue,currentValue)},serializeValue:function(value,inferredType){if(inferredType==="boolean"){return value?"":undefined}else if(inferredType!=="object"&&inferredType!=="function"&&value!==undefined){return value}},reflectPropertyToAttribute:function(name){var inferredType=typeof this[name];var serializedValue=this.serializeValue(this[name],inferredType);if(serializedValue!==undefined){this.setAttribute(name,serializedValue)}else if(inferredType==="boolean"){this.removeAttribute(name)}}};scope.api.instance.attributes=attributes})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var OBSERVE_SUFFIX="Changed";var empty=[];var updateRecord={object:undefined,type:"update",name:undefined,oldValue:undefined};var numberIsNaN=Number.isNaN||function(value){return typeof value==="number"&&isNaN(value)};function areSameValue(left,right){if(left===right)return left!==0||1/left===1/right;if(numberIsNaN(left)&&numberIsNaN(right))return true;return left!==left&&right!==right}function resolveBindingValue(oldValue,value){if(value===undefined&&oldValue===null){return value}return value===null||value===undefined?oldValue:value}var properties={createPropertyObserver:function(){var n$=this._observeNames;if(n$&&n$.length){var o=this._propertyObserver=new CompoundObserver(true);this.registerObserver(o);for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){o.addPath(this,n);this.observeArrayValue(n,this[n],null)}}},openPropertyObserver:function(){if(this._propertyObserver){this._propertyObserver.open(this.notifyPropertyChanges,this)}},notifyPropertyChanges:function(newValues,oldValues,paths){var name,method,called={};for(var i in oldValues){name=paths[2*i+1];method=this.observe[name];if(method){var ov=oldValues[i],nv=newValues[i];this.observeArrayValue(name,nv,ov);if(!called[method]){if(ov!==undefined&&ov!==null||nv!==undefined&&nv!==null){called[method]=true;this.invokeMethod(method,[ov,nv,arguments])}}}}},invokeMethod:function(method,args){var fn=this[method]||method;if(typeof fn==="function"){fn.apply(this,args)}},deliverChanges:function(){if(this._propertyObserver){this._propertyObserver.deliver()}},observeArrayValue:function(name,value,old){var callbackName=this.observe[name];if(callbackName){if(Array.isArray(old)){log.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,name);this.closeNamedObserver(name+"__array")}if(Array.isArray(value)){log.observe&&console.log("[%s] observeArrayValue: register observer [%s]",this.localName,name,value);var observer=new ArrayObserver(value);observer.open(function(splices){this.invokeMethod(callbackName,[splices])},this);this.registerNamedObserver(name+"__array",observer)}}},emitPropertyChangeRecord:function(name,value,oldValue){var object=this;if(areSameValue(value,oldValue)){return}this._propertyChanged(name,value,oldValue);if(!Observer.hasObjectObserve){return}var notifier=this._objectNotifier;if(!notifier){notifier=this._objectNotifier=Object.getNotifier(this)}updateRecord.object=this;updateRecord.name=name;updateRecord.oldValue=oldValue;notifier.notify(updateRecord)},_propertyChanged:function(name,value,oldValue){if(this.reflect[name]){this.reflectPropertyToAttribute(name)}},bindProperty:function(property,observable,oneTime){if(oneTime){this[property]=observable;return}var computed=this.element.prototype.computed;if(computed&&computed[property]){var privateComputedBoundValue=property+"ComputedBoundObservable_";this[privateComputedBoundValue]=observable;return}return this.bindToAccessor(property,observable,resolveBindingValue)},bindToAccessor:function(name,observable,resolveFn){var privateName=name+"_";var privateObservable=name+"Observable_";var privateComputedBoundValue=name+"ComputedBoundObservable_";this[privateObservable]=observable;var oldValue=this[privateName];var self=this;function updateValue(value,oldValue){self[privateName]=value;var setObserveable=self[privateComputedBoundValue];if(setObserveable&&typeof setObserveable.setValue=="function"){setObserveable.setValue(value)}self.emitPropertyChangeRecord(name,value,oldValue)}var value=observable.open(updateValue);if(resolveFn&&!areSameValue(oldValue,value)){var resolvedValue=resolveFn(oldValue,value);if(!areSameValue(value,resolvedValue)){value=resolvedValue;if(observable.setValue){observable.setValue(value)}}}updateValue(value,oldValue);var observer={close:function(){observable.close();self[privateObservable]=undefined;self[privateComputedBoundValue]=undefined}};this.registerObserver(observer);return observer},createComputedProperties:function(){if(!this._computedNames){return}for(var i=0;i<this._computedNames.length;i++){var name=this._computedNames[i];var expressionText=this.computed[name];try{var expression=PolymerExpressions.getExpression(expressionText);var observable=expression.getBinding(this,this.element.syntax);this.bindToAccessor(name,observable)}catch(ex){console.error("Failed to create computed property",ex)}}},registerObserver:function(observer){if(!this._observers){this._observers=[observer];return}this._observers.push(observer)},closeObservers:function(){if(!this._observers){return}var observers=this._observers;for(var i=0;i<observers.length;i++){var observer=observers[i];if(observer&&typeof observer.close=="function"){observer.close()}}this._observers=[]},registerNamedObserver:function(name,observer){var o$=this._namedObservers||(this._namedObservers={});o$[name]=observer},closeNamedObserver:function(name){var o$=this._namedObservers;if(o$&&o$[name]){o$[name].close();o$[name]=null;return true}},closeNamedObservers:function(){if(this._namedObservers){for(var i in this._namedObservers){this.closeNamedObserver(i)}this._namedObservers={}}}};var LOG_OBSERVE="[%s] watching [%s]";var LOG_OBSERVED="[%s#%s] watch: [%s] now [%s] was [%s]";var LOG_CHANGED="[%s#%s] propertyChanged: [%s] now [%s] was [%s]";scope.api.instance.properties=properties})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var mdv={instanceTemplate:function(template){HTMLTemplateElement.decorate(template);var syntax=this.syntax||!template.bindingDelegate&&this.element.syntax;var dom=template.createInstance(this,syntax);var observers=dom.bindings_;for(var i=0;i<observers.length;i++){this.registerObserver(observers[i])}return dom},bind:function(name,observable,oneTime){var property=this.propertyForAttribute(name);if(!property){return this.mixinSuper(arguments)}else{var observer=this.bindProperty(property,observable,oneTime);if(Platform.enableBindingsReflection&&observer){observer.path=observable.path_;this._recordBinding(property,observer)}if(this.reflect[property]){this.reflectPropertyToAttribute(property)}return observer}},_recordBinding:function(name,observer){this.bindings_=this.bindings_||{};this.bindings_[name]=observer},bindFinished:function(){this.makeElementReady()},asyncUnbindAll:function(){if(!this._unbound){log.unbind&&console.log("[%s] asyncUnbindAll",this.localName);this._unbindAllJob=this.job(this._unbindAllJob,this.unbindAll,0)}},unbindAll:function(){if(!this._unbound){this.closeObservers();this.closeNamedObservers();this._unbound=true}},cancelUnbindAll:function(){if(this._unbound){log.unbind&&console.warn("[%s] already unbound, cannot cancel unbindAll",this.localName);return}log.unbind&&console.log("[%s] cancelUnbindAll",this.localName);if(this._unbindAllJob){this._unbindAllJob=this._unbindAllJob.stop()}}};function unbindNodeTree(node){forNodeTree(node,_nodeUnbindAll)}function _nodeUnbindAll(node){node.unbindAll()}function forNodeTree(node,callback){if(node){callback(node);for(var child=node.firstChild;child;child=child.nextSibling){forNodeTree(child,callback)}}}var mustachePattern=/\{\{([^{}]*)}}/;scope.bindPattern=mustachePattern;scope.api.instance.mdv=mdv})(Polymer);(function(scope){var base={PolymerBase:true,job:function(job,callback,wait){if(typeof job==="string"){var n="___"+job;this[n]=Polymer.job.call(this,this[n],callback,wait)}else{return Polymer.job.call(this,job,callback,wait)}},"super":Polymer.super,created:function(){},ready:function(){},createdCallback:function(){if(this.templateInstance&&this.templateInstance.model){console.warn("Attributes on "+this.localName+" were data bound "+"prior to Polymer upgrading the element. This may result in "+"incorrect binding types.")}this.created();this.prepareElement();if(!this.ownerDocument.isStagingDocument){this.makeElementReady()}},prepareElement:function(){if(this._elementPrepared){console.warn("Element already prepared",this.localName);return}this._elementPrepared=true;this.shadowRoots={};this.createPropertyObserver();this.openPropertyObserver();this.copyInstanceAttributes();this.takeAttributes();this.addHostListeners()},makeElementReady:function(){if(this._readied){return}this._readied=true;this.createComputedProperties();this.parseDeclarations(this.__proto__);this.removeAttribute("unresolved");this.ready()},attributeChangedCallback:function(name,oldValue){if(name!=="class"&&name!=="style"){this.attributeToProperty(name,this.getAttribute(name))}if(this.attributeChanged){this.attributeChanged.apply(this,arguments)}},attachedCallback:function(){this.cancelUnbindAll();if(this.attached){this.attached()}if(!this.hasBeenAttached){this.hasBeenAttached=true;if(this.domReady){this.async("domReady")}}},detachedCallback:function(){if(!this.preventDispose){this.asyncUnbindAll()}if(this.detached){this.detached()}if(this.leftView){this.leftView()}},parseDeclarations:function(p){if(p&&p.element){this.parseDeclarations(p.__proto__);p.parseDeclaration.call(this,p.element)}},parseDeclaration:function(elementElement){var template=this.fetchTemplate(elementElement);if(template){var root=this.shadowFromTemplate(template);this.shadowRoots[elementElement.name]=root}},fetchTemplate:function(elementElement){return elementElement.querySelector("template")},shadowFromTemplate:function(template){if(template){var root=this.createShadowRoot();var dom=this.instanceTemplate(template);root.appendChild(dom);this.shadowRootReady(root,template);return root}},lightFromTemplate:function(template,refNode){if(template){this.eventController=this;var dom=this.instanceTemplate(template);if(refNode){this.insertBefore(dom,refNode)}else{this.appendChild(dom)}this.shadowRootReady(this);return dom}},shadowRootReady:function(root){this.marshalNodeReferences(root)},marshalNodeReferences:function(root){var $=this.$=this.$||{};if(root){var n$=root.querySelectorAll("[id]");for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){$[n.id]=n}}},onMutation:function(node,listener){var observer=new MutationObserver(function(mutations){listener.call(this,observer,mutations);observer.disconnect()}.bind(this));observer.observe(node,{childList:true,subtree:true})}};function isBase(object){return object.hasOwnProperty("PolymerBase")}function PolymerBase(){}PolymerBase.prototype=base;base.constructor=PolymerBase;scope.Base=PolymerBase;scope.isBase=isBase;scope.api.instance.base=base})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var hasShadowDOMPolyfill=window.ShadowDOMPolyfill;var STYLE_SCOPE_ATTRIBUTE="element";var STYLE_CONTROLLER_SCOPE="controller";var styles={STYLE_SCOPE_ATTRIBUTE:STYLE_SCOPE_ATTRIBUTE,installControllerStyles:function(){var scope=this.findStyleScope();if(scope&&!this.scopeHasNamedStyle(scope,this.localName)){var proto=getPrototypeOf(this),cssText="";while(proto&&proto.element){cssText+=proto.element.cssTextForScope(STYLE_CONTROLLER_SCOPE);proto=getPrototypeOf(proto)}if(cssText){this.installScopeCssText(cssText,scope)}}},installScopeStyle:function(style,name,scope){var scope=scope||this.findStyleScope(),name=name||"";if(scope&&!this.scopeHasNamedStyle(scope,this.localName+name)){var cssText="";if(style instanceof Array){for(var i=0,l=style.length,s;i<l&&(s=style[i]);i++){cssText+=s.textContent+"\n\n"}}else{cssText=style.textContent}this.installScopeCssText(cssText,scope,name)}},installScopeCssText:function(cssText,scope,name){scope=scope||this.findStyleScope();name=name||"";if(!scope){return}if(hasShadowDOMPolyfill){cssText=shimCssText(cssText,scope.host)}var style=this.element.cssTextToScopeStyle(cssText,STYLE_CONTROLLER_SCOPE);Polymer.applyStyleToScope(style,scope);this.styleCacheForScope(scope)[this.localName+name]=true},findStyleScope:function(node){var n=node||this;while(n.parentNode){n=n.parentNode}return n},scopeHasNamedStyle:function(scope,name){var cache=this.styleCacheForScope(scope);return cache[name]},styleCacheForScope:function(scope){if(hasShadowDOMPolyfill){var scopeName=scope.host?scope.host.localName:scope.localName;return polyfillScopeStyleCache[scopeName]||(polyfillScopeStyleCache[scopeName]={})}else{return scope._scopeStyles=scope._scopeStyles||{}}}};var polyfillScopeStyleCache={};function getPrototypeOf(prototype){return prototype.__proto__}function shimCssText(cssText,host){var name="",is=false;if(host){name=host.localName;is=host.hasAttribute("is")}var selector=WebComponents.ShadowCSS.makeScopeSelector(name,is);return WebComponents.ShadowCSS.shimCssText(cssText,selector)}scope.api.instance.styles=styles})(Polymer);(function(scope){var extend=scope.extend;var api=scope.api;function element(name,prototype){if(typeof name!=="string"){var script=prototype||document._currentScript;prototype=name;name=script&&script.parentNode&&script.parentNode.getAttribute?script.parentNode.getAttribute("name"):"";if(!name){throw"Element name could not be inferred."}}if(getRegisteredPrototype(name)){throw"Already registered (Polymer) prototype for element "+name}registerPrototype(name,prototype);notifyPrototype(name)}function waitingForPrototype(name,client){waitPrototype[name]=client}var waitPrototype={};function notifyPrototype(name){if(waitPrototype[name]){waitPrototype[name].registerWhenReady();delete waitPrototype[name]}}var prototypesByName={};function registerPrototype(name,prototype){return prototypesByName[name]=prototype||{}}function getRegisteredPrototype(name){return prototypesByName[name]}function instanceOfType(element,type){if(typeof type!=="string"){return false}var proto=HTMLElement.getPrototypeForTag(type);var ctor=proto&&proto.constructor;if(!ctor){return false}if(CustomElements.instanceof){return CustomElements.instanceof(element,ctor)}return element instanceof ctor}scope.getRegisteredPrototype=getRegisteredPrototype;scope.waitingForPrototype=waitingForPrototype;scope.instanceOfType=instanceOfType;window.Polymer=element;extend(Polymer,scope);if(WebComponents.consumeDeclarations){WebComponents.consumeDeclarations(function(declarations){if(declarations){for(var i=0,l=declarations.length,d;i<l&&(d=declarations[i]);i++){element.apply(null,d)}}})}})(Polymer);(function(scope){var path={resolveElementPaths:function(node){Polymer.urlResolver.resolveDom(node)},addResolvePathApi:function(){var assetPath=this.getAttribute("assetpath")||"";var root=new URL(assetPath,this.ownerDocument.baseURI);
|
10
|
+
this.prototype.resolvePath=function(urlPath,base){var u=new URL(urlPath,base||root);return u.href}}};scope.api.declaration.path=path})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var api=scope.api.instance.styles;var STYLE_SCOPE_ATTRIBUTE=api.STYLE_SCOPE_ATTRIBUTE;var hasShadowDOMPolyfill=window.ShadowDOMPolyfill;var STYLE_SELECTOR="style";var STYLE_LOADABLE_MATCH="@import";var SHEET_SELECTOR="link[rel=stylesheet]";var STYLE_GLOBAL_SCOPE="global";var SCOPE_ATTR="polymer-scope";var styles={loadStyles:function(callback){var template=this.fetchTemplate();var content=template&&this.templateContent();if(content){this.convertSheetsToStyles(content);var styles=this.findLoadableStyles(content);if(styles.length){var templateUrl=template.ownerDocument.baseURI;return Polymer.styleResolver.loadStyles(styles,templateUrl,callback)}}if(callback){callback()}},convertSheetsToStyles:function(root){var s$=root.querySelectorAll(SHEET_SELECTOR);for(var i=0,l=s$.length,s,c;i<l&&(s=s$[i]);i++){c=createStyleElement(importRuleForSheet(s,this.ownerDocument.baseURI),this.ownerDocument);this.copySheetAttributes(c,s);s.parentNode.replaceChild(c,s)}},copySheetAttributes:function(style,link){for(var i=0,a$=link.attributes,l=a$.length,a;(a=a$[i])&&i<l;i++){if(a.name!=="rel"&&a.name!=="href"){style.setAttribute(a.name,a.value)}}},findLoadableStyles:function(root){var loadables=[];if(root){var s$=root.querySelectorAll(STYLE_SELECTOR);for(var i=0,l=s$.length,s;i<l&&(s=s$[i]);i++){if(s.textContent.match(STYLE_LOADABLE_MATCH)){loadables.push(s)}}}return loadables},installSheets:function(){this.cacheSheets();this.cacheStyles();this.installLocalSheets();this.installGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(SHEET_SELECTOR);this.sheets.forEach(function(s){if(s.parentNode){s.parentNode.removeChild(s)}})},cacheStyles:function(){this.styles=this.findNodes(STYLE_SELECTOR+"["+SCOPE_ATTR+"]");this.styles.forEach(function(s){if(s.parentNode){s.parentNode.removeChild(s)}})},installLocalSheets:function(){var sheets=this.sheets.filter(function(s){return!s.hasAttribute(SCOPE_ATTR)});var content=this.templateContent();if(content){var cssText="";sheets.forEach(function(sheet){cssText+=cssTextFromSheet(sheet)+"\n"});if(cssText){var style=createStyleElement(cssText,this.ownerDocument);content.insertBefore(style,content.firstChild)}}},findNodes:function(selector,matcher){var nodes=this.querySelectorAll(selector).array();var content=this.templateContent();if(content){var templateNodes=content.querySelectorAll(selector).array();nodes=nodes.concat(templateNodes)}return matcher?nodes.filter(matcher):nodes},installGlobalStyles:function(){var style=this.styleForScope(STYLE_GLOBAL_SCOPE);applyStyleToScope(style,document.head)},cssTextForScope:function(scopeDescriptor){var cssText="";var selector="["+SCOPE_ATTR+"="+scopeDescriptor+"]";var matcher=function(s){return matchesSelector(s,selector)};var sheets=this.sheets.filter(matcher);sheets.forEach(function(sheet){cssText+=cssTextFromSheet(sheet)+"\n\n"});var styles=this.styles.filter(matcher);styles.forEach(function(style){cssText+=style.textContent+"\n\n"});return cssText},styleForScope:function(scopeDescriptor){var cssText=this.cssTextForScope(scopeDescriptor);return this.cssTextToScopeStyle(cssText,scopeDescriptor)},cssTextToScopeStyle:function(cssText,scopeDescriptor){if(cssText){var style=createStyleElement(cssText);style.setAttribute(STYLE_SCOPE_ATTRIBUTE,this.getAttribute("name")+"-"+scopeDescriptor);return style}}};function importRuleForSheet(sheet,baseUrl){var href=new URL(sheet.getAttribute("href"),baseUrl).href;return"@import '"+href+"';"}function applyStyleToScope(style,scope){if(style){if(scope===document){scope=document.head}if(hasShadowDOMPolyfill){scope=document.head}var clone=createStyleElement(style.textContent);var attr=style.getAttribute(STYLE_SCOPE_ATTRIBUTE);if(attr){clone.setAttribute(STYLE_SCOPE_ATTRIBUTE,attr)}var refNode=scope.firstElementChild;if(scope===document.head){var selector="style["+STYLE_SCOPE_ATTRIBUTE+"]";var s$=document.head.querySelectorAll(selector);if(s$.length){refNode=s$[s$.length-1].nextElementSibling}}scope.insertBefore(clone,refNode)}}function createStyleElement(cssText,scope){scope=scope||document;scope=scope.createElement?scope:scope.ownerDocument;var style=scope.createElement("style");style.textContent=cssText;return style}function cssTextFromSheet(sheet){return sheet&&sheet.__resource||""}function matchesSelector(node,inSelector){if(matches){return matches.call(node,inSelector)}}var p=HTMLElement.prototype;var matches=p.matches||p.matchesSelector||p.webkitMatchesSelector||p.mozMatchesSelector;scope.api.declaration.styles=styles;scope.applyStyleToScope=applyStyleToScope})(Polymer);(function(scope){var log=window.WebComponents?WebComponents.flags.log:{};var api=scope.api.instance.events;var EVENT_PREFIX=api.EVENT_PREFIX;var mixedCaseEventTypes={};["webkitAnimationStart","webkitAnimationEnd","webkitTransitionEnd","DOMFocusOut","DOMFocusIn","DOMMouseScroll"].forEach(function(e){mixedCaseEventTypes[e.toLowerCase()]=e});var events={parseHostEvents:function(){var delegates=this.prototype.eventDelegates;this.addAttributeDelegates(delegates)},addAttributeDelegates:function(delegates){for(var i=0,a;a=this.attributes[i];i++){if(this.hasEventPrefix(a.name)){delegates[this.removeEventPrefix(a.name)]=a.value.replace("{{","").replace("}}","").trim()}}},hasEventPrefix:function(n){return n&&n[0]==="o"&&n[1]==="n"&&n[2]==="-"},removeEventPrefix:function(n){return n.slice(prefixLength)},findController:function(node){while(node.parentNode){if(node.eventController){return node.eventController}node=node.parentNode}return node.host},getEventHandler:function(controller,target,method){var events=this;return function(e){if(!controller||!controller.PolymerBase){controller=events.findController(target)}var args=[e,e.detail,e.currentTarget];controller.dispatchMethod(controller,method,args)}},prepareEventBinding:function(pathString,name,node){if(!this.hasEventPrefix(name))return;var eventType=this.removeEventPrefix(name);eventType=mixedCaseEventTypes[eventType]||eventType;var events=this;return function(model,node,oneTime){var handler=events.getEventHandler(undefined,node,pathString);PolymerGestures.addEventListener(node,eventType,handler);if(oneTime)return;function bindingValue(){return"{{ "+pathString+" }}"}return{open:bindingValue,discardChanges:bindingValue,close:function(){PolymerGestures.removeEventListener(node,eventType,handler)}}}}};var prefixLength=EVENT_PREFIX.length;scope.api.declaration.events=events})(Polymer);(function(scope){var observationBlacklist=["attribute"];var properties={inferObservers:function(prototype){var observe=prototype.observe,property;for(var n in prototype){if(n.slice(-7)==="Changed"){property=n.slice(0,-7);if(this.canObserveProperty(property)){if(!observe){observe=prototype.observe={}}observe[property]=observe[property]||n}}}},canObserveProperty:function(property){return observationBlacklist.indexOf(property)<0},explodeObservers:function(prototype){var o=prototype.observe;if(o){var exploded={};for(var n in o){var names=n.split(" ");for(var i=0,ni;ni=names[i];i++){exploded[ni]=o[n]}}prototype.observe=exploded}},optimizePropertyMaps:function(prototype){if(prototype.observe){var a=prototype._observeNames=[];for(var n in prototype.observe){var names=n.split(" ");for(var i=0,ni;ni=names[i];i++){a.push(ni)}}}if(prototype.publish){var a=prototype._publishNames=[];for(var n in prototype.publish){a.push(n)}}if(prototype.computed){var a=prototype._computedNames=[];for(var n in prototype.computed){a.push(n)}}},publishProperties:function(prototype,base){var publish=prototype.publish;if(publish){this.requireProperties(publish,prototype,base);this.filterInvalidAccessorNames(publish);prototype._publishLC=this.lowerCaseMap(publish)}var computed=prototype.computed;if(computed){this.filterInvalidAccessorNames(computed)}},filterInvalidAccessorNames:function(propertyNames){for(var name in propertyNames){if(this.propertyNameBlacklist[name]){console.warn('Cannot define property "'+name+'" for element "'+this.name+'" because it has the same name as an HTMLElement '+"property, and not all browsers support overriding that. "+"Consider giving it a different name.");delete propertyNames[name]}}},requireProperties:function(propertyInfos,prototype,base){prototype.reflect=prototype.reflect||{};for(var n in propertyInfos){var value=propertyInfos[n];if(value&&value.reflect!==undefined){prototype.reflect[n]=Boolean(value.reflect);value=value.value}if(value!==undefined){prototype[n]=value}}},lowerCaseMap:function(properties){var map={};for(var n in properties){map[n.toLowerCase()]=n}return map},createPropertyAccessor:function(name,ignoreWrites){var proto=this.prototype;var privateName=name+"_";var privateObservable=name+"Observable_";proto[privateName]=proto[name];Object.defineProperty(proto,name,{get:function(){var observable=this[privateObservable];if(observable)observable.deliver();return this[privateName]},set:function(value){if(ignoreWrites){return this[privateName]}var observable=this[privateObservable];if(observable){observable.setValue(value);return}var oldValue=this[privateName];this[privateName]=value;this.emitPropertyChangeRecord(name,value,oldValue);return value},configurable:true})},createPropertyAccessors:function(prototype){var n$=prototype._computedNames;if(n$&&n$.length){for(var i=0,l=n$.length,n,fn;i<l&&(n=n$[i]);i++){this.createPropertyAccessor(n,true)}}var n$=prototype._publishNames;if(n$&&n$.length){for(var i=0,l=n$.length,n,fn;i<l&&(n=n$[i]);i++){if(!prototype.computed||!prototype.computed[n]){this.createPropertyAccessor(n)}}}},propertyNameBlacklist:{children:1,"class":1,id:1,hidden:1,style:1,title:1}};scope.api.declaration.properties=properties})(Polymer);(function(scope){var ATTRIBUTES_ATTRIBUTE="attributes";var ATTRIBUTES_REGEX=/\s|,/;var attributes={inheritAttributesObjects:function(prototype){this.inheritObject(prototype,"publishLC");this.inheritObject(prototype,"_instanceAttributes")},publishAttributes:function(prototype,base){var attributes=this.getAttribute(ATTRIBUTES_ATTRIBUTE);if(attributes){var publish=prototype.publish||(prototype.publish={});var names=attributes.split(ATTRIBUTES_REGEX);for(var i=0,l=names.length,n;i<l;i++){n=names[i].trim();if(n&&publish[n]===undefined){publish[n]=undefined}}}},accumulateInstanceAttributes:function(){var clonable=this.prototype._instanceAttributes;var a$=this.attributes;for(var i=0,l=a$.length,a;i<l&&(a=a$[i]);i++){if(this.isInstanceAttribute(a.name)){clonable[a.name]=a.value}}},isInstanceAttribute:function(name){return!this.blackList[name]&&name.slice(0,3)!=="on-"},blackList:{name:1,"extends":1,constructor:1,noscript:1,assetpath:1,"cache-csstext":1}};attributes.blackList[ATTRIBUTES_ATTRIBUTE]=1;scope.api.declaration.attributes=attributes})(Polymer);(function(scope){var events=scope.api.declaration.events;var syntax=new PolymerExpressions;var prepareBinding=syntax.prepareBinding;syntax.prepareBinding=function(pathString,name,node){return events.prepareEventBinding(pathString,name,node)||prepareBinding.call(syntax,pathString,name,node)};var mdv={syntax:syntax,fetchTemplate:function(){return this.querySelector("template")},templateContent:function(){var template=this.fetchTemplate();return template&&template.content},installBindingDelegate:function(template){if(template){template.bindingDelegate=this.syntax}}};scope.api.declaration.mdv=mdv})(Polymer);(function(scope){var api=scope.api;var isBase=scope.isBase;var extend=scope.extend;var hasShadowDOMPolyfill=window.ShadowDOMPolyfill;var prototype={register:function(name,extendeeName){this.buildPrototype(name,extendeeName);this.registerPrototype(name,extendeeName);this.publishConstructor()},buildPrototype:function(name,extendeeName){var extension=scope.getRegisteredPrototype(name);var base=this.generateBasePrototype(extendeeName);this.desugarBeforeChaining(extension,base);this.prototype=this.chainPrototypes(extension,base);this.desugarAfterChaining(name,extendeeName)},desugarBeforeChaining:function(prototype,base){prototype.element=this;this.publishAttributes(prototype,base);this.publishProperties(prototype,base);this.inferObservers(prototype);this.explodeObservers(prototype)},chainPrototypes:function(prototype,base){this.inheritMetaData(prototype,base);var chained=this.chainObject(prototype,base);ensurePrototypeTraversal(chained);return chained},inheritMetaData:function(prototype,base){this.inheritObject("observe",prototype,base);this.inheritObject("publish",prototype,base);this.inheritObject("reflect",prototype,base);this.inheritObject("_publishLC",prototype,base);this.inheritObject("_instanceAttributes",prototype,base);this.inheritObject("eventDelegates",prototype,base)},desugarAfterChaining:function(name,extendee){this.optimizePropertyMaps(this.prototype);this.createPropertyAccessors(this.prototype);this.installBindingDelegate(this.fetchTemplate());this.installSheets();this.resolveElementPaths(this);this.accumulateInstanceAttributes();this.parseHostEvents();this.addResolvePathApi();if(hasShadowDOMPolyfill){WebComponents.ShadowCSS.shimStyling(this.templateContent(),name,extendee)}if(this.prototype.registerCallback){this.prototype.registerCallback(this)}},publishConstructor:function(){var symbol=this.getAttribute("constructor");if(symbol){window[symbol]=this.ctor}},generateBasePrototype:function(extnds){var prototype=this.findBasePrototype(extnds);if(!prototype){var prototype=HTMLElement.getPrototypeForTag(extnds);prototype=this.ensureBaseApi(prototype);memoizedBases[extnds]=prototype}return prototype},findBasePrototype:function(name){return memoizedBases[name]},ensureBaseApi:function(prototype){if(prototype.PolymerBase){return prototype}var extended=Object.create(prototype);api.publish(api.instance,extended);this.mixinMethod(extended,prototype,api.instance.mdv,"bind");return extended},mixinMethod:function(extended,prototype,api,name){var $super=function(args){return prototype[name].apply(this,args)};extended[name]=function(){this.mixinSuper=$super;return api[name].apply(this,arguments)}},inheritObject:function(name,prototype,base){var source=prototype[name]||{};prototype[name]=this.chainObject(source,base[name])},registerPrototype:function(name,extendee){var info={prototype:this.prototype};var typeExtension=this.findTypeExtension(extendee);if(typeExtension){info.extends=typeExtension}HTMLElement.register(name,this.prototype);this.ctor=document.registerElement(name,info)},findTypeExtension:function(name){if(name&&name.indexOf("-")<0){return name}else{var p=this.findBasePrototype(name);if(p.element){return this.findTypeExtension(p.element.extends)}}}};var memoizedBases={};if(Object.__proto__){prototype.chainObject=function(object,inherited){if(object&&inherited&&object!==inherited){object.__proto__=inherited}return object}}else{prototype.chainObject=function(object,inherited){if(object&&inherited&&object!==inherited){var chained=Object.create(inherited);object=extend(chained,object)}return object}}function ensurePrototypeTraversal(prototype){if(!Object.__proto__){var ancestor=Object.getPrototypeOf(prototype);prototype.__proto__=ancestor;if(isBase(ancestor)){ancestor.__proto__=Object.getPrototypeOf(ancestor)}}}api.declaration.prototype=prototype})(Polymer);(function(scope){var queue={wait:function(element){if(!element.__queue){element.__queue={};elements.push(element)}},enqueue:function(element,check,go){var shouldAdd=element.__queue&&!element.__queue.check;if(shouldAdd){queueForElement(element).push(element);element.__queue.check=check;element.__queue.go=go}return this.indexOf(element)!==0},indexOf:function(element){var i=queueForElement(element).indexOf(element);if(i>=0&&document.contains(element)){i+=HTMLImports.useNative||HTMLImports.ready?importQueue.length:1e9}return i},go:function(element){var readied=this.remove(element);if(readied){element.__queue.flushable=true;this.addToFlushQueue(readied);this.check()}},remove:function(element){var i=this.indexOf(element);if(i!==0){return}return queueForElement(element).shift()},check:function(){var element=this.nextElement();if(element){element.__queue.check.call(element)}if(this.canReady()){this.ready();return true}},nextElement:function(){return nextQueued()},canReady:function(){return!this.waitToReady&&this.isEmpty()},isEmpty:function(){for(var i=0,l=elements.length,e;i<l&&(e=elements[i]);i++){if(e.__queue&&!e.__queue.flushable){return}}return true},addToFlushQueue:function(element){flushQueue.push(element)},flush:function(){if(this.flushing){return}this.flushing=true;var element;while(flushQueue.length){element=flushQueue.shift();element.__queue.go.call(element);element.__queue=null}this.flushing=false},ready:function(){var polyfillWasReady=CustomElements.ready;CustomElements.ready=false;this.flush();if(!CustomElements.useNative){CustomElements.upgradeDocumentTree(document)}CustomElements.ready=polyfillWasReady;Polymer.flush();requestAnimationFrame(this.flushReadyCallbacks)},addReadyCallback:function(callback){if(callback){readyCallbacks.push(callback)}},flushReadyCallbacks:function(){if(readyCallbacks){var fn;while(readyCallbacks.length){fn=readyCallbacks.shift();fn()}}},waitingFor:function(){var e$=[];for(var i=0,l=elements.length,e;i<l&&(e=elements[i]);i++){if(e.__queue&&!e.__queue.flushable){e$.push(e)}}return e$},waitToReady:true};var elements=[];var flushQueue=[];var importQueue=[];var mainQueue=[];var readyCallbacks=[];function queueForElement(element){return document.contains(element)?mainQueue:importQueue}function nextQueued(){return importQueue.length?importQueue[0]:mainQueue[0]}function whenReady(callback){queue.waitToReady=true;Polymer.endOfMicrotask(function(){HTMLImports.whenReady(function(){queue.addReadyCallback(callback);queue.waitToReady=false;queue.check()})})}function forceReady(timeout){if(timeout===undefined){queue.ready();return}var handle=setTimeout(function(){queue.ready()},timeout);Polymer.whenReady(function(){clearTimeout(handle)})}scope.elements=elements;scope.waitingFor=queue.waitingFor.bind(queue);scope.forceReady=forceReady;scope.queue=queue;scope.whenReady=scope.whenPolymerReady=whenReady})(Polymer);(function(scope){var extend=scope.extend;var api=scope.api;var queue=scope.queue;var whenReady=scope.whenReady;var getRegisteredPrototype=scope.getRegisteredPrototype;var waitingForPrototype=scope.waitingForPrototype;var prototype=extend(Object.create(HTMLElement.prototype),{createdCallback:function(){if(this.getAttribute("name")){this.init()}},init:function(){this.name=this.getAttribute("name");this.extends=this.getAttribute("extends");queue.wait(this);this.loadResources();this.registerWhenReady()},registerWhenReady:function(){if(this.registered||this.waitingForPrototype(this.name)||this.waitingForQueue()||this.waitingForResources()){return}queue.go(this)},_register:function(){if(isCustomTag(this.extends)&&!isRegistered(this.extends)){console.warn("%s is attempting to extend %s, an unregistered element "+"or one that was not registered with Polymer.",this.name,this.extends)}this.register(this.name,this.extends);this.registered=true},waitingForPrototype:function(name){if(!getRegisteredPrototype(name)){waitingForPrototype(name,this);this.handleNoScript(name);return true}},handleNoScript:function(name){if(this.hasAttribute("noscript")&&!this.noscript){this.noscript=true;Polymer(name)}},waitingForResources:function(){return this._needsResources},waitingForQueue:function(){return queue.enqueue(this,this.registerWhenReady,this._register)},loadResources:function(){this._needsResources=true;this.loadStyles(function(){this._needsResources=false;this.registerWhenReady()}.bind(this))}});api.publish(api.declaration,prototype);function isRegistered(name){return Boolean(HTMLElement.getPrototypeForTag(name))}function isCustomTag(name){return name&&name.indexOf("-")>=0}whenReady(function(){document.body.removeAttribute("unresolved");document.dispatchEvent(new CustomEvent("polymer-ready",{bubbles:true}))});document.registerElement("polymer-element",{prototype:prototype})})(Polymer);(function(scope){var whenReady=scope.whenReady;function importElements(node,callback){if(node){document.head.appendChild(node);whenReady(callback)}else if(callback){callback()}}function _import(urls,callback){if(urls&&urls.length){var frag=document.createDocumentFragment();for(var i=0,l=urls.length,url,link;i<l&&(url=urls[i]);i++){link=document.createElement("link");link.rel="import";link.href=url;frag.appendChild(link)}importElements(frag,callback)}else if(callback){callback()}}scope.import=_import;scope.importElements=importElements})(Polymer);(function(){var element=document.createElement("polymer-element");element.setAttribute("name","auto-binding");element.setAttribute("extends","template");element.init();Polymer("auto-binding",{createdCallback:function(){this.syntax=this.bindingDelegate=this.makeSyntax();Polymer.whenPolymerReady(function(){this.model=this;this.setAttribute("bind","");this.async(function(){this.marshalNodeReferences(this.parentNode);this.fire("template-bound")})}.bind(this))},makeSyntax:function(){var events=Object.create(Polymer.api.declaration.events);var self=this;events.findController=function(){return self.model};var syntax=new PolymerExpressions;var prepareBinding=syntax.prepareBinding;syntax.prepareBinding=function(pathString,name,node){return events.prepareEventBinding(pathString,name,node)||prepareBinding.call(syntax,pathString,name,node)};return syntax}})})();</script><script>PolymerExpressions.prototype.resolveURL=function(url,base){var r=new RegExp("^(?:[a-z]+:)?//","i");if(!url||!base||r.test(url)){return url}return base+url};</script><script>PolymerExpressions.prototype.resolveURL=function(url,base){var r=new RegExp("^(?:[a-z]+:)?//","i");if(!url||!base||r.test(url)){return url}return base+url};</script></head><body><div hidden=""><polymer-element name="concerto-content" attributes="contentId title duration autoLoad baseURL cssText" assetpath="contents/"><template><style> :host { position: absolute; } </style></template><script>Polymer("concerto-content",{contentId:0,title:"",duration:0,autoLoad:true,cssText:"",baseURL:"",domReady:function(){if(this.autoLoad){this.loaded()}},loaded:function(){this.fire("load",this)},fromJSON:function(data){Object.keys(data).forEach(function(key){if(key in this){this.setAttribute(key,data[key])}}.bind(this));if(this.autoLoad){this.loaded()}},cssTextChanged:function(){this.style.cssText=this.cssText}});</script></polymer-element><script>function registerContentType(){var contentDocument=document.currentScript.ownerDocument;var elem=contentDocument.querySelector("polymer-element");window.addEventListener("polymer-ready",function(){if(concerto&&concerto.contentFactory){var name=elem.getAttribute("name").replace(/^concerto-/,"");var klass=elem.getAttribute("constructor");concerto.contentFactory.registerType(name,window[klass])}})}</script><polymer-element name="concerto-ticker" attributes="data" constructor="ConcertoTicker" extends="concerto-content" assetpath="contents/"><template><div id="ticker" class="ticker"></div></template><script>Polymer("concerto-ticker",{data:"",dataChanged:function(){this.$.ticker.innerHTML=this.data}});</script></polymer-element><script>registerContentType();</script><polymer-element name="concerto-graphic" attributes="path" constructor="ConcertoGraphic" extends="concerto-content" autoload="false" assetpath="contents/"><template><style> :host { display: block; width: 100%; height: 100%; text-align: center; } .portrait { width: 100%; } .landscape { height: 100%; } img { position: relative; top: 50%; transform: translateY(-50%); } </style><img id="graphic" src="{{path | resolveURL(baseURL)}}"></template><script>Polymer("concerto-graphic",{path:"",created:function(){this.handleGraphicLoadBound=this.handleGraphicLoad.bind(this)},ready:function(){this.$.graphic.addEventListener("load",this.handleGraphicLoadBound)},handleGraphicLoad:function(){this.$.graphic.removeEventListener("load",this.handleGraphicLoadBound);this.loaded();this.resize()},resize:function(){var containerRatio=this.offsetWidth/this.offsetHeight;if(!containerRatio){return}var imgRatio=this.$.graphic.naturalWidth/this.$.graphic.naturalHeight;this.$.graphic.classList.toggle("portrait",imgRatio>=containerRatio);this.$.graphic.classList.toggle("landscape",imgRatio<=containerRatio)},cssTextChanged:function(){this.$.graphic.style.cssText=this.cssText}});</script></polymer-element><script>registerContentType();</script><polymer-element name="concerto-htmltext" attributes="data" constructor="ConcertoHtmlText" extends="concerto-content" assetpath="contents/"><template><div id="htmltext" class="htmltext"></div></template><script>Polymer("concerto-htmltext",{data:"",dataChanged:function(){this.$.htmltext.innerHTML=this.data}});</script></polymer-element><script>registerContentType();</script><polymer-element name="concerto-client-time" attributes="path" constructor="ConcertoClientTime" extends="concerto-content" assetpath="contents/"><template><div id="clientTime" class="clientTime"></div></template><script>Polymer("concerto-client-time",{dateObj:null,domReady:function(){this.dateObj=new Date;var date=this.prepareDate();var time=this.prepareTime();this.$.clientTime.innerHTML=date+"<br />"+time},prepareDate:function(){return this.dateObj.toLocaleDateString()},prepareTime:function(){var rawTime=this.dateObj.toLocaleTimeString();var amPm=rawTime.slice(-2);var hours=this.dateObj.getHours();hours=(hours+11)%12+1;var minutes=this.dateObj.getMinutes();if(minutes<10){minutes="0"+minutes}return hours+":"+minutes+" "+amPm}});</script></polymer-element><script>registerContentType();</script><polymer-element name="core-xhr" hidden="" assetpath="bower_components/core-ajax/"><script>Polymer("core-xhr",{request:function(options){var xhr=new XMLHttpRequest;var url=options.url;var method=options.method||"GET";var async=!options.sync;var params=this.toQueryString(options.params);if(params&&method=="GET"){url+=(url.indexOf("?")>0?"&":"?")+params}var xhrParams=this.isBodyMethod(method)?options.body||params:null;xhr.open(method,url,async);if(options.responseType){xhr.responseType=options.responseType}if(options.withCredentials){xhr.withCredentials=true}this.makeReadyStateHandler(xhr,options.callback);this.setRequestHeaders(xhr,options.headers);xhr.send(xhrParams);if(!async){xhr.onreadystatechange(xhr)}return xhr},toQueryString:function(params){var r=[];for(var n in params){var v=params[n];n=encodeURIComponent(n);r.push(v==null?n:n+"="+encodeURIComponent(v))}return r.join("&")},isBodyMethod:function(method){return this.bodyMethods[(method||"").toUpperCase()]},bodyMethods:{POST:1,PUT:1,DELETE:1},makeReadyStateHandler:function(xhr,callback){xhr.onreadystatechange=function(){if(xhr.readyState==4){callback&&callback.call(null,xhr.response,xhr)}}},setRequestHeaders:function(xhr,headers){if(headers){for(var name in headers){xhr.setRequestHeader(name,headers[name])}}}});</script></polymer-element><polymer-element name="core-ajax" hidden="" attributes="url handleAs auto params response error method headers body contentType withCredentials" assetpath="bower_components/core-ajax/"><script>Polymer("core-ajax",{url:"",handleAs:"",auto:false,params:"",response:null,error:null,method:"",headers:null,body:null,contentType:"application/x-www-form-urlencoded",withCredentials:false,xhrArgs:null,ready:function(){this.xhr=document.createElement("core-xhr")},receive:function(response,xhr){if(this.isSuccess(xhr)){this.processResponse(xhr)}else{this.processError(xhr)}this.complete(xhr)},isSuccess:function(xhr){var status=xhr.status||0;return!status||status>=200&&status<300},processResponse:function(xhr){var response=this.evalResponse(xhr);if(xhr===this.activeRequest){this.response=response}this.fire("core-response",{response:response,xhr:xhr})},processError:function(xhr){var response=xhr.status+": "+xhr.responseText;if(xhr===this.activeRequest){this.error=response}this.fire("core-error",{response:response,xhr:xhr})},complete:function(xhr){this.fire("core-complete",{response:xhr.status,xhr:xhr})},evalResponse:function(xhr){return this[(this.handleAs||"text")+"Handler"](xhr)},xmlHandler:function(xhr){return xhr.responseXML},textHandler:function(xhr){return xhr.responseText},jsonHandler:function(xhr){var r=xhr.responseText;try{return JSON.parse(r)}catch(x){console.warn("core-ajax caught an exception trying to parse response as JSON:");console.warn("url:",this.url);console.warn(x);return r}},documentHandler:function(xhr){return xhr.response},blobHandler:function(xhr){return xhr.response},arraybufferHandler:function(xhr){return xhr.response},urlChanged:function(){if(!this.handleAs){var ext=String(this.url).split(".").pop();switch(ext){case"json":this.handleAs="json";break}}this.autoGo()},paramsChanged:function(){this.autoGo()},autoChanged:function(){this.autoGo()},autoGo:function(){if(this.auto){this.goJob=this.job(this.goJob,this.go,0)}},go:function(){var args=this.xhrArgs||{};args.body=this.body||args.body;args.params=this.params||args.params;if(args.params&&typeof args.params=="string"){args.params=JSON.parse(args.params)}args.headers=this.headers||args.headers||{};if(args.headers&&typeof args.headers=="string"){args.headers=JSON.parse(args.headers)}var hasContentType=Object.keys(args.headers).some(function(header){return header.toLowerCase()==="content-type"});if(!hasContentType&&this.contentType){args.headers["Content-Type"]=this.contentType}if(this.handleAs==="arraybuffer"||this.handleAs==="blob"||this.handleAs==="document"){args.responseType=this.handleAs}args.withCredentials=this.withCredentials;args.callback=this.receive.bind(this);args.url=this.url;args.method=this.method;this.response=this.error=null;this.activeRequest=args.url&&this.xhr.request(args);return this.activeRequest}});</script></polymer-element><polymer-element name="core-meta" attributes="label type" hidden="" assetpath="bower_components/core-meta/"><script>(function(){var SKIP_ID="meta";var metaData={},metaArray={};Polymer("core-meta",{type:"default",alwaysPrepare:true,ready:function(){this.register(this.id)},get metaArray(){var t=this.type;if(!metaArray[t]){metaArray[t]=[]}return metaArray[t]},get metaData(){var t=this.type;if(!metaData[t]){metaData[t]={}}return metaData[t]},register:function(id,old){if(id&&id!==SKIP_ID){this.unregister(this,old);this.metaData[id]=this;this.metaArray.push(this)}},unregister:function(meta,id){delete this.metaData[id||meta.id];var i=this.metaArray.indexOf(meta);if(i>=0){this.metaArray.splice(i,1)}},get list(){return this.metaArray},byId:function(id){return this.metaData[id]}})})();</script></polymer-element><polymer-element name="core-transition" extends="core-meta" assetpath="bower_components/core-transition/"><script>Polymer("core-transition",{type:"transition",go:function(node,state){this.complete(node)},setup:function(node){},teardown:function(node){},complete:function(node){this.fire("core-transitionend",null,node)},listenOnce:function(node,event,fn,args){var self=this;var listener=function(){fn.apply(self,args);node.removeEventListener(event,listener,false)};node.addEventListener(event,listener,false)}});</script></polymer-element><polymer-element name="core-transition-css" extends="core-transition" attributes="transitionType" assetpath="bower_components/core-transition/"><template><style no-shim="">:host(.core-transition) { outline: none; overflow: auto; opacity: 0; transition: transform 0.2s ease-in-out, opacity 0.2s ease-in; -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in;}:host(.core-transition.core-opened) { opacity: 1; transform: translateZ(0); -webkit-transform: translateZ(0);}:host(.core-transition-center) { transform: scale(0.5); -webkit-transform: scale(0.5);}:host(.core-transition-top) { transform: translateY(-200%); -webkit-transform: translateY(-200%);}:host(.core-transition-bottom) { transform: translateY(200%); -webkit-transform: translateY(200%);}:host(.core-transition-left) { transform: translateX(-200%); -webkit-transform: translateX(-200%);}:host(.core-transition-right) { transform: translateX(200%); -webkit-transform: translateX(200%);}</style></template><script>Polymer("core-transition-css",{baseClass:"core-transition",openedClass:"core-opened",closedClass:"core-closed",completeEventName:"transitionend",publish:{transitionType:null},registerCallback:function(element){this.transitionStyle=element.templateContent().firstElementChild},fetchTemplate:function(){return null},go:function(node,state){if(state.opened!==undefined){this.transitionOpened(node,state.opened)}},setup:function(node){if(!node._hasTransitionStyle){if(!node.shadowRoot){node.createShadowRoot().innerHTML="<content></content>"}this.installScopeStyle(this.transitionStyle,"transition",node.shadowRoot);node._hasTransitionStyle=true}node.classList.add(this.baseClass);if(this.transitionType){node.classList.add(this.baseClass+"-"+this.transitionType)}},teardown:function(node){node.classList.remove(this.baseClass);if(this.transitionType){node.classList.remove(this.baseClass+"-"+this.transitionType)}},transitionOpened:function(node,opened){this.listenOnce(node,this.completeEventName,function(){node.classList.toggle(this.revealedClass,opened);if(!opened){node.classList.remove(this.closedClass)}this.complete(node)});node.classList.toggle(this.openedClass,opened);node.classList.toggle(this.closedClass,!opened)}});</script></polymer-element><core-transition-css id="core-transition-fade"></core-transition-css><core-transition-css id="core-transition-center" transitiontype="center"></core-transition-css><core-transition-css id="core-transition-top" transitiontype="top"></core-transition-css><core-transition-css id="core-transition-bottom" transitiontype="bottom"></core-transition-css><core-transition-css id="core-transition-left" transitiontype="left"></core-transition-css><core-transition-css id="core-transition-right" transitiontype="right"></core-transition-css><polymer-element name="concerto-field" attributes="screenId fieldId fieldName baseURL contentStyle" assetpath=""><template><style> :host { display: block; width: 100%; height: 100%; } #content { width: 100%; height: 100%; } </style><core-ajax id="contentsData" url="{{baseURL}}/frontend/{{screenId}}/fields/{{fieldId}}/contents.json" handleas="json" on-core-response="{{handleContents}}" on-core-error="{{handleContentsError}}"></core-ajax><div id="content"></div></template><script>Polymer("concerto-field",{screenId:0,fieldId:0,fieldName:"",baseURL:"",contentStyle:"",currentContent:undefined,contentErrorCount:0,created:function(){this.contentQueue=[];var meta=document.createElement("core-meta");meta.type="transition";this.transition=meta.byId("core-transition-fade");this.handleContentLoadedBound=this.handleContentLoaded.bind(this)},domReady:function(){this.loadNextContent()},fetchContent:function(){this.$.contentsData.go()},handleContents:function(event,response){Array.prototype.push.apply(this.contentQueue,response.response);if(!this.currentContent&&this.contentQueue.length>=1){console.log("Urgent content update for field "+this.fieldId);this.scheduleNextContent(1)}},handleContentsError:function(event,xhr){console.log("Error retrieving content data for field "+this.fieldId)},loadNextContent:function(){var contentData=this.contentQueue.shift();if(!contentData||this.contentQueue.length<1){this.fetchContent()}if(this.fieldName=="Time"){var contentData={duration:15,id:0,name:"System Time",type:"ClientTime",render_details:{data:null}}}if(!contentData){console.log("No content available for field "+this.fieldId);this.scheduleNextContent(10*1e3)}else{if(!this.loadContent(contentData)){console.log("Unable to load "+contentData.type+" content for field "+this.fieldId);this.contentErrorCount++;if(this.contentErrorCount<=5){this.loadNextContent()}else{var retryDuration=Math.min((this.contentErrorCount-1)*30,600);console.log("Retrying in "+retryDuration+" seconds.");this.scheduleNextContent(retryDuration*1e3)}}else{this.contentErrorCount=0}}},loadContent:function(contentData){if(!contentData){console.log("Missing contentData for field "+this.fieldId);return false}var simpleContentData={title:contentData.name,contentId:contentData.id,duration:contentData.duration};Object.keys(contentData.render_details).forEach(function(key){simpleContentData[key]=contentData.render_details[key]});var contentType=contentData.type;var content=concerto.contentFactory.getType(contentType);if(!content){console.log("No content type registered for "+contentType);return false}content.baseURL=this.baseURL;content.cssText=this.contentStyle;content.addEventListener("load",this.handleContentLoadedBound);content.fromJSON(simpleContentData);return true},handleContentLoaded:function(event){var content=event.detail;content.removeEventListener("load",this.handleContentLoadedBound);this.displayContent(content)},displayContent:function(content){if(this.currentContent!=content){content.style.zIndex="100";if(this.currentContent){this.transition.setup(this.currentContent);this.currentContent.addEventListener("core-transitionend",this.handleTransitionOutComplete);this.transition.go(this.currentContent,{opened:false});var zIndex=parseInt(this.currentContent.style.zIndex);if(zIndex<2147483647){content.style.zIndex=zIndex+1}}this.transition.setup(content);this.$.content.appendChild(content);this.transition.go(content,{opened:true});this.currentContent=content}this.scheduleNextContent(content.duration*1e3)},handleTransitionOutComplete:function(event){var oldContent=event.target;oldContent.removeEventListener("core-transitionend",this.handleTransitionOutComplete);if(oldContent.parentNode){oldContent.parentNode.removeChild(event.target)}},scheduleNextContent:function(msToWait){this.job("updateFieldContent"+this.fieldId,function(){this.loadNextContent()},msToWait)}});</script></polymer-element><polymer-element name="concerto-screen" attributes="screenId baseURL" assetpath=""><template><style> :host { display: block; position: relative; width: 100%; height: 100%; } .position { position: absolute; overflow: hidden; } .template { width: 100%; height: 100%; background-size: 100% 100%; background-repeat: no-repeat; } </style><core-ajax id="screenData" url="{{baseURL}}/frontend/{{screenId}}/setup.json" handleas="json" auto="" on-core-response="{{handleScreenData}}"></core-ajax><template bind="" if="{{template.id}}"><div id="template_{{template.id}}" class="template" style="background-image: url('{{template.path | resolveURL(baseURL)}}');"><template repeat="{{position in template.positions}}"><div class="position" id="position_{{position.id}}" style="left: {{position.left * 100}}%;
|
11
|
+
top: {{position.top * 100}}%;
|
12
|
+
width: {{(position.right - position.left) * 100}}%;
|
13
|
+
height: {{(position.bottom - position.top) * 100}}%;"><concerto-field screenid="{{screenId}}" fieldid="{{position.field.id}}" fieldname="{{position.field.name}}" baseurl="{{baseURL}}" contentstyle="{{position.style}}"></concerto-field></div></template></div></template></template><script>Polymer("concerto-screen",{screenId:0,baseURL:"",publish:{name:{value:"",reflect:true}},created:function(){this.template={}},handleScreenData:function(event,response){var data=response.response;this.name=data.name;this.template=data.template}});</script></polymer-element></div><h3>Screen</h3><concerto-screen screenid="<%= params[:id] %>" style="width: 100%; height: 500px;"></concerto-screen></body></html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module ConcertoFrontend
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace ConcertoFrontend
|
4
|
+
engine_name "concerto_frontend"
|
5
|
+
|
6
|
+
# Define plugin information for the Concerto application to read
|
7
|
+
def plugin_info(plugin_info_class)
|
8
|
+
@plugin_info ||= plugin_info_class.new do
|
9
|
+
add_view_hook "frontend/ScreensController", :concerto_frontend, partial: "concerto_frontend/frontend"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: concerto_frontend
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gabriel Perez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.1.6
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.1.6
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: A Ruby Gem that contains the Concerto polymer frontend.
|
42
|
+
email:
|
43
|
+
- perez283@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- app/views/concerto_frontend/_frontend.html
|
52
|
+
- config/routes.rb
|
53
|
+
- lib/concerto_frontend.rb
|
54
|
+
- lib/concerto_frontend/engine.rb
|
55
|
+
- lib/concerto_frontend/version.rb
|
56
|
+
homepage: https://concerto-signage.org
|
57
|
+
licenses: []
|
58
|
+
metadata: {}
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options: []
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
requirements: []
|
74
|
+
rubyforge_project:
|
75
|
+
rubygems_version: 2.2.2
|
76
|
+
signing_key:
|
77
|
+
specification_version: 4
|
78
|
+
summary: Concerto Frontend
|
79
|
+
test_files: []
|