UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

338 lines (288 loc) 32.6 kB
/*! For license information please see chunk.0c8e89235ea78789d5ed.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[450,2132],{14114:(e,t,i)=>{"use strict";i.d(t,{P:()=>o});const o=e=>(t,i)=>{if(t.constructor._observers){if(!t.constructor.hasOwnProperty("_observers")){const e=t.constructor._observers;t.constructor._observers=new Map,e.forEach(((e,i)=>t.constructor._observers.set(i,e)))}}else{t.constructor._observers=new Map;const e=t.updated;t.updated=function(t){e.call(this,t),t.forEach(((e,t)=>{const i=this.constructor._observers.get(t);void 0!==i&&i.call(this,this[t],e)}))}}t.constructor._observers.set(i,e)}},35854:(e,t,i)=>{"use strict";i.d(t,{G:()=>r,R:()=>a});i(65233);var o=i(21006),n=i(98235);const r={properties:{checked:{type:Boolean,value:!1,reflectToAttribute:!0,notify:!0,observer:"_checkedChanged"},toggles:{type:Boolean,value:!0,reflectToAttribute:!0},value:{type:String,value:"on",observer:"_valueChanged"}},observers:["_requiredChanged(required)"],created:function(){this._hasIronCheckedElementBehavior=!0},_getValidity:function(e){return this.disabled||!this.required||this.checked},_requiredChanged:function(){this.required?this.setAttribute("aria-required","true"):this.removeAttribute("aria-required")},_checkedChanged:function(){this.active=this.checked,this.fire("iron-change")},_valueChanged:function(){void 0!==this.value&&null!==this.value||(this.value="on")}},a=[o.V,n.x,r]},67810:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});i(65233);var o=i(87156);const n={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(e,t){if(this._oldScrollTarget&&(this._toggleScrollListener(!1,this._oldScrollTarget),this._oldScrollTarget=null),t)if("document"===e)this.scrollTarget=this._doc;else if("string"==typeof e){var i=this.domHost;this.scrollTarget=i&&i.$?i.$[e]:(0,o.vz)(this.ownerDocument).querySelector("#"+e)}else this._isValidScrollTarget()&&(this._oldScrollTarget=e,this._toggleScrollListener(this._shouldHaveListener,e))},_scrollHandler:function(){},get _defaultScrollTarget(){return this._doc},get _doc(){return this.ownerDocument.documentElement},get _scrollTop(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageYOffset:this.scrollTarget.scrollTop:0},get _scrollLeft(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageXOffset:this.scrollTarget.scrollLeft:0},set _scrollTop(e){this.scrollTarget===this._doc?window.scrollTo(window.pageXOffset,e):this._isValidScrollTarget()&&(this.scrollTarget.scrollTop=e)},set _scrollLeft(e){this.scrollTarget===this._doc?window.scrollTo(e,window.pageYOffset):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=e)},scroll:function(e,t){var i;"object"==typeof e?(i=e.left,t=e.top):i=e,i=i||0,t=t||0,this.scrollTarget===this._doc?window.scrollTo(i,t):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=i,this.scrollTarget.scrollTop=t)},get _scrollTargetWidth(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerWidth:this.scrollTarget.offsetWidth:0},get _scrollTargetHeight(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerHeight:this.scrollTarget.offsetHeight:0},_isValidScrollTarget:function(){return this.scrollTarget instanceof HTMLElement},_toggleScrollListener:function(e,t){var i=t===this._doc?window:t;e?this._boundScrollHandler||(this._boundScrollHandler=this._scrollHandler.bind(this),i.addEventListener("scroll",this._boundScrollHandler)):this._boundScrollHandler&&(i.removeEventListener("scroll",this._boundScrollHandler),this._boundScrollHandler=null)},toggleScrollListener:function(e){this._shouldHaveListener=e,this._toggleScrollListener(e,this.scrollTarget)}}},62132:(e,t,i)=>{"use strict";i.d(t,{K:()=>s});i(65233);var o=i(35854),n=i(49075),r=i(84938);const a={_checkedChanged:function(){o.G._checkedChanged.call(this),this.hasRipple()&&(this.checked?this._ripple.setAttribute("checked",""):this._ripple.removeAttribute("checked"))},_buttonStateChanged:function(){r.o._buttonStateChanged.call(this),this.disabled||this.isAttached&&(this.checked=this.active)}},s=[n.B,o.R,a]},49075:(e,t,i)=>{"use strict";i.d(t,{S:()=>a,B:()=>s});i(65233);var o=i(51644),n=i(26110),r=i(84938);const a={observers:["_focusedChanged(receivedFocusFromKeyboard)"],_focusedChanged:function(e){e&&this.ensureRipple(),this.hasRipple()&&(this._ripple.holdDown=e)},_createRipple:function(){var e=r.o._createRipple();return e.id="ink",e.setAttribute("center",""),e.classList.add("circle"),e}},s=[o.P,n.a,r.o,a]},84938:(e,t,i)=>{"use strict";i.d(t,{o:()=>r});i(65233),i(60748);var o=i(51644),n=i(87156);const r={properties:{noink:{type:Boolean,observer:"_noinkChanged"},_rippleContainer:{type:Object}},_buttonStateChanged:function(){this.focused&&this.ensureRipple()},_downHandler:function(e){o.$._downHandler.call(this,e),this.pressed&&this.ensureRipple(e)},ensureRipple:function(e){if(!this.hasRipple()){this._ripple=this._createRipple(),this._ripple.noink=this.noink;var t=this._rippleContainer||this.root;if(t&&(0,n.vz)(t).appendChild(this._ripple),e){var i=(0,n.vz)(this._rippleContainer||this),o=(0,n.vz)(e).rootTarget;i.deepContains(o)&&this._ripple.uiDownAction(e)}}},getRipple:function(){return this.ensureRipple(),this._ripple},hasRipple:function(){return Boolean(this._ripple)},_createRipple:function(){return document.createElement("paper-ripple")},_noinkChanged:function(e){this.hasRipple()&&(this._ripple.noink=e)}}},32296:(e,t,i)=>{"use strict";i(65233),i(1656);var o=i(62132),n=i(49075),r=i(9672),a=i(50856),s=i(87529);const c=a.d`<style> :host { display: inline-block; white-space: nowrap; cursor: pointer; --calculated-paper-checkbox-size: var(--paper-checkbox-size, 18px); /* -1px is a sentinel for the default and is replaced in \`attached\`. */ --calculated-paper-checkbox-ink-size: var(--paper-checkbox-ink-size, -1px); @apply --paper-font-common-base; line-height: 0; -webkit-tap-highlight-color: transparent; } :host([hidden]) { display: none !important; } :host(:focus) { outline: none; } .hidden { display: none; } #checkboxContainer { display: inline-block; position: relative; width: var(--calculated-paper-checkbox-size); height: var(--calculated-paper-checkbox-size); min-width: var(--calculated-paper-checkbox-size); margin: var(--paper-checkbox-margin, initial); vertical-align: var(--paper-checkbox-vertical-align, middle); background-color: var(--paper-checkbox-unchecked-background-color, transparent); } #ink { position: absolute; /* Center the ripple in the checkbox by negative offsetting it by * (inkWidth - rippleWidth) / 2 */ top: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); width: var(--calculated-paper-checkbox-ink-size); height: var(--calculated-paper-checkbox-ink-size); color: var(--paper-checkbox-unchecked-ink-color, var(--primary-text-color)); opacity: 0.6; pointer-events: none; } #ink:dir(rtl) { right: calc(0px - (var(--calculated-paper-checkbox-ink-size) - var(--calculated-paper-checkbox-size)) / 2); left: auto; } #ink[checked] { color: var(--paper-checkbox-checked-ink-color, var(--primary-color)); } #checkbox { position: relative; box-sizing: border-box; height: 100%; border: solid 2px; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); border-radius: 2px; pointer-events: none; -webkit-transition: background-color 140ms, border-color 140ms; transition: background-color 140ms, border-color 140ms; -webkit-transition-duration: var(--paper-checkbox-animation-duration, 140ms); transition-duration: var(--paper-checkbox-animation-duration, 140ms); } /* checkbox checked animations */ #checkbox.checked #checkmark { -webkit-animation: checkmark-expand 140ms ease-out forwards; animation: checkmark-expand 140ms ease-out forwards; -webkit-animation-duration: var(--paper-checkbox-animation-duration, 140ms); animation-duration: var(--paper-checkbox-animation-duration, 140ms); } @-webkit-keyframes checkmark-expand { 0% { -webkit-transform: scale(0, 0) rotate(45deg); } 100% { -webkit-transform: scale(1, 1) rotate(45deg); } } @keyframes checkmark-expand { 0% { transform: scale(0, 0) rotate(45deg); } 100% { transform: scale(1, 1) rotate(45deg); } } #checkbox.checked { background-color: var(--paper-checkbox-checked-color, var(--primary-color)); border-color: var(--paper-checkbox-checked-color, var(--primary-color)); } #checkmark { position: absolute; width: 36%; height: 70%; border-style: solid; border-top: none; border-left: none; border-right-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-bottom-width: calc(2/15 * var(--calculated-paper-checkbox-size)); border-color: var(--paper-checkbox-checkmark-color, white); -webkit-transform-origin: 97% 86%; transform-origin: 97% 86%; box-sizing: content-box; /* protect against page-level box-sizing */ } #checkmark:dir(rtl) { -webkit-transform-origin: 50% 14%; transform-origin: 50% 14%; } /* label */ #checkboxLabel { position: relative; display: inline-block; vertical-align: middle; padding-left: var(--paper-checkbox-label-spacing, 8px); white-space: normal; line-height: normal; color: var(--paper-checkbox-label-color, var(--primary-text-color)); @apply --paper-checkbox-label; } :host([checked]) #checkboxLabel { color: var(--paper-checkbox-label-checked-color, var(--paper-checkbox-label-color, var(--primary-text-color))); @apply --paper-checkbox-label-checked; } #checkboxLabel:dir(rtl) { padding-right: var(--paper-checkbox-label-spacing, 8px); padding-left: 0; } #checkboxLabel[hidden] { display: none; } /* disabled state */ :host([disabled]) #checkbox { opacity: 0.5; border-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); } :host([disabled][checked]) #checkbox { background-color: var(--paper-checkbox-unchecked-color, var(--primary-text-color)); opacity: 0.5; } :host([disabled]) #checkboxLabel { opacity: 0.65; } /* invalid state */ #checkbox.invalid:not(.checked) { border-color: var(--paper-checkbox-error-color, var(--error-color)); } </style> <div id="checkboxContainer"> <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> </div> </div> <div id="checkboxLabel"><slot></slot></div>`;c.setAttribute("strip-whitespace",""),(0,r.k)({_template:c,is:"paper-checkbox",behaviors:[o.K],hostAttributes:{role:"checkbox","aria-checked":!1,tabindex:0},properties:{ariaActiveAttribute:{type:String,value:"aria-checked"}},attached:function(){(0,s.T8)(this,(function(){if("-1px"===this.getComputedStyleValue("--calculated-paper-checkbox-ink-size").trim()){var e=this.getComputedStyleValue("--calculated-paper-checkbox-size").trim(),t="px",i=e.match(/[A-Za-z]+$/);null!==i&&(t=i[0]);var o=parseFloat(e),n=8/3*o;"px"===t&&(n=Math.floor(n))%2!=o%2&&n++,this.updateStyles({"--paper-checkbox-ink-size":n+t})}}))},_computeCheckboxClass:function(e,t){var i="";return e&&(i+="checked "),t&&(i+="invalid"),i},_computeCheckmarkClass:function(e){return e?"":"hidden"},_createRipple:function(){return this._rippleContainer=this.$.checkboxContainer,n.S._createRipple.call(this)}})},51654:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r,n:()=>a});i(65233);var o=i(75009),n=i(87156);const r={hostAttributes:{role:"dialog",tabindex:"-1"},properties:{modal:{type:Boolean,value:!1},__readied:{type:Boolean,value:!1}},observers:["_modalChanged(modal, __readied)"],listeners:{tap:"_onDialogClick"},ready:function(){this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.__readied=!0},_modalChanged:function(e,t){t&&(e?(this.__prevNoCancelOnOutsideClick=this.noCancelOnOutsideClick,this.__prevNoCancelOnEscKey=this.noCancelOnEscKey,this.__prevWithBackdrop=this.withBackdrop,this.noCancelOnOutsideClick=!0,this.noCancelOnEscKey=!0,this.withBackdrop=!0):(this.noCancelOnOutsideClick=this.noCancelOnOutsideClick&&this.__prevNoCancelOnOutsideClick,this.noCancelOnEscKey=this.noCancelOnEscKey&&this.__prevNoCancelOnEscKey,this.withBackdrop=this.withBackdrop&&this.__prevWithBackdrop))},_updateClosingReasonConfirmed:function(e){this.closingReason=this.closingReason||{},this.closingReason.confirmed=e},_onDialogClick:function(e){for(var t=(0,n.vz)(e).path,i=0,o=t.indexOf(this);i<o;i++){var r=t[i];if(r.hasAttribute&&(r.hasAttribute("dialog-dismiss")||r.hasAttribute("dialog-confirm"))){this._updateClosingReasonConfirmed(r.hasAttribute("dialog-confirm")),this.close(),e.stopPropagation();break}}}},a=[o.$,r]},22626:(e,t,i)=>{"use strict";i(65233),i(65660),i(1656);var o=i(51654),n=i(9672),r=i(50856);(0,n.k)({_template:r.d` <style> :host { display: block; @apply --layout-relative; } :host(.is-scrolled:not(:first-child))::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--divider-color); } :host(.can-scroll:not(.scrolled-to-bottom):not(:last-child))::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: var(--divider-color); } .scrollable { padding: 0 24px; @apply --layout-scroll; @apply --paper-dialog-scrollable; } .fit { @apply --layout-fit; } </style> <div id="scrollable" class="scrollable" on-scroll="updateScrollState"> <slot></slot> </div> `,is:"paper-dialog-scrollable",properties:{dialogElement:{type:Object}},get scrollTarget(){return this.$.scrollable},ready:function(){this._ensureTarget(),this.classList.add("no-padding")},attached:function(){this._ensureTarget(),requestAnimationFrame(this.updateScrollState.bind(this))},updateScrollState:function(){this.toggleClass("is-scrolled",this.scrollTarget.scrollTop>0),this.toggleClass("can-scroll",this.scrollTarget.offsetHeight<this.scrollTarget.scrollHeight),this.toggleClass("scrolled-to-bottom",this.scrollTarget.scrollTop+this.scrollTarget.offsetHeight>=this.scrollTarget.scrollHeight)},_ensureTarget:function(){this.dialogElement=this.dialogElement||this.parentElement,this.dialogElement&&this.dialogElement.behaviors&&this.dialogElement.behaviors.indexOf(o.Z)>=0?(this.dialogElement.sizingTarget=this.scrollTarget,this.scrollTarget.classList.remove("fit")):this.dialogElement&&this.scrollTarget.classList.add("fit")}})},8878:(e,t,i)=>{"use strict";i(65233),i(8621),i(63207),i(30879),i(78814),i(60748),i(1656),i(57548),i(73962);var o=i(51644),n=i(26110),r=i(21006),a=i(98235),s=i(9672),c=i(87156),l=i(81668),h=i(50856);(0,s.k)({_template:h.d` <style include="paper-dropdown-menu-shared-styles"></style> <!-- this div fulfills an a11y requirement for combobox, do not remove --> <span role="button"></span> <paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat, verticalOffset)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]"> <!-- support hybrid mode: user might be using paper-menu-button 1.x which distributes via <content> --> <div class="dropdown-trigger" slot="dropdown-trigger"> <paper-ripple></paper-ripple> <!-- paper-input has type="text" for a11y, do not remove --> <paper-input type="text" invalid="[[invalid]]" readonly disabled="[[disabled]]" value="[[value]]" placeholder="[[placeholder]]" error-message="[[errorMessage]]" always-float-label="[[alwaysFloatLabel]]" no-label-float="[[noLabelFloat]]" label="[[label]]"> <!-- support hybrid mode: user might be using paper-input 1.x which distributes via <content> --> <iron-icon icon="paper-dropdown-menu:arrow-drop-down" suffix slot="suffix"></iron-icon> </paper-input> </div> <slot id="content" name="dropdown-content" slot="dropdown-content"></slot> </paper-menu-button> `,is:"paper-dropdown-menu",behaviors:[o.P,n.a,r.V,a.x],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},verticalOffset:Number,dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},hostAttributes:{role:"combobox","aria-autocomplete":"none","aria-haspopup":"true"},observers:["_selectedItemChanged(selectedItem)"],attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=(0,c.vz)(this.$.content).getDistributedNodes(),t=0,i=e.length;t<i;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){l.nJ(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this.value=t,this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e,t){return t||(e?-4:8)},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)}})},57301:(e,t,i)=>{"use strict";i(53973),i(89194),i(25782)},25782:(e,t,i)=>{"use strict";i(65233),i(65660),i(47686),i(97968);var o=i(9672),n=i(50856),r=i(33760);(0,o.k)({_template:n.d` <style include="paper-item-shared-styles"></style> <style> :host { @apply --layout-horizontal; @apply --layout-center; @apply --paper-font-subhead; @apply --paper-item; @apply --paper-icon-item; } .content-icon { @apply --layout-horizontal; @apply --layout-center; width: var(--paper-item-icon-width, 56px); @apply --paper-item-icon; } </style> <div id="contentIcon" class="content-icon"> <slot name="item-icon"></slot> </div> <slot></slot> `,is:"paper-icon-item",behaviors:[r.U]})},60748:(e,t,i)=>{"use strict";i(65233);var o=i(8621),n=i(9672),r=i(87156),a=i(50856),s={distance:function(e,t,i,o){var n=e-i,r=t-o;return Math.sqrt(n*n+r*r)},now:window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now};function c(e){this.element=e,this.width=this.boundingRect.width,this.height=this.boundingRect.height,this.size=Math.max(this.width,this.height)}function l(e){this.element=e,this.color=window.getComputedStyle(e).color,this.wave=document.createElement("div"),this.waveContainer=document.createElement("div"),this.wave.style.backgroundColor=this.color,this.wave.classList.add("wave"),this.waveContainer.classList.add("wave-container"),(0,r.vz)(this.waveContainer).appendChild(this.wave),this.resetInteractionState()}c.prototype={get boundingRect(){return this.element.getBoundingClientRect()},furthestCornerDistanceFrom:function(e,t){var i=s.distance(e,t,0,0),o=s.distance(e,t,this.width,0),n=s.distance(e,t,0,this.height),r=s.distance(e,t,this.width,this.height);return Math.max(i,o,n,r)}},l.MAX_RADIUS=300,l.prototype={get recenters(){return this.element.recenters},get center(){return this.element.center},get mouseDownElapsed(){var e;return this.mouseDownStart?(e=s.now()-this.mouseDownStart,this.mouseUpStart&&(e-=this.mouseUpElapsed),e):0},get mouseUpElapsed(){return this.mouseUpStart?s.now()-this.mouseUpStart:0},get mouseDownElapsedSeconds(){return this.mouseDownElapsed/1e3},get mouseUpElapsedSeconds(){return this.mouseUpElapsed/1e3},get mouseInteractionSeconds(){return this.mouseDownElapsedSeconds+this.mouseUpElapsedSeconds},get initialOpacity(){return this.element.initialOpacity},get opacityDecayVelocity(){return this.element.opacityDecayVelocity},get radius(){var e=this.containerMetrics.width*this.containerMetrics.width,t=this.containerMetrics.height*this.containerMetrics.height,i=1.1*Math.min(Math.sqrt(e+t),l.MAX_RADIUS)+5,o=1.1-i/l.MAX_RADIUS*.2,n=this.mouseInteractionSeconds/o,r=i*(1-Math.pow(80,-n));return Math.abs(r)},get opacity(){return this.mouseUpStart?Math.max(0,this.initialOpacity-this.mouseUpElapsedSeconds*this.opacityDecayVelocity):this.initialOpacity},get outerOpacity(){var e=.3*this.mouseUpElapsedSeconds,t=this.opacity;return Math.max(0,Math.min(e,t))},get isOpacityFullyDecayed(){return this.opacity<.01&&this.radius>=Math.min(this.maxRadius,l.MAX_RADIUS)},get isRestingAtMaxRadius(){return this.opacity>=this.initialOpacity&&this.radius>=Math.min(this.maxRadius,l.MAX_RADIUS)},get isAnimationComplete(){return this.mouseUpStart?this.isOpacityFullyDecayed:this.isRestingAtMaxRadius},get translationFraction(){return Math.min(1,this.radius/this.containerMetrics.size*2/Math.sqrt(2))},get xNow(){return this.xEnd?this.xStart+this.translationFraction*(this.xEnd-this.xStart):this.xStart},get yNow(){return this.yEnd?this.yStart+this.translationFraction*(this.yEnd-this.yStart):this.yStart},get isMouseDown(){return this.mouseDownStart&&!this.mouseUpStart},resetInteractionState:function(){this.maxRadius=0,this.mouseDownStart=0,this.mouseUpStart=0,this.xStart=0,this.yStart=0,this.xEnd=0,this.yEnd=0,this.slideDistance=0,this.containerMetrics=new c(this.element)},draw:function(){var e,t,i;this.wave.style.opacity=this.opacity,e=this.radius/(this.containerMetrics.size/2),t=this.xNow-this.containerMetrics.width/2,i=this.yNow-this.containerMetrics.height/2,this.waveContainer.style.webkitTransform="translate("+t+"px, "+i+"px)",this.waveContainer.style.transform="translate3d("+t+"px, "+i+"px, 0)",this.wave.style.webkitTransform="scale("+e+","+e+")",this.wave.style.transform="scale3d("+e+","+e+",1)"},downAction:function(e){var t=this.containerMetrics.width/2,i=this.containerMetrics.height/2;this.resetInteractionState(),this.mouseDownStart=s.now(),this.center?(this.xStart=t,this.yStart=i,this.slideDistance=s.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)):(this.xStart=e?e.detail.x-this.containerMetrics.boundingRect.left:this.containerMetrics.width/2,this.yStart=e?e.detail.y-this.containerMetrics.boundingRect.top:this.containerMetrics.height/2),this.recenters&&(this.xEnd=t,this.yEnd=i,this.slideDistance=s.distance(this.xStart,this.yStart,this.xEnd,this.yEnd)),this.maxRadius=this.containerMetrics.furthestCornerDistanceFrom(this.xStart,this.yStart),this.waveContainer.style.top=(this.containerMetrics.height-this.containerMetrics.size)/2+"px",this.waveContainer.style.left=(this.containerMetrics.width-this.containerMetrics.size)/2+"px",this.waveContainer.style.width=this.containerMetrics.size+"px",this.waveContainer.style.height=this.containerMetrics.size+"px"},upAction:function(e){this.isMouseDown&&(this.mouseUpStart=s.now())},remove:function(){(0,r.vz)(this.waveContainer.parentNode).removeChild(this.waveContainer)}},(0,n.k)({_template:a.d` <style> :host { display: block; position: absolute; border-radius: inherit; overflow: hidden; top: 0; left: 0; right: 0; bottom: 0; /* See PolymerElements/paper-behaviors/issues/34. On non-Chrome browsers, * creating a node (with a position:absolute) in the middle of an event * handler "interrupts" that event handler (which happens when the * ripple is created on demand) */ pointer-events: none; } :host([animating]) { /* This resolves a rendering issue in Chrome (as of 40) where the ripple is not properly clipped by its parent (which may have rounded corners). See: http://jsbin.com/temexa/4 Note: We only apply this style conditionally. Otherwise, the browser will create a new compositing layer for every ripple element on the page, and that would be bad. */ -webkit-transform: translate(0, 0); transform: translate3d(0, 0, 0); } #background, #waves, .wave-container, .wave { pointer-events: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; } #background, .wave { opacity: 0; } #waves, .wave { overflow: hidden; } .wave-container, .wave { border-radius: 50%; } :host(.circle) #background, :host(.circle) #waves { border-radius: 50%; } :host(.circle) .wave-container { overflow: hidden; } </style> <div id="background"></div> <div id="waves"></div> `,is:"paper-ripple",behaviors:[o.G],properties:{initialOpacity:{type:Number,value:.25},opacityDecayVelocity:{type:Number,value:.8},recenters:{type:Boolean,value:!1},center:{type:Boolean,value:!1},ripples:{type:Array,value:function(){return[]}},animating:{type:Boolean,readOnly:!0,reflectToAttribute:!0,value:!1},holdDown:{type:Boolean,value:!1,observer:"_holdDownChanged"},noink:{type:Boolean,value:!1},_animating:{type:Boolean},_boundAnimate:{type:Function,value:function(){return this.animate.bind(this)}}},get target(){return this.keyEventTarget},keyBindings:{"enter:keydown":"_onEnterKeydown","space:keydown":"_onSpaceKeydown","space:keyup":"_onSpaceKeyup"},attached:function(){11==this.parentNode.nodeType?this.keyEventTarget=(0,r.vz)(this).getOwnerRoot().host:this.keyEventTarget=this.parentNode;var e=this.keyEventTarget;this.listen(e,"up","uiUpAction"),this.listen(e,"down","uiDownAction")},detached:function(){this.unlisten(this.keyEventTarget,"up","uiUpAction"),this.unlisten(this.keyEventTarget,"down","uiDownAction"),this.keyEventTarget=null},get shouldKeepAnimating(){for(var e=0;e<this.ripples.length;++e)if(!this.ripples[e].isAnimationComplete)return!0;return!1},simulatedRipple:function(){this.downAction(null),this.async((function(){this.upAction()}),1)},uiDownAction:function(e){this.noink||this.downAction(e)},downAction:function(e){this.holdDown&&this.ripples.length>0||(this.addRipple().downAction(e),this._animating||(this._animating=!0,this.animate()))},uiUpAction:function(e){this.noink||this.upAction(e)},upAction:function(e){this.holdDown||(this.ripples.forEach((function(t){t.upAction(e)})),this._animating=!0,this.animate())},onAnimationComplete:function(){this._animating=!1,this.$.background.style.backgroundColor=null,this.fire("transitionend")},addRipple:function(){var e=new l(this);return(0,r.vz)(this.$.waves).appendChild(e.waveContainer),this.$.background.style.backgroundColor=e.color,this.ripples.push(e),this._setAnimating(!0),e},removeRipple:function(e){var t=this.ripples.indexOf(e);t<0||(this.ripples.splice(t,1),e.remove(),this.ripples.length||this._setAnimating(!1))},animate:function(){if(this._animating){var e,t;for(e=0;e<this.ripples.length;++e)(t=this.ripples[e]).draw(),this.$.background.style.opacity=t.outerOpacity,t.isOpacityFullyDecayed&&!t.isRestingAtMaxRadius&&this.removeRipple(t);this.shouldKeepAnimating||0!==this.ripples.length?window.requestAnimationFrame(this._boundAnimate):this.onAnimationComplete()}},animateRipple:function(){return this.animate()},_onEnterKeydown:function(){this.uiDownAction(),this.async(this.uiUpAction,1)},_onSpaceKeydown:function(){this.uiDownAction()},_onSpaceKeyup:function(){this.uiUpAction()},_holdDownChanged:function(e,t){void 0!==t&&(e?this.downAction():this.upAction())}})},91107:(e,t,i)=>{"use strict";i.d(t,{Ud:()=>d});const o=Symbol("Comlink.proxy"),n=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),a=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,c=new Map([["proxy",{canHandle:e=>s(e)&&e[o],serialize(e){const{port1:t,port2:i}=new MessageChannel;return l(e,t),[i,[i]]},deserialize:e=>(e.start(),d(e))}],["throw",{canHandle:e=>s(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function l(e,t=self){t.addEventListener("message",(function i(n){if(!n||!n.data)return;const{id:r,type:s,path:c}=Object.assign({path:[]},n.data),d=(n.data.argumentList||[]).map(b);let p;try{const t=c.slice(0,-1).reduce(((e,t)=>e[t]),e),i=c.reduce(((e,t)=>e[t]),e);switch(s){case"GET":p=i;break;case"SET":t[c.slice(-1)[0]]=b(n.data.value),p=!0;break;case"APPLY":p=i.apply(t,d);break;case"CONSTRUCT":p=function(e){return Object.assign(e,{[o]:!0})}(new i(...d));break;case"ENDPOINT":{const{port1:t,port2:i}=new MessageChannel;l(e,i),p=function(e,t){return m.set(e,t),e}(t,[t])}break;case"RELEASE":p=void 0;break;default:return}}catch(e){p={value:e,[a]:0}}Promise.resolve(p).catch((e=>({value:e,[a]:0}))).then((e=>{const[o,n]=v(e);t.postMessage(Object.assign(Object.assign({},o),{id:r}),n),"RELEASE"===s&&(t.removeEventListener("message",i),h(t))}))})),t.start&&t.start()}function h(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function d(e,t){return u(e,[],t)}function p(e){if(e)throw new Error("Proxy has been released and is not useable")}function u(e,t=[],i=function(){}){let o=!1;const a=new Proxy(i,{get(i,n){if(p(o),n===r)return()=>y(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{h(e),o=!0}));if("then"===n){if(0===t.length)return{then:()=>a};const i=y(e,{type:"GET",path:t.map((e=>e.toString()))}).then(b);return i.then.bind(i)}return u(e,[...t,n])},set(i,n,r){p(o);const[a,s]=v(r);return y(e,{type:"SET",path:[...t,n].map((e=>e.toString())),value:a},s).then(b)},apply(i,r,a){p(o);const s=t[t.length-1];if(s===n)return y(e,{type:"ENDPOINT"}).then(b);if("bind"===s)return u(e,t.slice(0,-1));const[c,l]=g(a);return y(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:c},l).then(b)},construct(i,n){p(o);const[r,a]=g(n);return y(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:r},a).then(b)}});return a}function g(e){const t=e.map(v);return[t.map((e=>e[0])),(i=t.map((e=>e[1])),Array.prototype.concat.apply([],i))];var i}const m=new WeakMap;function v(e){for(const[t,i]of c)if(i.canHandle(e)){const[o,n]=i.serialize(e);return[{type:"HANDLER",name:t,value:o},n]}return[{type:"RAW",value:e},m.get(e)||[]]}function b(e){switch(e.type){case"HANDLER":return c.get(e.name).deserialize(e.value);case"RAW":return e.value}}function y(e,t,i){return new Promise((o=>{const n=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(i){i.data&&i.data.id&&i.data.id===n&&(e.removeEventListener("message",t),o(i.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:n},t),i)}))}}}]); //# sourceMappingURL=chunk.0c8e89235ea78789d5ed.js.map