"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["43388"],{41367:function(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{HuiClockCardDigital:function(){return z}});var n,o,s,r,m=e(72153),c=e(44734),d=e(43080),l=e(69683),u=e(25460),h=e(6454),p=e(74487),v=(e(50113),e(18111),e(20116),e(69085),e(26099),e(40445)),f=e(96196),g=e(77845),_=e(69543),k=e(8480),y=t([p,k]);[p,k]=y.then?(await y)():y;var z=function(t){function i(){return(0,c.A)(this,i),(0,l.A)(this,i,arguments)}return(0,h.A)(i,t),(0,d.A)(i,[{key:"_initDate",value:function(){var t,i,e,a;if(this.config&&this.hass){var n=null===(t=this.hass)||void 0===t?void 0:t.locale;null!==(i=this.config)&&void 0!==i&&i.time_format&&(n=Object.assign(Object.assign({},n),{},{time_format:this.config.time_format}));var o=(0,_.J)(n);this._dateTimeFormat=new Intl.DateTimeFormat(this.hass.locale.language,{hour:o?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:o?"h12":"h23",timeZone:(null===(e=this.config)||void 0===e?void 0:e.time_zone)||(0,k.w)(n.time_zone,null===(a=this.hass.config)||void 0===a?void 0:a.time_zone)}),this._tick()}}},{key:"updated",value:function(t){if(t.has("hass")){var i,e=t.get("hass");e&&e.locale===(null===(i=this.hass)||void 0===i?void 0:i.locale)||this._initDate()}}},{key:"connectedCallback",value:function(){(0,u.A)(i,"connectedCallback",this,3)([]),this._startTick()}},{key:"disconnectedCallback",value:function(){(0,u.A)(i,"disconnectedCallback",this,3)([]),this._stopTick()}},{key:"_startTick",value:function(){var t=this;this._tickInterval=window.setInterval(function(){return t._tick()},1e3),this._tick()}},{key:"_stopTick",value:function(){this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=void 0)}},{key:"_tick",value:function(){var t,i,e,a,n;if(this._dateTimeFormat){var o=this._dateTimeFormat.formatToParts();this._timeHour=null===(t=o.find(function(t){return"hour"===t.type}))||void 0===t?void 0:t.value,this._timeMinute=null===(i=o.find(function(t){return"minute"===t.type}))||void 0===i?void 0:i.value,this._timeSecond=null!==(e=this.config)&&void 0!==e&&e.show_seconds?null===(a=o.find(function(t){return"second"===t.type}))||void 0===a?void 0:a.value:void 0,this._timeAmPm=null===(n=o.find(function(t){return"dayPeriod"===t.type}))||void 0===n?void 0:n.value}}},{key:"render",value:function(){if(!this.config)return f.s6;var t=this.config.clock_size?"size-".concat(this.config.clock_size):"";return(0,f.qy)(n||(n=(0,m.A)([' <div class="time-parts ','"> <div class="time-part hour">','</div> <div class="time-part minute">',"</div> "," "," </div> "])),t,this._timeHour,this._timeMinute,void 0!==this._timeSecond?(0,f.qy)(o||(o=(0,m.A)(['<div class="time-part second">',"</div>"])),this._timeSecond):f.s6,void 0!==this._timeAmPm?(0,f.qy)(s||(s=(0,m.A)(['<div class="time-part am-pm">',"</div>"])),this._timeAmPm):f.s6)}}])}(f.WF);z.styles=(0,f.AH)(r||(r=(0,m.A)([':host{display:block}.time-parts{align-items:center;display:grid;grid-template-areas:"hour minute second" "hour minute am-pm";font-size:1.5rem;font-weight:var(--ha-font-weight-medium);line-height:.8;direction:ltr}.time-title+.time-parts{font-size:1.5rem}.time-parts.size-medium{font-size:3rem}.time-parts.size-large{font-size:4rem}.time-parts.size-medium .time-part.am-pm,.time-parts.size-medium .time-part.second{font-size:var(--ha-font-size-l);margin-left:6px}.time-parts.size-large .time-part.am-pm,.time-parts.size-large .time-part.second{font-size:var(--ha-font-size-2xl);margin-left:8px}.time-parts .time-part.hour{grid-area:hour}.time-parts .time-part.minute{grid-area:minute}.time-parts .time-part.second{grid-area:second;line-height:.9;opacity:.4}.time-parts .time-part.am-pm{grid-area:am-pm;line-height:.9;opacity:.6}.time-parts .time-part.am-pm,.time-parts .time-part.second{font-size:var(--ha-font-size-xs);margin-left:4px}.time-parts .time-part.hour:after{content:":";margin:0 2px}']))),(0,v.Cg)([(0,g.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,v.Cg)([(0,g.MZ)({attribute:!1})],z.prototype,"config",void 0),(0,v.Cg)([(0,g.wk)()],z.prototype,"_dateTimeFormat",void 0),(0,v.Cg)([(0,g.wk)()],z.prototype,"_timeHour",void 0),(0,v.Cg)([(0,g.wk)()],z.prototype,"_timeMinute",void 0),(0,v.Cg)([(0,g.wk)()],z.prototype,"_timeSecond",void 0),(0,v.Cg)([(0,g.wk)()],z.prototype,"_timeAmPm",void 0),z=(0,v.Cg)([(0,g.EM)("hui-clock-card-digital")],z),a()}catch(C){a(C)}})}}]);
//# sourceMappingURL=43388.29f3710276be68e2.js.map