2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-06-19 20:15:57 +00:00
const t = "undefined" != typeof window && null != window . customElements && void 0 !== window . customElements . polyfillWrapFlushCallback , e = ( t , e , a = null ) => { for ( ; e !== a ; ) { const a = e . nextSibling ; t . removeChild ( e ) , e = a } } , a = ` {{lit- ${ String ( Math . random ( ) ) . slice ( 2 ) } }} ` , r = ` \x 3c!-- ${ a } -- \x 3e ` , n = new RegExp ( ` ${ a } | ${ r } ` ) ; class o { constructor ( t , e ) { this . parts = [ ] , this . element = e ; const r = [ ] , o = [ ] , s = document . createTreeWalker ( e . content , 133 , null , ! 1 ) ; let u = 0 , d = - 1 , p = 0 ; const { strings : h , values : { length : m } } = t ; for ( ; p < m ; ) { const t = s . nextNode ( ) ; if ( null !== t ) { if ( d ++ , 1 === t . nodeType ) { if ( t . hasAttributes ( ) ) { const e = t . attributes , { length : a } = e ; let r = 0 ; for ( let t = 0 ; t < a ; t ++ ) i ( e [ t ] . name , "$lit$" ) && r ++ ; for ( ; r -- > 0 ; ) { const e = h [ p ] , a = c . exec ( e ) [ 2 ] , r = a . toLowerCase ( ) + "$lit$" , o = t . getAttribute ( r ) ; t . removeAttribute ( r ) ; const i = o . split ( n ) ; this . parts . push ( { type : "attribute" , index : d , name : a , strings : i } ) , p += i . length - 1 } } "TEMPLATE" === t . tagName && ( o . push ( t ) , s . currentNode = t . content ) } else if ( 3 === t . nodeType ) { const e = t . data ; if ( e . indexOf ( a ) >= 0 ) { const a = t . parentNode , o = e . split ( n ) , s = o . length - 1 ; for ( let e = 0 ; e < s ; e ++ ) { let r , n = o [ e ] ; if ( "" === n ) r = l ( ) ; else { const t = c . exec ( n ) ; null !== t && i ( t [ 2 ] , "$lit$" ) && ( n = n . slice ( 0 , t . index ) + t [ 1 ] + t [ 2 ] . slice ( 0 , - "$lit$" . length ) + t [ 3 ] ) , r = document . createTextNode ( n ) } a . insertBefore ( r , t ) , this . parts . push ( { type : "node" , index : ++ d } ) } "" === o [ s ] ? ( a . insertBefore ( l ( ) , t ) , r . push ( t ) ) : t . data = o [ s ] , p += s } } else if ( 8 === t . nodeType ) if ( t . data === a ) { const e = t . parentNode ; null !== t . previousSibling && d !== u || ( d ++ , e . insertBefore ( l ( ) , t ) ) , u = d , this . parts . push ( { type : "node" , index : d } ) , null === t . nextSibling ? t . data = "" : ( r . push ( t ) , d -- ) , p ++ } else { let e = - 1 ; for ( ; - 1 !== ( e = t . data . indexOf ( a , e + 1 ) ) ; ) this . parts . push ( { type : "node" , index : - 1 } ) , p ++ } } else s . currentNode = o . pop ( ) } for ( const t of r ) t . parentNode . removeChild ( t ) } } const i = ( t , e ) => { const a = t . length - e . length ; return a >= 0 && t . slice ( a ) === e } , s = t => - 1 !== t . index , l = ( ) => document . createComment ( "" ) , c = /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/ ; function u ( t , e ) { const { element : { content : a } , parts : r } = t , n = document . createTreeWalker ( a , 133 , null , ! 1 ) ; let o = p ( r ) , i = r [ o ] , s = - 1 , l = 0 ; const c = [ ] ; let u = null ; for ( ; n . nextNode ( ) ; ) { s ++ ; const t = n . currentNode ; for ( t . previousSibling === u && ( u = null ) , e . has ( t ) && ( c . push ( t ) , null === u && ( u = t ) ) , null !== u && l ++ ; void 0 !== i && i . index === s ; ) i . index = null !== u ? - 1 : i . index - l , o = p ( r , o ) , i = r [ o ] } c . forEach ( t => t . parentNode . removeChild ( t ) ) } const d = t => { let e = 11 === t . nodeType ? 0 : 1 ; const a = document . createTreeWalker ( t , 133 , null , ! 1 ) ; for ( ; a . nextNode ( ) ; ) e ++ ; return e } , p = ( t , e = - 1 ) => { for ( let a = e + 1 ; a < t . length ; a ++ ) { const e = t [ a ] ; if ( s ( e ) ) return a } return - 1 } ;
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-06-19 20:15:57 +00:00
const h = new WeakMap , m = t => "function" == typeof t && h . has ( t ) , g = { } , f = { } ;
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-06-19 20:15:57 +00:00
class b { constructor ( t , e , a ) { this . _ _parts = [ ] , this . template = t , this . processor = e , this . options = a } update ( t ) { let e = 0 ; for ( const a of this . _ _parts ) void 0 !== a && a . setValue ( t [ e ] ) , e ++ ; for ( const t of this . _ _parts ) void 0 !== t && t . commit ( ) } _clone ( ) { const e = t ? this . template . element . content . cloneNode ( ! 0 ) : document . importNode ( this . template . element . content , ! 0 ) , a = [ ] , r = this . template . parts , n = document . createTreeWalker ( e , 133 , null , ! 1 ) ; let o , i = 0 , l = 0 , c = n . nextNode ( ) ; for ( ; i < r . length ; ) if ( o = r [ i ] , s ( o ) ) { for ( ; l < o . index ; ) l ++ , "TEMPLATE" === c . nodeName && ( a . push ( c ) , n . currentNode = c . content ) , null === ( c = n . nextNode ( ) ) && ( n . currentNode = a . pop ( ) , c = n . nextNode ( ) ) ; if ( "node" === o . type ) { const t = this . processor . handleTextExpression ( this . options ) ; t . insertAfterNode ( c . previousSibling ) , this . _ _parts . push ( t ) } else this . _ _parts . push ( ... this . processor . handleAttributeExpressions ( c , o . name , o . strings , this . options ) ) ; i ++ } else this . _ _parts . push ( void 0 ) , i ++ ; return t && ( document . adoptNode ( e ) , customElements . upgrade ( e ) ) , e } }
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / c o n s t y = ` $ { a } ` ; c l a s s v { c o n s t r u c t o r ( t , e , a , r ) { t h i s . s t r i n g s = t , t h i s . v a l u e s = e , t h i s . t y p e = a , t h i s . p r o c e s s o r = r } g e t H T M L ( ) { c o n s t t = t h i s . s t r i n g s . l e n g t h - 1 ; l e t e = " " , n = ! 1 ; f o r ( l e t o = 0 ; o < t ; o + + ) { c o n s t t = t h i s . s t r i n g s [ o ] , i = t . l a s t I n d e x O f ( " \ x 3 c ! - - " ) ; n = ( i > - 1 | | n ) & & - 1 = = = t . i n d e x O f ( " - - \ x 3 e " , i + 1 ) ; c o n s t s = c . e x e c ( t ) ; e + = n u l l = = = s ? t + ( n ? y : r ) : t . s u b s t r ( 0 , s . i n d e x ) + s [ 1 ] + s [ 2 ] + " $ l i t $ " + s [ 3 ] + a } r e t u r n e + = t h i s . s t r i n g s [ t ] , e } g e t T e m p l a t e E l e m e n t ( ) { c o n s t t = d o c u m e n t . c r e a t e E l e m e n t ( " t e m p l a t e " ) ; r e t u r n t . i n n e r H T M L = t h i s . g e t H T M L ( ) , t } }
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / c o n s t S = t = > n u l l = = = t | | ! ( " o b j e c t " = = t y p e o f t | | " f u n c t i o n " = = t y p e o f t ) , w = t = > A r r a y . i s A r r a y ( t ) | | ! ( ! t | | ! t [ S y m b o l . i t e r a t o r ] ) ; c l a s s _ { c o n s t r u c t o r ( t , e , a ) { t h i s . d i r t y = ! 0 , t h i s . e l e m e n t = t , t h i s . n a m e = e , t h i s . s t r i n g s = a , t h i s . p a r t s = [ ] ; f o r ( l e t t = 0 ; t < a . l e n g t h - 1 ; t + + ) t h i s . p a r t s [ t ] = t h i s . _ c r e a t e P a r t ( ) } _ c r e a t e P a r t ( ) { r e t u r n n e w k ( t h i s ) } _ g e t V a l u e ( ) { c o n s t t = t h i s . s t r i n g s , e = t . l e n g t h - 1 ; l e t a = " " ; f o r ( l e t r = 0 ; r < e ; r + + ) { a + = t [ r ] ; c o n s t e = t h i s . p a r t s [ r ] ; i f ( v o i d 0 ! = = e ) { c o n s t t = e . v a l u e ; i f ( S ( t ) | | ! w ( t ) ) a + = " s t r i n g " = = t y p e o f t ? t : S t r i n g ( t ) ; e l s e f o r ( c o n s t e o f t ) a + = " s t r i n g " = = t y p e o f e ? e : S t r i n g ( e ) } } r e t u r n a + = t [ e ] , a } c o m m i t ( ) { t h i s . d i r t y & & ( t h i s . d i r t y = ! 1 , t h i s . e l e m e n t . s e t A t t r i b u t e ( t h i s . n a m e , t h i s . _ g e t V a l u e ( ) ) ) } } c l a s s k { c o n s t r u c t o r ( t ) { t h i s . v a l u e = v o i d 0 , t h i s . c o m m i t t e r = t } s e t V a l u e ( t ) { t = = = g | | S ( t ) & & t = = = t h i s . v a l u e | | ( t h i s . v a l u e = t , m ( t ) | | ( t h i s . c o m m i t t e r . d i r t y = ! 0 ) ) } c o m m i t ( ) { f o r ( ; m ( t h i s . v a l u e ) ; ) { c o n s t t = t h i s . v a l u e ; t h i s . v a l u e = g , t ( t h i s ) } t h i s . v a l u e ! = = g & & t h i s . c o m m i t t e r . c o m m i t ( ) } } c l a s s z { c o n s t r u c t o r ( t ) { t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , t h i s . o p t i o n s = t } a p p e n d I n t o ( t ) { t h i s . s t a r t N o d e = t . a p p e n d C h i l d ( l ( ) ) , t h i s . e n d N o d e = t . a p p e n d C h i l d ( l ( ) ) } i n s e r t A f t e r N o d e ( t ) { t h i s . s t a r t N o d e = t , t h i s . e n d N o d e = t . n e x t S i b l i n g } a p p e n d I n t o P a r t ( t ) { t . _ _ i n s e r t ( t h i s . s t a r t N o d e = l ( ) ) , t . _ _ i n s e r t ( t h i s . e n d N o d e = l ( ) ) } i n s e r t A f t e r P a r t ( t ) { t . _ _ i n s e r t ( t h i s . s t a r t N o d e = l ( ) ) , t h i s . e n d N o d e = t . e n d N o d e , t . e n d N o d e = t h i s . s t a r t N o d e } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { i f ( n u l l = = = t h i s . s t a r t N o d e . p a r e n t N o d e ) r e t u r n ; f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = g , t ( t h i s ) } c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t ! = = g & & ( S ( t ) ? t ! = = t h i s . v a l u e & & t h i s . _ _ c o m m i t T e x t ( t ) : t i n s t a n c e o f v ? t h i s . _ _ c o m m i t T e m p l a t e R e s u l t ( t ) : t i n s t a n c e o f N o d e ? t h i s . _ _ c o m m i t N o d e ( t ) : w ( t ) ? t h i s . _ _ c o m m i t I t e r a b l e ( t ) : t = = = f ? ( t h i s . v a l u e = f , t h i s . c l e a r ( ) ) : t h i s . _ _ c o m m i t T e x t ( t ) ) } _ _ i n s e r t ( t ) { t h i s . e n d N o d e . p a r e n t N o d e . i n s e r t B e f o r e ( t , t h i s . e n d N o d e ) } _ _ c o m m i t N o d e ( t ) { t h i s . v a l u e ! = = t & & ( t h i s . c l e a r ( ) , t h i s . _ _ i n s e r t ( t ) , t h i s . v a l u e = t ) } _ _ c o m m i t T e x t ( t ) { c o n s t e = t h i s . s t a r t N o d e . n e x t S i b l i n g , a = " s t r i n g " = = t y p e o f ( t = n u l l = = t ? " " : t ) ? t : S t r i n g ( t ) ; e = = = t h i s . e n d N o d e . p r e v i o u s S i b l i n g & & 3 = = = e . n o d e T y p e ? e . d a t a = a : t h i s . _ _ c o m m i t N o d e ( d o c u m e n t . c r e a t e T e x t N o d e ( a ) ) , t h i s . v a l u e = t } _ _ c o m m i t T e m p l a t e R e s u l t ( t ) { c o n s t e = t h i s . o p t i o n s . t e m p l a t e F a c t o r y ( t ) ; i f ( t h i s . v a l u e i n s t a n c e o f b & & t h i s . v a l u e . t e m p l a t e = = = e ) t h i s . v a l u e . u p d a t e ( t . v a l u e s ) ; e l s e { c o n s t a = n e w b ( e , t . p r o c e s s o r , t h i s . o p t i o n s ) , r = a . _ c l o n e ( ) ; a . u p d a t e ( t . v a l u e s ) , t h i s . _ _ c o m m i t N o d e ( r ) , t h i s . v a l u e = a } } _ _ c o m m i t I t e r a b l e ( t ) { A r r a y . i s A r r a y ( t h i s . v a l u e ) | | ( t h i s . v a l u e = [ ] , t h i s . c l e a r ( ) ) ; c o n s t e = t h i s . v a l u e ; l e t a , r = 0 ; f o r ( c o n s t n o f t ) a = e [ r ] , v o i d 0 = = = a & & ( a = n e w z ( t h i s . o p t i o n s ) , e . p u s h ( a ) , 0 = = = r ? a . a p p e n d I n t o P a r t ( t h i s ) : a . i n s e r t A f t e r P a r t ( e [ r - 1 ] ) ) , a . s e t V a l u e ( n ) , a . c o m m i t ( ) , r + + ; r < e . l e n g t h & & ( e . l e n g t h = r , t h i s . c l e a r ( a & & a . e n d N o d e ) ) } c l e a r ( t = t h i s . s t a r t N o d e ) { e ( t h i s . s t a r t N o d e . p a r e n t N o d e , t . n e x t S i b l i n g , t h i s . e n d N o d e ) } } c l a s s x { c o n s t r u c t o r ( t , e , a ) { i f ( t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , 2 ! = = a . l e n g t h | | " " ! = = a [ 0 ] | | " " ! = = a [ 1 ] ) t h r o w n e w E r r o r ( " B o o l e a n a t t r i b u t e s c a n o n l y c o n t a i n a s i n g l e e x p r e s s i o n " ) ; t h i s . e l e m e n t = t , t h i s . n a m e = e , t h i s . s t r i n g s = a } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = g , t ( t h i s ) } i f ( t h i s . _ _ p e n d i n g V a l u e = = = g ) r e t u r n ; c o n s t t = ! ! t h i s . _ _ p e n d i n g V a l u e ; t h i s . v a l u e ! = = t & & ( t ? t h i s . e l e m e n t . s e t A t t r i b u t e ( t h i s . n a m e , " " ) : t h i s . e l e m e n t . r e m o v e A t t r i b u t e ( t h i s . n a m e ) , t h i s . v a l u e = t ) , t h i s . _ _ p e n d i n g V a l u e = g } } c l a s s V e x t e n d s _ { c o n s t r u c t o r ( t , e , a ) { s u p e r ( t , e , a ) , t h i s . s i n g l e = 2 = = = a . l e n g t h & & " " = = = a [ 0 ] & & " " = = = a [ 1 ] } _ c r e a t e P a r t ( ) { r e t u r n n e w U ( t h i s ) } _ g e t V a l u e ( ) { r e t u r n t h i s . s i n g l e ? t h i s . p a r t s [ 0 ] . v a l u e : s u p e r . _ g e t V a l u e ( ) } c o m m i t ( ) { t h i s . d i r t y & & ( t h i s . d i r t y = ! 1 , t h i s . e l e m e n t [ t h i s . n a m e ] = t h i s . _ g e t V a l u e ( ) ) } } c l a s s U e x t e n d s k { } l e t R = ! 1 ; ( ( ) = > { t r y { c o n s t t = { g e t c a p t u r e ( ) { r e t u r n R = ! 0 , ! 1 } } ; w i n d o w . a d d E v e n t L i s t e n e r ( " t e s t " , t , t ) , w i n d o w . r e m o v e E v e n t L i s t e n e r ( " t e s t " , t , t ) } c a t c h ( t ) { } } ) ( ) ; c l a s s T { c o n s t r u c t o r ( t , e , a ) { t h i s . v a l u e = v o i d 0 , t h i s . _ _ p e n d i n g V a l u e = v o i d 0 , t h i s . e l e m e n t = t , t h i s . e v e n t N a m e = e , t h i s . e v e n t C o n t e x t = a , t h i s . _ _ b o u n d H a n d l e E v e n t = t = > t h i s . h a n d l e E v e n t ( t ) } s e t V a l u e ( t ) { t h i s . _ _ p e n d i n g V a l u e = t } c o m m i t ( ) { f o r ( ; m ( t h i s . _ _ p e n d i n g V a l u e ) ; ) { c o n s t t = t h i s . _ _ p e n d i n g V a l u e ; t h i s . _ _ p e n d i n g V a l u e = g , t ( t h i s ) } i f ( t h i s . _ _ p e n d i n g V a l u e = = = g ) r e t u r n ; c o n s
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / ; f u n c t i o n O ( t ) { l e t e = P . g e t ( t . t y p e ) ; v o i d 0 = = = e & & ( e = { s t r i n g s A r r a y : n e w W e a k M a p , k e y S t r i n g : n e w M a p } , P . s e t ( t . t y p e , e ) ) ; l e t r = e . s t r i n g s A r r a y . g e t ( t . s t r i n g s ) ; i f ( v o i d 0 ! = = r ) r e t u r n r ; c o n s t n = t . s t r i n g s . j o i n ( a ) ; r e t u r n r = e . k e y S t r i n g . g e t ( n ) , v o i d 0 = = = r & & ( r = n e w o ( t , t . g e t T e m p l a t e E l e m e n t ( ) ) , e . k e y S t r i n g . s e t ( n , r ) ) , e . s t r i n g s A r r a y . s e t ( t . s t r i n g s , r ) , r } c o n s t P = n e w M a p , E = n e w W e a k M a p ;
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / c o n s t j = n e w
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-06-19 20:15:57 +00:00
class { handleAttributeExpressions ( t , e , a , r ) { const n = e [ 0 ] ; if ( "." === n ) { return new V ( t , e . slice ( 1 ) , a ) . parts } return "@" === n ? [ new T ( t , e . slice ( 1 ) , r . eventContext ) ] : "?" === n ? [ new x ( t , e . slice ( 1 ) , a ) ] : new _ ( t , e , a ) . parts } handleTextExpression ( t ) { return new z ( t ) } } ;
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / " u n d e f i n e d " ! = t y p e o f w i n d o w & & ( w i n d o w . l i t H t m l V e r s i o n s | | ( w i n d o w . l i t H t m l V e r s i o n s = [ ] ) ) . p u s h ( " 1 . 2 . 1 " ) ; c o n s t M = ( t , . . . e ) = > n e w v ( t , e , " h t m l " , j )
2020-06-03 20:36:46 +00:00
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
2020-06-19 20:15:57 +00:00
* / , q = ( t , e ) = > ` $ { t } - - $ { e } ` ; l e t W = ! 0 ; v o i d 0 = = = w i n d o w . S h a d y C S S ? W = ! 1 : v o i d 0 = = = w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e D o m & & ( c o n s o l e . w a r n ( " I n c o m p a t i b l e S h a d y C S S v e r s i o n d e t e c t e d . P l e a s e u p d a t e t o a t l e a s t @ w e b c o m p o n e n t s / w e b c o m p o n e n t s j s @ 2 . 0 . 2 a n d @ w e b c o m p o n e n t s / s h a d y c s s @ 1 . 3 . 1 . " ) , W = ! 1 ) ; c o n s t K = t = > e = > { c o n s t r = q ( e . t y p e , t ) ; l e t n = P . g e t ( r ) ; v o i d 0 = = = n & & ( n = { s t r i n g s A r r a y : n e w W e a k M a p , k e y S t r i n g : n e w M a p } , P . s e t ( r , n ) ) ; l e t i = n . s t r i n g s A r r a y . g e t ( e . s t r i n g s ) ; i f ( v o i d 0 ! = = i ) r e t u r n i ; c o n s t s = e . s t r i n g s . j o i n ( a ) ; i f ( i = n . k e y S t r i n g . g e t ( s ) , v o i d 0 = = = i ) { c o n s t a = e . g e t T e m p l a t e E l e m e n t ( ) ; W & & w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e D o m ( a , t ) , i = n e w o ( e , a ) , n . k e y S t r i n g . s e t ( s , i ) } r e t u r n n . s t r i n g s A r r a y . s e t ( e . s t r i n g s , i ) , i } , X = [ " h t m l " , " s v g " ] , C = n e w S e t , F = ( t , e , a ) = > { C . a d d ( t ) ; c o n s t r = a ? a . e l e m e n t : d o c u m e n t . c r e a t e E l e m e n t ( " t e m p l a t e " ) , n = e . q u e r y S e l e c t o r A l l ( " s t y l e " ) , { l e n g t h : o } = n ; i f ( 0 = = = o ) r e t u r n v o i d w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e S t y l e s ( r , t ) ; c o n s t i = d o c u m e n t . c r e a t e E l e m e n t ( " s t y l e " ) ; f o r ( l e t t = 0 ; t < o ; t + + ) { c o n s t e = n [ t ] ; e . p a r e n t N o d e . r e m o v e C h i l d ( e ) , i . t e x t C o n t e n t + = e . t e x t C o n t e n t } ( t = > { X . f o r E a c h ( e = > { c o n s t a = P . g e t ( q ( e , t ) ) ; v o i d 0 ! = = a & & a . k e y S t r i n g . f o r E a c h ( t = > { c o n s t { e l e m e n t : { c o n t e n t : e } } = t , a = n e w S e t ; A r r a y . f r o m ( e . q u e r y S e l e c t o r A l l ( " s t y l e " ) ) . f o r E a c h ( t = > { a . a d d ( t ) } ) , u ( t , a ) } ) } ) } ) ( t ) ; c o n s t s = r . c o n t e n t ; a ? f u n c t i o n ( t , e , a = n u l l ) { c o n s t { e l e m e n t : { c o n t e n t : r } , p a r t s : n } = t ; i f ( n u l l = = a ) r e t u r n v o i d r . a p p e n d C h i l d ( e ) ; c o n s t o = d o c u m e n t . c r e a t e T r e e W a l k e r ( r , 1 3 3 , n u l l , ! 1 ) ; l e t i = p ( n ) , s = 0 , l = - 1 ; f o r ( ; o . n e x t N o d e ( ) ; ) { f o r ( l + + , o . c u r r e n t N o d e = = = a & & ( s = d ( e ) , a . p a r e n t N o d e . i n s e r t B e f o r e ( e , a ) ) ; - 1 ! = = i & & n [ i ] . i n d e x = = = l ; ) { i f ( s > 0 ) { f o r ( ; - 1 ! = = i ; ) n [ i ] . i n d e x + = s , i = p ( n , i ) ; r e t u r n } i = p ( n , i ) } } } ( a , i , s . f i r s t C h i l d ) : s . i n s e r t B e f o r e ( i , s . f i r s t C h i l d ) , w i n d o w . S h a d y C S S . p r e p a r e T e m p l a t e S t y l e s ( r , t ) ; c o n s t l = s . q u e r y S e l e c t o r ( " s t y l e " ) ; i f ( w i n d o w . S h a d y C S S . n a t i v e S h a d o w & & n u l l ! = = l ) e . i n s e r t B e f o r e ( l . c l o n e N o d e ( ! 0 ) , e . f i r s t C h i l d ) ; e l s e i f ( a ) { s . i n s e r t B e f o r e ( i , s . f i r s t C h i l d ) ; c o n s t t = n e w S e t ; t . a d d ( i ) , u ( a , t ) } } ; w i n d o w . J S C o m p i l e r _ r e n a m e P r o p e r t y = ( t , e ) = > t ; c o n s t Y = { t o A t t r i b u t e ( t , e ) { s w i t c h ( e ) { c a s e B o o l e a n : r e t u r n t ? " " : n u l l ; c a s e O b j e c t : c a s e A r r a y : r e t u r n n u l l = = t ? t : J S O N . s t r i n g i f y ( t ) } r e t u r n t } , f r o m A t t r i b u t e ( t , e ) { s w i t c h ( e ) { c a s e B o o l e a n : r e t u r n n u l l ! = = t ; c a s e N u m b e r : r e t u r n n u l l = = = t ? n u l l : N u m b e r ( t ) ; c a s e O b j e c t : c a s e A r r a y : r e t u r n J S O N . p a r s e ( t ) } r e t u r n t } } , Z = ( t , e ) = > e ! = = t & & ( e = = e | | t = = t ) , A = { a t t r i b u t e : ! 0 , t y p e : S t r i n g , c o n v e r t e r : Y , r e f l e c t : ! 1 , h a s C h a n g e d : Z } ; c l a s s D e x t e n d s H T M L E l e m e n t { c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . _ u p d a t e S t a t e = 0 , t h i s . _ i n s t a n c e P r o p e r t i e s = v o i d 0 , t h i s . _ u p d a t e P r o m i s e = n e w P r o m i s e ( t = > t h i s . _ e n a b l e U p d a t i n g R e s o l v e r = t ) , t h i s . _ c h a n g e d P r o p e r t i e s = n e w M a p , t h i s . _ r e f l e c t i n g P r o p e r t i e s = v o i d 0 , t h i s . i n i t i a l i z e ( ) } s t a t i c g e t o b s e r v e d A t t r i b u t e s ( ) { t h i s . f i n a l i z e ( ) ; c o n s t t = [ ] ; r e t u r n t h i s . _ c l a s s P r o p e r t i e s . f o r E a c h ( ( e , a ) = > { c o n s t r = t h i s . _ a t t r i b u t e N a m e F o r P r o p e r t y ( a , e ) ; v o i d 0 ! = = r & & ( t h i s . _ a t t r i b u t e T o P r o p e r t y M a p . s e t ( r , a ) , t . p u s h ( r ) ) } ) , t } s t a t i c _ e n s u r e C l a s s P r o p e r t i e s ( ) { i f ( ! t h i s . h a s O w n P r o p e r t y ( J S C o m p i l e r _ r e n a m e P r o p e r t y ( " _ c l a s s P r o p e r t i e s " , t h i s ) ) ) { t h i s . _ c l a s s P r o p e r t i e s = n e w M a p ; c o n s t t = O b j e c t . g e t P r o t o t y p e O f ( t h i s ) . _ c l a s s P r o p e r t i e s ; v o i d 0 ! = = t & & t . f o r E a c h ( ( t , e ) = > t h i s . _ c l a s s P r o p e r t i e s . s e t ( e , t ) ) } } s t a t i c c r e a t e P r o p e r t y ( t , e = A ) { i f ( t h i s . _ e n s u r e C l a s s P r o p e r t i e s ( ) , t h i s . _ c l a s s P r o p e r t i e s . s e t ( t , e ) , e . n o A c c e s s o r | | t h i s . p r o t o t y p e . h a s O w n P r o p e r t y ( t ) ) r e t u r n ; c o n s t a = " s y m b o l " = = t y p e o f t ? S y m b o l ( ) : " _ _ " + t , r = t h i s . g e t P r o p e r t y D e s c r i p t o r ( t , a , e ) ; v o i d 0 ! = = r & & O b j e c t . d e f i n e P r o p e r t y ( t h i s . p r o t o t y p e , t , r ) } s t a t i c g e t P r o p e r t y D e s c r i p t o r ( t , e , a ) { r e t u r n { g e t ( ) { r e t u r n t h i s [ e ] } , s e t ( a ) { c o n s t r = t h i s [ t ] ; t h i s [ e ] = a , t h i s . _ r e q u e s t U p d a t e ( t , r ) } , c o n f i g u r a b l e : ! 0 , e n u m e r a b l e : ! 0 } } s t a t i c g e t P r o p e r t y O p t i o n s ( t ) { r e t u r n t h i s . _ c l a s s P r o p e r t i e s & & t h i s . _ c l a s s P r o p e r t i e s . g e t ( t ) | | A } s t a t i c f i n a l i z e ( ) { c o n s t t = O b j e c t . g e t P r o t o t y p e O f ( t h i s ) ; i f ( t . h a s O w n P r o p e r t y ( " f i n a l i z e d " ) | | t . f i n a l i z e ( ) , t h i s . f i n a l i z e d = ! 0 , t h i s . _ e n s u r e C l a s s P r o p e r t i e s ( ) , t h i s . _ a t t r i b u t e T o P r o p e r t y M a p = n e w M a p , t h i s . h a s O w n P r o p e r t y ( J S C o m p i l e r _ r e n a m e P r o p e r t y ( " p r o p e r t i e s " , t h i s ) ) ) { c o n s t t = t h i s . p r o p e r t i e s , e = [ . . . O b j e c t . g e t O w n P r o p e r t y N a m e s ( t ) , . . . " f u n c t i o n " = = t y p e o f O b j e c t . g e t O w n P r o p e r t y S y m b o l s ? O b j e c t . g e t O w n P r o p e r t y S y m b o l s ( t ) : [ ] ] ; f o r ( c o n s t a o f e ) t h i s . c r e a t e P r o p e r t y ( a , t [ a ] ) } } s t a t i c _ a t t r i b u t e N a m e F o r P r o p e r t y ( t , e ) { c o n s t a = e . a t t r i b u t e ; r e t u r n ! 1 = = = a ? v o i d 0 : " s t r i n g " = = t y p e o f a ? a : " s t r i n g " = = t y p e o f t ? t . t o L o w e
2020-06-03 20:36:46 +00:00
/ * *
@ license
Copyright ( c ) 2019 The Polymer Project Authors . All rights reserved .
This code may only be used under the BSD style license found at
http : //polymer.github.io/LICENSE.txt The complete set of authors may be found at
http : //polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http : //polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http : //polymer.github.io/PATENTS.txt
* /
const J = "adoptedStyleSheets" in Document . prototype && "replace" in CSSStyleSheet . prototype , I = Symbol ( ) ; class L { constructor ( t , e ) { if ( e !== I ) throw new Error ( "CSSResult is not constructable. Use `unsafeCSS` or `css` instead." ) ; this . cssText = t } get styleSheet ( ) { return void 0 === this . _styleSheet && ( J ? ( this . _styleSheet = new CSSStyleSheet , this . _styleSheet . replaceSync ( this . cssText ) ) : this . _styleSheet = null ) , this . _styleSheet } toString ( ) { return this . cssText } } const H = ( t , ... e ) => { const a = e . reduce ( ( e , a , r ) => e + ( t => { if ( t instanceof L ) return t . cssText ; if ( "number" == typeof t ) return t ; throw new Error ( ` Value passed to 'css' function must be a 'css' function result: ${ t } . Use 'unsafeCSS' to pass non-literal values, but \n take care to ensure page security. ` ) } ) ( a ) + t [ r + 1 ] , t [ 0 ] ) ; return new L ( a , I ) } ;
/ * *
* @ license
* Copyright ( c ) 2017 The Polymer Project Authors . All rights reserved .
* This code may only be used under the BSD style license found at
* http : //polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http : //polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http : //polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http : //polymer.github.io/PATENTS.txt
* /
2020-06-19 20:15:57 +00:00
( window . litElementVersions || ( window . litElementVersions = [ ] ) ) . push ( "2.3.1" ) ; const G = { } ; class Q extends D { static getStyles ( ) { return this . styles } static _getUniqueStyles ( ) { if ( this . hasOwnProperty ( JSCompiler _renameProperty ( "_styles" , this ) ) ) return ; const t = this . getStyles ( ) ; if ( void 0 === t ) this . _styles = [ ] ; else if ( Array . isArray ( t ) ) { const e = ( t , a ) => t . reduceRight ( ( t , a ) => Array . isArray ( a ) ? e ( a , t ) : ( t . add ( a ) , t ) , a ) , a = e ( t , new Set ) , r = [ ] ; a . forEach ( t => r . unshift ( t ) ) , this . _styles = r } else this . _styles = [ t ] } initialize ( ) { super . initialize ( ) , this . constructor . _getUniqueStyles ( ) , this . renderRoot = this . createRenderRoot ( ) , window . ShadowRoot && this . renderRoot instanceof window . ShadowRoot && this . adoptStyles ( ) } createRenderRoot ( ) { return this . attachShadow ( { mode : "open" } ) } adoptStyles ( ) { const t = this . constructor . _styles ; 0 !== t . length && ( void 0 === window . ShadyCSS || window . ShadyCSS . nativeShadow ? J ? this . renderRoot . adoptedStyleSheets = t . map ( t => t . styleSheet ) : this . _needsShimAdoptedStyleSheets = ! 0 : window . ShadyCSS . ScopingShim . prepareAdoptedCssText ( t . map ( t => t . cssText ) , this . localName ) ) } connectedCallback ( ) { super . connectedCallback ( ) , this . hasUpdated && void 0 !== window . ShadyCSS && window . ShadyCSS . styleElement ( this ) } update ( t ) { const e = this . render ( ) ; super . update ( t ) , e !== G && this . constructor . render ( e , this . renderRoot , { scopeName : this . localName , eventContext : this } ) , this . _needsShimAdoptedStyleSheets && ( this . _needsShimAdoptedStyleSheets = ! 1 , this . constructor . _styles . forEach ( t => { const e = document . createElement ( "style" ) ; e . textContent = t . cssText , this . renderRoot . appendChild ( e ) } ) ) } render ( ) { return G } } Q . finalized = ! 0 , Q . render = ( t , a , r ) => { if ( ! r || "object" != typeof r || ! r . scopeName ) throw new Error ( "The `scopeName` option is required." ) ; const n = r . scopeName , o = E . has ( a ) , i = W && 11 === a . nodeType && ! ! a . host , s = i && ! C . has ( n ) , l = s ? document . createDocumentFragment ( ) : a ; if ( ( ( t , a , r ) => { let n = E . get ( a ) ; void 0 === n && ( e ( a , a . firstChild ) , E . set ( a , n = new z ( Object . assign ( { templateFactory : O } , r ) ) ) , n . appendInto ( a ) ) , n . setValue ( t ) , n . commit ( ) } ) ( t , l , Object . assign ( { templateFactory : K ( n ) } , r ) ) , s ) { const t = E . get ( l ) ; E . delete ( l ) ; const r = t . value instanceof b ? t . value . template : void 0 ; F ( n , l , r ) , e ( a , a . firstChild ) , a . appendChild ( l ) , E . set ( a , t ) } ! o && i && window . ShadyCSS . styleElement ( a . host ) } ; var B = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g , $ = "[^\\s]+" , tt = /\[([^]*?)\]/gm ; function et ( t , e ) { for ( var a = [ ] , r = 0 , n = t . length ; r < n ; r ++ ) a . push ( t [ r ] . substr ( 0 , e ) ) ; return a } var at = function ( t ) { return function ( e , a ) { var r = a [ t ] . map ( ( function ( t ) { return t . toLowerCase ( ) } ) ) . indexOf ( e . toLowerCase ( ) ) ; return r > - 1 ? r : null } } ; function rt ( t ) { for ( var e = [ ] , a = 1 ; a < arguments . length ; a ++ ) e [ a - 1 ] = arguments [ a ] ; for ( var r = 0 , n = e ; r < n . length ; r ++ ) { var o = n [ r ] ; for ( var i in o ) t [ i ] = o [ i ] } return t } var nt = [ "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" ] , ot = [ "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ] , it = et ( ot , 3 ) , st = { dayNamesShort : et ( nt , 3 ) , dayNames : nt , monthNamesShort : it , monthNames : ot , amPm : [ "am" , "pm" ] , DoFn : function ( t ) { return t + [ "th" , "st" , "nd" , "rd" ] [ t % 10 > 3 ? 0 : ( t - t % 10 != 10 ? 1 : 0 ) * t % 10 ] } } , lt = rt ( { } , st ) , ct = function ( t , e ) { for ( void 0 === e && ( e = 2 ) , t = String ( t ) ; t . length < e ; ) t = "0" + t ; return t } , ut = { D : function ( t ) { return String ( t . getDate ( ) ) } , DD : function ( t ) { return ct ( t . getDate ( ) ) } , Do : function ( t , e ) { return e . DoFn ( t . getDate ( ) ) } , d : function ( t ) { return String ( t . getDay ( ) ) } , dd : function ( t ) { return ct ( t . getDay ( ) ) } , ddd : function ( t , e ) { return e . dayNamesShort [ t . getDay ( ) ] } , dddd : function ( t , e ) { return e . dayNames [ t . getDay ( ) ] } , M : function ( t ) { return String ( t . getMonth ( ) + 1 ) } , MM : function ( t ) { return ct ( t . getMonth ( ) + 1 ) } , MMM : function ( t , e ) { return e . monthNamesShort [ t . getMonth ( ) ] } , MMMM : function ( t , e ) { return e . monthNames [ t . getMonth ( ) ] } , YY : function ( t ) { return ct ( String ( t . getFullYear ( ) ) , 4 ) . substr ( 2 ) } , YYYY : function ( t ) { return ct ( t . getFullYear ( ) , 4 ) } , h : function ( t ) { return String ( t . getHours ( ) % 12 || 12 ) } , hh : function ( t ) { return ct ( t . getHours ( ) % 12 || 12 ) } , H : function ( t ) { return String ( t . getHours ( ) ) } , HH : function ( t ) { return ct ( t . getHours ( ) ) } , m : function ( t ) { return String ( t . getMinutes ( ) ) } , mm : function ( t ) { return ct ( t . getMinutes ( ) ) } , s : function ( t ) { return String ( t . getSeconds ( ) ) } , ss : function ( t ) { return ct ( t . getSeco
2020-06-03 20:36:46 +00:00
< div class = "card-config" >
< paper - dropdown - menu
2020-06-19 20:15:57 +00:00
label = "${Re(" editor . entity ")}"
2020-06-03 20:36:46 +00:00
@ value - changed = $ { this . _valueChanged }
. configValue = $ { "entity" }
>
< paper - listbox
slot = "dropdown-content"
. selected = $ { t . indexOf ( this . _entity ) }
>
2020-06-19 20:15:57 +00:00
$ { t . map ( t => M ` <paper-item> ${ t } </paper-item> ` ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - l i s t b o x >
< / p a p e r - d r o p d o w n - m e n u >
< paper - dropdown - menu
2020-06-19 20:15:57 +00:00
label = "${Re(" editor . entity ")}"
2020-06-03 20:36:46 +00:00
@ value - changed = $ { this . _valueChanged }
. configValue = $ { "map" }
>
< paper - listbox
slot = "dropdown-content"
. selected = $ { e . indexOf ( this . _map ) }
>
2020-06-19 20:15:57 +00:00
$ { e . map ( t => M ` <paper-item> ${ t } </paper-item> ` ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - l i s t b o x >
< / p a p e r - d r o p d o w n - m e n u >
< paper - input
2020-06-19 20:15:57 +00:00
label = "${Re(" editor . image ")}"
2020-06-03 20:36:46 +00:00
. value = $ { this . _image }
. configValue = $ { "image" }
@ value - changed = $ { this . _valueChanged }
> < / p a p e r - i n p u t >
< ha - switch
style = "margin: 10px auto;"
2020-06-19 20:15:57 +00:00
aria - label = $ { Re ( this . _compact _view ? "editor.compact_view_aria_label_off" : "editor.compact_view_aria_label_on" ) }
2020-06-03 20:36:46 +00:00
. checked = $ { ! 1 !== this . _compact _view }
. configValue = $ { "compact_view" }
@ change = $ { this . _valueChanged }
>
2020-06-19 20:15:57 +00:00
$ { Re ( "editor.compact_view" ) }
2020-06-03 20:36:46 +00:00
< / h a - s w i t c h >
< ha - switch
style = "margin: 10px auto;"
2020-06-19 20:15:57 +00:00
aria - label = $ { Re ( this . _show _name ? "editor.show_name_aria_label_off" : "editor.show_name_aria_label_on" ) }
2020-06-03 20:36:46 +00:00
. checked = $ { ! 1 !== this . _show _name }
. configValue = $ { "show_name" }
@ change = $ { this . _valueChanged }
>
2020-06-19 20:15:57 +00:00
$ { Re ( "editor.show_name" ) }
2020-06-03 20:36:46 +00:00
< / h a - s w i t c h >
< ha - switch
style = "margin: 10px auto;"
2020-06-19 20:15:57 +00:00
aria - label = $ { Re ( this . _show _status ? "editor.show_status_aria_label_off" : "editor.show_status_aria_label_on" ) }
2020-06-03 20:36:46 +00:00
. checked = $ { ! 1 !== this . _show _status }
. configValue = $ { "show_status" }
@ change = $ { this . _valueChanged }
>
2020-06-19 20:15:57 +00:00
$ { Re ( "editor.show_status" ) }
2020-06-03 20:36:46 +00:00
< / h a - s w i t c h >
< ha - switch
style = "margin: 10px auto;"
2020-06-19 20:15:57 +00:00
aria - label = $ { Re ( this . _show _name ? "editor.show_toolbar_aria_label_off" : "editor.show_toolbar_aria_label_on" ) }
2020-06-03 20:36:46 +00:00
. checked = $ { ! 1 !== this . _show _toolbar }
. configValue = $ { "show_toolbar" }
@ change = $ { this . _valueChanged }
>
2020-06-19 20:15:57 +00:00
$ { Re ( "editor.show_toolbar" ) }
2020-06-03 20:36:46 +00:00
< / h a - s w i t c h >
< strong >
2020-06-19 20:15:57 +00:00
$ { Re ( "editor.code_only_note" ) }
2020-06-03 20:36:46 +00:00
< / s t r o n g >
< / d i v >
` }_valueChanged(t){if(!this._config||!this.hass)return;const e=t.target;this["_"+e.configValue]!==e.value&&(e.configValue&&(""===e.value?delete this._config[e.configValue]:this._config={...this._config,[e.configValue]:void 0!==e.checked?e.checked:e.value}),yt(this,"config-changed",{config:this._config}))}static get styles(){return H `
. card - config paper - dropdown - menu {
width : 100 % ;
}
2020-06-19 20:15:57 +00:00
` }});var Te=H `
2020-06-03 20:36:46 +00:00
: host {
display : flex ;
flex : 1 ;
flex - direction : column ;
}
ha - card {
flex - direction : column ;
flex : 1 ;
position : relative ;
padding : 0 px ;
border - radius : 4 px ;
overflow : hidden ;
}
. preview {
background : var ( -- primary - color ) ;
cursor : pointer ;
overflow : hidden ;
position : relative ;
}
. preview . not - available {
filter : grayscale ( 1 ) ;
}
. map {
display : block ;
2020-06-19 20:15:57 +00:00
max - width : 100 % ;
2020-06-03 20:36:46 +00:00
image - rendering : crisp - edges ;
}
@ keyframes cleaning {
0 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
5 % {
transform : rotate ( 0 ) translate ( 0 , - 10 px ) ;
}
10 % {
transform : rotate ( 0 ) translate ( 0 , 5 px ) ;
}
15 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
/* Turn left */
20 % {
transform : rotate ( 30 deg ) translate ( 0 ) ;
}
25 % {
transform : rotate ( 30 deg ) translate ( 0 , - 10 px ) ;
}
30 % {
transform : rotate ( 30 deg ) translate ( 0 , 5 px ) ;
}
35 % {
transform : rotate ( 30 deg ) translate ( 0 ) ;
}
40 % {
transform : rotate ( 0 ) translate ( 0 ) ;
}
/* Turn right */
45 % {
transform : rotate ( - 30 deg ) translate ( 0 ) ;
}
50 % {
transform : rotate ( - 30 deg ) translate ( 0 , - 10 px ) ;
}
55 % {
transform : rotate ( - 30 deg ) translate ( 0 , 5 px ) ;
}
60 % {
transform : rotate ( - 30 deg ) translate ( 0 ) ;
}
70 % {
transform : rotate ( 0 deg ) translate ( 0 ) ;
}
/* Staying still */
100 % {
transform : rotate ( 0 deg ) ;
}
}
@ keyframes returning {
0 % {
transform : rotate ( 0 ) ;
}
25 % {
transform : rotate ( 10 deg ) ;
}
50 % {
transform : rotate ( 0 ) ;
}
75 % {
transform : rotate ( - 10 deg ) ;
}
100 % {
transform : rotate ( 0 ) ;
}
}
. vacuum {
display : block ;
max - width : 90 % ;
max - height : 200 px ;
image - rendering : crisp - edges ;
margin : 30 px auto 20 px auto ;
}
. vacuum . cleaning {
animation : cleaning 5 s linear infinite ;
}
. vacuum . returning {
animation : returning 2 s linear infinite ;
}
. vacuum . paused {
opacity : 100 % ;
}
. vacuum . docked {
opacity : 50 % ;
}
. fill - gap {
flex - grow : 1 ;
}
. header {
height : 40 px ;
display : flex ;
flex - direction : row ;
justify - content : space - between ;
align - items : center ;
color : var ( -- text - primary - color ) ;
}
. battery {
text - align : right ;
font - weight : bold ;
padding : 8 px ;
}
. source {
text - align : center ;
}
. status {
display : flex ;
align - items : center ;
justify - content : center ;
}
. status - text {
color : var ( -- text - primary - color ) ;
white - space : nowrap ;
text - overflow : ellipsis ;
overflow : hidden ;
margin - left : calc ( 20 px + 9 px ) ; /* size + margin of spinner */
}
. status paper - spinner {
min - width : 20 px ;
width : 20 px ;
height : 20 px ;
margin - left : 9 px ;
}
. vacuum - name {
text - align : center ;
font - weight : bold ;
color : var ( -- text - primary - color ) ;
font - size : 16 px ;
}
. not - available {
text - align : center ;
color : var ( -- text - primary - color ) ;
font - size : 16 px ;
}
. metadata {
margin : 10 px auto ;
}
. stats {
border - top : 1 px solid rgba ( 255 , 255 , 255 , 0.2 ) ;
display : flex ;
flex - direction : row ;
justify - content : space - evenly ;
color : var ( -- text - primary - color ) ;
}
. stats - block {
margin : 10 px 0 px ;
text - align : center ;
border - right : 1 px solid rgba ( 255 , 255 , 255 , 0.2 ) ;
flex - grow : 1 ;
}
. stats - block : last - child {
border : 0 px ;
}
. stats - hours {
font - size : 20 px ;
font - weight : bold ;
}
ha - icon {
color : # fff ;
}
. toolbar {
background : var ( -- lovelace - background , var ( -- primary - background - color ) ) ;
min - height : 30 px ;
display : flex ;
flex - direction : row ;
justify - content : space - evenly ;
}
. toolbar ha - icon - button {
color : var ( -- primary - color ) ;
flex - direction : column ;
width : 44 px ;
height : 44 px ;
-- mdc - icon - button - size : 44 px ;
margin : 5 px 0 ;
}
. toolbar ha - icon - button : first - child {
margin - left : 5 px ;
}
. toolbar ha - icon - button : last - child {
margin - right : 5 px ;
}
. toolbar paper - button {
color : var ( -- primary - color ) ;
flex - direction : column ;
margin - right : 10 px ;
padding : 15 px 10 px ;
cursor : pointer ;
}
. toolbar ha - icon - button : active ,
. toolbar paper - button : active {
opacity : 0.4 ;
background : rgba ( 0 , 0 , 0 , 0.1 ) ;
}
. toolbar paper - button {
color : var ( -- primary - color ) ;
flex - direction : row ;
}
. toolbar ha - icon {
color : var ( -- primary - color ) ;
padding - right : 15 px ;
}
2020-06-19 20:15:57 +00:00
` ;const Ne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeoAAAHqCAQAAABhZMWxAAAgAElEQVR42uydd3xUVdrHv3dm0ggBEggECL33Ih0UCyiKdW2ra0NXiohtXVbfLbLdVVfWRSFh144Nu+KKUpTepfdOQiCUhJA+mZn7/jHn3kzCzDCZeyfJzJyfH5lzc2duO+d3n+c85ym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qUV6bQh0tzNi8kimxyhgcTQijb16C43bnqzhUe45k7umrtdkrq+U/ox5QXd1q12WfHYwNh6YMEp4TCHOCXMSym0IZ20iDZRqpwkmyyhjyg0pyMd6oVKbi/690/7L9UevlKuTp/7b0nq+juPbq6+qV6nbcUcmVTQp84Xr0o5wkFyUQEbbWhDOtFU0KOEbLLIwgEotKAT7an77BPbt2Y2riwVoPxPmRA5/mYRRepJ49S3KvOXdFz+q8F1m7ukjCMc4oRO5460jSAP65rByTEO6dRuSUfaeyaDqwM4Sv+54dBl+mau8kDmQknqeoVpcfbn1cd1lSr/nn11aetWyWIP2bgAK+l0pB0ylQo4OMohsnECFtLpTps6HX0r183rqqeCVpVXYp+JhGWuCCH1pJ68r+qKdtKW37ZIbllX11LIXvZRIoZtR9ohE6lURYWgtgtoQFe61aFjTf6Jv+YWVjonbeXuzF2S1PVhJv1z138146riGLpywmV1s4ri4ih7yEEFkulGl7AKgKhtlLOfveQDCq3oTru6Wvpyvbl83SjdRanY8suMDyWp6xQzbDkv8KS2FXNs2vluveviOgrYw37KABsd6Va14q2ET+Syl0M4gHi60J26cSbYu
2020-06-03 20:36:46 +00:00
< paper - menu - button
slot = "dropdown-trigger"
. horizontalAlign = $ { "right" }
. verticalAlign = $ { "top" }
. verticalOffset = $ { 40 }
. noAnimations = $ { ! 0 }
@ click = "${t=>t.stopPropagation()}"
>
< paper - button slot = "dropdown-trigger" >
< ha - icon icon = "mdi:fan" > < / h a - i c o n >
< span show = $ { ! 0 } >
2020-06-19 20:15:57 +00:00
$ { Re ( "source." + t ) || t }
2020-06-03 20:36:46 +00:00
< / s p a n >
< / p a p e r - b u t t o n >
< paper - listbox
slot = "dropdown-content"
selected = $ { a }
@ click = "${t=>this.handleSpeed(t)}"
>
2020-06-19 20:15:57 +00:00
$ { e . map ( t => M ` <paper-item value= ${ t }
> $ { Re ( "source." + t ) || t } < / p a p e r - i t e m
2020-06-03 20:36:46 +00:00
> ` )}
< / p a p e r - l i s t b o x >
< / p a p e r - m e n u - b u t t o n >
2020-06-19 20:15:57 +00:00
` }renderMapOrImage(t){return this.compactView?M ` ` :this.map?M ` < img class = "map" src = "${this.mapUrl}" / > ` :this.image?M ` < img class = "vacuum ${t}" src = "${this.image}" / > ` :M ` ` }renderStats(t){const{stats:e={}}=this.config;return(e[t]||e.default||[]).map(({attribute:t,unit:e,subtitle:a})=>M `
2020-06-03 20:36:46 +00:00
< div class = "stats-block" >
< span class = "stats-hours" > $ { this . entity . attributes [ t ] } < / s p a n >
$ { e }
< div class = "stats-subtitle" > $ { a } < / d i v >
< / d i v >
2020-06-19 20:15:57 +00:00
` )}renderName(){const{friendly_name:t}=this.getAttributes(this.entity);return this.showName?M `
2020-06-03 20:36:46 +00:00
< div class = "vacuum-name" >
$ { t }
< / d i v >
2020-06-19 20:15:57 +00:00
` :M ` ` }renderStatus(){const{status:t}=this.getAttributes(this.entity),e=Re("status."+t)||t;return this.showStatus?M `
2020-06-03 20:36:46 +00:00
< div class = "status" >
< span class = "status-text" alt = $ { e } >
$ { e }
< / s p a n >
< paper - spinner ? active = $ { this . requestInProgress } > < / p a p e r - s p i n n e r >
< / d i v >
2020-06-19 20:15:57 +00:00
` :M ` ` }renderToolbar(t){if(!this.showToolbar)return M ` ` ;switch(t){case"cleaning":return M `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
< paper - button @ click = "${()=>this.callService(" pause ")}" >
< ha - icon icon = "hass:pause" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.pause" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< paper - button @ click = "${()=>this.callService(" stop ")}" >
< ha - icon icon = "hass:stop" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.stop" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< paper - button @ click = "${()=>this.callService(" return _to _base ")}" >
< ha - icon icon = "hass:home-map-marker" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.return_to_base" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2020-06-19 20:15:57 +00:00
` ;case"paused":return M `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
< paper - button @ click = "${()=>this.callService(" start ")}" >
< ha - icon icon = "hass:play" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.continue" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< paper - button @ click = "${()=>this.callService(" return _to _base ")}" >
< ha - icon icon = "hass:home-map-marker" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.return_to_base" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2020-06-19 20:15:57 +00:00
` ;case"returning":return M `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
< paper - button @ click = "${()=>this.callService(" start ")}" >
< ha - icon icon = "hass:play" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.continue" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< paper - button @ click = "${()=>this.callService(" pause ")}" >
< ha - icon icon = "hass:pause" > < / h a - i c o n >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.pause" ) }
2020-06-03 20:36:46 +00:00
< / p a p e r - b u t t o n >
< / d i v >
2020-06-19 20:15:57 +00:00
` ;case"docked":case"idle":default:{const{actions:e=[]}=this.config,a=e.map(({name:t,service:e,icon:a,service_data:r})=>M ` < ha - icon - button
2020-06-03 20:36:46 +00:00
icon = "${a}"
title = "${t}"
@ click = "${()=>{const[t,a]=e.split(" . ");this.hass.callService(t,a,r)}}"
2020-06-19 20:15:57 +00:00
> < / h a - i c o n - b u t t o n > ` ) , r = M `
2020-06-03 20:36:46 +00:00
< ha - icon - button
icon = "hass:home-map-marker"
2020-06-19 20:15:57 +00:00
title = "${Re(" common . return _to _base ")}"
2020-06-03 20:36:46 +00:00
@ click = "${()=>this.callService(" return _to _base ")}"
>
< / h a - i c o n - b u t t o n >
2020-06-19 20:15:57 +00:00
` ;return M `
2020-06-03 20:36:46 +00:00
< div class = "toolbar" >
< ha - icon - button
icon = "hass:play"
2020-06-19 20:15:57 +00:00
title = "${Re(" common . start ")}"
2020-06-03 20:36:46 +00:00
@ click = "${()=>this.callService(" start ")}"
>
< / h a - i c o n - b u t t o n >
< ha - icon - button
icon = "mdi:crosshairs-gps"
2020-06-19 20:15:57 +00:00
title = "${Re(" common . locate ")}"
2020-06-03 20:36:46 +00:00
@ click = "${()=>this.callService(" locate ",!1)}"
>
< / h a - i c o n - b u t t o n >
$ { "idle" === t ? r : "" }
< div class = "fill-gap" > < / d i v >
$ { a }
< / d i v >
2020-06-19 20:15:57 +00:00
` }}}render(){if(!this.entity)return M `
2020-06-03 20:36:46 +00:00
< ha - card >
< div class = "preview not-available" >
< div class = "metadata" >
< div class = "not-available" >
2020-06-19 20:15:57 +00:00
$ { Re ( "common.not_available" ) }
2020-06-03 20:36:46 +00:00
< / d i v >
< div >
< / d i v >
< / h a - c a r d >
2020-06-19 20:15:57 +00:00
` ;const{state:t}=this.entity,{battery_level:e,battery_icon:a}=this.getAttributes(this.entity);return M `
2020-06-03 20:36:46 +00:00
< ha - card >
< div
class = "preview"
@ click = "${()=>this.handleMore()}"
? more - info = "true"
>
< div class = "header" >
< div class = "source" >
$ { this . renderSource ( ) }
< / d i v >
< div class = "battery" >
$ { e } % < ha - icon icon = "${a}" > < / h a - i c o n >
< / d i v >
< / d i v >
$ { this . renderMapOrImage ( t ) }
< div class = "metadata" >
$ { this . renderName ( ) } $ { this . renderStatus ( ) }
< / d i v >
< div class = "stats" >
$ { this . renderStats ( t ) }
< / d i v >
< / d i v >
$ { this . renderToolbar ( t ) }
< / h a - c a r d >
2020-06-19 20:15:57 +00:00
` }}),window.customCards=window.customCards||[],window.customCards.push({preview:!0,type:"vacuum-card",name:Re("common.name"),description:Re("common.description")});