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