export const id=3584;export const ids=[3584,7108];export const modules={57108:(e,r,t)=>{t.r(r),t.d(r,{HaQrCode:()=>l});var a=t(36312),o=t(14562),i=t(19867),s=(t(16891),t(66360)),d=t(29818),c=t(50240),n=(t(77477),t(28310));let l=(0,a.A)([(0,d.EM)("ha-qr-code")],(function(e,r){class t extends r{constructor(...r){super(...r),e(this)}}return{F:t,d:[{kind:"field",decorators:[(0,d.MZ)()],key:"data",value:void 0},{kind:"field",decorators:[(0,d.MZ)({attribute:"error-correction-level"})],key:"errorCorrectionLevel",value:()=>"medium"},{kind:"field",decorators:[(0,d.MZ)({type:Number})],key:"width",value:()=>4},{kind:"field",decorators:[(0,d.MZ)({type:Number})],key:"scale",value:()=>4},{kind:"field",decorators:[(0,d.MZ)({type:Number})],key:"margin",value:()=>4},{kind:"field",decorators:[(0,d.MZ)({type:Number})],key:"maskPattern",value:void 0},{kind:"field",decorators:[(0,d.MZ)({attribute:"center-image"})],key:"centerImage",value:void 0},{kind:"field",decorators:[(0,d.wk)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,d.P)("canvas")],key:"_canvas",value:void 0},{kind:"method",key:"willUpdate",value:function(e){(0,o.A)((0,i.A)(t.prototype),"willUpdate",this).call(this,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.v2)(t.split(",").map((e=>parseInt(e,10)))),i=(0,n.v2)(a.split(",").map((e=>parseInt(e,10))));if(c.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?s.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:s.qy`<canvas></canvas>`:s.s6}},{kind:"field",static:!0,key:"styles",value:()=>s.AH`:host{display:block}`}]}}),s.WF)},23584:(e,r,t)=>{t.r(r),t.d(r,{HaSelectorQRCode:()=>s});var a=t(36312),o=t(66360),i=t(29818);t(57108);let s=(0,a.A)([(0,i.EM)("ha-selector-qr_code")],(function(e,r){return{F:class extends r{constructor(...r){super(...r),e(this)}},d:[{kind:"field",decorators:[(0,i.MZ)({attribute:!1})],key:"selector",value:void 0},{kind:"method",key:"render",value:function(){return o.qy`<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.AH`ha-qr-code{text-align:center}`}]}}),o.WF)}};
//# sourceMappingURL=3584.QFFQiIfynW8.js.map