import{E as w}from"./index-6Jqoo2rk.js";function f(e){const t=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return new Promise(r=>{const a=new FileReader;a.onload=n=>{r(n.target.result)},a.readAsDataURL(t)})}const c=new Map;function h(e){let t=c.get(e);return t||(t=fetch("assets/img/logo_padded.svg").then(r=>r.text()).then(r=>f(r.replace(/(fill:).+?(;)/,`$1${e}$2`))),c.set(e,t)),t}async function C(e){const{data:t,size:r,host:a,background:n,foreground:i,logoColor:g,pixelRatio:d=window.devicePixelRatio,QRCodeStylingCtor:u}=e,m=await h(g),o=new u({width:r*d,height:r*d,data:t,image:m,dotsOptions:{color:i,type:"rounded"},cornersSquareOptions:{type:"extra-rounded",color:i},imageOptions:{imageSize:1,margin:0},backgroundOptions:{color:n},qrOptions:{errorCorrectionLevel:"L"}});o.append(a);const l=a.lastChild;e.canvasClass&&l.classList.add(e.canvasClass);let s;return o._drawingPromise?s=o._drawingPromise:s=Promise.race([w(1e3),new Promise(p=>{o._canvas._image.addEventListener("load",()=>{window.requestAnimationFrame(()=>p())},{once:!0})})]),await s,{canvas:l,qrCode:o}}function b(e){return`https://t.me/${e}`}export{b,C as p,f as t};
//# sourceMappingURL=paintQrCode-u2FNs0A8.js.map
