"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["52266"],{60543:function(e,t,r){r.r(t),r.d(t,{HaQrCode:function(){return y}});var a,o,i,n=r(72153),s=r(44734),c=r(43080),h=r(69683),d=r(6454),l=r(25460),u=(r(28706),r(62062),r(18111),r(61701),r(2892),r(26099),r(58940),r(40445)),v=r(96196),p=r(77845),g=r(81298),m=(r(38962),r(79468)),y=function(e){function t(){var e;(0,s.A)(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=(0,h.A)(this,t,[].concat(a))).errorCorrectionLevel="medium",e.width=4,e.scale=4,e.margin=4,e}return(0,d.A)(t,e),(0,c.A)(t,[{key:"willUpdate",value:function(e){(0,l.A)(t,"willUpdate",this,3)([e]),(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}},{key:"updated",value:function(e){var t=this,r=this._canvas;if(r&&this.data&&(e.has("data")||e.has("scale")||e.has("width")||e.has("margin")||e.has("maskPattern")||e.has("errorCorrectionLevel")||e.has("centerImage"))){var a=getComputedStyle(this),o=a.getPropertyValue("--rgb-primary-text-color"),i=a.getPropertyValue("--rgb-card-background-color"),n=(0,m.v2)(o.split(",").map(function(e){return parseInt(e,10)})),s=(0,m.v2)(i.split(",").map(function(e){return parseInt(e,10)}));if(g.toCanvas(r,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:s,dark:n}}).catch(function(e){t._error=e.message}),this.centerImage){var c=this._canvas.getContext("2d"),h=new Image;h.src=this.centerImage,h.onload=function(){null==c||c.drawImage(h,.375*r.width,.375*r.height,r.width/4,r.height/4)}}}}},{key:"render",value:function(){return this.data?this._error?(0,v.qy)(a||(a=(0,n.A)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._error):(0,v.qy)(o||(o=(0,n.A)(["<canvas></canvas>"]))):v.s6}}])}(v.WF);y.styles=(0,v.AH)(i||(i=(0,n.A)([":host{display:block}"]))),(0,u.Cg)([(0,p.MZ)()],y.prototype,"data",void 0),(0,u.Cg)([(0,p.MZ)({attribute:"error-correction-level"})],y.prototype,"errorCorrectionLevel",void 0),(0,u.Cg)([(0,p.MZ)({type:Number})],y.prototype,"width",void 0),(0,u.Cg)([(0,p.MZ)({type:Number})],y.prototype,"scale",void 0),(0,u.Cg)([(0,p.MZ)({type:Number})],y.prototype,"margin",void 0),(0,u.Cg)([(0,p.MZ)({attribute:!1,type:Number})],y.prototype,"maskPattern",void 0),(0,u.Cg)([(0,p.MZ)({attribute:"center-image"})],y.prototype,"centerImage",void 0),(0,u.Cg)([(0,p.wk)()],y.prototype,"_error",void 0),(0,u.Cg)([(0,p.P)("canvas")],y.prototype,"_canvas",void 0),y=(0,u.Cg)([(0,p.EM)("ha-qr-code")],y)},35313:function(e,t,r){r.r(t),r.d(t,{HaSelectorQRCode:function(){return v}});var a,o,i=r(72153),n=r(44734),s=r(43080),c=r(69683),h=r(6454),d=r(40445),l=r(96196),u=r(77845),v=(r(60543),function(e){function t(){return(0,n.A)(this,t),(0,c.A)(this,t,arguments)}return(0,h.A)(t,e),(0,s.A)(t,[{key:"render",value:function(){var e,t,r,o;return(0,l.qy)(a||(a=(0,i.A)(['<ha-qr-code .data="','" .scale="','" .errorCorrectionLevel="','" .centerImage="','"></ha-qr-code>'])),null===(e=this.selector.qr_code)||void 0===e?void 0:e.data,null===(t=this.selector.qr_code)||void 0===t?void 0:t.scale,null===(r=this.selector.qr_code)||void 0===r?void 0:r.error_correction_level,null===(o=this.selector.qr_code)||void 0===o?void 0:o.center_image)}}])}(l.WF));v.styles=(0,l.AH)(o||(o=(0,i.A)(["ha-qr-code{text-align:center}"]))),(0,d.Cg)([(0,u.MZ)({attribute:!1})],v.prototype,"selector",void 0),v=(0,d.Cg)([(0,u.EM)("ha-selector-qr_code")],v)}}]);
//# sourceMappingURL=52266.58ada06ec04ff143.js.map