hassio-conf/www/plugins/vacuum-card.js

5 lines
98 KiB
JavaScript
Raw Normal View History

2024-10-17 19:45:45 +00:00
function t(t,e,a,o){var i,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,a,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(n<3?i(r):n>3?i(e,a,r):i(e,a))||r);return n>3&&r&&Object.defineProperty(e,a,r),r}const e=window,a=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),i=new WeakMap;class n{constructor(t,e,a){if(this._$cssResult$=!0,a!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(a&&void 0===t){const a=void 0!==e&&1===e.length;a&&(t=i.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),a&&i.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const a=1===t.length?t[0]:e.reduce(((e,a,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+t[o+1]),t[0]);return new n(a,t,o)},s=a?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const a of t.cssRules)e+=a.cssText;return(t=>new n("string"==typeof t?t:t+"",void 0,o))(e)})(t):t;var l;const c=window,u=c.trustedTypes,_=u?u.emptyScript:"",d=c.reactiveElementPolyfillSupport,h={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let a=t;switch(e){case Boolean:a=null!==t;break;case Number:a=null===t?null:Number(t);break;case Object:case Array:try{a=JSON.parse(t)}catch(t){a=null}}return a}},m=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:m};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,a)=>{const o=this._$Ep(a,e);void 0!==o&&(this._$Ev.set(o,a),t.push(o))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const a="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,a,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,a){return{get(){return this[e]},set(o){const i=this[t];this[e]=o,this.requestUpdate(t,i,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const a of e)this.createProperty(a,t[a])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const a=new Set(t.flat(1/0).reverse());for(const t of a)e.unshift(s(t))}else void 0!==t&&e.push(s(t));return e}static _$Ep(t,e){const a=e.attribute;return!1===a?void 0:"string"==typeof a?a:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,a;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(a=t.hostConnected)||void 0===a||a.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach
--ha-card-background,
var(--card-background-color, white)
);--vc-primary-text-color:var(--primary-text-color);--vc-secondary-text-color:var(--secondary-text-color);--vc-icon-color:var(--secondary-text-color);--vc-toolbar-background:var(--vc-background);--vc-toolbar-text-color:var(--secondary-text-color);--vc-toolbar-icon-color:var(--secondary-text-color);--vc-divider-color:var(--entities-divider-color, var(--divider-color));--vc-spacing:10px;display:flex;flex:1;flex-direction:column}ha-card{flex-direction:column;flex:1;position:relative;overflow:hidden}.preview{background:var(--vc-background);position:relative;text-align:center}.preview.not-available{filter:grayscale(1)}.header{display:flex;justify-content:space-between}.tips{display:flex;gap:var(--vc-spacing);flex-grow:1;flex-wrap:wrap;padding:var(--vc-spacing)}.tips .tip{cursor:pointer}.map{max-width:95%;image-rendering:crisp-edges;cursor:pointer}@keyframes cleaning{0%{transform:rotate(0) translate(0)}5%{transform:rotate(0) translate(0,-10px)}10%{transform:rotate(0) translate(0,5px)}15%{transform:rotate(0) translate(0)}20%{transform:rotate(30deg) translate(0)}25%{transform:rotate(30deg) translate(0,-10px)}30%{transform:rotate(30deg) translate(0,5px)}35%{transform:rotate(30deg) translate(0)}40%{transform:rotate(0) translate(0)}45%{transform:rotate(-30deg) translate(0)}50%{transform:rotate(-30deg) translate(0,-10px)}55%{transform:rotate(-30deg) translate(0,5px)}60%{transform:rotate(-30deg) translate(0)}70%{transform:rotate(0) translate(0)}100%{transform:rotate(0)}}@keyframes returning{0%{transform:rotate(0)}25%{transform:rotate(10deg)}50%{transform:rotate(0)}75%{transform:rotate(-10deg)}100%{transform:rotate(0)}}.vacuum{display:block;max-width:90%;max-height:200px;image-rendering:crisp-edges;margin:var(--vc-spacing) auto;cursor:pointer;filter:brightness(.9)}.vacuum.auto,.vacuum.cleaning,.vacuum.edge,.vacuum.on,.vacuum.single_room,.vacuum.spot{animation:cleaning 5s linear infinite}.vacuum.returning{animation:returning 2s linear infinite}.vacuum.paused{opacity:1}.vacuum.docked{opacity:.5}.fill-gap{flex-grow:1}.more-info ha-icon{display:flex}.status{display:flex;align-items:center;justify-content:center;direction:ltr}.status-text{color:var(--vc-secondary-text-color);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-left:calc(28px + var(--vc-spacing))}.status mwc-circular-progress{--mdc-theme-primary:var(--vc-secondary-text-color)!important;margin-left:var(--vc-spacing)}.vacuum-name{text-align:center;font-weight:700;color:var(--vc-primary-text-color);font-size:16px}.not-available .offline{text-align:center;color:var(--vc-primary-text-color);font-size:16px}.metadata{margin:var(--vc-spacing) auto}.stats{border-top:1px solid var(--vc-divider-color);display:flex;flex-direction:row;justify-content:space-evenly;color:var(--vc-secondary-text-color)}.stats-block{cursor:pointer;padding:var(--vc-spacing) 0;text-align:center;border-right:1px solid var(--vc-divider-color);flex-grow:1}.stats-block:last-of-type{border-right:0}.stats-value{font-size:20px;color:var(--vc-primary-text-color)}ha-icon{color:var(--vc-icon-color)}.toolbar{background:var(--vc-toolbar-background);min-height:30px;display:flex;flex-direction:row;flex-flow:row wrap;flex-wrap:wrap;justify-content:space-evenly;padding:5px;border-top:1px solid var(--vc-divider-color)}.toolbar ha-icon-button{color:var(--vc-toolbar-text-color);flex-direction:column;width:44px;height:44px;--mdc-icon-button-size:44px}.toolbar paper-button{color:var(--vc-toolbar-text-color);display:flex;align-items:center;margin-right:10px;padding:15px 10px;cursor:pointer}.toolbar paper-button ha-icon{margin-right:5px;color:var(--vc-toolbar-icon-color)}.toolbar ha-icon{color:var(--vc-toolbar-icon-color);display:flex}.icon-title{display:inline-block;vertical-align:middle;padding:0 3px}`;Xn(Qn);var tr;!function(t="ha-template"){customElements.get(t)||customElements.define(t,mt)}();console.info("%c VACUUM-CARD %c 2.10.0","color: white; background: blue; font-weight: 700;","color: blue; background: white; font-weight: 700;"),customElements.get("ha-icon-button")||customElements.define("ha-icon-button",c