import{s as b,e as x,c as w,h as S,d as l,a as i,i as v,n as d,o as C,p as T}from"./scheduler.bDsl0G2p.js";import{S as k,i as A}from"./index.DtyFm6kT.js";import{p as E}from"./0.D1YHP6Ug.js";import{p as m,H as u,a as Q}from"./BrowserQRCodeSvgWriter.BJvCx6wU.js";const H=o=>{const e=atob(o),t=e.length,r=new Uint8Array(t);for(let s=0;s<t;s++)r[s]=e.charCodeAt(s);return m.inflate(r,{to:"string"})};function R(o){let e;return{c(){e=x("div"),this.h()},l(t){e=w(t,"DIV",{monitor:!0,id:!0,style:!0}),S(e).forEach(l),this.h()},h(){i(e,"monitor","barcode vision"),i(e,"id","barcode_vision"),i(e,"style",o[0])},m(t,r){v(t,e,r)},p:d,i:d,o:d,d(t){t&&l(e)}}}function D(o,e,t){let{found:r=()=>{}}=e,{styles:c={}}=e,s=E(Object.assign({},{height:"400px",width:"100%","max-width":"600px",margin:"0 auto"},c));const _=async(n,y)=>{const g=H(n);r({hexadecimal_string:g,decodedText:n,decodedResult:y})},h=function(){if(arguments[0]==="QR code parse error, error = NotFoundException: No MultiFormat Readers were able to detect the code."){console.info("The code was not visualized.");return}console.log("on_error",arguments)};let a;const f=()=>{const n={fps:10,qrbox:{width:500,height:500},formatsToSupport:[u.QR_CODE,u.AZTEC]};a=new Q("barcode_vision",n),a.render(_,h)},p=()=>{a&&a.pause()};return C(async()=>{f()}),T(async()=>{if(a)try{a.clear()}catch(n){console.error(n)}}),o.$$set=n=>{"found"in n&&t(1,r=n.found),"styles"in n&&t(2,c=n.styles)},[s,r,c,p]}class L extends k{constructor(e){super(),A(this,e,D,R,b,{found:1,styles:2,stop_the_scan:3})}get stop_the_scan(){return this.$$.ctx[3]}}const N=o=>{const e=new TextEncoder().encode(o),t=m.deflate(e);return btoa(String.fromCharCode(...new Uint8Array(t)))};export{L as T,N as p,H as u};
//# sourceMappingURL=pack.R63SLi_0.js.map
