(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[7071],{45890:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});const r=i(15652).iv`
  ha-switch {
    padding: 16px 6px;
  }
  .side-by-side {
    display: flex;
  }
  .side-by-side > * {
    flex: 1;
    padding-right: 8px;
  }
  .side-by-side > *:last-child {
    flex: 1;
    padding-right: 0;
  }
  .suffix {
    margin: 0 8px;
  }
`},87071:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HuiGraphFooterEditor:()=>_});i(8878),i(30879);var r=i(15652),n=i(4268),o=i(47181),a=(i(74535),i(83927),i(43709),i(48626)),s=i(45890);function c(){c=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach((function(i){t.forEach((function(t){t.kind===i&&"own"===t.placement&&this.defineClassElement(e,t)}),this)}),this)},initializeClassElements:function(e,t){var i=e.prototype;["method","field"].forEach((function(r){t.forEach((function(t){var n=t.placement;if(t.kind===r&&("static"===n||"prototype"===n)){var o="static"===n?e:i;this.defineClassElement(o,t)}}),this)}),this)},defineClassElement:function(e,t){var i=t.descriptor;if("field"===t.kind){var r=t.initializer;i={enumerable:i.enumerable,writable:i.writable,configurable:i.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,i)},decorateClass:function(e,t){var i=[],r=[],n={static:[],prototype:[],own:[]};if(e.forEach((function(e){this.addElementPlacement(e,n)}),this),e.forEach((function(e){if(!f(e))return i.push(e);var t=this.decorateElement(e,n);i.push(t.element),i.push.apply(i,t.extras),r.push.apply(r,t.finishers)}),this),!t)return{elements:i,finishers:r};var o=this.decorateConstructor(i,t);return r.push.apply(r,o.finishers),o.finishers=r,o},addElementPlacement:function(e,t,i){var r=t[e.placement];if(!i&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var i=[],r=[],n=e.decorators,o=n.length-1;o>=0;o--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),c=this.toElementFinisherExtras((0,n[o])(s)||s);e=c.element,this.addElementPlacement(e,t),c.finisher&&r.push(c.finisher);var l=c.extras;if(l){for(var d=0;d<l.length;d++)this.addElementPlacement(l[d],t);i.push.apply(i,l)}}return{element:e,finishers:r,extras:i}},decorateConstructor:function(e,t){for(var i=[],r=t.length-1;r>=0;r--){var n=this.fromClassDescriptor(e),o=this.toClassDescriptor((0,t[r])(n)||n);if(void 0!==o.finisher&&i.push(o.finisher),void 0!==o.elements){e=o.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:i}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){var t;if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?y(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t}),this)},toElementDescriptor:function(e){var t=String(e.kind);if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var i=p(e.key),r=String(e.placement);if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var n=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var o={kind:t,key:i,placement:r,descriptor:Object.assign({},n)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(n,"get","The property descriptor of a field descriptor"),this.disallowProperty(n,"set","The property descriptor of a field descriptor"),this.disallowProperty(n,"value","The property descriptor of a field descriptor"),o.initializer=e.initializer),o},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:h(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=String(e.kind);if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var i=h(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:i}},runClassFinishers:function(e,t){for(var i=0;i<t.length;i++){var r=(0,t[i])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,i){if(void 0!==e[t])throw new TypeError(i+" can't have a ."+t+" property.")}};return e}function l(e){var t,i=p(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:i,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function d(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function f(e){return e.decorators&&e.decorators.length}function u(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function h(e,t){var i=e[t];if(void 0!==i&&"function"!=typeof i)throw new TypeError("Expected '"+t+"' to be a function");return i}function p(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}const m=["sensor"];let _=function(e,t,i,r){var n=c();if(r)for(var o=0;o<r.length;o++)n=r[o](n);var a=t((function(e){n.initializeInstanceElements(e,s.elements)}),i),s=n.decorateClass(function(e){for(var t=[],i=function(e){return"method"===e.kind&&e.key===o.key&&e.placement===o.placement},r=0;r<e.length;r++){var n,o=e[r];if("method"===o.kind&&(n=t.find(i)))if(u(o.descriptor)||u(n.descriptor)){if(f(o)||f(n))throw new ReferenceError("Duplicated methods ("+o.key+") can't be decorated.");n.descriptor=o.descriptor}else{if(f(o)){if(f(n))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+o.key+").");n.decorators=o.decorators}d(o,n)}else t.push(o)}return t}(a.d.map(l)),e);return n.initializeClassElements(a.F,s.elements),n.runClassFinishers(a.F,s.finishers)}([(0,r.Mo)("hui-graph-footer-editor")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.sz)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){(0,n.hu)(e,a.gg),this._config=e}},{kind:"get",key:"_entity",value:function(){return this._config.entity||""}},{kind:"get",key:"_detail",value:function(){var e;return null!==(e=this._config.detail)&&void 0!==e?e:1}},{kind:"get",key:"_hours_to_show",value:function(){return this._config.hours_to_show||24}},{kind:"method",key:"render",value:function(){return this.hass&&this._config?r.dy`
      <div class="card-config">
        <ha-entity-picker
          allow-custom-entity
          .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.entity")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.required")})"
          .hass=${this.hass}
          .value=${this._entity}
          .configValue=${"entity"}
          .includeDomains=${m}
          @change=${this._valueChanged}
        ></ha-entity-picker>
        <div class="side-by-side">
          <ha-formfield
            label=${this.hass.localize("ui.panel.lovelace.editor.card.sensor.show_more_detail")}
          >
            <ha-switch
              .checked=${2===this._detail}
              .configValue=${"detail"}
              @change=${this._change}
            ></ha-switch>
          </ha-formfield>
          <paper-input
            type="number"
            .label="${this.hass.localize("ui.panel.lovelace.editor.card.generic.hours_to_show")} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})"
            .value=${this._hours_to_show}
            .configValue=${"hours_to_show"}
            @value-changed=${this._valueChanged}
          ></paper-input>
        </div>
      </div>
    `:r.dy``}},{kind:"method",key:"_change",value:function(e){if(!this._config||!this.hass)return;const t=e.target.checked?2:1;this._detail!==t&&(this._config={...this._config,detail:t},(0,o.B)(this,"config-changed",{config:this._config}))}},{kind:"method",key:"_valueChanged",value:function(e){if(!this._config||!this.hass)return;const t=e.target;if(this[`_${t.configValue}`]!==t.value){if(t.configValue)if(""===t.value||"number"===t.type&&isNaN(Number(t.value)))this._config={...this._config},delete this._config[t.configValue];else{let e=t.value;"number"===t.type&&(e=Number(e)),this._config={...this._config,[t.configValue]:e}}(0,o.B)(this,"config-changed",{config:this._config})}}},{kind:"get",static:!0,key:"styles",value:function(){return s.A}}]}}),r.oi)},51598:(e,t,i)=>{"use strict";i.d(t,{fJ:()=>n,KA:()=>b});var r=i(4268);const n=(0,r.D8)(((e,t)=>t.branch[0][t.path[0]]&&l[t.branch[0][t.path[0]].action]||d)),o=(0,r.Ry)({user:(0,r.Z_)()}),a=(0,r.G0)([(0,r.O7)(),(0,r.Ry)({text:(0,r.jt)((0,r.Z_)()),excemptions:(0,r.jt)((0,r.IX)(o))})]),s=(0,r.Ry)({action:(0,r.i0)("url"),url_path:(0,r.Z_)(),confirmation:(0,r.jt)(a)}),c=(0,r.Ry)({action:(0,r.i0)("call-service"),service:(0,r.Z_)(),service_data:(0,r.jt)((0,r.Ry)()),target:(0,r.jt)((0,r.Ry)({entity_id:(0,r.jt)((0,r.G0)([(0,r.Z_)(),(0,r.IX)((0,r.Z_)())])),device_id:(0,r.jt)((0,r.G0)([(0,r.Z_)(),(0,r.IX)((0,r.Z_)())])),area_id:(0,r.jt)((0,r.G0)([(0,r.Z_)(),(0,r.IX)((0,r.Z_)())]))})),confirmation:(0,r.jt)(a)}),l={url:s,navigate:(0,r.Ry)({action:(0,r.i0)("navigate"),navigation_path:(0,r.Z_)(),confirmation:(0,r.jt)(a)}),"call-service":c},d=(0,r.Ry)({action:(0,r.kE)(["none","toggle","more-info","call-service","url","navigate"]),confirmation:(0,r.jt)(a)}),f=(0,r.Ry)({type:(0,r.Z_)(),name:(0,r.Z_)(),action_name:(0,r.jt)((0,r.Z_)()),tap_action:n,hold_action:(0,r.jt)(n),double_tap_action:(0,r.jt)(n)}),u=(0,r.Ry)({type:(0,r.Z_)(),view:(0,r.G0)([(0,r.Z_)(),(0,r.Rx)()]),dashboard:(0,r.jt)((0,r.Z_)()),name:(0,r.jt)((0,r.Z_)()),icon:(0,r.jt)((0,r.Z_)()),hide_if_unavailable:(0,r.jt)((0,r.O7)())}),h=(0,r.Ry)({type:(0,r.Z_)(),name:(0,r.Z_)(),service:(0,r.Z_)(),icon:(0,r.jt)((0,r.Z_)()),action_name:(0,r.jt)((0,r.Z_)()),service_data:(0,r.jt)((0,r.Yj)())}),p=(0,r.Ry)({type:(0,r.Z_)(),row:(0,r.Yj)(),conditions:(0,r.IX)((0,r.Ry)({entity:(0,r.Z_)(),state:(0,r.jt)((0,r.Z_)()),state_not:(0,r.jt)((0,r.Z_)())}))}),y=(0,r.Ry)({type:(0,r.Z_)(),style:(0,r.jt)((0,r.Yj)())}),m=(0,r.Ry)({type:(0,r.Z_)(),label:(0,r.jt)((0,r.Z_)())}),_=(0,r.Ry)({type:(0,r.Z_)(),url:(0,r.Z_)(),name:(0,r.jt)((0,r.Z_)()),icon:(0,r.jt)((0,r.Z_)())}),v=(0,r.Ry)({type:(0,r.Z_)(),entities:(0,r.IX)((0,r.G0)([(0,r.Ry)({entity:(0,r.Z_)(),icon:(0,r.jt)((0,r.Z_)()),image:(0,r.jt)((0,r.Z_)()),name:(0,r.jt)((0,r.Z_)())}),(0,r.Z_)()]))}),g=(0,r.Ry)({type:(0,r.Z_)(),entity:(0,r.Z_)(),attribute:(0,r.Z_)(),prefix:(0,r.jt)((0,r.Z_)()),suffix:(0,r.jt)((0,r.Z_)()),name:(0,r.jt)((0,r.Z_)())}),b=(0,r.G0)([(0,r.Ry)({entity:(0,r.Z_)(),name:(0,r.jt)((0,r.Z_)()),icon:(0,r.jt)((0,r.Z_)()),image:(0,r.jt)((0,r.Z_)()),secondary_info:(0,r.jt)((0,r.Z_)()),format:(0,r.jt)((0,r.Z_)()),state_color:(0,r.jt)((0,r.O7)()),tap_action:(0,r.jt)(n),hold_action:(0,r.jt)(n),double_tap_action:(0,r.jt)(n)}),(0,r.Z_)(),f,u,p,y,m,_,v,g,h])},48626:(e,t,i)=>{"use strict";i.d(t,{gg:()=>s,ds:()=>c});var r=i(4268),n=i(51598);const o=(0,r.Ry)({type:(0,r.Z_)(),image:(0,r.Z_)(),tap_action:(0,r.jt)(n.fJ),hold_action:(0,r.jt)(n.fJ),double_tap_action:(0,r.jt)(n.fJ)}),a=(0,r.Ry)({type:(0,r.Z_)(),entities:(0,r.IX)(n.KA)}),s=(0,r.Ry)({type:(0,r.Z_)(),entity:(0,r.Z_)(),detail:(0,r.jt)((0,r.Rx)()),hours_to_show:(0,r.jt)((0,r.Rx)())}),c=(0,r.G0)([o,a,s])}}]);
//# sourceMappingURL=chunk.f851ec4593fe1232c9f3.js.map