-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
5 lines (5 loc) · 135 KB
/
index.js
1
2
3
4
5
(function(scope){scope.CoreResizable={resizableAttachedHandler:function(cb){cb=cb||this._notifyResizeSelf;this.async(function(){var detail={callback:cb,hasParentResizer:false};this.fire("core-request-resize",detail);if(!detail.hasParentResizer){this._boundWindowResizeHandler=cb.bind(this);window.addEventListener("resize",this._boundWindowResizeHandler)}}.bind(this))},resizableDetachedHandler:function(){this.fire("core-request-resize-cancel",null,this,false);if(this._boundWindowResizeHandler){window.removeEventListener("resize",this._boundWindowResizeHandler)}},_notifyResizeSelf:function(){return this.fire("core-resize",null,this,false).defaultPrevented}};scope.CoreResizer=Polymer.mixin({resizerAttachedHandler:function(){this.resizableAttachedHandler(this.notifyResize);this._boundResizeRequested=this._boundResizeRequested||this._handleResizeRequested.bind(this);var listener;if(this.resizerIsPeer){listener=this.parentElement||this.parentNode&&this.parentNode.host;listener._resizerPeers=listener._resizerPeers||[];listener._resizerPeers.push(this)}else{listener=this}listener.addEventListener("core-request-resize",this._boundResizeRequested);this._resizerListener=listener},resizerDetachedHandler:function(){this.resizableDetachedHandler();this._resizerListener.removeEventListener("core-request-resize",this._boundResizeRequested)},notifyResize:function(){if(!this._notifyResizeSelf()){var r=this.resizeRequestors;if(r){for(var i=0;i<r.length;i++){var ri=r[i];if(!this.resizerShouldNotify||this.resizerShouldNotify(ri.target)){ri.callback.apply(ri.target)}}}}},_handleResizeRequested:function(e){var target=e.path[0];if(target==this||target==this._resizerListener||this._resizerPeers&&this._resizerPeers.indexOf(target)<0){return}if(!this.resizeRequestors){this.resizeRequestors=[]}this.resizeRequestors.push({target:target,callback:e.detail.callback});target.addEventListener("core-request-resize-cancel",this._cancelResizeRequested.bind(this));e.detail.hasParentResizer=true;e.stopPropagation()},_cancelResizeRequested:function(e){if(this.resizeRequestors){for(var i=0;i<this.resizeRequestors.length;i++){if(this.resizeRequestors[i].target==e.target){this.resizeRequestors.splice(i,1);break}}}}},Polymer.CoreResizable)})(Polymer);Polymer("paper-shadow",{publish:{z:1,animated:false},setZ:function(newZ){if(this.z!==newZ){this.$["shadow-bottom"].classList.remove("paper-shadow-bottom-z-"+this.z);this.$["shadow-bottom"].classList.add("paper-shadow-bottom-z-"+newZ);this.$["shadow-top"].classList.remove("paper-shadow-top-z-"+this.z);this.$["shadow-top"].classList.add("paper-shadow-top-z-"+newZ);this.z=newZ}}});(function(){var KEY_IDENTIFIER={"U+0009":"tab","U+001B":"esc","U+0020":"space","U+002A":"*","U+0030":"0","U+0031":"1","U+0032":"2","U+0033":"3","U+0034":"4","U+0035":"5","U+0036":"6","U+0037":"7","U+0038":"8","U+0039":"9","U+0041":"a","U+0042":"b","U+0043":"c","U+0044":"d","U+0045":"e","U+0046":"f","U+0047":"g","U+0048":"h","U+0049":"i","U+004A":"j","U+004B":"k","U+004C":"l","U+004D":"m","U+004E":"n","U+004F":"o","U+0050":"p","U+0051":"q","U+0052":"r","U+0053":"s","U+0054":"t","U+0055":"u","U+0056":"v","U+0057":"w","U+0058":"x","U+0059":"y","U+005A":"z","U+007F":"del"};var KEY_CODE={9:"tab",13:"enter",27:"esc",33:"pageup",34:"pagedown",35:"end",36:"home",32:"space",37:"left",38:"up",39:"right",40:"down",46:"del",106:"*"};var KEY_CHAR=/[a-z0-9*]/;function transformKey(key){var validKey="";if(key){var lKey=key.toLowerCase();if(lKey.length==1){if(KEY_CHAR.test(lKey)){validKey=lKey}}else if(lKey=="multiply"){validKey="*"}else{validKey=lKey}}return validKey}var IDENT_CHAR=/U\+/;function transformKeyIdentifier(keyIdent){var validKey="";if(keyIdent){if(IDENT_CHAR.test(keyIdent)){validKey=KEY_IDENTIFIER[keyIdent]}else{validKey=keyIdent.toLowerCase()}}return validKey}function transformKeyCode(keyCode){var validKey="";if(Number(keyCode)){if(keyCode>=65&&keyCode<=90){validKey=String.fromCharCode(32+keyCode)}else if(keyCode>=112&&keyCode<=123){validKey="f"+(keyCode-112)}else if(keyCode>=48&&keyCode<=57){validKey=String(48-keyCode)}else if(keyCode>=96&&keyCode<=105){validKey=String(96-keyCode)}else{validKey=KEY_CODE[keyCode]}}return validKey}function keyboardEventToKey(ev){var normalizedKey=transformKey(ev.key)||transformKeyIdentifier(ev.keyIdentifier)||transformKeyCode(ev.keyCode)||transformKey(ev.detail.key)||"";return{shift:ev.shiftKey,ctrl:ev.ctrlKey,meta:ev.metaKey,alt:ev.altKey,key:normalizedKey}}function stringToKey(keyCombo){var keys=keyCombo.split("+");var keyObj=Object.create(null);keys.forEach(function(key){if(key=="shift"){keyObj.shift=true}else if(key=="ctrl"){keyObj.ctrl=true}else if(key=="alt"){keyObj.alt=true}else{keyObj.key=key}});return keyObj}function keyMatches(a,b){return Boolean(a.alt)==Boolean(b.alt)&&Boolean(a.ctrl)==Boolean(b.ctrl)&&Boolean(a.shift)==Boolean(b.shift)&&a.key===b.key}function processKeys(ev){var current=keyboardEventToKey(ev);for(var i=0,dk;i<this._desiredKeys.length;i++){dk=this._desiredKeys[i];if(keyMatches(dk,current)){ev.preventDefault();ev.stopPropagation();this.fire("keys-pressed",current,this,false);break}}}function listen(node,handler){if(node&&node.addEventListener){node.addEventListener("keydown",handler)}}function unlisten(node,handler){if(node&&node.removeEventListener){node.removeEventListener("keydown",handler)}}Polymer("core-a11y-keys",{created:function(){this._keyHandler=processKeys.bind(this)},attached:function(){if(!this.target){this.target=this.parentNode}listen(this.target,this._keyHandler)},detached:function(){unlisten(this.target,this._keyHandler)},publish:{keys:"",target:null},keysChanged:function(){var normalized=this.keys.replace("*","* shift+*");this._desiredKeys=normalized.toLowerCase().split(" ").map(stringToKey)},targetChanged:function(oldTarget){unlisten(oldTarget,this._keyHandler);listen(this.target,this._keyHandler)}})})();(function(){var waveMaxRadius=150;function waveRadiusFn(touchDownMs,touchUpMs,anim){var touchDown=touchDownMs/1e3;var touchUp=touchUpMs/1e3;var totalElapsed=touchDown+touchUp;var ww=anim.width,hh=anim.height;var waveRadius=Math.min(Math.sqrt(ww*ww+hh*hh),waveMaxRadius)*1.1+5;var duration=1.1-.2*(waveRadius/waveMaxRadius);var tt=totalElapsed/duration;var size=waveRadius*(1-Math.pow(80,-tt));return Math.abs(size)}function waveOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var totalElapsed=touchDown+touchUp;if(tu<=0){return anim.initialOpacity}return Math.max(0,anim.initialOpacity-touchUp*anim.opacityDecayVelocity)}function waveOuterOpacityFn(td,tu,anim){var touchDown=td/1e3;var touchUp=tu/1e3;var outerOpacity=touchDown*.3;var waveOpacity=waveOpacityFn(td,tu,anim);return Math.max(0,Math.min(outerOpacity,waveOpacity))}function waveDidFinish(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity<.01&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function waveAtMaximum(wave,radius,anim){var waveOpacity=waveOpacityFn(wave.tDown,wave.tUp,anim);return waveOpacity>=anim.initialOpacity&&radius>=Math.min(wave.maxRadius,waveMaxRadius)}function drawRipple(ctx,x,y,radius,innerAlpha,outerAlpha){if(outerAlpha!==undefined){ctx.bg.style.opacity=outerAlpha}ctx.wave.style.opacity=innerAlpha;var s=radius/(ctx.containerSize/2);var dx=x-ctx.containerWidth/2;var dy=y-ctx.containerHeight/2;ctx.wc.style.webkitTransform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wc.style.transform="translate3d("+dx+"px,"+dy+"px,0)";ctx.wave.style.webkitTransform="scale("+s+","+s+")";ctx.wave.style.transform="scale3d("+s+","+s+",1)"}function createWave(elem){var elementStyle=window.getComputedStyle(elem);var fgColor=elementStyle.color;var inner=document.createElement("div");inner.style.backgroundColor=fgColor;inner.classList.add("wave");var outer=document.createElement("div");outer.classList.add("wave-container");outer.appendChild(inner);var container=elem.$.waves;container.appendChild(outer);elem.$.bg.style.backgroundColor=fgColor;var wave={bg:elem.$.bg,wc:outer,wave:inner,waveColor:fgColor,maxRadius:0,isMouseDown:false,mouseDownStart:0,mouseUpStart:0,tDown:0,tUp:0};return wave}function removeWaveFromScope(scope,wave){if(scope.waves){var pos=scope.waves.indexOf(wave);scope.waves.splice(pos,1);wave.wc.remove()}}var pow=Math.pow;var now=Date.now;if(window.performance&&performance.now){now=performance.now.bind(performance)}function cssColorWithAlpha(cssColor,alpha){var parts=cssColor.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(typeof alpha=="undefined"){alpha=1}if(!parts){return"rgba(255, 255, 255, "+alpha+")"}return"rgba("+parts[1]+", "+parts[2]+", "+parts[3]+", "+alpha+")"}function dist(p1,p2){return Math.sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2))}function distanceFromPointToFurthestCorner(point,size){var tl_d=dist(point,{x:0,y:0});var tr_d=dist(point,{x:size.w,y:0});var bl_d=dist(point,{x:0,y:size.h});var br_d=dist(point,{x:size.w,y:size.h});return Math.max(tl_d,tr_d,bl_d,br_d)}Polymer("paper-ripple",{initialOpacity:.25,opacityDecayVelocity:.8,backgroundFill:true,pixelDensity:2,eventDelegates:{down:"downAction",up:"upAction"},ready:function(){this.waves=[]},downAction:function(e){var wave=createWave(this);this.cancelled=false;wave.isMouseDown=true;wave.tDown=0;wave.tUp=0;wave.mouseUpStart=0;wave.mouseDownStart=now();var rect=this.getBoundingClientRect();var width=rect.width;var height=rect.height;var touchX=e.x-rect.left;var touchY=e.y-rect.top;wave.startPosition={x:touchX,y:touchY};if(this.classList.contains("recenteringTouch")){wave.endPosition={x:width/2,y:height/2};wave.slideDistance=dist(wave.startPosition,wave.endPosition)}wave.containerSize=Math.max(width,height);wave.containerWidth=width;wave.containerHeight=height;wave.maxRadius=distanceFromPointToFurthestCorner(wave.startPosition,{w:width,h:height});wave.wc.style.top=(wave.containerHeight-wave.containerSize)/2+"px";wave.wc.style.left=(wave.containerWidth-wave.containerSize)/2+"px";wave.wc.style.width=wave.containerSize+"px";wave.wc.style.height=wave.containerSize+"px";this.waves.push(wave);if(!this._loop){this._loop=this.animate.bind(this,{width:width,height:height});requestAnimationFrame(this._loop)}},upAction:function(){for(var i=0;i<this.waves.length;i++){var wave=this.waves[i];if(wave.isMouseDown){wave.isMouseDown=false;wave.mouseUpStart=now();wave.mouseDownStart=0;wave.tUp=0;break}}this._loop&&requestAnimationFrame(this._loop)},cancel:function(){this.cancelled=true},animate:function(ctx){var shouldRenderNextFrame=false;var deleteTheseWaves=[];var longestTouchDownDuration=0;var longestTouchUpDuration=0;var lastWaveColor=null;var anim={initialOpacity:this.initialOpacity,opacityDecayVelocity:this.opacityDecayVelocity,height:ctx.height,width:ctx.width};for(var i=0;i<this.waves.length;i++){var wave=this.waves[i];if(wave.mouseDownStart>0){wave.tDown=now()-wave.mouseDownStart}if(wave.mouseUpStart>0){wave.tUp=now()-wave.mouseUpStart}var tUp=wave.tUp;var tDown=wave.tDown;longestTouchDownDuration=Math.max(longestTouchDownDuration,tDown);longestTouchUpDuration=Math.max(longestTouchUpDuration,tUp);var radius=waveRadiusFn(tDown,tUp,anim);var waveAlpha=waveOpacityFn(tDown,tUp,anim);var waveColor=cssColorWithAlpha(wave.waveColor,waveAlpha);lastWaveColor=wave.waveColor;var x=wave.startPosition.x;var y=wave.startPosition.y;if(wave.endPosition){var translateFraction=Math.min(1,radius/wave.containerSize*2/Math.sqrt(2));x+=translateFraction*(wave.endPosition.x-wave.startPosition.x);y+=translateFraction*(wave.endPosition.y-wave.startPosition.y)}var bgFillColor=null;if(this.backgroundFill){var bgFillAlpha=waveOuterOpacityFn(tDown,tUp,anim);bgFillColor=cssColorWithAlpha(wave.waveColor,bgFillAlpha)}drawRipple(wave,x,y,radius,waveAlpha,bgFillAlpha);var maximumWave=waveAtMaximum(wave,radius,anim);var waveDissipated=waveDidFinish(wave,radius,anim);var shouldKeepWave=!waveDissipated||maximumWave;var shouldRenderWaveAgain=wave.mouseUpStart?!waveDissipated:!maximumWave;shouldRenderNextFrame=shouldRenderNextFrame||shouldRenderWaveAgain;if(!shouldKeepWave||this.cancelled){deleteTheseWaves.push(wave)}}if(shouldRenderNextFrame){requestAnimationFrame(this._loop)}for(var i=0;i<deleteTheseWaves.length;++i){var wave=deleteTheseWaves[i];removeWaveFromScope(this,wave)}if(!this.waves.length&&this._loop){this.$.bg.style.backgroundColor=null;this._loop=null;this.fire("core-transitionend")}}})})();(function(){var p={eventDelegates:{down:"downAction",up:"upAction"},toggleBackground:function(){if(this.active){if(!this.$.bg){var bg=document.createElement("div");bg.setAttribute("id","bg");bg.setAttribute("fit","");bg.style.opacity=.25;this.$.bg=bg;this.shadowRoot.insertBefore(bg,this.shadowRoot.firstChild)}this.$.bg.style.backgroundColor=getComputedStyle(this).color}else{if(this.$.bg){this.$.bg.style.backgroundColor=""}}},activeChanged:function(){this.super();if(this.toggle&&(!this.lastEvent||this.matches(":host-context([noink])"))){this.toggleBackground()}},pressedChanged:function(){this.super();if(!this.lastEvent){return}if(this.$.ripple&&!this.hasAttribute("noink")){if(this.pressed){this.$.ripple.downAction(this.lastEvent)}else{this.$.ripple.upAction()}}this.adjustZ()},focusedChanged:function(){this.adjustZ()},disabledChanged:function(){this._disabledChanged();this.adjustZ()},recenteringTouchChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("recenteringTouch",this.recenteringTouch)}},fillChanged:function(){if(this.$.ripple){this.$.ripple.classList.toggle("fill",this.fill)}},adjustZ:function(){if(!this.$.shadow){return}if(this.active){this.$.shadow.setZ(2)}else if(this.disabled){this.$.shadow.setZ(0)}else if(this.focused){this.$.shadow.setZ(3)}else{this.$.shadow.setZ(1)}},downAction:function(e){this._downAction();if(this.hasAttribute("noink")){return}this.lastEvent=e;if(!this.$.ripple){var ripple=document.createElement("paper-ripple");ripple.setAttribute("id","ripple");ripple.setAttribute("fit","");if(this.recenteringTouch){ripple.classList.add("recenteringTouch")}if(!this.fill){ripple.classList.add("circle")}this.$.ripple=ripple;this.shadowRoot.insertBefore(ripple,this.shadowRoot.firstChild)}},upAction:function(){this._upAction();if(this.toggle){this.toggleBackground();if(this.$.ripple){this.$.ripple.cancel()}}}};Polymer.mixin2(p,Polymer.CoreFocusable);Polymer("paper-button-base",p)})();Polymer("paper-button",{publish:{raised:false,recenteringTouch:false,fill:true},_activate:function(){this.click();this.fire("tap");if(!this.pressed){var bcr=this.getBoundingClientRect();var x=bcr.left+bcr.width/2;var y=bcr.top+bcr.height/2;this.downAction({x:x,y:y});var fn=function fn(){this.upAction();this.removeEventListener("keyup",fn)}.bind(this);this.addEventListener("keyup",fn)}}});Polymer("paper-radio-button",{publish:{checked:{value:false,reflect:true},label:"",toggles:false,disabled:{value:false,reflect:true}},eventDelegates:{tap:"tap"},tap:function(){if(this.disabled){return}var old=this.checked;this.toggle();if(this.checked!==old){this.fire("change")}},toggle:function(){this.checked=!this.toggles||!this.checked},checkedChanged:function(){this.setAttribute("aria-checked",this.checked?"true":"false");this.fire("core-change")},labelChanged:function(){this.setAttribute("aria-label",this.label)}});Polymer("paper-checkbox",{toggles:true,checkedChanged:function(){this.$.checkbox.classList.toggle("checked",this.checked);this.setAttribute("aria-checked",this.checked?"true":"false");this.$.checkmark.classList.toggle("hidden",!this.checked);this.fire("core-change")},checkboxAnimationEnd:function(){var cl=this.$.checkmark.classList;cl.toggle("hidden",!this.checked&&cl.contains("hidden"))}});(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]}})})();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)}});Polymer("core-key-helper",{ENTER_KEY:13,ESCAPE_KEY:27});(function(){Polymer("core-overlay-layer",{publish:{opened:false},openedChanged:function(){this.classList.toggle("core-opened",this.opened)},addElement:function(element){if(!this.parentNode){document.querySelector("body").appendChild(this)}if(element.parentNode!==this){element.__contents=[];var ip$=element.querySelectorAll("content");for(var i=0,l=ip$.length,n;i<l&&(n=ip$[i]);i++){this.moveInsertedElements(n);this.cacheDomLocation(n);n.parentNode.removeChild(n);element.__contents.push(n)}this.cacheDomLocation(element);this.updateEventController(element);var h=this.makeHost();h.shadowRoot.appendChild(element);element.__host=h}},makeHost:function(){var h=document.createElement("overlay-host");h.createShadowRoot();this.appendChild(h);return h},moveInsertedElements:function(insertionPoint){var n$=insertionPoint.getDistributedNodes();var parent=insertionPoint.parentNode;insertionPoint.__contents=[];for(var i=0,l=n$.length,n;i<l&&(n=n$[i]);i++){this.cacheDomLocation(n);this.updateEventController(n);insertionPoint.__contents.push(n);parent.appendChild(n)}},updateEventController:function(element){element.eventController=this.element.findController(element)},removeElement:function(element){element.eventController=null;this.replaceElement(element);var h=element.__host;if(h){h.parentNode.removeChild(h)}},replaceElement:function(element){if(element.__contents){for(var i=0,c$=element.__contents,c;c=c$[i];i++){this.replaceElement(c)}element.__contents=null}if(element.__parentNode){var n=element.__nextElementSibling&&element.__nextElementSibling===element.__parentNode?element.__nextElementSibling:null;element.__parentNode.insertBefore(element,n)}},cacheDomLocation:function(element){element.__nextElementSibling=element.nextElementSibling;element.__parentNode=element.parentNode}})})();(function(){Polymer("core-overlay",Polymer.mixin({publish:{target:null,sizingTarget:null,opened:false,backdrop:false,layered:false,autoCloseDisabled:false,autoFocusDisabled:false,closeAttribute:"core-overlay-toggle",closeSelector:"",transition:"core-transition-fade"},captureEventName:"tap",targetListeners:{tap:"tapHandler",keydown:"keydownHandler","core-transitionend":"transitionend"},attached:function(){this.resizerAttachedHandler()},detached:function(){this.resizerDetachedHandler()},resizerShouldNotify:function(){return this.opened},registerCallback:function(element){this.layer=document.createElement("core-overlay-layer");this.keyHelper=document.createElement("core-key-helper");this.meta=document.createElement("core-transition");this.scrim=document.createElement("div");this.scrim.className="core-overlay-backdrop"},ready:function(){this.target=this.target||this;Polymer.flush()},toggle:function(){this.opened=!this.opened},open:function(){this.opened=true},close:function(){this.opened=false},domReady:function(){this.ensureTargetSetup()},targetChanged:function(old){if(this.target){if(this.target.tabIndex<0){this.target.tabIndex=-1}this.addElementListenerList(this.target,this.targetListeners);this.target.style.display="none";this.target.__overlaySetup=false}if(old){this.removeElementListenerList(old,this.targetListeners);var transition=this.getTransition();if(transition){transition.teardown(old)}else{old.style.position="";old.style.outline=""}old.style.display=""}},transitionChanged:function(old){if(!this.target){return}if(old){this.getTransition(old).teardown(this.target)}this.target.__overlaySetup=false},ensureTargetSetup:function(){if(!this.target||this.target.__overlaySetup){return}if(!this.sizingTarget){this.sizingTarget=this.target}this.target.__overlaySetup=true;this.target.style.display="";var transition=this.getTransition();if(transition){transition.setup(this.target)}var style=this.target.style;var computed=getComputedStyle(this.target);if(computed.position==="static"){style.position="fixed"}style.outline="none";style.display="none"},openedChanged:function(){this.transitioning=true;this.ensureTargetSetup();this.prepareRenderOpened();this.async(function(){this.target.style.display="";this.target.offsetWidth;this.renderOpened()});this.fire("core-overlay-open",this.opened)},prepareRenderOpened:function(){if(this.opened){addOverlay(this)}this.prepareBackdrop();this.async(function(){if(!this.autoCloseDisabled){this.enableElementListener(this.opened,document,this.captureEventName,"captureHandler",true)}});this.enableElementListener(this.opened,window,"resize","resizeHandler");if(this.opened){this.target.offsetHeight;this.discoverDimensions();this.preparePositioning();this.positionTarget();this.updateTargetDimensions();this.finishPositioning();if(this.layered){this.layer.addElement(this.target);this.layer.opened=this.opened}}},renderOpened:function(){this.notifyResize();var transition=this.getTransition();if(transition){transition.go(this.target,{opened:this.opened})}else{this.transitionend()}this.renderBackdropOpened()},transitionend:function(e){if(e&&e.target!==this.target){return}this.transitioning=false;if(!this.opened){this.resetTargetDimensions();this.target.style.display="none";this.completeBackdrop();removeOverlay(this);if(this.layered){if(!currentOverlay()){this.layer.opened=this.opened}this.layer.removeElement(this.target)}}this.fire("core-overlay-"+(this.opened?"open":"close")+"-completed");this.applyFocus()},prepareBackdrop:function(){if(this.backdrop&&this.opened){if(!this.scrim.parentNode){document.body.appendChild(this.scrim);this.scrim.style.zIndex=currentOverlayZ()-1}trackBackdrop(this)}},renderBackdropOpened:function(){if(this.backdrop&&getBackdrops().length<2){this.scrim.classList.toggle("core-opened",this.opened)}},completeBackdrop:function(){if(this.backdrop){trackBackdrop(this);if(getBackdrops().length===0){this.scrim.parentNode.removeChild(this.scrim)}}},preparePositioning:function(){this.target.style.transition=this.target.style.webkitTransition="none";this.target.style.transform=this.target.style.webkitTransform="none";this.target.style.display=""},discoverDimensions:function(){if(this.dimensions){return}var target=getComputedStyle(this.target);var sizer=getComputedStyle(this.sizingTarget);this.dimensions={position:{v:target.top!=="auto"?"top":target.bottom!=="auto"?"bottom":null,h:target.left!=="auto"?"left":target.right!=="auto"?"right":null,css:target.position},size:{v:sizer.maxHeight!=="none",h:sizer.maxWidth!=="none"},margin:{top:parseInt(target.marginTop)||0,right:parseInt(target.marginRight)||0,bottom:parseInt(target.marginBottom)||0,left:parseInt(target.marginLeft)||0}}},finishPositioning:function(target){this.target.style.display="none";this.target.style.transform=this.target.style.webkitTransform="";this.target.offsetWidth;this.target.style.transition=this.target.style.webkitTransition=""},getTransition:function(name){return this.meta.byId(name||this.transition)},getFocusNode:function(){return this.target.querySelector("[autofocus]")||this.target},applyFocus:function(){var focusNode=this.getFocusNode();if(this.opened){if(!this.autoFocusDisabled){focusNode.focus()}}else{focusNode.blur();if(currentOverlay()==this){console.warn("Current core-overlay is attempting to focus itself as next! (bug)")}else{focusOverlay()}}},positionTarget:function(){this.fire("core-overlay-position",{target:this.target,sizingTarget:this.sizingTarget,opened:this.opened});if(!this.dimensions.position.v){this.target.style.top="0px"}if(!this.dimensions.position.h){this.target.style.left="0px"}},updateTargetDimensions:function(){this.sizeTarget();this.repositionTarget()},sizeTarget:function(){this.sizingTarget.style.boxSizing="border-box";var dims=this.dimensions;var rect=this.target.getBoundingClientRect();if(!dims.size.v){this.sizeDimension(rect,dims.position.v,"top","bottom","Height")}if(!dims.size.h){this.sizeDimension(rect,dims.position.h,"left","right","Width")}},sizeDimension:function(rect,positionedBy,start,end,extent){var dims=this.dimensions;var flip=positionedBy===end;var m=flip?start:end;var ws=window["inner"+extent];var o=dims.margin[m]+(flip?ws-rect[end]:rect[start]);var offset="offset"+extent;var o2=this.target[offset]-this.sizingTarget[offset];this.sizingTarget.style["max"+extent]=ws-o-o2+"px"},repositionTarget:function(){if(this.dimensions.position.css!=="fixed"){return}if(!this.dimensions.position.v){var t=(window.innerHeight-this.target.offsetHeight)/2;t-=this.dimensions.margin.top;this.target.style.top=t+"px"}if(!this.dimensions.position.h){var l=(window.innerWidth-this.target.offsetWidth)/2;l-=this.dimensions.margin.left;this.target.style.left=l+"px"}},resetTargetDimensions:function(){if(!this.dimensions||!this.dimensions.size.v){this.sizingTarget.style.maxHeight="";this.target.style.top=""}if(!this.dimensions||!this.dimensions.size.h){this.sizingTarget.style.maxWidth="";this.target.style.left=""}this.dimensions=null},tapHandler:function(e){if(e.target&&(this.closeSelector&&e.target.matches(this.closeSelector))||this.closeAttribute&&e.target.hasAttribute(this.closeAttribute)){this.toggle()}else{if(this.autoCloseJob){this.autoCloseJob.stop();this.autoCloseJob=null}}},captureHandler:function(e){if(!this.autoCloseDisabled&¤tOverlay()==this){this.autoCloseJob=this.job(this.autoCloseJob,function(){this.close()})}},keydownHandler:function(e){if(!this.autoCloseDisabled&&e.keyCode==this.keyHelper.ESCAPE_KEY){this.close();e.stopPropagation()}},resizeHandler:function(){this.updateTargetDimensions()},addElementListenerList:function(node,events){for(var i in events){this.addElementListener(node,i,events[i])}},removeElementListenerList:function(node,events){for(var i in events){this.removeElementListener(node,i,events[i])}},enableElementListener:function(enable,node,event,methodName,capture){if(enable){this.addElementListener(node,event,methodName,capture)}else{this.removeElementListener(node,event,methodName,capture)}},addElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.addEventListener(node,event,fn,capture)}},removeElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.removeEventListener(node,event,fn,capture)}},_makeBoundListener:function(methodName){var self=this,method=this[methodName];if(!method){return}var bound="_bound"+methodName;if(!this[bound]){this[bound]=function(e){method.call(self,e)}}return this[bound]}},Polymer.CoreResizer));var overlays=[];function addOverlay(overlay){var z0=currentOverlayZ();overlays.push(overlay);var z1=currentOverlayZ();if(z1<=z0){applyOverlayZ(overlay,z0)}}function removeOverlay(overlay){var i=overlays.indexOf(overlay);if(i>=0){overlays.splice(i,1);setZ(overlay,"")}}function applyOverlayZ(overlay,aboveZ){setZ(overlay.target,aboveZ+2)}function setZ(element,z){element.style.zIndex=z}function currentOverlay(){return overlays[overlays.length-1]}var DEFAULT_Z=10;function currentOverlayZ(){var z;var current=currentOverlay();if(current){var z1=window.getComputedStyle(current.target).zIndex;if(!isNaN(z1)){z=Number(z1)}}return z||DEFAULT_Z}function focusOverlay(){var current=currentOverlay();if(current&&!current.transitioning){current.applyFocus()}}var backdrops=[];function trackBackdrop(element){if(element.opened){backdrops.push(element)}else{var i=backdrops.indexOf(element);if(i>=0){backdrops.splice(i,1)}}}function getBackdrops(){return backdrops}})();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(){if(!opened){node.classList.remove(this.closedClass)}this.complete(node)});node.classList.toggle(this.openedClass,opened);node.classList.toggle(this.closedClass,!opened)}});Polymer("paper-dialog-base",{publish:{heading:"",transition:"",layered:true},ready:function(){this.super();this.sizingTarget=this.$.scroller},headingChanged:function(old){var label=this.getAttribute("aria-label");if(!label||label===old){this.setAttribute("aria-label",this.heading)}},openAction:function(){if(this.$.scroller.scrollTop){this.$.scroller.scrollTop=0}}});Polymer("paper-action-dialog",{publish:{closeSelector:"[affirmative],[dismissive]"}});Polymer("paper-dialog");(function(){function docElem(property){var t;return((t=document.documentElement)||(t=document.body.parentNode))&&typeof t[property]==="number"?t:document.body}function viewSize(){var doc=docElem("clientWidth");var body=document.body;var w,h;return typeof document.clientWidth==="number"?{w:document.clientWidth,h:document.clientHeight}:doc===body||(w=Math.max(doc.clientWidth,body.clientWidth))>self.innerWidth||(h=Math.max(doc.clientHeight,body.clientHeight))>self.innerHeight?{w:body.clientWidth,h:body.clientHeight}:{w:w,h:h}}Polymer("core-dropdown",{publish:{relatedTarget:null,halign:"left",valign:"top"},measure:function(){var target=this.target;var pos=target.style.position;target.style.position="fixed";target.style.left="0px";target.style.top="0px";var rect=target.getBoundingClientRect();target.style.position=pos;target.style.left=null;target.style.top=null;return rect},resetTargetDimensions:function(){var dims=this.dimensions;var style=this.target.style;if(dims.position.h_by===this.localName){style[dims.position.h]=null;dims.position.h_by=null}if(dims.position.v_by===this.localName){style[dims.position.v]=null;dims.position.v_by=null}style.width=null;style.height=null;this.super()},positionTarget:function(){if(!this.relatedTarget){this.relatedTarget=this.target.parentElement||this.target.parentNode&&this.target.parentNode.host;if(!this.relatedTarget){this.super();return}}var target=this.sizingTarget;var rect=this.measure();target.style.width=Math.ceil(rect.width)+"px";target.style.height=Math.ceil(rect.height)+"px";if(this.layered){this.positionLayeredTarget()}else{this.positionNestedTarget()}},positionLayeredTarget:function(){var target=this.target;var rect=this.relatedTarget.getBoundingClientRect();var dims=this.dimensions;var margin=dims.margin;var vp=viewSize();if(!dims.position.h){if(this.halign==="right"){target.style.right=vp.w-rect.right-margin.right+"px";dims.position.h="right"}else{target.style.left=rect.left-margin.left+"px";dims.position.h="left"}dims.position.h_by=this.localName}if(!dims.position.v){if(this.valign==="bottom"){target.style.bottom=vp.h-rect.bottom-margin.bottom+"px";dims.position.v="bottom"}else{target.style.top=rect.top-margin.top+"px";dims.position.v="top"}dims.position.v_by=this.localName}if(dims.position.h_by||dims.position.v_by){target.style.position="fixed"}},positionNestedTarget:function(){var target=this.target;
var related=this.relatedTarget;var t_op=target.offsetParent;var r_op=related.offsetParent;if(window.ShadowDOMPolyfill){t_op=wrap(t_op);r_op=wrap(r_op)}if(t_op!==r_op&&t_op!==related){console.warn("core-dropdown-overlay: dropdown's offsetParent must be the relatedTarget or the relatedTarget's offsetParent!")}var dims=this.dimensions;var margin=dims.margin;var inside=t_op===related;if(!dims.position.h){if(this.halign==="right"){target.style.right=(inside?0:t_op.offsetWidth-related.offsetLeft-related.offsetWidth)-margin.right+"px";dims.position.h="right"}else{target.style.left=(inside?0:related.offsetLeft)-margin.left+"px";dims.position.h="left"}dims.position.h_by=this.localName}if(!dims.position.v){if(this.valign==="bottom"){target.style.bottom=(inside?0:t_op.offsetHeight-related.offsetTop-related.offsetHeight)-margin.bottom+"px";dims.position.v="bottom"}else{target.style.top=(inside?0:related.offsetTop)-margin.top+"px";dims.position.v="top"}dims.position.v_by=this.localName}}})})();Polymer("paper-dropdown-transition",{publish:{duration:500},setup:function(node){this.super(arguments);var to={top:"0%",left:"0%",bottom:"100%",right:"100%"};var bg=node.$.background;bg.style.webkitTransformOrigin=to[node.halign]+" "+to[node.valign];bg.style.transformOrigin=to[node.halign]+" "+to[node.valign]},transitionOpened:function(node,opened){this.super(arguments);if(opened){if(this.player){this.player.cancel()}var duration=Number(node.getAttribute("duration"))||this.duration;var anims=[];var size=node.getBoundingClientRect();var ink=node.$.ripple;var offset=.2;anims.push(new Animation(ink,[{opacity:.9,transform:"scale(0)"},{opacity:.9,transform:"scale(1)"}],{duration:duration*offset}));var bg=node.$.background;var sx=40/size.width;var sy=40/size.height;anims.push(new Animation(bg,[{opacity:.9,transform:"scale("+sx+","+sy+")"},{opacity:1,transform:"scale("+Math.max(sx,.95)+","+Math.max(sy,.5)+")"},{opacity:1,transform:"scale(1, 1)"}],{delay:duration*offset,duration:duration*(1-offset),fill:"forwards"}));var menu=node.querySelector(".menu");if(menu){var items=menu.items||menu.children.array();var itemDelay=offset+(1-offset)/2;var itemDuration=duration*(1-itemDelay)/items.length;var reverse=this.valign==="bottom";items.forEach(function(item,i){anims.push(new Animation(item,[{opacity:0},{opacity:1}],{delay:duration*itemDelay+itemDuration*(reverse?items.length-1-i:i),duration:itemDuration,fill:"both"}))}.bind(this));anims.push(new Animation(node.$.scroller,[{opacity:1},{opacity:1}],{delay:duration*itemDelay,duration:itemDuration*items.length,fill:"both"}))}else{anims.push(new Animation(node.$.scroller,[{opacity:0},{opacity:1}],{delay:duration*(offset+(1-offset)/2),duration:duration*.5,fill:"both"}))}var group=new AnimationGroup(anims,{easing:"cubic-bezier(0.4, 0, 0.2, 1)"});this.player=document.timeline.play(group);this.player.onfinish=function(){this.fire("core-transitionend",this,node)}.bind(this)}else{this.fire("core-transitionend",this,node)}}});Polymer("paper-dropdown",{publish:{transition:"paper-dropdown-transition"},ready:function(){this.super();this.sizingTarget=this.$.scroller}});Polymer("core-dropdown-base",{publish:{opened:false},eventDelegates:{tap:"toggleOverlay"},overlayListeners:{"core-overlay-open":"openAction"},get dropdown(){if(!this._dropdown){this._dropdown=this.querySelector(".dropdown");for(var l in this.overlayListeners){this.addElementListener(this._dropdown,l,this.overlayListeners[l])}}return this._dropdown},attached:function(){this.dropdown},addElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.addEventListener(node,event,fn,capture)}},removeElementListener:function(node,event,methodName,capture){var fn=this._makeBoundListener(methodName);if(node&&fn){Polymer.removeEventListener(node,event,fn,capture)}},_makeBoundListener:function(methodName){var self=this,method=this[methodName];if(!method){return}var bound="_bound"+methodName;if(!this[bound]){this[bound]=function(e){method.call(self,e)}}return this[bound]},openedChanged:function(){if(this.disabled){return}var dropdown=this.dropdown;if(dropdown){dropdown.opened=this.opened}},openAction:function(e){this.opened=!!e.detail},toggleOverlay:function(){this.opened=!this.opened}});Polymer("core-iconset",{src:"",width:0,icons:"",iconSize:24,offsetX:0,offsetY:0,type:"iconset",created:function(){this.iconMap={};this.iconNames=[];this.themes={}},ready:function(){if(this.src&&this.ownerDocument!==document){this.src=this.resolvePath(this.src,this.ownerDocument.baseURI)}this.super();this.updateThemes()},iconsChanged:function(){var ox=this.offsetX;var oy=this.offsetY;this.icons&&this.icons.split(/\s+/g).forEach(function(name,i){this.iconNames.push(name);this.iconMap[name]={offsetX:ox,offsetY:oy};if(ox+this.iconSize<this.width){ox+=this.iconSize}else{ox=this.offsetX;oy+=this.iconSize}},this)},updateThemes:function(){var ts=this.querySelectorAll("property[theme]");ts&&ts.array().forEach(function(t){this.themes[t.getAttribute("theme")]={offsetX:parseInt(t.getAttribute("offsetX"))||0,offsetY:parseInt(t.getAttribute("offsetY"))||0}},this)},getOffset:function(icon,theme){var i=this.iconMap[icon];if(!i){var n=this.iconNames[Number(icon)];i=this.iconMap[n]}var t=this.themes[theme];if(i&&t){return{offsetX:i.offsetX+t.offsetX,offsetY:i.offsetY+t.offsetY}}return i},applyIcon:function(element,icon,scale){var offset=this.getOffset(icon);scale=scale||1;if(element&&offset){var icon=element._icon||document.createElement("div");var style=icon.style;style.backgroundImage="url("+this.src+")";style.backgroundPosition=-offset.offsetX*scale+"px"+" "+(-offset.offsetY*scale+"px");style.backgroundSize=scale===1?"auto":this.width*scale+"px";if(icon.parentNode!==element){element.appendChild(icon)}return icon}}});(function(){var meta;Polymer("core-icon",{src:"",icon:"",alt:null,observe:{icon:"updateIcon",alt:"updateAlt"},defaultIconset:"icons",ready:function(){if(!meta){meta=document.createElement("core-iconset")}if(this.hasAttribute("aria-label")){if(!this.hasAttribute("role")){this.setAttribute("role","img")}return}this.updateAlt()},srcChanged:function(){var icon=this._icon||document.createElement("div");icon.textContent="";icon.setAttribute("fit","");icon.style.backgroundImage="url("+this.src+")";icon.style.backgroundPosition="center";icon.style.backgroundSize="100%";if(!icon.parentNode){this.appendChild(icon)}this._icon=icon},getIconset:function(name){return meta.byId(name||this.defaultIconset)},updateIcon:function(oldVal,newVal){if(!this.icon){this.updateAlt();return}var parts=String(this.icon).split(":");var icon=parts.pop();if(icon){var set=this.getIconset(parts.pop());if(set){this._icon=set.applyIcon(this,icon);if(this._icon){this._icon.setAttribute("fit","")}}}if(oldVal){if(oldVal.split(":").pop()==this.getAttribute("aria-label")){this.updateAlt()}}},updateAlt:function(){if(this.getAttribute("aria-hidden")){return}if(this.alt===""){this.setAttribute("aria-hidden","true");if(this.hasAttribute("role")){this.removeAttribute("role")}if(this.hasAttribute("aria-label")){this.removeAttribute("aria-label")}}else{this.setAttribute("aria-label",this.alt||this.icon.split(":").pop());if(!this.hasAttribute("role")){this.setAttribute("role","img")}if(this.hasAttribute("aria-hidden")){this.removeAttribute("aria-hidden")}}}})})();Polymer("core-iconset-svg",{iconSize:24,type:"iconset",created:function(){this._icons={}},ready:function(){this.super();this.updateIcons()},iconById:function(id){return this._icons[id]||(this._icons[id]=this.querySelector('[id="'+id+'"]'))},cloneIcon:function(id){var icon=this.iconById(id);if(icon){var content=icon.cloneNode(true);content.removeAttribute("id");var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("viewBox","0 0 "+this.iconSize+" "+this.iconSize);svg.style.pointerEvents="none";svg.appendChild(content);return svg}},get iconNames(){if(!this._iconNames){this._iconNames=this.findIconNames()}return this._iconNames},findIconNames:function(){var icons=this.querySelectorAll("[id]").array();if(icons.length){return icons.map(function(n){return n.id})}},applyIcon:function(element,icon){var root=element;var old=root.querySelector("svg");if(old){old.remove()}var svg=this.cloneIcon(icon);if(!svg){return}svg.setAttribute("height","100%");svg.setAttribute("width","100%");svg.setAttribute("preserveAspectRatio","xMidYMid meet");svg.style.display="block";root.insertBefore(svg,root.firstElementChild);return svg},updateIcons:function(selector,method){selector=selector||"[icon]";method=method||"updateIcon";var deep=window.ShadowDOMPolyfill?"":"html /deep/ ";var i$=document.querySelectorAll(deep+selector);for(var i=0,e;e=i$[i];i++){if(e[method]){e[method].call(e)}}}});(function(){var p={publish:{label:"Select an item",openedIcon:"arrow-drop-up",closedIcon:"arrow-drop-down"},selectedItemLabel:"",overlayListeners:{"core-overlay-open":"openAction","core-activate":"activateAction","core-select":"selectAction"},activateAction:function(e){this.opened=false},selectAction:function(e){var detail=e.detail;if(detail.isSelected){this.$.label.classList.add("selectedItem");this.selectedItemLabel=detail.item.label||detail.item.textContent}else{this.$.label.classList.remove("selectedItem");this.selectedItemLabel=""}}};Polymer.mixin2(p,Polymer.CoreFocusable);Polymer("paper-dropdown-menu",p)})();Polymer("paper-fab",{publish:{src:"",icon:"",mini:false,raised:true,recenteringTouch:true,fill:false},iconChanged:function(oldIcon){var label=this.getAttribute("aria-label");if(!label||label===oldIcon){this.setAttribute("aria-label",this.icon)}}});Polymer("paper-icon-button",{publish:{src:"",icon:"",recenteringTouch:true,fill:false},iconChanged:function(oldIcon){var label=this.getAttribute("aria-label");if(!label||label===oldIcon){this.setAttribute("aria-label",this.icon)}}});Polymer("core-input",{publish:{committedValue:"",preventInvalidInput:false},previousValidInput:"",eventDelegates:{input:"inputAction",change:"changeAction"},ready:function(){this.disabledHandler();this.placeholderHandler()},attributeChanged:function(attr,old){if(this[attr+"Handler"]){this[attr+"Handler"](old)}},disabledHandler:function(){if(this.disabled){this.setAttribute("aria-disabled","")}else{this.removeAttribute("aria-disabled")}},placeholderHandler:function(){if(this.placeholder){this.setAttribute("aria-label",this.placeholder)}else{this.removeAttribute("aria-label")}},commit:function(){this.committedValue=this.value},changeAction:function(){this.commit()},inputAction:function(e){if(this.preventInvalidInput){if(!e.target.validity.valid){e.target.value=this.previousValidInput}else{this.previousValidInput=e.target.value}}}});(function(){window.CoreStyle=window.CoreStyle||{g:{},list:{},refMap:{}};Polymer("core-style",{publish:{ref:""},g:CoreStyle.g,refMap:CoreStyle.refMap,list:CoreStyle.list,ready:function(){if(this.id){this.provide()}else{this.registerRef(this.ref);if(!window.ShadowDOMPolyfill){this.require()}}},attached:function(){if(!this.id&&window.ShadowDOMPolyfill){this.require()}},provide:function(){this.register();if(this.textContent){this._completeProvide()}else{this.async(this._completeProvide)}},register:function(){var i=this.list[this.id];if(i){if(!Array.isArray(i)){this.list[this.id]=[i]}this.list[this.id].push(this)}else{this.list[this.id]=this}},_completeProvide:function(){this.createShadowRoot();this.domObserver=new MutationObserver(this.domModified.bind(this)).observe(this.shadowRoot,{subtree:true,characterData:true,childList:true});this.provideContent()},provideContent:function(){this.ensureTemplate();this.shadowRoot.textContent="";this.shadowRoot.appendChild(this.instanceTemplate(this.template));this.cssText=this.shadowRoot.textContent},ensureTemplate:function(){if(!this.template){this.template=this.querySelector("template:not([repeat]):not([bind])");if(!this.template){this.template=document.createElement("template");var n=this.firstChild;while(n){this.template.content.appendChild(n.cloneNode(true));n=n.nextSibling}}}},domModified:function(){this.cssText=this.shadowRoot.textContent;this.notify()},notify:function(){var s$=this.refMap[this.id];if(s$){for(var i=0,s;s=s$[i];i++){s.require()}}},registerRef:function(ref){this.refMap[this.ref]=this.refMap[this.ref]||[];this.refMap[this.ref].push(this)},applyRef:function(ref){this.ref=ref;this.registerRef(this.ref);this.require()},require:function(){var cssText=this.cssTextForRef(this.ref);if(cssText){this.ensureStyleElement();if(this.styleElement._cssText===cssText){return}this.styleElement._cssText=cssText;if(window.ShadowDOMPolyfill){this.styleElement.textContent=cssText;cssText=WebComponents.ShadowCSS.shimStyle(this.styleElement,this.getScopeSelector())}this.styleElement.textContent=cssText}},cssTextForRef:function(ref){var s$=this.byId(ref);var cssText="";if(s$){if(Array.isArray(s$)){var p=[];for(var i=0,l=s$.length,s;i<l&&(s=s$[i]);i++){p.push(s.cssText)}cssText=p.join("\n\n")}else{cssText=s$.cssText}}if(s$&&!cssText){console.warn("No styles provided for ref:",ref)}return cssText},byId:function(id){return this.list[id]},ensureStyleElement:function(){if(!this.styleElement){this.styleElement=window.ShadowDOMPolyfill?this.makeShimStyle():this.makeRootStyle()}if(!this.styleElement){console.warn(this.localName,"could not setup style.")}},makeRootStyle:function(){var style=document.createElement("style");this.appendChild(style);return style},makeShimStyle:function(){var host=this.findHost(this);if(host){var name=host.localName;var style=document.querySelector("style["+name+"="+this.ref+"]");if(!style){style=document.createElement("style");style.setAttribute(name,this.ref);document.head.appendChild(style)}return style}},getScopeSelector:function(){if(!this._scopeSelector){var selector="",host=this.findHost(this);if(host){var typeExtension=host.hasAttribute("is");var name=typeExtension?host.getAttribute("is"):host.localName;selector=WebComponents.ShadowCSS.makeScopeSelector(name,typeExtension)}this._scopeSelector=selector}return this._scopeSelector},findHost:function(node){while(node.parentNode){node=node.parentNode}return node.host||wrap(document.documentElement)},cycle:function(rgb,amount){if(rgb.match("#")){var o=this.hexToRgb(rgb);if(!o){return rgb}rgb="rgb("+o.r+","+o.b+","+o.g+")"}function cycleChannel(v){return Math.abs((Number(v)-amount)%255)}return rgb.replace(/rgb\(([^,]*),([^,]*),([^,]*)\)/,function(m,a,b,c){return"rgb("+cycleChannel(a)+","+cycleChannel(b)+", "+cycleChannel(c)+")"})},hexToRgb:function(hex){var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?{r:parseInt(result[1],16),g:parseInt(result[2],16),b:parseInt(result[3],16)}:null}})})();(function(){var paperInput=CoreStyle.g.paperInput=CoreStyle.g.paperInput||{};paperInput.labelColor="#757575";paperInput.focusedColor="#4059a9";paperInput.invalidColor="#d34336";Polymer("paper-input-decorator",{publish:{label:"",floatingLabel:false,disabled:{value:false,reflect:true},labelVisible:null,isInvalid:false,autoValidate:false,error:"",focused:{value:false,reflect:true}},computed:{floatingLabelVisible:"floatingLabel && !_labelVisible",_labelVisible:"(labelVisible === true || labelVisible === false) ? labelVisible : _autoLabelVisible"},ready:function(){Polymer.addEventListener(this,"focus",this.focusAction.bind(this),true);Polymer.addEventListener(this,"blur",this.blurAction.bind(this),true)},attached:function(){this.input=this.querySelector("input,textarea");this.mo=new MutationObserver(function(){this.input=this.querySelector("input,textarea")}.bind(this));this.mo.observe(this,{childList:true})},detached:function(){this.mo.disconnect();this.mo=null},prepareLabelTransform:function(){var toRect=this.$.floatedLabelText.getBoundingClientRect();var fromRect=this.$.labelText.getBoundingClientRect();if(toRect.width!==0){var sy=toRect.height/fromRect.height;this.$.labelText.cachedTransform="scale3d("+toRect.width/fromRect.width+","+sy+",1) "+"translate3d(0,"+(toRect.top-fromRect.top)/sy+"px,0)"}},animateFloatingLabel:function(){if(!this.floatingLabel||this.labelAnimated){return false}if(!this.$.labelText.cachedTransform){this.prepareLabelTransform()}if(!this.$.labelText.cachedTransform){return false}this.labelAnimated=true;this.async(function(){this.transitionEndAction()},null,250);if(this._labelVisible){if(!this.$.labelText.style.webkitTransform&&!this.$.labelText.style.transform){this.$.labelText.style.webkitTransform=this.$.labelText.cachedTransform;this.$.labelText.style.transform=this.$.labelText.cachedTransform;this.$.labelText.offsetTop}this.$.labelText.style.webkitTransform="";this.$.labelText.style.transform=""}else{this.$.labelText.style.webkitTransform=this.$.labelText.cachedTransform;this.$.labelText.style.transform=this.$.labelText.cachedTransform;this.input.placeholder=""}return true},animateUnderline:function(e){if(this.focused){var rect=this.$.underline.getBoundingClientRect();var right=e.x-rect.left;this.$.focusedUnderline.style.mozTransformOrigin=right+"px";this.$.focusedUnderline.style.webkitTransformOrigin=right+"px ";this.$.focusedUnderline.style.transformOriginX=right+"px";this.underlineAnimated=true}},validate:function(){this.isInvalid=!this.input.validity.valid;return this.input.validity.valid},_labelVisibleChanged:function(old){if(old!==undefined){if(!this.animateFloatingLabel()){this.updateInputLabel(this.input,this.label)}}},labelVisibleChanged:function(){if(this.labelVisible==="true"){this.labelVisible=true}else if(this.labelVisible==="false"){this.labelVisible=false}},labelChanged:function(){if(this.input){this.updateInputLabel(this.input,this.label)}},isInvalidChanged:function(){this.classList.toggle("invalid",this.isInvalid)},focusedChanged:function(){this.updateLabelVisibility(this.input&&this.input.value);if(this.lastEvent){this.animateUnderline(this.lastEvent);this.lastEvent=null}this.underlineVisible=this.focused},inputChanged:function(old){if(this.input){this.updateLabelVisibility(this.input.value);this.updateInputLabel(this.input,this.label);if(this.autoValidate){this.validate()}}if(old){this.updateInputLabel(old,"")}},focusAction:function(){this.focused=true},blurAction:function(){this.focused=false},updateLabelVisibility:function(value){var v=value!==null&&value!==undefined?String(value):value;this._autoLabelVisible=!this.focused&&!v||!this.floatingLabel&&!v},updateInputLabel:function(input,label){if(this._labelVisible){this.input.placeholder=this.label}else{this.input.placeholder=""}if(label){input.setAttribute("aria-label",label)}else{input.removeAttribute("aria-label")}},inputAction:function(){this.updateLabelVisibility(this.input.value);if(this.autoValidate){this.validate()}},downAction:function(e){if(e.target!==this.input&&this.focused){e.preventDefault();return}this.lastEvent=e},tapAction:function(e){if(this.disabled){return}if(this.focused){return}if(this.input){this.input.focus();e.preventDefault()}},transitionEndAction:function(){this.underlineAnimated=false;this.labelAnimated=false;if(this._labelVisible){this.input.placeholder=this.label}}})})();Polymer("paper-input",{publish:{label:"",floatingLabel:false,disabled:{value:false,reflect:true},value:"",committedValue:""},focus:function(){this.$.input.focus()},valueChanged:function(){this.$.decorator.updateLabelVisibility(this.value)},changeAction:function(e){this.fire("change",null,this)}});Polymer("paper-item",{publish:{raised:false,recenteringTouch:false,fill:true}});Polymer("paper-menu-button",{overlayListeners:{"core-overlay-open":"openAction","core-activate":"activateAction"},activateAction:function(){this.opened=false}});Polymer("core-range",{value:0,min:0,max:100,step:1,ratio:0,observe:{"value min max step":"update"},calcRatio:function(value){return(this.clampValue(value)-this.min)/(this.max-this.min)},clampValue:function(value){return Math.min(this.max,Math.max(this.min,this.calcStep(value)))},calcStep:function(value){return this.step?Math.round(value/this.step)/(1/this.step):value},validateValue:function(){var v=this.clampValue(this.value);this.value=this.oldValue=isNaN(v)?this.oldValue:v;return this.value!==v},update:function(){this.validateValue();this.ratio=this.calcRatio(this.value)*100}});Polymer("paper-progress",{secondaryProgress:0,indeterminate:false,step:0,observe:{"value secondaryProgress min max indeterminate":"update"},update:function(){this.super();this.secondaryProgress=this.clampValue(this.secondaryProgress);this.secondaryRatio=this.calcRatio(this.secondaryProgress)*100;this.$.activeProgress.classList.toggle("indeterminate",this.indeterminate)},transformProgress:function(progress,ratio){var transform="scaleX("+ratio/100+")";progress.style.transform=progress.style.webkitTransform=transform},ratioChanged:function(){this.transformProgress(this.$.activeProgress,this.ratio)},secondaryRatioChanged:function(){this.transformProgress(this.$.secondaryProgress,this.secondaryRatio)}});Polymer("core-selection",{multi:false,ready:function(){this.clear()},clear:function(){this.selection=[]},getSelection:function(){return this.multi?this.selection:this.selection[0]},isSelected:function(item){return this.selection.indexOf(item)>=0},setItemSelected:function(item,isSelected){if(item!==undefined&&item!==null){if(isSelected){this.selection.push(item)}else{var i=this.selection.indexOf(item);if(i>=0){this.selection.splice(i,1)}}this.fire("core-select",{isSelected:isSelected,item:item})}},select:function(item){if(this.multi){this.toggle(item)}else if(this.getSelection()!==item){this.setItemSelected(this.getSelection(),false);this.setItemSelected(item,true)}},toggle:function(item){this.setItemSelected(item,!this.isSelected(item))}});Polymer("core-selector",{selected:null,multi:false,valueattr:"name",selectedClass:"core-selected",selectedProperty:"",selectedAttribute:"active",selectedItem:null,selectedModel:null,selectedIndex:-1,excludedLocalNames:"",target:null,itemsSelector:"",activateEvent:"tap",notap:false,defaultExcludedLocalNames:"template",observe:{"selected multi":"selectedChanged"},ready:function(){this.activateListener=this.activateHandler.bind(this);this.itemFilter=this.filterItem.bind(this);this.excludedLocalNamesChanged();this.observer=new MutationObserver(this.updateSelected.bind(this));if(!this.target){this.target=this}},get items(){if(!this.target){return[]}var nodes=this.target!==this?this.itemsSelector?this.target.querySelectorAll(this.itemsSelector):this.target.children:this.$.items.getDistributedNodes();return Array.prototype.filter.call(nodes,this.itemFilter)},filterItem:function(node){return!this._excludedNames[node.localName]},excludedLocalNamesChanged:function(){this._excludedNames={};var s=this.defaultExcludedLocalNames;if(this.excludedLocalNames){s+=" "+this.excludedLocalNames}s.split(/\s+/g).forEach(function(n){this._excludedNames[n]=1},this)},targetChanged:function(old){if(old){this.removeListener(old);this.observer.disconnect();this.clearSelection()}if(this.target){this.addListener(this.target);this.observer.observe(this.target,{childList:true});this.updateSelected()}},addListener:function(node){Polymer.addEventListener(node,this.activateEvent,this.activateListener)},removeListener:function(node){Polymer.removeEventListener(node,this.activateEvent,this.activateListener)},get selection(){return this.$.selection.getSelection()},selectedChanged:function(){if(arguments.length===1){this.processSplices(arguments[0])}else{this.updateSelected()}},updateSelected:function(){this.validateSelected();if(this.multi){this.clearSelection(this.selected);this.selected&&this.selected.forEach(function(s){this.setValueSelected(s,true)},this)}else{this.valueToSelection(this.selected)}},validateSelected:function(){if(this.multi&&!Array.isArray(this.selected)&&this.selected!=null){this.selected=[this.selected]}else if(!this.multi&&Array.isArray(this.selected)){var s=this.selected[0];this.clearSelection([s]);this.selected=s}},processSplices:function(splices){for(var i=0,splice;splice=splices[i];i++){for(var j=0;j<splice.removed.length;j++){this.setValueSelected(splice.removed[j],false)}for(var j=0;j<splice.addedCount;j++){this.setValueSelected(this.selected[splice.index+j],true)}}},clearSelection:function(excludes){this.$.selection.selection.slice().forEach(function(item){var v=this.valueForNode(item)||this.items.indexOf(item);if(!excludes||excludes.indexOf(v)<0){this.$.selection.setItemSelected(item,false)}},this)},valueToSelection:function(value){var item=this.valueToItem(value);this.$.selection.select(item)},setValueSelected:function(value,isSelected){var item=this.valueToItem(value);if(isSelected^this.$.selection.isSelected(item)){this.$.selection.setItemSelected(item,isSelected)}},updateSelectedItem:function(){this.selectedItem=this.selection},selectedItemChanged:function(){if(this.selectedItem){var t=this.selectedItem.templateInstance;this.selectedModel=t?t.model:undefined}else{this.selectedModel=null}this.selectedIndex=this.selectedItem?parseInt(this.valueToIndex(this.selected)):-1},valueToItem:function(value){return value===null||value===undefined?null:this.items[this.valueToIndex(value)]},valueToIndex:function(value){for(var i=0,items=this.items,c;c=items[i];i++){if(this.valueForNode(c)==value){return i}}return value},valueForNode:function(node){return node[this.valueattr]||node.getAttribute(this.valueattr)},selectionSelect:function(e,detail){this.updateSelectedItem();if(detail.item){this.applySelection(detail.item,detail.isSelected)}},applySelection:function(item,isSelected){if(this.selectedClass){item.classList.toggle(this.selectedClass,isSelected)}if(this.selectedProperty){item[this.selectedProperty]=isSelected}if(this.selectedAttribute&&item.setAttribute){if(isSelected){item.setAttribute(this.selectedAttribute,"")}else{item.removeAttribute(this.selectedAttribute)}}},activateHandler:function(e){if(!this.notap){var i=this.findDistributedTarget(e.target,this.items);if(i>=0){var item=this.items[i];var s=this.valueForNode(item)||i;if(this.multi){if(this.selected){this.addRemoveSelected(s)}else{this.selected=[s]}}else{this.selected=s}this.asyncFire("core-activate",{item:item})}}},addRemoveSelected:function(value){var i=this.selected.indexOf(value);if(i>=0){this.selected.splice(i,1)}else{this.selected.push(value)}},findDistributedTarget:function(target,nodes){while(target&&target!=this){var i=Array.prototype.indexOf.call(nodes,target);if(i>=0){return i}target=target.parentNode}},selectIndex:function(index){var item=this.items[index];if(item){this.selected=this.valueForNode(item)||index;return item}},selectPrevious:function(wrapped){var i=wrapped&&!this.selectedIndex?this.items.length-1:this.selectedIndex-1;return this.selectIndex(i)},selectNext:function(wrapped){var i=wrapped&&this.selectedIndex>=this.items.length-1?0:this.selectedIndex+1;return this.selectIndex(i)}});Polymer("paper-radio-group",{nextIndex:function(index){var items=this.items;var newIndex=index;do{newIndex=(newIndex+1)%items.length;if(newIndex===index){break}}while(items[newIndex].disabled);return newIndex},previousIndex:function(index){var items=this.items;var newIndex=index;do{newIndex=(newIndex||items.length)-1;if(newIndex===index){break}}while(items[newIndex].disabled);return newIndex},selectNext:function(){var node=this.selectIndex(this.nextIndex(this.selectedIndex));node.focus()},selectPrevious:function(){var node=this.selectIndex(this.previousIndex(this.selectedIndex));node.focus()},selectedAttribute:"checked",activateEvent:"change"});Polymer("paper-slider",{snaps:false,pin:false,disabled:false,secondaryProgress:0,editable:false,maxMarkers:100,dragging:false,observe:{"step snaps":"update"},ready:function(){this.update()},update:function(){this.positionKnob(this.calcRatio(this.value));this.updateMarkers()},minChanged:function(){this.update();this.setAttribute("aria-valuemin",this.min)},maxChanged:function(){this.update();this.setAttribute("aria-valuemax",this.max)},valueChanged:function(){this.update();this.setAttribute("aria-valuenow",this.value);this.fire("core-change")},disabledChanged:function(){if(this.disabled){this.removeAttribute("tabindex")}else{this.tabIndex=0}},immediateValueChanged:function(){if(!this.dragging){this.value=this.immediateValue}this.fire("immediate-value-change")},expandKnob:function(){this.expand=true},resetKnob:function(){this.expandJob&&this.expandJob.stop();this.expand=false},positionKnob:function(ratio){this.immediateValue=this.calcStep(this.calcKnobPosition(ratio))||0;this._ratio=this.snaps?this.calcRatio(this.immediateValue):ratio;this.$.sliderKnob.style.left=this._ratio*100+"%"},inputChange:function(){this.value=this.$.input.value;this.fire("change")},calcKnobPosition:function(ratio){return(this.max-this.min)*ratio+this.min},trackStart:function(e){this._w=this.$.sliderBar.offsetWidth;this._x=this._ratio*this._w;this._startx=this._x||0;this._minx=-this._startx;this._maxx=this._w-this._startx;this.$.sliderKnob.classList.add("dragging");this.dragging=true;e.preventTap()},trackx:function(e){var x=Math.min(this._maxx,Math.max(this._minx,e.dx));this._x=this._startx+x;this.immediateValue=this.calcStep(this.calcKnobPosition(this._x/this._w))||0;var s=this.$.sliderKnob.style;s.transform=s.webkitTransform="translate3d("+(this.snaps?this.calcRatio(this.immediateValue)*this._w-this._startx:x)+"px, 0, 0)"},trackEnd:function(){var s=this.$.sliderKnob.style;s.transform=s.webkitTransform="";this.$.sliderKnob.classList.remove("dragging");this.dragging=false;this.resetKnob();this.value=this.immediateValue;this.fire("change")},knobdown:function(e){e.preventDefault();this.expandKnob()},bardown:function(e){e.preventDefault();this.transiting=true;this._w=this.$.sliderBar.offsetWidth;var rect=this.$.sliderBar.getBoundingClientRect();var ratio=(e.x-rect.left)/this._w;this.positionKnob(ratio);this.expandJob=this.job(this.expandJob,this.expandKnob,60);this.asyncFire("change")},knobTransitionEnd:function(e){if(e.target===this.$.sliderKnob){this.transiting=false}},updateMarkers:function(){this.markers=[];var l=(this.max-this.min)/this.step;if(!this.snaps&&l>this.maxMarkers){return}for(var i=0;i<l;i++){this.markers.push("")}},increment:function(){this.value=this.clampValue(this.value+this.step)},decrement:function(){this.value=this.clampValue(this.value-this.step)},incrementKey:function(ev,keys){if(keys.key==="end"){this.value=this.max}else{this.increment()}this.fire("change")},decrementKey:function(ev,keys){if(keys.key==="home"){this.value=this.min}else{this.decrement()}this.fire("change")}});Polymer("paper-spinner",{eventDelegates:{animationend:"reset",webkitAnimationEnd:"reset"},publish:{active:{value:false,reflect:true},alt:{value:"loading",reflect:true}},ready:function(){if(this.hasAttribute("aria-label")){this.alt=this.getAttribute("aria-label")}else{this.setAttribute("aria-label",this.alt)}if(!this.active){this.setAttribute("aria-hidden","true")}},activeChanged:function(){if(this.active){this.$.spinnerContainer.classList.remove("cooldown");this.$.spinnerContainer.classList.add("active");this.removeAttribute("aria-hidden")}else{this.$.spinnerContainer.classList.add("cooldown");this.setAttribute("aria-hidden","true")}},altChanged:function(){if(this.alt===""){this.setAttribute("aria-hidden","true")}else{this.removeAttribute("aria-hidden")}this.setAttribute("aria-label",this.alt)},reset:function(){this.$.spinnerContainer.classList.remove("active","cooldown")}});Polymer("paper-tab",{noink:false,eventDelegates:{down:"downAction",up:"upAction"},downAction:function(e){if(this.noink||this.parentElement&&this.parentElement.noink){return}this.$.ink.downAction(e)},upAction:function(){this.$.ink.upAction()},cancelRipple:function(){this.$.ink.upAction()}});Polymer("paper-tabs",Polymer.mixin({noink:false,nobar:false,noslide:false,scrollable:false,disableDrag:false,hideScrollButton:false,eventDelegates:{"core-resize":"resizeHandler"},activateEvent:"tap",step:10,holdDelay:10,ready:function(){this.super();this._trackxHandler=this.trackx.bind(this);Polymer.addEventListener(this.$.tabsContainer,"trackx",this._trackxHandler);
this._tabsObserver=new MutationObserver(this.updateBar.bind(this))},domReady:function(){this.async("resizeHandler");this._tabsObserver.observe(this,{childList:true,subtree:true,characterData:true})},attached:function(){this.resizableAttachedHandler()},detached:function(){Polymer.removeEventListener(this.$.tabsContainer,"trackx",this._trackxHandler);this._tabsObserver.disconnect();this.resizableDetachedHandler()},trackStart:function(e){if(!this.scrollable||this.disableDrag){return}var t=e.target;if(t&&t.cancelRipple){t.cancelRipple()}this._startx=this.$.tabsContainer.scrollLeft;e.preventTap()},trackx:function(e){if(!this.scrollable||this.disableDrag){return}this.$.tabsContainer.scrollLeft=this._startx-e.dx},resizeHandler:function(){this.scroll();this.updateBar()},scroll:function(){if(!this.scrollable){return}var tc=this.$.tabsContainer;var l=tc.scrollLeft;this.leftHidden=l===0;this.rightHidden=l===Math.max(0,tc.scrollWidth-tc.clientWidth)},holdLeft:function(){this.holdJob=setInterval(this.scrollToLeft.bind(this),this.holdDelay)},holdRight:function(){this.holdJob=setInterval(this.scrollToRight.bind(this),this.holdDelay)},releaseHold:function(){clearInterval(this.holdJob);this.holdJob=null},scrollToLeft:function(){this.$.tabsContainer.scrollLeft-=this.step},scrollToRight:function(){this.$.tabsContainer.scrollLeft+=this.step},updateBar:function(){this.async("selectedItemChanged")},selectedItemChanged:function(old){var oldIndex=this.selectedIndex;this.super(arguments);var s=this.$.selectionBar.style;if(!this.selectedItem){s.width=0;s.left=0;return}var r=this.$.tabsContent.getBoundingClientRect();this._w=r.width;this._l=r.left;r=this.selectedItem.getBoundingClientRect();this._sw=r.width;this._sl=r.left;this._sOffsetLeft=this._sl-this._l;if(this.noslide||old==null){this.positionBarForSelected();return}var oldRect=old.getBoundingClientRect();var m=5;this.$.selectionBar.classList.add("expand");if(oldIndex<this.selectedIndex){s.width=this.calcPercent(this._sl+this._sw-oldRect.left)-m+"%";this._transitionCounter=1}else{s.width=this.calcPercent(oldRect.left+oldRect.width-this._sl)-m+"%";s.left=this.calcPercent(this._sOffsetLeft)+m+"%";this._transitionCounter=2}if(this.scrollable){this.scrollToSelectedIfNeeded()}},scrollToSelectedIfNeeded:function(){var scrollLeft=this.$.tabsContainer.scrollLeft;if(this._sOffsetLeft+this._sw<scrollLeft||this._sOffsetLeft-scrollLeft>this.$.tabsContainer.offsetWidth){this.$.tabsContainer.scrollLeft=this._sOffsetLeft}},positionBarForSelected:function(){var s=this.$.selectionBar.style;s.width=this.calcPercent(this._sw)+"%";s.left=this.calcPercent(this._sOffsetLeft)+"%"},calcPercent:function(w){return 100*w/this._w},barTransitionEnd:function(e){this._transitionCounter--;var cl=this.$.selectionBar.classList;if(cl.contains("expand")&&!this._transitionCounter){cl.remove("expand");cl.add("contract");this.positionBarForSelected()}else if(cl.contains("contract")){cl.remove("contract")}}},Polymer.CoreResizable));Polymer("core-media-query",{queryMatches:false,query:"",ready:function(){this._mqHandler=this.queryHandler.bind(this);this._mq=null},queryChanged:function(){if(this._mq){this._mq.removeListener(this._mqHandler)}var query=this.query;if(query[0]!=="("){query="("+this.query+")"}this._mq=window.matchMedia(query);this._mq.addListener(this._mqHandler);this.queryHandler(this._mq)},queryHandler:function(mq){this.queryMatches=mq.matches;this.asyncFire("core-media-change",mq)}});(function(){var currentToast;Polymer("paper-toast",{text:"",duration:3e3,opened:false,responsiveWidth:"480px",swipeDisabled:false,autoCloseDisabled:false,narrowMode:false,eventDelegates:{trackstart:"trackStart",track:"track",trackend:"trackEnd",transitionend:"transitionEnd"},narrowModeChanged:function(){this.classList.toggle("fit-bottom",this.narrowMode);if(this.opened){this.$.overlay.resizeHandler()}},openedChanged:function(){if(this.opened){this.dismissJob=this.job(this.dismissJob,this.dismiss,this.duration)}else{this.dismissJob&&this.dismissJob.stop();this.dismiss()}},toggle:function(){this.opened=!this.opened},show:function(){if(currentToast){currentToast.dismiss()}currentToast=this;this.opened=true},dismiss:function(){if(this.dragging){this.shouldDismiss=true}else{this.opened=false;if(currentToast===this){currentToast=null}}},trackStart:function(e){if(!this.swipeDisabled){e.preventTap();this.vertical=e.yDirection;this.w=this.offsetWidth;this.h=this.offsetHeight;this.dragging=true;this.classList.add("dragging")}},track:function(e){if(this.dragging){var s=this.style;if(this.vertical){var y=e.dy;s.opacity=(this.h-Math.abs(y))/this.h;s.transform=s.webkitTransform="translate3d(0, "+y+"px, 0)"}else{var x=e.dx;s.opacity=(this.w-Math.abs(x))/this.w;s.transform=s.webkitTransform="translate3d("+x+"px, 0, 0)"}}},trackEnd:function(e){if(this.dragging){this.classList.remove("dragging");this.style.opacity="";this.style.transform=this.style.webkitTransform="";var cl=this.classList;if(this.vertical){cl.toggle("fade-out-down",e.yDirection===1&&e.dy>0);cl.toggle("fade-out-up",e.yDirection===-1&&e.dy<0)}else{cl.toggle("fade-out-right",e.xDirection===1&&e.dx>0);cl.toggle("fade-out-left",e.xDirection===-1&&e.dx<0)}this.dragging=false}},transitionEnd:function(){var cl=this.classList;if(cl.contains("fade-out-right")||cl.contains("fade-out-left")||cl.contains("fade-out-down")||cl.contains("fade-out-up")){this.dismiss();cl.remove("fade-out-right","fade-out-left","fade-out-down","fade-out-up")}else if(this.shouldDismiss){this.dismiss()}this.shouldDismiss=false}})})();Polymer("paper-toggle-button",{checked:false,disabled:false,eventDelegates:{down:"downAction",up:"upAction",tap:"tap",trackstart:"trackStart",trackx:"trackx",trackend:"trackEnd"},downAction:function(e){var rect=this.$.ink.getBoundingClientRect();this.$.ink.downAction({x:rect.left+rect.width/2,y:rect.top+rect.height/2})},upAction:function(e){this.$.ink.upAction()},tap:function(){if(this.disabled){return}this.checked=!this.checked;this.fire("change")},trackStart:function(e){if(this.disabled){return}this._w=this.$.toggleBar.offsetWidth/2;e.preventTap()},trackx:function(e){this._x=Math.min(this._w,Math.max(0,this.checked?this._w+e.dx:e.dx));this.$.toggleButton.classList.add("dragging");var s=this.$.toggleButton.style;s.webkitTransform=s.transform="translate3d("+this._x+"px,0,0)"},trackEnd:function(){var s=this.$.toggleButton.style;s.transform=s.webkitTransform="";this.$.toggleButton.classList.remove("dragging");var old=this.checked;this.checked=Math.abs(this._x)>this._w/2;if(this.checked!==old){this.fire("change")}},checkedChanged:function(){this.setAttribute("aria-pressed",Boolean(this.checked));this.fire("core-change")}});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.toUpperCase()=="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,PATCH: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])}}}});Polymer("core-ajax",{url:"",handleAs:"",auto:false,params:"",response:null,error:null,loading:false,progress:null,method:"",headers:null,body:null,contentType:"application/x-www-form-urlencoded",withCredentials:false,xhrArgs:null,created:function(){this.progress={}},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})},processProgress:function(progress,xhr){if(xhr!==this.activeRequest){return}var progressProxy={lengthComputable:progress.lengthComputable,loaded:progress.loaded,total:progress.total};this.progress=progressProxy},complete:function(xhr){if(xhr===this.activeRequest){this.loading=false}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()},bodyChanged:function(){this.autoGo()},autoChanged:function(){this.autoGo()},autoGo:function(){if(this.auto){this.goJob=this.job(this.goJob,this.go,0)}},getParams:function(params){params=this.params||params;if(params&&typeof params=="string"){params=JSON.parse(params)}return params},go:function(){var args=this.xhrArgs||{};args.body=this.body||args.body;args.params=this.getParams(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(args.body instanceof FormData){delete args.headers["Content-Type"]}else 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=this.progress=null;this.activeRequest=args.url&&this.xhr.request(args);if(this.activeRequest){this.loading=true;var activeRequest=this.activeRequest;if("onprogress"in activeRequest){this.activeRequest.addEventListener("progress",function(progress){this.processProgress(progress,activeRequest)}.bind(this),false)}else{this.progress={lengthComputable:false}}}return this.activeRequest},abort:function(){if(!this.activeRequest)return;this.activeRequest.abort();this.activeRequest=null;this.progress={};this.loading=false}});(function(){var transitions=CoreStyle.g.transitions=CoreStyle.g.transitions||{};transitions.duration="500ms";transitions.heroDelay="50ms";transitions.scaleDelay="500ms";transitions.cascadeFadeDuration="250ms";Polymer("core-transition-pages",{publish:{scopeClass:"",activeClass:"",transitionProperty:""},completed:false,prepare:function(scope,options){this.boundCompleteFn=this.complete.bind(this,scope);if(this.scopeClass){scope.classList.add(this.scopeClass)}},go:function(scope,options){this.completed=false;if(this.activeClass){scope.classList.add(this.activeClass)}scope.addEventListener("transitionend",this.boundCompleteFn,false)},setup:function(scope){if(!scope._pageTransitionStyles){scope._pageTransitionStyles={}}var name=this.calcStyleName();if(!scope._pageTransitionStyles[name]){this.installStyleInScope(scope,name);scope._pageTransitionStyles[name]=true}},calcStyleName:function(){return this.id||this.localName},installStyleInScope:function(scope,id){if(!scope.shadowRoot){scope.createShadowRoot().innerHTML="<content></content>"}var root=scope.shadowRoot;var scopeStyle=document.createElement("core-style");root.insertBefore(scopeStyle,root.firstChild);scopeStyle.applyRef(id)},complete:function(scope,e){if(e.propertyName!=="box-shadow"&&(!this.transitionProperty||e.propertyName.indexOf(this.transitionProperty)!==-1)){this.completed=true;this.fire("core-transitionend",this,scope)}},ensureComplete:function(scope){scope.removeEventListener("transitionend",this.boundCompleteFn,false);if(this.scopeClass){scope.classList.remove(this.scopeClass)}if(this.activeClass){scope.classList.remove(this.activeClass)}}})})();(function(){var webkitStyles="-webkit-transition"in document.documentElement.style;var TRANSITION_CSSNAME=webkitStyles?"-webkit-transition":"transition";var TRANSFORM_CSSNAME=webkitStyles?"-webkit-transform":"transform";var TRANSITION_NAME=webkitStyles?"webkitTransition":"transition";var TRANSFORM_NAME=webkitStyles?"webkitTransform":"transform";var hasShadowDOMPolyfill=window.ShadowDOMPolyfill;Polymer("hero-transition",{go:function(scope,options){var props=["border-radius","width","height",TRANSFORM_CSSNAME];var duration=options&&options.duration||(CoreStyle.g.transitions.heroDuration||CoreStyle.g.transitions.duration);scope._heroes.forEach(function(h){var d=h.h0.hasAttribute("hero-delayed")?CoreStyle.g.transitions.heroDelay:"";var wt=[];props.forEach(function(p){wt.push(p+" "+duration+" "+options.easing+" "+d)});h.h1.style[TRANSITION_NAME]=wt.join(", ");h.h1.style.borderRadius=h.r1;h.h1.style[TRANSFORM_NAME]=""});this.super(arguments);if(!scope._heroes.length){this.completed=true}},prepare:function(scope,options){this.super(arguments);var src=options.src,dst=options.dst;if(scope._heroes&&scope._heroes.length){this.ensureComplete(scope)}else{scope._heroes=[]}var ss="[hero]";var h$=this.findAllInShadows(src,ss);if(src.selectedItem){hs$=this.findAllInShadows(src.selectedItem,ss);hsa$=[];Array.prototype.forEach.call(hs$,function(hs){if(h$.indexOf(hs)===-1){hsa$.push(hs)}});h$=h$.concat(hsa$)}for(var i=0,h0;h0=h$[i];i++){var v=h0.getAttribute("hero-id");var ds='[hero][hero-id="'+v+'"]';var h1=this.findInShadows(dst,ds);if(!h1&&dst.selectedItem){h1=this.findInShadows(dst.selectedItem,ds)}if(v&&h1){var c0=getComputedStyle(h0);var c1=getComputedStyle(h1);var h={h0:h0,b0:h0.getBoundingClientRect(),r0:c0.borderRadius,h1:h1,b1:h1.getBoundingClientRect(),r1:c1.borderRadius};var dl=h.b0.left-h.b1.left;var dt=h.b0.top-h.b1.top;var sw=h.b0.width/h.b1.width;var sh=h.b0.height/h.b1.height;if(h.r0!==h.r1){h.h1.style.borderRadius=h.r0}h.h1.style[TRANSFORM_NAME]="translate("+dl+"px,"+dt+"px)"+" scale("+sw+","+sh+")";h.h1.style[TRANSFORM_NAME+"Origin"]="0 0";scope._heroes.push(h)}}},findInShadows:function(node,selector){return node.querySelector(selector)||(hasShadowDOMPolyfill?queryAllShadows(node,selector):node.querySelector("::shadow "+selector))},findAllInShadows:function(node,selector){if(hasShadowDOMPolyfill){var nodes=node.querySelectorAll(selector).array();var shadowNodes=queryAllShadows(node,selector,true);return nodes.concat(shadowNodes)}else{return node.querySelectorAll(selector).array().concat(node.shadowRoot?node.shadowRoot.querySelectorAll(selector).array():[])}},ensureComplete:function(scope){this.super(arguments);if(scope._heroes){scope._heroes.forEach(function(h){h.h1.style[TRANSITION_NAME]="";h.h1.style[TRANSFORM_NAME]=""});scope._heroes=[]}},complete:function(scope,e){var done=false;scope._heroes.forEach(function(h){if(h.h1===e.path[0]){done=true}});if(done){this.super(arguments)}}});function queryShadow(node,selector){var m,el=node.firstElementChild;var shadows,sr,i;shadows=[];sr=node.shadowRoot;while(sr){shadows.push(sr);sr=sr.olderShadowRoot}for(i=shadows.length-1;i>=0;i--){m=shadows[i].querySelector(selector);if(m){return m}}while(el){m=queryShadow(el,selector);if(m){return m}el=el.nextElementSibling}return null}function _queryAllShadows(node,selector,results){var el=node.firstElementChild;var temp,sr,shadows,i,j;shadows=[];sr=node.shadowRoot;while(sr){shadows.push(sr);sr=sr.olderShadowRoot}for(i=shadows.length-1;i>=0;i--){temp=shadows[i].querySelectorAll(selector);for(j=0;j<temp.length;j++){results.push(temp[j])}}while(el){_queryAllShadows(el,selector,results);el=el.nextElementSibling}return results}queryAllShadows=function(node,selector,all){if(all){return _queryAllShadows(node,selector,[])}else{return queryShadow(node,selector)}}})();Polymer("core-animated-pages",Polymer.mixin({eventDelegates:{"core-transitionend":"transitionEnd"},transitions:"",selected:0,lastSelected:null,registerCallback:function(){this.tmeta=document.createElement("core-transition")},created:function(){this._transitions=[];this.transitioning=[]},attached:function(){this.resizerAttachedHandler()},detached:function(){this.resizerDetachedHandler()},transitionsChanged:function(){this._transitions=this.transitions.split(" ")},_transitionsChanged:function(old){if(this._transitionElements){this._transitionElements.forEach(function(t){t.teardown(this)},this)}this._transitionElements=[];this._transitions.forEach(function(transitionId){var t=this.getTransition(transitionId);if(t){this._transitionElements.push(t);t.setup(this)}},this)},getTransition:function(transitionId){return this.tmeta.byId(transitionId)},selectionSelect:function(e,detail){this.updateSelectedItem()},applyTransition:function(src,dst){if(this.animating){this.cancelAsync(this.animating);this.animating=null}Polymer.flush();if(this.transitioning.indexOf(src)===-1){this.transitioning.push(src)}if(this.transitioning.indexOf(dst)===-1){this.transitioning.push(dst)}src.setAttribute("animate","");dst.setAttribute("animate","");var options={src:src,dst:dst,easing:"cubic-bezier(0.4, 0, 0.2, 1)"};this.fire("core-animated-pages-transition-prepare");this._transitionElements.forEach(function(transition){transition.prepare(this,options)},this);src.offsetTop;this.applySelection(dst,true);this.applySelection(src,false);this._transitionElements.forEach(function(transition){transition.go(this,options)},this);if(!this._transitionElements.length){this.complete()}else{this.animating=this.async(this.complete.bind(this),null,5e3)}},complete:function(){if(this.animating){this.cancelAsync(this.animating);this.animating=null}this.transitioning.forEach(function(t){t.removeAttribute("animate")});this.transitioning=[];this._transitionElements.forEach(function(transition){transition.ensureComplete(this)},this);this.fire("core-animated-pages-transition-end")},transitionEnd:function(e){if(this.transitioning.length){var completed=true;this._transitionElements.forEach(function(transition){if(!transition.completed){completed=false}});if(completed){this.job("transitionWatch",function(){this.complete()},100)}}},selectedChanged:function(old){this.lastSelected=old;this.super(arguments)},selectedItemChanged:function(oldItem){this.super(arguments);if(!oldItem){this.applySelection(this.selectedItem,true);this.async(this.notifyResize);return}if(this.hasAttribute("no-transition")||!this._transitionElements||!this._transitionElements.length){this.applySelection(oldItem,false);this.applySelection(this.selectedItem,true);this.notifyResize();return}if(oldItem&&this.selectedItem){var self=this;Polymer.flush();Polymer.endOfMicrotask(function(){self.applyTransition(oldItem,self.selectedItem);self.notifyResize()})}},resizerShouldNotify:function(el){while(el&&el!=this){if(el==this.selectedItem){return true}el=el.parentElement||el.parentNode&&el.parentNode.host}}},Polymer.CoreResizer));Polymer("core-collapse",{target:null,horizontal:false,opened:false,duration:.33,fixedSize:false,allowOverflow:false,created:function(){this.transitionEndListener=this.transitionEnd.bind(this)},ready:function(){this.target=this.target||this},domReady:function(){this.async(function(){this.afterInitialUpdate=true})},detached:function(){if(this.target){this.removeListeners(this.target)}},targetChanged:function(old){if(old){this.removeListeners(old)}if(!this.target){return}this.isTargetReady=!!this.target;this.classList.toggle("core-collapse-closed",this.target!==this);this.toggleOpenedStyle(false);this.horizontalChanged();this.addListeners(this.target);this.toggleClosedClass(true);this.update()},addListeners:function(node){node.addEventListener("transitionend",this.transitionEndListener)},removeListeners:function(node){node.removeEventListener("transitionend",this.transitionEndListener)},horizontalChanged:function(){this.dimension=this.horizontal?"width":"height"},openedChanged:function(){this.update();this.fire("core-collapse-open",this.opened)},toggle:function(){this.opened=!this.opened},setTransitionDuration:function(duration){var s=this.target.style;s.transition=duration?this.dimension+" "+duration+"s":null;if(duration===0){this.async("transitionEnd")}},transitionEnd:function(){if(this.opened&&!this.fixedSize){this.updateSize("auto",null)}this.setTransitionDuration(null);this.toggleOpenedStyle(this.opened);this.toggleClosedClass(!this.opened);this.asyncFire("core-resize",null,this.target)},toggleClosedClass:function(closed){this.hasClosedClass=closed;this.target.classList.toggle("core-collapse-closed",closed)},toggleOpenedStyle:function(opened){this.target.style.overflow=this.allowOverflow&&opened?"":"hidden"},updateSize:function(size,duration,forceEnd){this.setTransitionDuration(duration);this.calcSize();var s=this.target.style;var nochange=s[this.dimension]===size;s[this.dimension]=size;if(forceEnd&&nochange){this.transitionEnd()}},update:function(){if(!this.target){return}if(!this.isTargetReady){this.targetChanged()}this.horizontalChanged();this[this.opened?"show":"hide"]()},calcSize:function(){return this.target.getBoundingClientRect()[this.dimension]+"px"},getComputedSize:function(){return getComputedStyle(this.target)[this.dimension]},show:function(){this.toggleClosedClass(false);if(!this.afterInitialUpdate){this.transitionEnd();return}if(!this.fixedSize){this.updateSize("auto",null);var s=this.calcSize();if(s=="0px"){this.transitionEnd();return}this.updateSize(0,null)}this.async(function(){this.updateSize(this.size||s,this.duration,true)})},hide:function(){this.toggleOpenedStyle(false);if(this.hasClosedClass&&!this.fixedSize){return}if(this.fixedSize){this.size=this.getComputedSize()}else{this.updateSize(this.calcSize(),null)}this.async(function(){this.updateSize(0,this.duration)})}});Polymer("core-icon-button",{src:"",active:false,icon:"",activeChanged:function(){this.classList.toggle("selected",this.active)}});(function(){Polymer("core-toolbar",{justify:"",middleJustify:"",bottomJustify:"",justifyChanged:function(old){this.updateBarJustify(this.$.topBar,this.justify,old)},middleJustifyChanged:function(old){this.updateBarJustify(this.$.middleBar,this.middleJustify,old)},bottomJustifyChanged:function(old){this.updateBarJustify(this.$.bottomBar,this.bottomJustify,old)},updateBarJustify:function(bar,justify,old){if(old){bar.removeAttribute(this.toLayoutAttrName(old))}if(justify){bar.setAttribute(this.toLayoutAttrName(justify),"")}},toLayoutAttrName:function(value){return value==="between"?"justified":value+"-justified"}})})();Polymer("core-header-panel",{publish:{mode:{value:"",reflect:true},tallClass:"tall",shadow:false},animateDuration:200,modeConfigs:{shadowMode:{waterfall:1,"waterfall-tall":1},noShadow:{seamed:1,cover:1,scroll:1},tallMode:{"waterfall-tall":1},outerScroll:{scroll:1}},ready:function(){this.scrollHandler=this.scroll.bind(this);this.addListener()},detached:function(){this.removeListener(this.mode)},addListener:function(){this.scroller.addEventListener("scroll",this.scrollHandler)},removeListener:function(mode){var s=this.getScrollerForMode(mode);s.removeEventListener("scroll",this.scrollHandler)},domReady:function(){this.async("scroll")},modeChanged:function(old){var configs=this.modeConfigs;var header=this.header;if(header){if(configs.tallMode[old]&&!configs.tallMode[this.mode]){header.classList.remove(this.tallClass);this.async(function(){header.classList.remove("animate")},null,this.animateDuration)}else{header.classList.toggle("animate",configs.tallMode[this.mode])}}if(configs&&(configs.outerScroll[this.mode]||configs.outerScroll[old])){this.removeListener(old);this.addListener()}this.scroll()},get header(){return this.$.headerContent.getDistributedNodes()[0]},getScrollerForMode:function(mode){return this.modeConfigs.outerScroll[mode]?this.$.outerContainer:this.$.mainContainer},get scroller(){return this.getScrollerForMode(this.mode)},scroll:function(){var configs=this.modeConfigs;var main=this.$.mainContainer;var header=this.header;var sTop=main.scrollTop;var atTop=sTop===0;this.$.dropShadow.classList.toggle("hidden",!this.shadow&&(atTop&&configs.shadowMode[this.mode]||configs.noShadow[this.mode]));if(header&&configs.tallMode[this.mode]){header.classList.toggle(this.tallClass,atTop||header.classList.contains(this.tallClass)&&main.scrollHeight<this.$.outerContainer.offsetHeight)}this.fire("scroll",{target:this.scroller},this,false)}});Polymer("marked-element",{text:"",attached:function(){marked.setOptions({highlight:this.highlight.bind(this)});if(!this.text){this.text=this.innerHTML}},textChanged:function(oldVal,newVal){if(newVal){this.innerHTML=marked(this.text)}},highlight:function(code,lang){var event=this.fire("marked-js-highlight",{code:code,lang:lang});return event.detail.code||code}});Polymer("context-free-parser",{text:null,textChanged:function(){if(this.text){var entities=ContextFreeParser.parse(this.text);if(!entities||entities.length===0){entities=[{name:this.url.split("/").pop(),description:"**Undocumented**"}]}this.data={classes:entities}}},dataChanged:function(){this.fire("data-ready")}});Polymer("core-doc-page",{hilight:function(event,detail,sender){detail.code=prettyPrintOne((detail.code||"").replace(/</g,"<").replace(/>/g,">"))},homepageFilter:function(data){if(!data){return""}if(!data.homepage||data.homepage==="github.io"){return"//polymer.github.io/"+data.name}else{return data.homepage}},dataChanged:function(){this.async(function(){var elementToFocus=this.shadowRoot.getElementById(window.location.hash.slice(1));if(elementToFocus){elementToFocus.scrollIntoView()}else{var viewer=this.$.panel.scroller;viewer.scrollTop=0;viewer.scrollLeft=0}})}});Polymer("core-menu");Polymer("core-item",{});Polymer("core-doc-toc",{searchAction:function(){this.$.searchBar.style.opacity=1;this.$.searchBar.style.display=""},closeSearchAction:function(){this.$.searchBar.style.opacity=0;this.$.searchBar.style.display="none"}});Polymer("core-doc-viewer",{classes:[],sources:[],ready:function(){window.addEventListener("hashchange",this.parseLocationHash.bind(this));this.parseLocationHash()},parseLocationHash:function(){this.route=window.location.hash.slice(1)},routeChanged:function(){this.validateRoute()},validateRoute:function(){if(this.route){this.classes.some(function(c){if(c.name===this.route.split(".")[0]){this.data=c;this.route="";return}},this)}},selectedChanged:function(){this.data=this.classes[this.selected]},parserDataReady:function(event,detail,sender){var path="";if(this.sources.length){var path=event.target.templateInstance.model;var idx=path.lastIndexOf("/");path=idx!=-1?path.substr(0,idx):"."}else{var parts=location.pathname.split("/");parts.pop();path=parts.join("/")}var data=event.target.data;var xhr=new XMLHttpRequest;xhr.open("GET",path+"/bower.json");xhr.onerror=function(e){this.assimilateData(data)}.bind(this);xhr.onloadend=function(e){if(e.target.status==200){var version=JSON.parse(e.target.response).version;for(var i=0,c;c=data.classes[i];++i){c.version=version}}this.assimilateData(data)}.bind(this);xhr.send()},assimilateData:function(data){this.classes=this.classes.concat(data.classes);this.classes.sort(function(a,b){var na=a&&a.name.toLowerCase(),nb=b&&b.name.toLowerCase();return na<nb?-1:na==nb?0:1});if(!this.data&&!this.route&&this.classes.length){this.data=this.classes[0]}if(this.classes.length>1){this.$.toc.style.display="block"}this.validateRoute()}});(function(){var avatar;Polymer("core-drag-drop",{observe:{"x y":"coordinatesChanged"},ready:function(){if(!avatar){avatar=document.createElement("core-drag-avatar");document.body.appendChild(avatar)}this.avatar=avatar;this.dragging=false},draggingChanged:function(){this.avatar.style.display=this.dragging?"":"none"},coordinatesChanged:function(){var x=this.x,y=this.y;this.avatar.style.transform=this.avatar.style.webkitTransform="translate("+x+"px, "+y+"px)"},attached:function(){var listen=function(event,handler){Polymer.addEventListener(this.parentNode,event,this[handler].bind(this))}.bind(this);listen("trackstart","trackStart");listen("track","track");listen("trackend","trackEnd");var host=this.parentNode.host||this.parentNode;host.style.cssText+="; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;"},trackStart:function(event){this.avatar.style.cssText="";this.dragInfo={event:event,avatar:this.avatar};this.fire("drag-start",this.dragInfo);this.dragging=Boolean(this.dragInfo.drag)},track:function(event){if(this.dragging){this.x=event.pageX;this.y=event.pageY;this.dragInfo.event=event;this.dragInfo.p={x:this.x,y:this.y};this.dragInfo.drag(this.dragInfo)}},trackEnd:function(event){if(this.dragging){this.dragging=false;if(this.dragInfo.drop){this.dragInfo.framed=this.framed(event.relatedTarget);this.dragInfo.event=event;this.dragInfo.drop(this.dragInfo)}}this.dragInfo=null},framed:function(node){var local=node.getBoundingClientRect();return{x:this.x-local.left,y:this.y-local.top}}})})();Polymer("core-drawer-panel",{publish:{drawerWidth:"256px",responsiveWidth:"640px",selected:{value:null,reflect:true},defaultSelected:"main",narrow:{value:false,reflect:true},rightDrawer:false,disableSwipe:false,forceNarrow:false,disableEdgeSwipe:false},eventDelegates:{trackstart:"trackStart",trackx:"trackx",trackend:"trackEnd",down:"downHandler",up:"upHandler",tap:"tapHandler"},transition:false,edgeSwipeSensitivity:15,peeking:false,dragging:false,hasTransform:true,hasWillChange:true,toggleAttribute:"core-drawer-toggle",created:function(){this.hasTransform="transform"in this.style;this.hasWillChange="willChange"in this.style},domReady:function(){this.async(function(){this.transition=true})},togglePanel:function(){this.selected=this.isMainSelected()?"drawer":"main"},openDrawer:function(){this.selected="drawer"},closeDrawer:function(){this.selected="main"},queryMatchesChanged:function(){this.narrow=this.queryMatches||this.forceNarrow;if(this.narrow){this.selected=this.defaultSelected}this.setAttribute("touch-action",this.swipeAllowed()?"pan-y":"");this.fire("core-responsive-change",{narrow:this.narrow})},forceNarrowChanged:function(){this.queryMatchesChanged()},swipeAllowed:function(){return this.narrow&&!this.disableSwipe},isMainSelected:function(){return this.selected==="main"},startEdgePeek:function(){this.width=this.$.drawer.offsetWidth;this.moveDrawer(this.translateXForDeltaX(this.rightDrawer?-this.edgeSwipeSensitivity:this.edgeSwipeSensitivity));this.peeking=true},stopEdgePeak:function(){if(this.peeking){this.peeking=false;this.moveDrawer(null)}},downHandler:function(e){if(!this.dragging&&this.isMainSelected()&&this.isEdgeTouch(e)){this.startEdgePeek()}},upHandler:function(e){this.stopEdgePeak()},tapHandler:function(e){if(e.target&&this.toggleAttribute&&e.target.hasAttribute(this.toggleAttribute)){this.togglePanel()}},isEdgeTouch:function(e){return!this.disableEdgeSwipe&&this.swipeAllowed()&&(this.rightDrawer?e.pageX>=this.offsetWidth-this.edgeSwipeSensitivity:e.pageX<=this.edgeSwipeSensitivity)
},trackStart:function(e){if(this.swipeAllowed()){this.dragging=true;if(this.isMainSelected()){this.dragging=this.peeking||this.isEdgeTouch(e)}if(this.dragging){this.width=this.$.drawer.offsetWidth;this.transition=false;e.preventTap()}}},translateXForDeltaX:function(deltaX){var isMain=this.isMainSelected();if(this.rightDrawer){return Math.max(0,isMain?this.width+deltaX:deltaX)}else{return Math.min(0,isMain?deltaX-this.width:deltaX)}},trackx:function(e){if(this.dragging){if(this.peeking){if(Math.abs(e.dx)<=this.edgeSwipeSensitivity){return}this.peeking=false}this.moveDrawer(this.translateXForDeltaX(e.dx))}},trackEnd:function(e){if(this.dragging){this.dragging=false;this.transition=true;this.moveDrawer(null);if(this.rightDrawer){this.selected=e.xDirection>0?"main":"drawer"}else{this.selected=e.xDirection>0?"drawer":"main"}}},transformForTranslateX:function(translateX){if(translateX===null){return""}return this.hasWillChange?"translateX("+translateX+"px)":"translate3d("+translateX+"px, 0, 0)"},moveDrawer:function(translateX){var s=this.$.drawer.style;if(this.hasTransform){s.transform=this.transformForTranslateX(translateX)}else{s.webkitTransform=this.transformForTranslateX(translateX)}}});(function(){var p={publish:{label:"Select an item",openedIcon:"arrow-drop-up",closedIcon:"arrow-drop-down"},selectedItemLabel:"",overlayListeners:{"core-overlay-open":"openAction","core-activate":"activateAction","core-select":"selectAction"},activateAction:function(e){this.opened=false},selectAction:function(e){var detail=e.detail;if(detail.isSelected){this.selectedItemLabel=detail.item.label||detail.item.textContent}else{this.selectedItemLabel=""}}};Polymer.mixin2(p,Polymer.CoreFocusable);Polymer("core-dropdown-menu",p)})();Polymer("core-field");Polymer("core-image",{publish:{src:null,load:true,sizing:null,position:"center",preload:false,placeholder:null,fade:false,loading:false,width:null,height:null},observe:{"preload color sizing position src fade":"update"},widthChanged:function(){this.style.width=isNaN(this.width)?this.width:this.width+"px"},heightChanged:function(){this.style.height=isNaN(this.height)?this.height:this.height+"px"},update:function(){this.style.backgroundSize=this.sizing;this.style.backgroundPosition=this.sizing?this.position:null;this.style.backgroundRepeat=this.sizing?"no-repeat":null;if(this.preload){if(this.fade){if(!this._placeholderEl){this._placeholderEl=this.shadowRoot.querySelector("#placeholder")}this._placeholderEl.style.backgroundSize=this.sizing;this._placeholderEl.style.backgroundPosition=this.sizing?this.position:null;this._placeholderEl.style.backgroundRepeat=this.sizing?"no-repeat":null;this._placeholderEl.classList.remove("fadein");this._placeholderEl.style.backgroundImage=this.load&&this.placeholder?"url("+this.placeholder+")":null}else{this._setSrc(this.placeholder)}if(this.load&&this.src){var img=new Image;img.src=this.src;this.loading=true;img.onload=function(){this._setSrc(this.src);this.loading=false;if(this.fade){this._placeholderEl.classList.add("fadein")}}.bind(this)}}else{this._setSrc(this.src)}},_setSrc:function(src){if(this.sizing){this.style.backgroundImage=src?"url("+src+")":""}else{this.$.img.src=src||""}}});(function(){var ID=0;function generate(node){if(!node.id){node.id="core-label-"+ID++}return node.id}Polymer("core-label",{publish:{"for":{reflect:true,value:""}},eventDelegates:{tap:"tapHandler"},created:function(){generate(this);this._forElement=null},ready:function(){if(!this.for){this._forElement=this.querySelector("[for]");this._tie()}},tapHandler:function(ev){if(!this._forElement){return}if(ev.target===this._forElement){return}this._forElement.focus();this._forElement.click();this.fire("tap",null,this._forElement)},_tie:function(){if(this._forElement){this._forElement.setAttribute("aria-labelledby",this.id)}},_findScope:function(){var n=this.parentNode;while(n&&n.parentNode){n=n.parentNode}return n},forChanged:function(oldFor,newFor){if(this._forElement){this._forElement.removeAttribute("aria-labelledby")}var scope=this._findScope();if(!scope){return}this._forElement=scope.querySelector(newFor);if(this._forElement){this._tie()}}})})();(function(){Polymer("core-layout-grid",{nodes:null,layout:null,auto:false,created:function(){this.layout=[]},nodesChanged:function(){this.invalidate()},layoutChanged:function(){this.invalidate()},autoNodes:function(){this.nodes=this.parentNode.children.array().filter(function(node){switch(node.localName){case"core-layout-grid":case"style":return false}return true})},invalidate:function(){if(this.layout&&this.layout.length){this.layoutJob=this.job(this.layoutJob,this.relayout)}},relayout:function(){if(!this.nodes||this.auto){this.autoNodes()}layout(this.layout,this.nodes);this.asyncFire("core-layout")}});var lineParent;function line(axis,p,d){var l=document.createElement("line");var extent=axis==="left"?"width":axis==="top"?"height":axis;l.setAttribute("extent",extent);if(d<0){axis=axis==="left"?"right":axis==="top"?"bottom":axis}p=Math.abs(p);l.style[axis]=p+"px";l.style[extent]="0px";lineParent.appendChild(l)}var colCount,colOwners,rowCount,rowOwners;function matrixillate(matrix){rowCount=matrix.length;colCount=rowCount&&matrix[0].length||0;var transpose=[];for(var i=0;i<colCount;i++){var c=[];for(var j=0;j<rowCount;j++){c.push(matrix[j][i])}transpose.push(c)}colOwners=findOwners(matrix);rowOwners=findOwners(transpose)}function findOwners(matrix){var majCount=matrix.length;var minCount=majCount&&matrix[0].length||0;var owners=[];for(var i=0;i<minCount;i++){var contained={};for(var j=0;j<majCount;j++){var vector=matrix[j];var nodei=vector[i];if(nodei){var owns=false;if(i===0){owns=i===minCount-1||nodei!==vector[i+1]}else if(i===minCount-1){owns=i===0||nodei!==vector[i-1]}else{owns=nodei!==vector[i-1]&&nodei!==vector[i+1]}if(owns){contained[nodei]=1}}owners[i]=contained}}return owners}var nodes;function colWidth(i){for(var col in colOwners[i]){col=Number(col);if(col===0){return 96}var node=nodes[col-1];if(node.hasAttribute("h-flex")||node.hasAttribute("flex")){return-1}var w=node.offsetWidth;return w}return-1}function rowHeight(i){for(var row in rowOwners[i]){row=Number(row);if(row===0){return 96}var node=nodes[row-1];if(node.hasAttribute("v-flex")||node.hasAttribute("flex")){return-1}var h=node.offsetHeight;return h}return-1}var m=0;function railize(count,sizeFn){var rails=[];var a=0;for(var i=0,x;i<count;i++){rails[i]={p:a,s:1};x=sizeFn(i)+m+m;if(x==-1){break}a+=x}if(i===count){rails[i]={p:0,s:-1}}var b=0;for(var ii=count,x;ii>i;ii--){rails[ii]={p:b,s:-1};x=sizeFn(ii-1)+m+m;if(x!==-1){b+=x}}return rails}function unposition(box){var style=box.style;style.position="absolute";style.display="inline-block";style.boxSizing=style.mozBoxSizing="border-box"}function _position(style,maj,min,ext,a,b){style[maj]=style[min]="";style[ext]="auto";if(a.s<0&&b.s<0){var siz=a.p-b.p-m-m;style[ext]=siz+"px";var c="calc(100% - "+(b.p+siz+m)+"px"+")";style[maj]="-webkit-"+c;style[maj]=c}else if(b.s<0){style[maj]=a.p+m+"px";style[min]=b.p+m+"px"}else{style[maj]=a.p+m+"px";style[ext]=b.p-a.p-m-m+"px"}}function position(elt,left,right,top,bottom){_position(elt.style,"top","bottom","height",rows[top],rows[bottom]);_position(elt.style,"left","right","width",columns[left],columns[right])}function layout(matrix,anodes,alineParent){lineParent=alineParent;nodes=anodes;matrixillate(matrix);nodes.forEach(unposition);columns=railize(colCount,colWidth);rows=railize(rowCount,rowHeight);if(alineParent){columns.forEach(function(c){line("left",c.p,c.s)});rows.forEach(function(r){line("top",r.p,r.s)})}nodes.forEach(function(node,i){var n=i+1;var l,r,t=1e10,b=-1e10;matrix.forEach(function(vector,i){var f=vector.indexOf(n);if(f>-1){l=f;r=vector.lastIndexOf(n)+1;t=Math.min(t,i);b=Math.max(b,i)+1}});if(l==undefined){node.style.position="absolute";var offscreen=node.getAttribute("offscreen");switch(offscreen){case"basement":node.style.zIndex=0;break;case"left":case"top":node.style[offscreen]=node.offsetWidth*-2+"px";break;case"right":node.style.left=node.offsetParent.offsetWidth+node.offsetWidth+"px";break;case"bottom":node.style.top=node.parentNode.offsetHeight+node.offsetHeight+"px";break;default:node.style[Math.random()>=.5?"left":"top"]="-110%"}node.style.pointerEvents="none"}else{node.style.pointerEvents="";position(node,l,r,t,b)}})}})();Polymer("core-layout-trbl",{vertical:false,ready:function(){this.setAttribute("nolayout","")},attached:function(){this.asyncMethod(function(){this.prepare();this.layout()})},prepare:function(){var parent=this.parentNode.host||this.parentNode;if(parent.localName!=="body"){var cs=window.getComputedStyle(parent);if(cs.position==="static"){parent.style.position="relative"}}var stylize=this.stylize,vertical;this.parentNode.childNodes.array().forEach(function(c,i){if(c.nodeType===Node.ELEMENT_NODE&&!c.hasAttribute("nolayout")){stylize(c,{position:"absolute",boxSizing:"border-box",MozBoxSizing:"border-box"});if(vertical===undefined){vertical=c.offsetWidth==0&&c.offsetHeight!==0}}});this.vertical=this.vertical||vertical},layout:function(){var parent=this.parentNode.host||this.parentNode;var vertical=this.vertical;var ww=0,hh=0,pre=[],fit,post=[];var list=pre;this.parentNode.childNodes.array().forEach(function(c,i){if(c.nodeType===Node.ELEMENT_NODE&&!c.hasAttribute("nolayout")){var info={element:c,w:c.offsetWidth,h:c.offsetHeight};if(!c.hasAttribute("fit")&&!c.hasAttribute("flex")){ww+=c.offsetWidth;hh+=c.offsetHeight;list.push(info)}else{fit=c;list=post;ww=hh=0}}});var v=0;var mxp=0,myp=0;var stylize=this.stylize;pre.forEach(function(info){if(vertical){stylize(info.element,{top:v+"px",right:mxp,height:info.h+"px",left:mxp})}else{stylize(info.element,{top:myp,width:info.w+"px",bottom:myp,left:v+"px"})}v+=vertical?info.h:info.w});if(fit){if(vertical){stylize(fit,{top:v+"px",right:mxp,bottom:hh+"px",left:mxp})}else{stylize(fit,{top:myp,right:ww+"px",bottom:myp,left:v+"px"})}v=vertical?hh:ww;post.forEach(function(info){v-=vertical?info.h:info.w;if(vertical){stylize(info.element,{height:info.h+"px",right:mxp,bottom:v+"px",left:mxp})}else{stylize(info.element,{top:myp,right:v+"px",bottom:myp,width:info.w+"px"})}})}},stylize:function(element,styles){var style=element.style;Object.keys(styles).forEach(function(k){style[k]=styles[k]})}});(function(){var IOS=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/);var IOS_TOUCH_SCROLLING=IOS&&IOS[1]>=8;Polymer("core-list",Polymer.mixin({publish:{data:null,groups:null,scrollTarget:null,selectionEnabled:true,multi:false,selection:null,grid:false,width:null,height:200,runwayFactor:4},eventDelegates:{tap:"tapHandler","core-resize":"updateSize"},_scrollTop:0,observe:{"isAttached data grid width template scrollTarget":"initialize","multi selectionEnabled":"_resetSelection"},ready:function(){this._boundScrollHandler=this.scrollHandler.bind(this);this._boundPositionItems=this._positionItems.bind(this);this._oldMulti=this.multi;this._oldSelectionEnabled=this.selectionEnabled;this._virtualStart=0;this._virtualCount=0;this._physicalStart=0;this._physicalOffset=0;this._physicalSize=0;this._physicalSizes=[];this._physicalAverage=0;this._itemSizes=[];this._dividerSizes=[];this._repositionedItems=[];this._aboveSize=0;this._nestedGroups=false;this._groupStart=0;this._groupStartIndex=0},attached:function(){this.isAttached=true;this.template=this.querySelector("template");if(!this.template.bindingDelegate){this.template.bindingDelegate=this.element.syntax}this.resizableAttachedHandler()},detached:function(){this.isAttached=false;if(this._target){this._target.removeEventListener("scroll",this._boundScrollHandler)}this.resizableDetachedHandler()},updateSize:function(){if(!this._positionPending&&!this._needItemInit){this._resetIndex(this._getFirstVisibleIndex()||0);this.initialize()}},_resetSelection:function(){if(this._oldMulti!=this.multi&&!this.multi||this._oldSelectionEnabled!=this.selectionEnabled&&!this.selectionEnabled){this._clearSelection();this.refresh()}else{this.selection=this.$.selection.getSelection()}this._oldMulti=this.multi;this._oldSelectionEnabled=this.selectionEnabled},_adjustVirtualIndex:function(splices,group){if(this._targetSize===0){return}var totalDelta=0;for(var i=0;i<splices.length;i++){var s=splices[i];var idx=s.index;var gidx,gitem;if(group){gidx=this.data.indexOf(group);idx+=this.virtualIndexForGroup(gidx)}if(idx>=this._virtualStart){break}var delta=Math.max(s.addedCount-s.removed.length,idx-this._virtualStart);totalDelta+=delta;this._physicalStart+=delta;this._virtualStart+=delta;if(this._grouped){if(group){gitem=s.index}else{var g=this.groupForVirtualIndex(s.index);gidx=g.group;gitem=g.groupIndex}if(gidx==this._groupStart&&gitem<this._groupStartIndex){this._groupStartIndex+=delta}}}if(this._virtualStart<this._physicalCount){this._resetIndex(this._getFirstVisibleIndex()||0)}else{totalDelta=Math.max(totalDelta/this._rowFactor*this._physicalAverage,-this._physicalOffset);this._physicalOffset+=totalDelta;this._scrollTop=this.setScrollTop(this._scrollTop+totalDelta)}},_updateSelection:function(splices){for(var i=0;i<splices.length;i++){var s=splices[i];for(var j=0;j<s.removed.length;j++){var d=s.removed[j];this.$.selection.setItemSelected(d,false)}}},groupsChanged:function(){if(!!this.groups!=this._grouped){this.updateSize()}},initialize:function(){if(!this.template||!this.isAttached){return}var splices;if(arguments.length==1){splices=arguments[0];if(!this._nestedGroups){this._adjustVirtualIndex(splices)}this._updateSelection(splices)}else{this._clearSelection()}var target=this.scrollTarget||this;if(this._target!==target){this.initializeScrollTarget(target)}this.initializeData(splices,false)},initializeScrollTarget:function(target){if(this._target){this._target.removeEventListener("scroll",this._boundScrollHandler,false)}this._target=target;target.addEventListener("scroll",this._boundScrollHandler,false);if(target!=this&&target.setScrollTop&&target.getScrollTop){this.setScrollTop=function(val){target.setScrollTop(val);return target.getScrollTop()};this.getScrollTop=target.getScrollTop.bind(target);this.syncScroller=target.sync?target.sync.bind(target):function(){};this.adjustPositionAllowed=false}else{this.setScrollTop=function(val){target.scrollTop=val;return target.scrollTop};this.getScrollTop=function(){return target.scrollTop};this.syncScroller=function(){};this.adjustPositionAllowed=true}if(IOS_TOUCH_SCROLLING){target.style.webkitOverflowScrolling="touch";this.adjustPositionAllowed=false}this._target.style.willChange="transform";if(getComputedStyle(this._target).position=="static"){this._target.style.position="relative"}this.style.overflowY=target==this?"auto":null},updateGroupObservers:function(splices){if(!this._nestedGroups){if(this._groupObservers&&this._groupObservers.length){splices=[{index:0,addedCount:0,removed:this._groupObservers}]}else{splices=null}}if(this._nestedGroups){splices=splices||[{index:0,addedCount:this.data.length,removed:[]}]}if(splices){var observers=this._groupObservers||[];for(var i=0;i<splices.length;i++){var s=splices[i],j;var args=[s.index,s.removed.length];if(s.removed.length){for(j=s.index;j<s.removed.length;j++){observers[j].close()}}if(s.addedCount){for(j=s.index;j<s.addedCount;j++){var o=new ArrayObserver(this.data[j]);args.push(o);o.open(this.getGroupDataHandler(this.data[j]))}}observers.splice.apply(observers,args)}this._groupObservers=observers}},getGroupDataHandler:function(group){return function(splices){this.groupDataChanged(splices,group)}.bind(this)},groupDataChanged:function(splices,group){this._adjustVirtualIndex(splices,group);this._updateSelection(splices);this.initializeData(null,true)},initializeData:function(splices,groupUpdate){var i;if(this.grid){if(!this.width){throw"Grid requires the `width` property to be set"}this._rowFactor=Math.floor(this._target.offsetWidth/this.width)||1;var cs=getComputedStyle(this._target);var padding=parseInt(cs.paddingLeft||0)+parseInt(cs.paddingRight||0);this._rowMargin=(this._target.offsetWidth-this._rowFactor*this.width-padding)/2}else{this._rowFactor=1;this._rowMargin=0}if(!this.data||!this.data.length){this._virtualCount=0;this._grouped=false;this._nestedGroups=false}else if(this.groups){this._grouped=true;this._nestedGroups=Array.isArray(this.data[0]);if(this._nestedGroups){if(this.groups.length!=this.data.length){throw"When using nested grouped data, data.length and groups.length must agree!"}this._virtualCount=0;for(i=0;i<this.groups.length;i++){this._virtualCount+=this.data[i]&&this.data[i].length}}else{this._virtualCount=this.data.length;var len=0;for(i=0;i<this.groups.length;i++){len+=this.groups[i].length}if(len!=this.data.length){throw"When using groups data, the sum of group[n].length's and data.length must agree!"}}var g=this.groupForVirtualIndex(this._virtualStart);this._groupStart=g.group;this._groupStartIndex=g.groupIndex}else{this._grouped=false;this._nestedGroups=false;this._virtualCount=this.data.length}if(!groupUpdate){this.updateGroupObservers(splices)}var currentCount=this._physicalCount||0;var height=this._target.offsetHeight;if(!height&&this._target.offsetParent){console.warn("core-list must either be sized or be inside an overflow:auto div that is sized")}this._physicalCount=Math.min(Math.ceil(height/(this._physicalAverage||this.height))*this.runwayFactor*this._rowFactor,this._virtualCount);this._physicalCount=Math.max(currentCount,this._physicalCount);this._physicalData=this._physicalData||new Array(this._physicalCount);var needItemInit=false;while(currentCount<this._physicalCount){var model=this.templateInstance?Object.create(this.templateInstance.model):{};this._physicalData[currentCount++]=model;needItemInit=true}this.template.model=this._physicalData;this.template.setAttribute("repeat","");this._dir=0;if(!this._needItemInit){if(needItemInit){this._needItemInit=true;this.resetMetrics();this.onMutation(this,this.initializeItems)}else{this.refresh()}}},initializeItems:function(){var currentCount=this._physicalItems&&this._physicalItems.length||0;this._physicalItems=this._physicalItems||[new Array(this._physicalCount)];this._physicalDividers=this._physicalDividers||new Array(this._physicalCount);for(var i=0,item=this.template.nextElementSibling;item&&i<this._physicalCount;item=item.nextElementSibling){if(item.getAttribute("divider")!=null){this._physicalDividers[i]=item}else{this._physicalItems[i++]=item}}this.refresh();this._needItemInit=false},_updateItemData:function(force,physicalIndex,virtualIndex,groupIndex,groupItemIndex){var physicalItem=this._physicalItems[physicalIndex];var physicalDatum=this._physicalData[physicalIndex];var virtualDatum=this.dataForIndex(virtualIndex,groupIndex,groupItemIndex);var needsReposition;if(force||physicalDatum.model!=virtualDatum){physicalDatum.model=virtualDatum;physicalDatum.index=virtualIndex;physicalDatum.physicalIndex=physicalIndex;physicalDatum.selected=this.selectionEnabled&&virtualDatum?this._selectedData.get(virtualDatum):null;if(this._grouped){var groupModel=this.groups[groupIndex];physicalDatum.groupModel=groupModel&&(this._nestedGroups?groupModel:groupModel.data);physicalDatum.groupIndex=groupIndex;physicalDatum.groupItemIndex=groupItemIndex;physicalItem._isDivider=this.data.length&&groupItemIndex===0;physicalItem._isRowStart=groupItemIndex%this._rowFactor===0}else{physicalDatum.groupModel=null;physicalDatum.groupIndex=null;physicalDatum.groupItemIndex=null;physicalItem._isDivider=false;physicalItem._isRowStart=virtualIndex%this._rowFactor===0}physicalItem.hidden=!virtualDatum;var divider=this._physicalDividers[physicalIndex];if(divider&÷r.hidden==physicalItem._isDivider){divider.hidden=!physicalItem._isDivider}needsReposition=!force}else{needsReposition=false}return needsReposition||force},scrollHandler:function(){if(IOS_TOUCH_SCROLLING){if(!this._raf){this._raf=requestAnimationFrame(function(){this._raf=null;this.refresh()}.bind(this))}}else{this.refresh()}},resetMetrics:function(){this._physicalAverage=0;this._physicalAverageCount=0},updateMetrics:function(force){var totalSize=0;var count=0;for(var i=0;i<this._physicalCount;i++){var item=this._physicalItems[i];if(!item.hidden){var size=this._itemSizes[i]=item.offsetHeight;if(item._isDivider){var divider=this._physicalDividers[i];if(divider){size+=this._dividerSizes[i]=divider.offsetHeight}}this._physicalSizes[i]=size;if(item._isRowStart){totalSize+=size;count++}}}this._physicalSize=totalSize;this._viewportSize=this.$.viewport.offsetHeight;this._targetSize=this._target.offsetHeight;if(this._target!=this){this._aboveSize=this.offsetTop}else{this._aboveSize=parseInt(getComputedStyle(this._target).paddingTop)}if(count){totalSize=this._physicalAverage*this._physicalAverageCount+totalSize;this._physicalAverageCount+=count;this._physicalAverage=Math.round(totalSize/this._physicalAverageCount)}},getGroupLen:function(group){group=arguments.length?group:this._groupStart;if(this._nestedGroups){return this.data[group].length}else{return this.groups[group].length}},changeStartIndex:function(inc){this._virtualStart+=inc;if(this._grouped){while(inc>0){var groupMax=this.getGroupLen()-this._groupStartIndex-1;if(inc>groupMax){inc-=groupMax+1;this._groupStart++;this._groupStartIndex=0}else{this._groupStartIndex+=inc;inc=0}}while(inc<0){if(-inc>this._groupStartIndex){inc+=this._groupStartIndex;this._groupStart--;this._groupStartIndex=this.getGroupLen()}else{this._groupStartIndex+=inc;inc=this.getGroupLen()}}}if(this.grid){if(this._grouped){inc=this._groupStartIndex%this._rowFactor}else{inc=this._virtualStart%this._rowFactor}if(inc){this.changeStartIndex(-inc)}}},getRowCount:function(dir){if(!this.grid){return dir}else if(!this._grouped){return dir*this._rowFactor}else{if(dir<0){if(this._groupStartIndex>0){return-Math.min(this._rowFactor,this._groupStartIndex)}else{var prevLen=this.getGroupLen(this._groupStart-1);return-Math.min(this._rowFactor,prevLen%this._rowFactor||this._rowFactor)}}else{return Math.min(this._rowFactor,this.getGroupLen()-this._groupStartIndex)}}},_virtualToPhysical:function(virtualIndex){var physicalIndex=(virtualIndex-this._physicalStart)%this._physicalCount;return physicalIndex<0?this._physicalCount+physicalIndex:physicalIndex},groupForVirtualIndex:function(virtual){if(!this._grouped){return{}}else{var group;for(group=0;group<this.groups.length;group++){var groupLen=this.getGroupLen(group);if(groupLen>virtual){break}else{virtual-=groupLen}}return{group:group,groupIndex:virtual}}},virtualIndexForGroup:function(group,groupIndex){groupIndex=groupIndex?Math.min(groupIndex,this.getGroupLen(group)):0;group--;while(group>=0){groupIndex+=this.getGroupLen(group--)}return groupIndex},dataForIndex:function(virtual,group,groupIndex){if(this.data){if(this._nestedGroups){if(virtual<this._virtualCount){return this.data[group][groupIndex]}}else{return this.data[virtual]}}},refresh:function(){var i,deltaCount;var lastScrollTop=this._scrollTop;this._scrollTop=this.getScrollTop();var scrollDelta=this._scrollTop-lastScrollTop;this._dir=scrollDelta<0?-1:scrollDelta>0?1:0;if(Math.abs(scrollDelta)>Math.max(this._physicalSize,this._targetSize)){deltaCount=Math.round(scrollDelta/this._physicalAverage*this._rowFactor);deltaCount=Math.max(deltaCount,-this._virtualStart);deltaCount=Math.min(deltaCount,this._virtualCount-this._virtualStart-1);this._physicalOffset+=Math.max(scrollDelta,-this._physicalOffset);this.changeStartIndex(deltaCount)}else{var base=this._aboveSize+this._physicalOffset;var margin=.3*Math.max((this._physicalSize-this._targetSize,this._physicalSize));this._upperBound=base+margin;this._lowerBound=base+this._physicalSize-this._targetSize-margin;var flipBound=this._dir>0?this._upperBound:this._lowerBound;if(this._dir>0&&this._scrollTop>flipBound||this._dir<0&&this._scrollTop<flipBound){var flipSize=Math.abs(this._scrollTop-flipBound);for(i=0;i<this._physicalCount&&flipSize>0&&(this._dir<0&&this._virtualStart>0||this._dir>0&&this._virtualStart<this._virtualCount-this._physicalCount);i++){var idx=this._virtualToPhysical(this._dir>0?this._virtualStart:this._virtualStart+this._physicalCount-1);var size=this._physicalSizes[idx];flipSize-=size;var cnt=this.getRowCount(this._dir);if(this._dir>0){this._physicalOffset+=size}this.changeStartIndex(cnt);if(this._dir<0){this._repositionedItems.push(this._virtualStart)}}}}if(this._updateItems(!scrollDelta)){if(Observer.hasObjectObserve){this.async(this._boundPositionItems)}else{Platform.flush();Platform.endOfMicrotask(this._boundPositionItems)}}},_updateItems:function(force){var i,virtualIndex,physicalIndex;var needsReposition=false;var groupIndex=this._groupStart;var groupItemIndex=this._groupStartIndex;for(i=0;i<this._physicalCount;++i){virtualIndex=this._virtualStart+i;physicalIndex=this._virtualToPhysical(virtualIndex);needsReposition=this._updateItemData(force,physicalIndex,virtualIndex,groupIndex,groupItemIndex)||needsReposition;groupItemIndex++;if(this.groups&&groupIndex<this.groups.length-1){if(groupItemIndex>=this.getGroupLen(groupIndex)){groupItemIndex=0;groupIndex++}}}return needsReposition},_positionItems:function(){var i,virtualIndex,physicalIndex,physicalItem;this.updateMetrics();if(this._dir<0){while(this._repositionedItems.length){virtualIndex=this._repositionedItems.pop();physicalIndex=this._virtualToPhysical(virtualIndex);this._physicalOffset-=this._physicalSizes[physicalIndex]}if(this._scrollTop+this._targetSize<this._viewportSize){this._updateScrollPosition(this._scrollTop)}}var divider,upperBound,lowerBound;var rowx=0;var x=this._rowMargin;var y=this._physicalOffset;var lastHeight=0;for(i=0;i<this._physicalCount;++i){virtualIndex=this._virtualStart+i;physicalIndex=this._virtualToPhysical(virtualIndex);physicalItem=this._physicalItems[physicalIndex];if(physicalItem._isDivider){if(rowx!==0){y+=lastHeight;rowx=0}divider=this._physicalDividers[physicalIndex];x=this._rowMargin;if(divider&&(divider._translateX!=x||divider._translateY!=y)){divider.style.opacity=1;if(this.grid){divider.style.width=this.width*this._rowFactor+"px"}divider.style.transform=divider.style.webkitTransform="translate3d("+x+"px,"+y+"px,0)";divider._translateX=x;divider._translateY=y}y+=this._dividerSizes[physicalIndex]}if(physicalItem._translateX!=x||physicalItem._translateY!=y){physicalItem.style.opacity=1;physicalItem.style.transform=physicalItem.style.webkitTransform="translate3d("+x+"px,"+y+"px,0)";physicalItem._translateX=x;physicalItem._translateY=y}lastHeight=this._itemSizes[physicalIndex];if(this.grid){rowx++;if(rowx>=this._rowFactor){rowx=0;y+=lastHeight}x=this._rowMargin+rowx*this.width}else{y+=lastHeight}}if(this._scrollTop>=0){this._updateViewportHeight()}},_updateViewportHeight:function(){var remaining=Math.max(this._virtualCount-this._virtualStart-this._physicalCount,0);remaining=Math.ceil(remaining/this._rowFactor);var vs=this._physicalOffset+this._physicalSize+remaining*this._physicalAverage;if(this._viewportSize!=vs){this._viewportSize=vs;this.$.viewport.style.height=this._viewportSize+"px";this.syncScroller()}},_updateScrollPosition:function(scrollTop){var deltaHeight=this._virtualStart===0?this._physicalOffset:Math.min(scrollTop+this._physicalOffset,0);if(deltaHeight){if(this.adjustPositionAllowed){this._scrollTop=this.setScrollTop(scrollTop-deltaHeight)}this._physicalOffset-=deltaHeight}},tapHandler:function(e){var n=e.target;var p=e.path;if(!this.selectionEnabled||n===this){return}requestAnimationFrame(function(){var active=window.ShadowDOMPolyfill?wrap(document.activeElement):this.shadowRoot.activeElement;if(active&&active!=this&&active.parentElement!=this&&document.activeElement!=document.body){return}if(p[0].localName=="input"||p[0].localName=="button"||p[0].localName=="select"){return}var model=n.templateInstance&&n.templateInstance.model;if(model){var data=this.dataForIndex(model.index,model.groupIndex,model.groupItemIndex);var item=this._physicalItems[model.physicalIndex];if(!this.multi&&data==this.selection){this.$.selection.select(null)}else{this.$.selection.select(data)}this.asyncFire("core-activate",{data:data,item:item})}}.bind(this))},selectedHandler:function(e,detail){this.selection=this.$.selection.getSelection();var id=this.indexesForData(detail.item);this._selectedData.set(detail.item,detail.isSelected);if(id.physical>=0&&id.virtual>=0){this.refresh()}},selectItem:function(index){if(!this.selectionEnabled){return}var data=this.data[index];if(data){this.$.selection.select(data)}},setItemSelected:function(index,isSelected){var data=this.data[index];if(data){this.$.selection.setItemSelected(data,isSelected)}},indexesForData:function(data){var virtual=-1;var groupsLen=0;if(this._nestedGroups){for(var i=0;i<this.groups.length;i++){virtual=this.data[i].indexOf(data);if(virtual<0){groupsLen+=this.data[i].length}else{virtual+=groupsLen;break}}}else{virtual=this.data.indexOf(data)}var physical=this.virtualToPhysicalIndex(virtual);return{virtual:virtual,physical:physical}},virtualToPhysicalIndex:function(index){for(var i=0,l=this._physicalData.length;i<l;i++){if(this._physicalData[i].index===index){return i}}return-1},clearSelection:function(){this._clearSelection();this.refresh()},_clearSelection:function(){this._selectedData=new WeakMap;this.$.selection.clear();this.selection=this.$.selection.getSelection()},_getFirstVisibleIndex:function(){for(var i=0;i<this._physicalCount;i++){var virtualIndex=this._virtualStart+i;var physicalIndex=this._virtualToPhysical(virtualIndex);var item=this._physicalItems[physicalIndex];if(!item.hidden&&item._translateY>=this._scrollTop-this._aboveSize){return virtualIndex}}},_resetIndex:function(index){index=Math.min(index,this._virtualCount-1);index=Math.max(index,0);this.changeStartIndex(index-this._virtualStart);this._scrollTop=this.setScrollTop(this._aboveSize+index/this._rowFactor*this._physicalAverage);this._physicalOffset=this._scrollTop-this._aboveSize;this._dir=0},scrollToItem:function(index){this.scrollToGroupItem(null,index)},scrollToGroup:function(group){this.scrollToGroupItem(group,0)},scrollToGroupItem:function(group,index){if(group!=null){index=this.virtualIndexForGroup(group,index)}this._resetIndex(index);this.refresh()}},Polymer.CoreResizable))})();Polymer("core-localstorage",{name:"",value:null,useRaw:false,autoSaveDisabled:false,valueChanged:function(){if(this.loaded&&!this.autoSaveDisabled){this.save()}},nameChanged:function(){this.load()},load:function(){var v=localStorage.getItem(this.name);if(this.useRaw){this.value=v}else{if(v===null){if(this.value!=null){this.save()}}else{try{v=JSON.parse(v)}catch(x){}this.value=v}}this.loaded=true;this.asyncFire("core-localstorage-load")},save:function(){var v=this.useRaw?this.value:JSON.stringify(this.value);localStorage.setItem(this.name,v)}});Polymer("core-submenu",{publish:{active:{value:false,reflect:true}},opened:false,get items(){return this.$.submenu.items},hasItems:function(){return!!this.items.length},unselectAllItems:function(){this.$.submenu.selected=null;this.$.submenu.clearSelection()},activeChanged:function(){if(this.hasItems()){this.opened=this.active}if(!this.active){this.unselectAllItems()}},toggle:function(){this.opened=!this.opened},activate:function(){if(this.hasItems()&&this.active){this.toggle();this.unselectAllItems()}}});Polymer("core-menu-button",{overlayListeners:{"core-overlay-open":"openAction","core-activate":"activateAction"},activateAction:function(){this.opened=false}});Polymer("core-pages");Polymer("core-scaffold",{publish:{drawerWidth:"256px",responsiveWidth:"600px",rightDrawer:false,disableSwipe:false,mode:{value:"seamed",reflect:true}},ready:function(){this._scrollHandler=this.scroll.bind(this);this.$.headerPanel.addEventListener("scroll",this._scrollHandler)},detached:function(){this.$.headerPanel.removeEventListener("scroll",this._scrollHandler)},togglePanel:function(){this.$.drawerPanel.togglePanel()},openDrawer:function(){this.$.drawerPanel.openDrawer()},closeDrawer:function(){this.$.drawerPanel.closeDrawer()},get scroller(){return this.$.headerPanel.scroller},scroll:function(e){this.fire("scroll",{target:e.detail.target},this,false)
}});(function(){Polymer("core-scroll-header-panel",Polymer.mixin({publish:{condenses:false,noDissolve:false,noReveal:false,fixed:false,keepCondensedHeader:false,headerHeight:0,condensedHeaderHeight:0,scrollAwayTopbar:false},prevScrollTop:0,headerMargin:0,y:0,observe:{"headerMargin fixed":"setup"},eventDelegates:{"core-resize":"measureHeaderHeight"},attached:function(){this.resizableAttachedHandler()},ready:function(){this._scrollHandler=this.scroll.bind(this);this.scroller.addEventListener("scroll",this._scrollHandler)},detached:function(){this.scroller.removeEventListener("scroll",this._scrollHandler);this.resizableDetachedHandler()},domReady:function(){this.async("measureHeaderHeight")},get header(){return this.$.headerContent.getDistributedNodes()[0]},get scroller(){return this.$.mainContainer},measureHeaderHeight:function(){var header=this.header;if(header&&header.offsetHeight){this.headerHeight=header.offsetHeight}},headerHeightChanged:function(){if(!this.condensedHeaderHeight){this._condensedHeaderHeight=this.headerHeight*1/3}this.condensedHeaderHeightChanged()},condensedHeaderHeightChanged:function(){if(this.condensedHeaderHeight){this._condensedHeaderHeight=this.condensedHeaderHeight}if(this.headerHeight){this.headerMargin=this.headerHeight-this._condensedHeaderHeight}},condensesChanged:function(){if(this.condenses){this.scroll()}else{this.condenseHeader(null)}},setup:function(){var s=this.scroller.style;s.paddingTop=this.fixed?"":this.headerHeight+"px";s.top=this.fixed?this.headerHeight+"px":"";if(this.fixed){this.transformHeader(null)}else{this.scroll()}},transformHeader:function(y){var s=this.$.headerContainer.style;this.translateY(s,-y);if(this.condenses){this.condenseHeader(y)}this.fire("core-header-transform",{y:y,height:this.headerHeight,condensedHeight:this._condensedHeaderHeight})},condenseHeader:function(y){var reset=y==null;if(!this.scrollAwayTopbar&&this.header.$&&this.header.$.topBar){this.translateY(this.header.$.topBar.style,reset?null:Math.min(y,this.headerMargin))}var hbg=this.$.headerBg.style;if(!this.noDissolve){hbg.opacity=reset?"":(this.headerMargin-y)/this.headerMargin}this.translateY(hbg,reset?null:y/2);var chbg=this.$.condensedHeaderBg.style;if(!this.noDissolve){chbg=this.$.condensedHeaderBg.style;chbg.opacity=reset?"":y/this.headerMargin;this.translateY(chbg,reset?null:y/2)}},translateY:function(s,y){var t=y==null?"":"translate3d(0, "+y+"px, 0)";setTransform(s,t)},scroll:function(event){if(!this.header){return}var sTop=this.scroller.scrollTop;var y=Math.min(this.keepCondensedHeader?this.headerMargin:this.headerHeight,Math.max(0,this.noReveal?sTop:this.y+sTop-this.prevScrollTop));if(this.condenses&&this.prevScrollTop>=sTop&&sTop>this.headerMargin){y=Math.max(y,this.headerMargin)}if(!event||!this.fixed&&y!==this.y){this.transformHeader(y)}this.prevScrollTop=Math.max(sTop,0);this.y=y;if(event){this.fire("scroll",{target:this.scroller},this,false)}}},Polymer.CoreResizable));if(document.documentElement.style.transform!==undefined){var setTransform=function(style,string){style.transform=string}}else{var setTransform=function(style,string){style.webkitTransform=string}}})();Polymer("core-scroll-threshold",{publish:{scrollTarget:null,orient:"v",upperThreshold:null,lowerThreshold:null,upperTriggered:false,lowerTriggered:false},observe:{"upperThreshold lowerThreshold scrollTarget orient":"setup"},ready:function(){this._boundScrollHandler=this.checkThreshold.bind(this)},setup:function(){if(this._scrollTarget&&this._scrollTarget!=this.target){this._scrollTarget.removeEventListener(this._boundScrollHandler)}var target=this.scrollTarget||this;if(target){this._scrollTarget=target;this._scrollTarget.addEventListener("scroll",this._boundScrollHandler)}this.style.overflow=target==this?"auto":null;this.scrollPosition=this.orient=="v"?"scrollTop":"scrollLeft";this.sizeExtent=this.orient=="v"?"offsetHeight":"offsetWidth";this.scrollExtent=this.orient=="v"?"scrollHeight":"scrollWidth";if(!this.upperThreshold){this.upperTriggered=false}if(!this.lowerThreshold){this.lowerTriggered=false}},checkThreshold:function(e){var top=this._scrollTarget[this.scrollPosition];if(!this.upperTriggered&&this.upperThreshold!=null){if(top<this.upperThreshold){this.upperTriggered=true;this.fire("upper-trigger")}}if(this.lowerThreshold!=null){var bottom=top+this._scrollTarget[this.sizeExtent];var size=this._scrollTarget[this.scrollExtent];if(!this.lowerTriggered&&size-bottom<this.lowerThreshold){this.lowerTriggered=true;this.fire("lower-trigger")}}},clearUpper:function(waitForMutation){if(waitForMutation){this._waitForMutation(function(){this.clearUpper()}.bind(this))}else{requestAnimationFrame(function(){this.upperTriggered=false}.bind(this))}},clearLower:function(waitForMutation){if(waitForMutation){this._waitForMutation(function(){this.clearLower()}.bind(this))}else{requestAnimationFrame(function(){this.lowerTriggered=false}.bind(this))}},_waitForMutation:function(listener){var observer=new MutationObserver(function(mutations){listener.call(this,observer,mutations);observer.disconnect()}.bind(this));observer.observe(this._scrollTarget,{attributes:true,childList:true,subtree:true})}});(function(){Polymer("core-shared-lib",{notifyEvent:"core-shared-lib-load",ready:function(){if(!this.url&&this.defaultUrl){this.url=this.defaultUrl}},urlChanged:function(){require(this.url,this,this.callbackName)},provide:function(){this.async("notify")},notify:function(){this.fire(this.notifyEvent,arguments)}});var apiMap={};function require(url,notifiee,callbackName){var name=nameFromUrl(url);var loader=apiMap[name];if(!loader){loader=apiMap[name]=new Loader(name,url,callbackName)}loader.requestNotify(notifiee)}function nameFromUrl(url){return url.replace(/[\:\/\%\?\&\.\=\-\,]/g,"_")+"_api"}var Loader=function(name,url,callbackName){this.instances=[];this.callbackName=callbackName;if(this.callbackName){window[this.callbackName]=this.success.bind(this)}else{if(url.indexOf(this.callbackMacro)>=0){this.callbackName=name+"_loaded";window[this.callbackName]=this.success.bind(this);url=url.replace(this.callbackMacro,this.callbackName)}else{throw"core-shared-api: a %%callback%% parameter is required in the API url"}}this.addScript(url)};Loader.prototype={callbackMacro:"%%callback%%",loaded:false,addScript:function(src){var script=document.createElement("script");script.src=src;script.onerror=this.error.bind(this);var s=document.querySelector("script");s.parentNode.insertBefore(script,s);this.script=script},removeScript:function(){if(this.script.parentNode){this.script.parentNode.removeChild(this.script)}this.script=null},error:function(){this.cleanup()},success:function(){this.loaded=true;this.cleanup();this.result=Array.prototype.slice.call(arguments);this.instances.forEach(this.provide,this);this.instances=null},cleanup:function(){delete window[this.callbackName]},provide:function(instance){instance.notify(instance,this.result)},requestNotify:function(instance){if(this.loaded){this.provide(instance)}else{this.instances.push(instance)}}}})();(function(){Polymer("core-signals",{attached:function(){signals.push(this)},removed:function(){var i=signals.indexOf(this);if(i>=0){signals.splice(i,1)}}});var signals=[];function notify(name,data){var signal=new CustomEvent("core-signal-"+name,{bubbles:false,detail:data});signals.forEach(function(s){s.dispatchEvent(signal)})}document.addEventListener("core-signal",function(e){notify(e.detail.name,e.detail.data)})})();Polymer("core-splitter",Polymer.mixin({direction:"left",minSize:"",locked:false,allowOverflow:false,resizerIsPeer:true,ready:function(){this.directionChanged()},attached:function(){this.resizerAttachedHandler()},detached:function(){this.resizerDetachedHandler()},domReady:function(){if(!this.allowOverflow){this.parentNode.style.overflow=this.nextElementSibling.style.overflow=this.previousElementSibling.style.overflow="hidden"}},directionChanged:function(){this.isNext=this.direction==="right"||this.direction==="down";this.horizontal=this.direction==="up"||this.direction==="down";this.update()},update:function(){this.target=this.isNext?this.nextElementSibling:this.previousElementSibling;this.dimension=this.horizontal?"height":"width";this.classList.toggle("horizontal",this.horizontal)},targetChanged:function(old){if(old){old.style[old.__splitterMinSize]=""}var min=this.target.__splitterMinSize=this.horizontal?"minHeight":"minWidth";this.target.style[min]=this.minSize},trackStart:function(){this.update();this.size=parseInt(getComputedStyle(this.target)[this.dimension])},track:function(e){if(this.locked){return}var d=e[this.horizontal?"dy":"dx"];this.target.style[this.dimension]=this.size+(this.isNext?-d:d)+"px";this.notifyResize()},preventSelection:function(e){e.preventDefault()}},Polymer.CoreResizer));(function(){var proto={label:null,eventDelegates:{"core-resize":"positionChanged"},computed:{hasTooltipContent:"label || !!tipElement"},publish:{show:{value:false,reflect:true},position:{value:"bottom",reflect:true},noarrow:{value:false,reflect:true}},tipAttribute:"tip",attached:function(){this.updatedChildren();this.resizableAttachedHandler()},detached:function(){this.resizableDetachedHandler()},updatedChildren:function(){this.tipElement=null;for(var i=0,el;el=this.$.c.getDistributedNodes()[i];++i){if(el.hasAttribute&&el.hasAttribute("tip")){this.tipElement=el;break}}this.job("positionJob",this.setPosition);this.onMutation(this,this.updatedChildren)},labelChanged:function(oldVal,newVal){this.job("positionJob",this.setPosition)},positionChanged:function(oldVal,newVal){this.job("positionJob",this.setPosition)},setPosition:function(){var controlWidth=this.clientWidth;var controlHeight=this.clientHeight;var toolTipWidth=this.$.tooltip.clientWidth;var toolTipHeight=this.$.tooltip.clientHeight;switch(this.position){case"top":case"bottom":this.$.tooltip.style.left=(controlWidth-toolTipWidth)/2+"px";this.$.tooltip.style.top=null;break;case"left":case"right":this.$.tooltip.style.left=null;this.$.tooltip.style.top=(controlHeight-toolTipHeight)/2+"px";break}}};Polymer.mixin2(proto,Polymer.CoreFocusable);Polymer.mixin(proto,Polymer.CoreResizable);Polymer("core-tooltip",proto)})();Polymer("copyright-statement",{copyrightStart:2014,created:function(){},ready:function(){this.thisYear=(new Date).getFullYear();if(this.copyrightStart!=null){if(parseInt(this.copyrightStart)<this.thisYear){this.copyrightStart=this.copyrightStart+" — "}else{this.copyrightStart=""}}}});