export const ids=["2685"];export const modules={9643:function(e,r,t){t.r(r),t.d(r,{HaQrCode:function(){return c}});var a=t(44249),o=t(72621),i=(t(13334),t(57243)),s=t(50778),d=t(54647),n=(t(17949),t(91635));let c=(0,a.Z)([(0,s.Mo)("ha-qr-code")],(function(e,r){class t extends r{constructor(...r){super(...r),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"data",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-correction-level"})],key:"errorCorrectionLevel",value:()=>"medium"},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"width",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"scale",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"margin",value:()=>4},{kind:"field",decorators:[(0,s.Cb)({attribute:!1,type:Number})],key:"maskPattern",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"center-image"})],key:"centerImage",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,s.IO)("canvas")],key:"_canvas",value:void 0},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(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)}},{kind:"method",key:"updated",value:function(e){const 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"))){const e=getComputedStyle(this),t=e.getPropertyValue("--rgb-primary-text-color"),a=e.getPropertyValue("--rgb-card-background-color"),o=(0,n.CO)(t.split(",").map((e=>parseInt(e,10)))),i=(0,n.CO)(a.split(",").map((e=>parseInt(e,10))));if(d.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:i,dark:o}}).catch((e=>{this._error=e.message})),this.centerImage){const e=this._canvas.getContext("2d"),t=new Image;t.src=this.centerImage,t.onload=()=>{e?.drawImage(t,.375*r.width,.375*r.height,r.width/4,r.height/4)}}}}},{kind:"method",key:"render",value:function(){return this.data?this._error?i.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:i.dy`<canvas></canvas>`:i.Ld}},{kind:"field",static:!0,key:"styles",value:()=>i.iv`:host{display:block}`}]}}),i.oi)},34043:function(e,r,t){t.r(r),t.d(r,{HaSelectorQRCode:function(){return s}});var a=t(44249),o=t(57243),i=t(50778);t(9643);let s=(0,a.Z)([(0,i.Mo)("ha-selector-qr_code")],(function(e,r){return{F:class extends r{constructor(...r){super(...r),e(this)}},d:[{kind:"field",decorators:[(0,i.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"method",key:"render",value:function(){return o.dy`<ha-qr-code .data="${this.selector.qr_code?.data}" .scale="${this.selector.qr_code?.scale}" .errorCorrectionLevel="${this.selector.qr_code?.error_correction_level}" .centerImage="${this.selector.qr_code?.center_image}"></ha-qr-code>`}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-qr-code{text-align:center}`}]}}),o.oi)}};
//# sourceMappingURL=2685.e875eb39d25eaaba.js.map