2 lines
No EOL
32 KiB
JavaScript
2 lines
No EOL
32 KiB
JavaScript
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[5891],{58135:function(e,t,r){r.d(t,{z:function(){return i}});r(40271),r(60163);var i=function(e){return function(t,r){return e.includes(t,r)}}},58664:function(e,t,r){r.d(t,{v:function(){return n}});r(40271);var i=r(21157),o=r(36655);function n(e,t){var r=(0,o.M)(e.entity_id),n=void 0!==t?t:null==e?void 0:e.state;if(["button","event","input_button","scene"].includes(r))return n!==i.nZ;if((0,i.rk)(n))return!1;if(n===i.PX&&"alert"!==r)return!1;switch(r){case"alarm_control_panel":return"disarmed"!==n;case"alert":return"idle"!==n;case"cover":case"valve":return"closed"!==n;case"device_tracker":case"person":return"not_home"!==n;case"lawn_mower":return["mowing","error"].includes(n);case"lock":return"locked"!==n;case"media_player":return"standby"!==n;case"vacuum":return!["idle","docked","paused"].includes(n);case"plant":return"problem"===n;case"group":return["on","home","open","locked","problem"].includes(n);case"timer":return"active"===n;case"camera":return"streaming"===n}return!0}},42732:function(e,t,r){r.d(t,{I2:function(){return h},Hh:function(){return d}});r(51358),r(46798),r(78399),r(5239),r(56086),r(47884),r(81912),r(64584),r(41483),r(12367),r(9454),r(98490),r(36513),r(97393);var i=r(21157),o=r(97315);r(40039),r(34997),r(9849),r(12148),r(64777),r(2094),r(11451);var n=r(26654),a=(r(76843),r(36655)),l=r(58664),s=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater"]),d=function(e,t){if((void 0!==t?t:null==e?void 0:e.state)===i.nZ)return"var(--state-unavailable-color)";var r,o=c(e,t);return o?(r=o,Array.isArray(r)?r.reverse().reduce((function(e,t){return"var(".concat(t).concat(e?", ".concat(e):"",")")}),void 0):"var(".concat(r,")")):void 0},u=function(e,t,r){var i=void 0!==r?r:t.state,o=(0,l.v)(t,r),a=[],s=(0,n.l)(i,"_"),d=o?"active":"inactive",u=t.attributes.device_class;return u&&a.push("--state-".concat(e,"-").concat(u,"-").concat(s,"-color")),a.push("--state-".concat(e,"-").concat(s,"-color"),"--state-".concat(e,"-").concat(d,"-color"),"--state-".concat(d,"-color")),a},c=function(e,t){var r=void 0!==t?t:null==e?void 0:e.state,i=(0,a.M)(e.entity_id),n=e.attributes.device_class;if("sensor"===i&&"battery"===n){var l=function(e){var t=Number(e);if(!isNaN(t))return t>=70?"--state-sensor-battery-high-color":t>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"}(r);if(l)return[l]}if("group"===i){var d=(0,o.W)(e);if(d&&s.has(d))return u(d,e,t)}if(s.has(i))return u(i,e,t)},h=function(e){if(e.attributes.brightness&&"plant"!==(0,a.M)(e.entity_id)){var t=e.attributes.brightness;return"brightness(".concat((t+245)/5,"%)")}return""}},41010:function(e,t,r){r.d(t,{uf:function(){return o}});r(32550),r(76843),r(85717),r(97393),r(46798),r(94570),r(13227),r(56308);var i=r(35137),o=function(e,t,r){var o=t?function(e){switch(e.number_format){case i.y4.comma_decimal:return["en-US","en"];case i.y4.decimal_comma:return["de","es","it"];case i.y4.space_comma:return["fr","sv","cs"];case i.y4.system:return;default:return e.language}}(t):void 0;if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)!==i.y4.none&&!Number.isNaN(Number(e))&&Intl)try{return new Intl.NumberFormat(o,n(e,r)).format(Number(e))}catch(a){return console.error(a),new Intl.NumberFormat(void 0,n(e,r)).format(Number(e))}return!Number.isNaN(Number(e))&&""!==e&&(null==t?void 0:t.number_format)===i.y4.none&&Intl?new Intl.NumberFormat("en-US",n(e,Object.assign(Object.assign({},r),{},{useGrouping:!1}))).format(Number(e)):"string"==typeof e?e:"".concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}(e,null==r?void 0:r.maximumFractionDigits).toString()).concat("currency"===(null==r?void 0:r.style)?" ".concat(r.currency):"")},n=function(e,t){var r=Object.assign({maximumFractionDigits:2},t);if("string"!=typeof e)return r;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){var i=e.indexOf(".")>-1?e.split(".")[1].length:0;r.minimumFractionDigits=i,r.maximumFractionDigits=i}return r}},26654:function(e,t,r){r.d(t,{l:function(){return i}});r(10999),r(52117),r(63789),r(82479),r(94570),r(91989),r(24074),r(46798);var i=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_",i="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·",o="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz".concat(r),n=new RegExp(i.split("").join("|"),"g");return""===e?t="":""===(t=e.toString().toLowerCase().replace(n,(function(e){return o.charAt(i.indexOf(e))})).replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,r).replace(new RegExp("(".concat(r,")\\1+"),"g"),"$1").replace(new RegExp("^".concat(r,"+")),"").replace(new RegExp("".concat(r,"+$")),""))&&(t="unknown"),t}},62871:function(e,t,r){r.d(t,{K:function(){return i}});var i=function(e){switch(e.language){case"cz":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},7265:function(e,t,r){var i,o,n=r(88962),a=r(33368),l=r(71650),s=r(68308),d=r(82390),u=r(69205),c=r(91808),h=(r(97393),r(5095)),v=r(95260);(0,c.Z)([(0,v.Mo)("ha-input-helper-text")],(function(e,t){var r=function(t){function r(){var t;(0,l.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,s.Z)(this,r,[].concat(o)),e((0,d.Z)(t)),t}return(0,u.Z)(r,t),(0,a.Z)(r)}(t);return{F:r,d:[{kind:"method",key:"render",value:function(){return(0,h.dy)(i||(i=(0,n.Z)(["<slot></slot>"])))}},{kind:"field",static:!0,key:"styles",value:function(){return(0,h.iv)(o||(o=(0,n.Z)([":host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px}"])))}}]}}),h.oi)},65891:function(e,t,r){r.r(t),r.d(t,{HaColorTempSelector:function(){return J}});var i,o,n,a,l,s,d,u,c,h,v,p,m=r(88962),f=r(33368),b=r(71650),k=r(68308),g=r(82390),y=r(69205),_=r(91808),w=(r(97393),r(76843),r(5095)),x=r(95260),Z=r(86634),C=r(14516),N=r(18394),V=(r(7265),r(8956),(0,_.Z)([(0,x.Mo)("ha-labeled-slider")],(function(e,t){var r=function(t){function r(){var t;(0,b.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,k.Z)(this,r,[].concat(o)),e((0,g.Z)(t)),t}return(0,y.Z)(r,t),(0,f.Z)(r)}(t);return{F:r,d:[{kind:"field",decorators:[(0,x.Cb)({type:Boolean})],key:"labeled",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)()],key:"caption",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Boolean})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)({type:Boolean})],key:"required",value:function(){return!0}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"min",value:function(){return 0}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"max",value:function(){return 100}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"step",value:function(){return 1}},{kind:"field",decorators:[(0,x.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Boolean})],key:"extra",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"value",value:void 0},{kind:"method",key:"render",value:function(){return(0,w.dy)(i||(i=(0,m.Z)([' <div class="title">','</div> <div class="extra-container"><slot name="extra"></slot></div> <div class="slider-container"> ',' <ha-slider .min="','" .max="','" .step="','" .labeled="','" .disabled="','" .value="','" @change="','"></ha-slider> </div> '," "])),this._getTitle(),this.icon?(0,w.dy)(o||(o=(0,m.Z)(['<ha-icon icon="','"></ha-icon>'])),this.icon):w.Ld,this.min,this.max,this.step,this.labeled,this.disabled,this.value,this._inputChanged,this.helper?(0,w.dy)(n||(n=(0,m.Z)(["<ha-input-helper-text> "," </ha-input-helper-text>"])),this.helper):w.Ld)}},{kind:"method",key:"_getTitle",value:function(){return"".concat(this.caption).concat(this.caption&&this.required?" *":"")}},{kind:"method",key:"_inputChanged",value:function(e){(0,N.B)(this,"value-changed",{value:Number(e.target.value)})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,w.iv)(a||(a=(0,m.Z)([":host{display:block}.title{margin:5px 0 8px;color:var(--primary-text-color)}.slider-container{display:flex}ha-icon{margin-top:8px;color:var(--secondary-text-color)}ha-slider{flex-grow:1;background-image:var(--ha-slider-background);border-radius:4px}"])))}}]}}),w.oi),r(34541)),T=r(47838),M=r(62746),z=(r(36513),r(91989),r(46349),r(85717),r(4096)),B=(r(46097),r(70320),function(e,t,r){return Math.min(Math.max(e,t),r)}),P=2700,O=6500,S=function(e){var t=e/100;return[A(t),F(t),E(t)]},A=function(e){if(e<=66)return 255;var t=329.698727446*Math.pow(e-60,-.1332047592);return B(t,0,255)},F=function(e){var t;return t=e<=66?99.4708025861*Math.log(e)-161.1195681661:288.1221695283*Math.pow(e-60,-.0755148492),B(t,0,255)},E=function(e){if(e>=66)return 255;if(e<=19)return 0;var t=138.5177312231*Math.log(e-10)-305.0447927307;return B(t,0,255)},L=function(e){return Math.floor(1e6/e)},R=r(42732),U=r(89878),j=r(93359),D=(r(51358),r(46798),r(78399),r(5239),r(56086),r(47884),r(81912),r(64584),r(41483),r(12367),r(9454),r(98490),r(94570),r(96549)),H=r(53180),G=r(41010),K=r(62871),W=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","PageUp","PageDown","Home","End"]),I=((0,_.Z)([(0,x.Mo)("ha-control-slider")],(function(e,t){var r=function(t){function r(){var t;(0,b.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,k.Z)(this,r,[].concat(o)),e((0,g.Z)(t)),t}return(0,y.Z)(r,t),(0,f.Z)(r)}(t);return{F:r,d:[{kind:"field",decorators:[(0,x.Cb)({attribute:!1})],key:"locale",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)()],key:"mode",value:function(){return"start"}},{kind:"field",decorators:[(0,x.Cb)({type:Boolean,reflect:!0})],key:"vertical",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)({type:Boolean,attribute:"show-handle"})],key:"showHandle",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)({type:Boolean,attribute:"inverted"})],key:"inverted",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)({attribute:"tooltip-position"})],key:"tooltipPosition",value:void 0},{kind:"field",decorators:[(0,x.Cb)()],key:"unit",value:void 0},{kind:"field",decorators:[(0,x.Cb)({attribute:"tooltip-mode"})],key:"tooltipMode",value:function(){return"interaction"}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"value",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"step",value:function(){return 1}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"min",value:function(){return 0}},{kind:"field",decorators:[(0,x.Cb)({type:Number})],key:"max",value:function(){return 100}},{kind:"field",decorators:[(0,x.SB)()],key:"pressed",value:function(){return!1}},{kind:"field",decorators:[(0,x.SB)()],key:"tooltipVisible",value:function(){return!1}},{kind:"field",key:"_mc",value:void 0},{kind:"method",key:"valueToPercentage",value:function(e){var t=(this.boundedValue(e)-this.min)/(this.max-this.min);return this.inverted?1-t:t}},{kind:"method",key:"percentageToValue",value:function(e){return(this.max-this.min)*(this.inverted?1-e:e)+this.min}},{kind:"method",key:"steppedValue",value:function(e){return Math.round(e/this.step)*this.step}},{kind:"method",key:"boundedValue",value:function(e){return Math.min(Math.max(e,this.min),this.max)}},{kind:"method",key:"firstUpdated",value:function(e){(0,V.Z)((0,T.Z)(r.prototype),"firstUpdated",this).call(this,e),this.setupListeners(),this.setAttribute("role","slider"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}},{kind:"method",key:"updated",value:function(e){if((0,V.Z)((0,T.Z)(r.prototype),"updated",this).call(this,e),e.has("value")){var t,i=this.steppedValue(null!==(t=this.value)&&void 0!==t?t:0);this.setAttribute("aria-valuenow",i.toString()),this.setAttribute("aria-valuetext",this._formatValue(i))}if(e.has("min")&&this.setAttribute("aria-valuemin",this.min.toString()),e.has("max")&&this.setAttribute("aria-valuemax",this.max.toString()),e.has("vertical")){var o=this.vertical?"vertical":"horizontal";this.setAttribute("aria-orientation",o)}}},{kind:"method",key:"connectedCallback",value:function(){(0,V.Z)((0,T.Z)(r.prototype),"connectedCallback",this).call(this),this.setupListeners()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,V.Z)((0,T.Z)(r.prototype),"disconnectedCallback",this).call(this),this.destroyListeners()}},{kind:"field",decorators:[(0,x.IO)("#slider")],key:"slider",value:void 0},{kind:"method",key:"setupListeners",value:function(){var e,t=this;this.slider&&!this._mc&&(this._mc=new D.dK(this.slider,{touchAction:this.vertical?"pan-x":"pan-y"}),this._mc.add(new D.Ce({threshold:10,direction:D.oM,enable:!0})),this._mc.add(new D.Uw({event:"singletap"})),this._mc.on("panstart",(function(){t.disabled||(t.pressed=!0,t._showTooltip(),e=t.value)})),this._mc.on("pancancel",(function(){t.disabled||(t.pressed=!1,t._hideTooltip(),t.value=e)})),this._mc.on("panmove",(function(e){if(!t.disabled){var r=t._getPercentageFromEvent(e);t.value=t.percentageToValue(r);var i=t.steppedValue(t.value);(0,N.B)(t,"slider-moved",{value:i})}})),this._mc.on("panend",(function(e){if(!t.disabled){t.pressed=!1,t._hideTooltip();var r=t._getPercentageFromEvent(e);t.value=t.steppedValue(t.percentageToValue(r)),(0,N.B)(t,"slider-moved",{value:void 0}),(0,N.B)(t,"value-changed",{value:t.value})}})),this._mc.on("singletap",(function(e){if(!t.disabled){var r=t._getPercentageFromEvent(e);t.value=t.steppedValue(t.percentageToValue(r)),(0,N.B)(t,"value-changed",{value:t.value})}})),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("keyup",this._handleKeyUp))}},{kind:"method",key:"destroyListeners",value:function(){this._mc&&(this._mc.destroy(),this._mc=void 0),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("keyup",this._handleKeyUp)}},{kind:"get",key:"_tenPercentStep",value:function(){return Math.max(this.step,(this.max-this.min)/10)}},{kind:"method",key:"_showTooltip",value:function(){null!=this._tooltipTimeout&&window.clearTimeout(this._tooltipTimeout),this.tooltipVisible=!0}},{kind:"method",key:"_hideTooltip",value:function(e){var t=this;e?this._tooltipTimeout=window.setTimeout((function(){t.tooltipVisible=!1}),e):this.tooltipVisible=!1}},{kind:"method",key:"_handleKeyDown",value:function(e){var t,r,i,o;if(W.has(e.code)){switch(e.preventDefault(),e.code){case"ArrowRight":case"ArrowUp":this.value=this.boundedValue((null!==(t=this.value)&&void 0!==t?t:0)+this.step);break;case"ArrowLeft":case"ArrowDown":this.value=this.boundedValue((null!==(r=this.value)&&void 0!==r?r:0)-this.step);break;case"PageUp":this.value=this.steppedValue(this.boundedValue((null!==(i=this.value)&&void 0!==i?i:0)+this._tenPercentStep));break;case"PageDown":this.value=this.steppedValue(this.boundedValue((null!==(o=this.value)&&void 0!==o?o:0)-this._tenPercentStep));break;case"Home":this.value=this.min;break;case"End":this.value=this.max}this._showTooltip(),(0,N.B)(this,"slider-moved",{value:this.value})}}},{kind:"field",key:"_tooltipTimeout",value:void 0},{kind:"method",key:"_handleKeyUp",value:function(e){W.has(e.code)&&(e.preventDefault(),this._hideTooltip(500),(0,N.B)(this,"value-changed",{value:this.value}))}},{kind:"field",key:"_getPercentageFromEvent",value:function(){var e=this;return function(t){if(e.vertical){var r=t.center.y,i=t.target.getBoundingClientRect().top,o=t.target.clientHeight;return Math.max(Math.min(1,1-(r-i)/o),0)}var n=t.center.x,a=t.target.getBoundingClientRect().left,l=t.target.clientWidth;return Math.max(Math.min(1,(n-a)/l),0)}}},{kind:"method",key:"_formatValue",value:function(e){var t,r,i=(0,G.uf)(e,this.locale),o=this.unit?"".concat((t=this.unit,r=this.locale,"°"===t?"":r&&"%"===t?(0,K.K)(r):" ")).concat(this.unit):"";return"".concat(i).concat(o)}},{kind:"method",key:"_renderTooltip",value:function(){var e,t,r;if("never"===this.tooltipMode)return w.Ld;var i=null!==(e=this.tooltipPosition)&&void 0!==e?e:this.vertical?"left":"top",o="always"===this.tooltipMode||this.tooltipVisible&&"interaction"===this.tooltipMode,n=this.steppedValue(null!==(t=this.value)&&void 0!==t?t:0);return(0,w.dy)(l||(l=(0,m.Z)([' <span aria-hidden="true" class="tooltip ','"> '," </span> "])),(0,H.$)((0,j.Z)((0,j.Z)((0,j.Z)({visible:o},i,!0),null!==(r=this.mode)&&void 0!==r?r:"start",!0),"show-handle",this.showHandle)),this._formatValue(n))}},{kind:"method",key:"render",value:function(){var e,t;return(0,w.dy)(s||(s=(0,m.Z)([' <div class="container','" style="','"> <div id="slider" class="slider"> <div class="slider-track-background"></div> <slot name="background"></slot> '," </div> "," </div> "])),(0,H.$)({pressed:this.pressed}),(0,Z.V)({"--value":"".concat(this.valueToPercentage(null!==(e=this.value)&&void 0!==e?e:0))}),"cursor"===this.mode?null!=this.value?(0,w.dy)(d||(d=(0,m.Z)([' <div class="','"></div> '])),(0,H.$)({"slider-track-cursor":!0})):null:(0,w.dy)(u||(u=(0,m.Z)([' <div class="','"></div> '])),(0,H.$)((0,j.Z)((0,j.Z)({"slider-track-bar":!0},null!==(t=this.mode)&&void 0!==t?t:"start",!0),"show-handle",this.showHandle))),this._renderTooltip())}},{kind:"get",static:!0,key:"styles",value:function(){return(0,w.iv)(c||(c=(0,m.Z)([':host{display:block;--control-slider-color:var(--primary-color);--control-slider-background:var(--disabled-color);--control-slider-background-opacity:0.2;--control-slider-thickness:40px;--control-slider-border-radius:10px;--control-slider-tooltip-font-size:14px;height:var(--control-slider-thickness);width:100%;border-radius:var(--control-slider-border-radius);outline:0;transition:box-shadow 180ms ease-in-out}:host(:focus-visible){box-shadow:0 0 0 2px var(--control-slider-color)}:host([vertical]){width:var(--control-slider-thickness);height:100%}.container{position:relative;height:100%;width:100%;--handle-size:4px;--handle-margin:calc(var(--control-slider-thickness) / 8)}.tooltip{pointer-events:none;user-select:none;position:absolute;background-color:var(--clear-background-color);color:var(--primary-text-color);font-size:var(--control-slider-tooltip-font-size);border-radius:.8em;padding:.2em .4em;opacity:0;white-space:nowrap;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:opacity 180ms ease-in-out,left 180ms ease-in-out,bottom 180ms ease-in-out;--handle-spacing:calc(2 * var(--handle-margin) + var(--handle-size));--slider-tooltip-margin:-4px;--slider-tooltip-range:100%;--slider-tooltip-offset:0px;--slider-tooltip-position:calc(\n min(\n max(\n var(--value) * var(--slider-tooltip-range) +\n var(--slider-tooltip-offset),\n 0%\n ),\n 100%\n )\n )}.tooltip.start{--slider-tooltip-offset:calc(-0.5 * (var(--handle-spacing)))}.tooltip.end{--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.cursor{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.show-handle{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.visible{opacity:1}.tooltip.top{transform:translate3d(-50%,-100%,0);top:var(--slider-tooltip-margin);left:50%}.tooltip.bottom{transform:translate3d(-50%,100%,0);bottom:var(--slider-tooltip-margin);left:50%}.tooltip.left{transform:translate3d(-100%,50%,0);bottom:50%;left:var(--slider-tooltip-margin)}.tooltip.right{transform:translate3d(100%,50%,0);bottom:50%;right:var(--slider-tooltip-margin)}:host(:not([vertical])) .tooltip.bottom,:host(:not([vertical])) .tooltip.top{left:var(--slider-tooltip-position)}:host([vertical]) .tooltip.left,:host([vertical]) .tooltip.right{bottom:var(--slider-tooltip-position)}.slider{position:relative;height:100%;width:100%;border-radius:var(--control-slider-border-radius);transform:translateZ(0);overflow:hidden;cursor:pointer}.slider *{pointer-events:none}.slider .slider-track-background{position:absolute;top:0;left:0;height:100%;width:100%;background:var(--control-slider-background);opacity:var(--control-slider-background-opacity)}::slotted([slot=background]){position:absolute;top:0;left:0;height:100%;width:100%}.slider .slider-track-bar{--border-radius:var(--control-slider-border-radius);--slider-size:100%;position:absolute;height:100%;width:100%;background-color:var(--control-slider-color);transition:transform 180ms ease-in-out,background-color 180ms ease-in-out}.slider .slider-track-bar.show-handle{--slider-size:calc(\n 100% - 2 * var(--handle-margin) - var(--handle-size)\n )}.slider .slider-track-bar::after{display:block;content:"";position:absolute;margin:auto;border-radius:var(--handle-size);background-color:#fff}.slider .slider-track-bar{top:0;left:0;transform:translate3d(calc((var(--value,0) - 1) * var(--slider-size)),0,0);border-radius:0 var(--border-radius) var(--border-radius) 0}.slider .slider-track-bar:after{top:0;bottom:0;right:var(--handle-margin);height:50%;width:var(--handle-size)}.slider .slider-track-bar.end{right:0;left:initial;transform:translate3d(calc(var(--value,0) * var(--slider-size)),0,0);border-radius:var(--border-radius) 0 0 var(--border-radius)}.slider .slider-track-bar.end::after{right:initial;left:var(--handle-margin)}:host([vertical]) .slider .slider-track-bar{bottom:0;left:0;transform:translate3d(0,calc((1 - var(--value,0)) * var(--slider-size)),0);border-radius:var(--border-radius) var(--border-radius) 0 0}:host([vertical]) .slider .slider-track-bar:after{top:var(--handle-margin);right:0;left:0;bottom:initial;width:50%;height:var(--handle-size)}:host([vertical]) .slider .slider-track-bar.end{top:0;bottom:initial;transform:translate3d(0,calc((0 - var(--value,0)) * var(--slider-size)),0);border-radius:0 0 var(--border-radius) var(--border-radius)}:host([vertical]) .slider .slider-track-bar.end::after{top:initial;bottom:var(--handle-margin)}.slider .slider-track-cursor:after{display:block;content:"";background-color:var(--secondary-text-color);position:absolute;top:0;left:0;bottom:0;right:0;margin:auto;border-radius:var(--handle-size)}.slider .slider-track-cursor{--cursor-size:calc(var(--control-slider-thickness) / 4);position:absolute;background-color:#fff;border-radius:var(--handle-size);transition:left 180ms ease-in-out,bottom 180ms ease-in-out;top:0;bottom:0;left:calc(var(--value,0) * (100% - var(--cursor-size)));width:var(--cursor-size);box-shadow:0 2px 5px rgba(0,0,0,.2)}.slider .slider-track-cursor:after{height:50%;width:var(--handle-size)}:host([vertical]) .slider .slider-track-cursor{top:initial;right:0;left:0;bottom:calc(var(--value,0) * (100% - var(--cursor-size)));height:var(--cursor-size);width:100%}:host([vertical]) .slider .slider-track-cursor:after{height:var(--handle-size);width:50%}.pressed .tooltip{transition:opacity 180ms ease-in-out}.pressed .slider-track-bar,.pressed .slider-track-cursor{transition:none}:host(:disabled) .slider{cursor:not-allowed}'])))}}]}}),w.oi),r(21157)),$=(r(40271),r(60163),r(9849),r(13526),function(e){return e.UNKNOWN="unknown",e.ONOFF="onoff",e.BRIGHTNESS="brightness",e.COLOR_TEMP="color_temp",e.HS="hs",e.XY="xy",e.RGB="rgb",e.RGBW="rgbw",e.RGBWW="rgbww",e.WHITE="white",e}({})),q=[$.HS,$.XY,$.RGB,$.RGBW,$.RGBWW],X=([].concat(q,[$.COLOR_TEMP,$.BRIGHTNESS,$.WHITE]),r(27087)),Y=function(e,t){for(var r=[],i=(t-e)/10,o=0;o<11;o++){var n=e+i*o,a=(0,z.CO)(S(n));r.push([.1*o,a])}return r.map((function(e){var t=(0,M.Z)(e,2),r=t[0],i=t[1];return"".concat(i," ").concat(100*r,"%")})).join(", ")},J=((0,_.Z)([(0,x.Mo)("light-color-temp-picker")],(function(e,t){var r=function(t){function r(){var t;(0,b.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,k.Z)(this,r,[].concat(o)),e((0,g.Z)(t)),t}return(0,y.Z)(r,t),(0,f.Z)(r)}(t);return{F:r,d:[{kind:"field",decorators:[(0,x.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,x.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,x.SB)()],key:"_ctPickerValue",value:void 0},{kind:"method",key:"render",value:function(){var e,t;if(!this.stateObj)return w.Ld;var r=null!==(e=this.stateObj.attributes.min_color_temp_kelvin)&&void 0!==e?e:P,i=null!==(t=this.stateObj.attributes.max_color_temp_kelvin)&&void 0!==t?t:O,o=this._generateTemperatureGradient(r,i),n=(0,R.Hh)(this.stateObj);return(0,w.dy)(h||(h=(0,m.Z)([' <ha-control-slider inverted vertical .value="','" .min="','" .max="','" mode="cursor" @value-changed="','" @slider-moved="','" .ariaLabel="','" style="','" .disabled="','" .unit="','" .locale="','"> </ha-control-slider> '])),this._ctPickerValue,r,i,this._ctColorChanged,this._ctColorCursorMoved,this.hass.localize("ui.dialogs.more_info_control.light.color_temp"),(0,Z.V)({"--control-slider-color":n,"--gradient":o}),this.stateObj.state===I.nZ,X.F_.light.color_temp_kelvin,this.hass.locale)}},{kind:"field",key:"_generateTemperatureGradient",value:function(){return(0,C.Z)((function(e,t){return Y(e,t)}))}},{kind:"method",key:"_updateSliderValues",value:function(){var e=this.stateObj;"on"===e.state?this._ctPickerValue=e.attributes.color_mode===$.COLOR_TEMP?e.attributes.color_temp_kelvin:void 0:this._ctPickerValue=void 0}},{kind:"method",key:"willUpdate",value:function(e){(0,V.Z)((0,T.Z)(r.prototype),"willUpdate",this).call(this,e),e.has("stateObj")&&this._updateSliderValues()}},{kind:"method",key:"_ctColorCursorMoved",value:function(e){var t=e.detail.value;isNaN(t)||this._ctPickerValue===t||(this._ctPickerValue=t,(0,N.B)(this,"color-hovered",{color_temp_kelvin:t}),this._throttleUpdateColorTemp())}},{kind:"field",key:"_throttleUpdateColorTemp",value:function(){var e=this;return(0,U.P)((function(){e._updateColorTemp()}),500)}},{kind:"method",key:"_ctColorChanged",value:function(e){var t=e.detail.value;(0,N.B)(this,"color-hovered",void 0),isNaN(t)||this._ctPickerValue===t||(this._ctPickerValue=t,this._updateColorTemp())}},{kind:"method",key:"_updateColorTemp",value:function(){var e=this._ctPickerValue;this._applyColor({color_temp_kelvin:e})}},{kind:"method",key:"_applyColor",value:function(e,t){(0,N.B)(this,"color-changed",e),this.hass.callService("light","turn_on",Object.assign(Object.assign({entity_id:this.stateObj.entity_id},e),t))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,w.iv)(v||(v=(0,m.Z)([":host{display:flex;flex-direction:column}ha-control-slider{height:45vh;max-height:320px;min-height:200px;--control-slider-thickness:100px;--control-slider-border-radius:24px;--control-slider-color:var(--primary-color);--control-slider-background:-webkit-linear-gradient(\n top,\n var(--gradient)\n );--control-slider-tooltip-font-size:20px;--control-slider-background-opacity:1}"])))]}}]}}),w.oi),(0,_.Z)([(0,x.Mo)("ha-selector-color_temp")],(function(e,t){var r=function(t){function r(){var t;(0,b.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,k.Z)(this,r,[].concat(o)),e((0,g.Z)(t)),t}return(0,y.Z)(r,t),(0,f.Z)(r)}(t);return{F:r,d:[{kind:"field",decorators:[(0,x.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,x.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,x.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,x.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,x.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,x.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:function(){return!1}},{kind:"field",decorators:[(0,x.Cb)({type:Boolean})],key:"required",value:function(){return!0}},{kind:"method",key:"render",value:function(){var e,t,r,i,o,n,a,l,s,d,u,c,h,v,f,b,k;if("kelvin"===(null===(e=this.selector.color_temp)||void 0===e?void 0:e.unit))b=null!==(t=null===(r=this.selector.color_temp)||void 0===r?void 0:r.min)&&void 0!==t?t:P,k=null!==(i=null===(o=this.selector.color_temp)||void 0===o?void 0:o.max)&&void 0!==i?i:O;else b=null!==(n=null!==(a=null===(l=this.selector.color_temp)||void 0===l?void 0:l.min)&&void 0!==a?a:null===(s=this.selector.color_temp)||void 0===s?void 0:s.min_mireds)&&void 0!==n?n:153,k=null!==(d=null!==(u=null===(c=this.selector.color_temp)||void 0===c?void 0:c.max)&&void 0!==u?u:null===(h=this.selector.color_temp)||void 0===h?void 0:h.max_mireds)&&void 0!==d?d:500;var g=this._generateTemperatureGradient(null!==(v=null===(f=this.selector.color_temp)||void 0===f?void 0:f.unit)&&void 0!==v?v:"mired",b,k);return(0,w.dy)(p||(p=(0,m.Z)([' <ha-labeled-slider style="','" labeled icon="hass:thermometer" .caption="','" .min="','" .max="','" .value="','" .disabled="','" .helper="','" .required="','" @value-changed="','"></ha-labeled-slider> '])),(0,Z.V)({"--ha-slider-background":"linear-gradient( to var(--float-end), ".concat(g,")")}),this.label||"",b,k,this.value,this.disabled,this.helper,this.required,this._valueChanged)}},{kind:"field",key:"_generateTemperatureGradient",value:function(){return(0,C.Z)((function(e,t,r){var i;switch(e){case"kelvin":i=Y(t,r);break;case"mired":i=Y(L(t),L(r))}return i}))}},{kind:"method",key:"_valueChanged",value:function(e){(0,N.B)(this,"value-changed",{value:Number(e.detail.value)})}}]}}),w.oi))},8956:function(e,t,r){var i,o=r(88962),n=r(46097),a=r(33368),l=r(71650),s=r(68308),d=r(82390),u=r(69205),c=r(91808),h=(r(97393),r(95260)),v=(r(34131),r(96985)),p=r(5095);(0,c.Z)([(0,h.Mo)("ha-slider")],(function(e,t){var r=function(t){function r(){var t;(0,l.Z)(this,r);for(var i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return t=(0,s.Z)(this,r,[].concat(o)),e((0,d.Z)(t)),t}return(0,u.Z)(r,t),(0,a.Z)(r)}(t);return{F:r,d:[{kind:"field",static:!0,key:"styles",value:function(){return[].concat((0,n.Z)(v.$.styles),[(0,p.iv)(i||(i=(0,o.Z)([":host{--md-sys-color-primary:var(--primary-color);--md-sys-color-outline:var(--outline-color);--md-sys-color-on-surface:var(--primary-text-color);--md-slider-handle-width:14px;--md-slider-handle-height:14px;min-width:100px;min-inline-size:100px;width:200px}"])))])}}]}}),v.$)},21157:function(e,t,r){r.d(t,{PX:function(){return a},V_:function(){return l},nZ:function(){return o},rk:function(){return d}});var i=r(58135),o="unavailable",n="unknown",a="off",l=[o,n],s=[o,n,a],d=(0,i.z)(l);(0,i.z)(s)},27087:function(e,t,r){r.d(t,{F_:function(){return i}});r(51358),r(46798),r(78399),r(5239),r(56086),r(47884),r(81912),r(64584),r(41483),r(12367),r(9454),r(98490),r(94570),r(67712),r(27392),r(97393);new Set(["temperature","current_temperature","target_temperature","target_temp_temp","target_temp_high","target_temp_low","target_temp_step","min_temp","max_temp"]);var i={climate:{humidity:"%",current_humidity:"%",target_humidity_low:"%",target_humidity_high:"%",target_humidity_step:"%",min_humidity:"%",max_humidity:"%"},cover:{current_position:"%",current_tilt_position:"%"},fan:{percentage:"%"},humidifier:{humidity:"%",current_humidity:"%",min_humidity:"%",max_humidity:"%"},light:{color_temp:"mired",max_mireds:"mired",min_mireds:"mired",color_temp_kelvin:"K",min_color_temp_kelvin:"K",max_color_temp_kelvin:"K",brightness:"%"},sun:{elevation:"°"},vacuum:{battery_level:"%"},valve:{current_position:"%"},sensor:{battery_level:"%"},media_player:{volume_level:"%"}}},97315:function(e,t,r){r.d(t,{W:function(){return n},Z:function(){return a}});var i=r(46097),o=(r(51358),r(46798),r(78399),r(5239),r(56086),r(47884),r(81912),r(64584),r(41483),r(12367),r(9454),r(98490),r(46349),r(70320),r(36655)),n=function(e){var t=e.attributes.entity_id||[],r=(0,i.Z)(new Set(t.map((function(e){return(0,o.M)(e)}))));return 1===r.length?r[0]:void 0},a=function(e,t,r,i,o){return e.connection.subscribeMessage(o,{type:"group/start_preview",flow_id:t,flow_type:r,user_input:i})}}}]);
|
|
//# sourceMappingURL=5891.VpcaaKsmWqM.js.map
|