PageSourceSearch

https://freesavevideo.online/_app/immutable/nodes/18.evV7kKvz.js

js freesavevideo.online collected 2026-10-02 00:04:46 UTC 506,789 bytes, 20 lines download raw bytes

1import{s as lr,o as $t,a2 as Ir,H as zr,I as mn,f as k,d as O,C as F,k as U,i as T,y as N,D as L,j as C,l as E,V as Er,M as Te,n as j,m as _,z as Ie,E as Z,r as cr,K as Jt,F as Lt,p as fr,A as vt,O as Cr,J as no,S as Pn,N as io,P as kr,w as rr,x as nr,_ as da,h as ao,$ as ha,B as $r,aj as ln}from"../chunks/scheduler.Cc4Vd-yM.js";import{S as dr,i as hr,c as it,a as at,m as ot,t as he,b as xe,d as st,g as Rt,e as Pt,f as cn}from"../chunks/index.BuGf6HXW.js";import{g as oo}from"../chunks/globals.D0QH3NT1.js";import{e as mt,u as jr,d as Yr}from"../chunks/each.CEikupUu.js";import{t as ht}from"../chunks/translations.Dtlp3A-Q.js";import{p as so}from"../chunks/stores.MyUs4phX.js";import{S as En}from"../chunks/SettingsCategory.B9enzUGc.js";import{A as Bt}from"../chunks/ActionButton.BHZlVraB.js";import{b as fo,g as uo}from"../chunks/clerk.sh6PovXz.js";import{c as gr,C as lo}from"../chunks/clipboard-manager.BVOKS9G0.js";import{v as co}from"../chunks/env.G-8eSYOR.js";function Mn(r,e,t){const n=r.slice();return n[35]=e[t],n[37]=t,n}function Bn(r,e,t){const n=r.slice();return n[35]=e[t],n[37]=t,n}function Fn(r,e,t){const n=r.slice();return n[35]=e[t],n[37]=t,n}function Ln(r){let e,t,n,i="📥",a,o,s=r[10]("clipboard.file_transfer.new_file_received")+"",f;return{c(){e=O("div"),t=O("div"),n=O("span"),n.textContent=i,a=k(),o=O("span"),f=F(s),this.h()},l(u){e=T(u,"DIV",{class:!0});var l=N(e);t=T(l,"DIV",{class:!0});var c=N(t);n=T(c,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(n)!=="svelte-mmk2wo"&&(n.textContent=i),a=U(c),o=T(c,"SPAN",{class:!0});var d=N(o);f=L(d,s),d.forEach(C),c.forEach(C),l.forEach(C),this.h()},h(){E(n,"class","notification-icon svelte-w4s86g"),E(o,"class","notification-text"),E(t,"class","notification-content svelte-w4s86g"),E(e,"class","received-notification svelte-w4s86g")},m(u,l){j(u,e,l),_(e,t),_(t,n),_(t,a),_(t,o),_(o,f)},p(u,l){l[0]&1024&&s!==(s=u[10]("clipboard.file_transfer.new_file_received")+"")&&Z(f,s)},d(u){u&&C(e)}}}function ho(r){let e,t=r[10]("clipboard.file_transfer.drop_zone_text")+"",n;return{c(){e=O("p"),n=F(t),this.h()},l(i){e=T(i,"P",{class:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","svelte-w4s86g")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1024&&t!==(t=i[10]("clipboard.file_transfer.drop_zone_text")+"")&&Z(n,t)},d(i){i&&C(e)}}}function vo(r){let e,t,n=r[10]("clipboard.file_transfer.transfer_in_progress")+"",i;return{c(){e=O("p"),t=F("🚫 "),i=F(n),this.h()},l(a){e=T(a,"P",{class:!0});var o=N(e);t=L(o,"🚫 "),i=L(o,n),o.forEach(C),this.h()},h(){E(e,"class","svelte-w4s86g")},m(a,o){j(a,e,o),_(e,t),_(e,i)},p(a,o){o[0]&1024&&n!==(n=a[10]("clipboard.file_transfer.transfer_in_progress")+"")&&Z(i,n)},d(a){a&&C(e)}}}function kn(r){let e,t,n,i=r[10]("clipboard.file_transfer.send_files")+"",a,o,s=[],f=new Map,u,l,c,d,h,v=mt(r[1]);const p=A=>A[35].name+A[37];for(let A=0;A<v.length;A+=1){let x=Fn(r,v,A),m=p(x);f.set(m,s[A]=Un(m,x))}const y=[go,po],g=[];function w(A,x){return A[6]?1:0}return c=w(r),d=g[c]=y[c](r),{c(){e=O("div"),t=O("div"),n=O("h5"),a=F(i),o=k();for(let A=0;A<s.length;A+=1)s[A].c();u=k(),l=O("div"),d.c(),this.h()},l(A){e=T(A,"DIV",{class:!0});var x=N(e);t=T(x,"DIV",{class:!0});var m=N(t);n=T(m,"H5",{class:!0});var S=N(n);a=L(S,i),S.forEach(C),o=U(m);for(let D=0;D<s.length;D+=1)s[D].l(m);m.forEach(C),u=U(x),l=T(x,"DIV",{class:!0});var b=N(l);d.l(b),b.forEach(C),x.forEach(C),this.h()},h(){E(n,"class","svelte-w4s86g"),E(t,"class","file-list selected-files-list svelte-w4s86g"),E(l,"class","selected-files-footer svelte-w4s86g"),E(e,"class","selected-files-panel svelte-w4s86g")},m(A,x){j(A,e,x),_(e,t),_(t,n),_(n,a),_(t,o);for(let m=0;m<s.length;m+=1)s[m]&&s[m].m(t,null);_(e,u),_(e,l),g[c].m(l,null),h=!0},p(A,x){(!h||x[0]&1024)&&i!==(i=A[10]("clipboard.file_transfer.send_files")+"")&&Z(a,i),x[0]&132098&&(v=mt(A[1]),s=jr(s,x,p,1,A,v,f,t,Yr,Un,null,Fn));let m=c;c=w(A),c===m?g[c].p(A,x):(Rt(),xe(g[m],1,1,()=>{g[m]=null}),Pt(),d=g[c],d?d.p(A,x):(d=g[c]=y[c](A),d.c()),he(d,1),d.m(l,null))},i(A){h||(he(d),h=!0)},o(A){xe(d),h=!1},d(A){A&&C(e);for(let x=0;x<s.length;x+=1)s[x].d();g[c].d()}}}function Un(r,e){let t,n,i=e[35].name+"",a,o,s,f,u=er(e[35].size)+"",l,c,d,h,v,p,y,g,w;function A(){return e[27](e[37])}return{key:r,first:null,c(){t=O("div"),n=O("span"),a=F(i),o=k(),s=O("span"),f=F("("),l=F(u),c=F(")"),d=k(),h=O("button"),v=F("×"),y=k(),this.h()},l(x){t=T(x,"DIV",{class:!0});var m=N(t);n=T(m,"SPAN",{class:!0});var S=N(n);
1a=L(S,i),S.forEach(C),o=U(m),s=T(m,"SPAN",{class:!0});var b=N(s);f=L(b,"("),l=L(b,u),c=L(b,")"),b.forEach(C),d=U(m),h=T(m,"BUTTON",{class:!0,"aria-label":!0});var D=N(h);v=L(D,"×"),D.forEach(C),y=U(m),m.forEach(C),this.h()},h(){E(n,"class","file-name svelte-w4s86g"),E(s,"class","file-size svelte-w4s86g"),E(h,"class","remove-file svelte-w4s86g"),E(h,"aria-label",p=e[10]("clipboard.file_transfer.remove")),E(t,"class","file-item svelte-w4s86g"),this.first=t},m(x,m){j(x,t,m),_(t,n),_(n,a),_(t,o),_(t,s),_(s,f),_(s,l),_(s,c),_(t,d),_(t,h),_(h,v),_(t,y),g||(w=Ie(h,"click",A),g=!0)},p(x,m){e=x,m[0]&2&&i!==(i=e[35].name+"")&&Z(a,i),m[0]&2&&u!==(u=er(e[35].size)+"")&&Z(l,u),m[0]&1024&&p!==(p=e[10]("clipboard.file_transfer.remove"))&&E(h,"aria-label",p)},d(x){x&&C(t),g=!1,w()}}}function po(r){let e,t;return e=new Bt({props:{id:"confirm-send-files",disabled:r[1].length===0||r[7]||r[3],click:r[18],$$slots:{default:[_o]},$$scope:{ctx:r}}}),{c(){it(e.$$.fragment)},l(n){at(e.$$.fragment,n)},m(n,i){ot(e,n,i),t=!0},p(n,i){const a={};i[0]&138&&(a.disabled=n[1].length===0||n[7]||n[3]),i[0]&1024|i[1]&512&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){t||(he(e.$$.fragment,n),t=!0)},o(n){xe(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function go(r){let e,t=r[10]("clipboard.waiting_peer")+"",n;return{c(){e=O("div"),n=F(t),this.h()},l(i){e=T(i,"DIV",{class:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","connection-warning svelte-w4s86g")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1024&&t!==(t=i[10]("clipboard.waiting_peer")+"")&&Z(n,t)},i:fr,o:fr,d(i){i&&C(e)}}}function _o(r){let e=r[10]("clipboard.send")+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&1024&&e!==(e=n[10]("clipboard.send")+"")&&Z(t,e)},d(n){n&&C(t)}}}function Vn(r){let e,t,n,i=r[10]("clipboard.file_transfer.sending_progress")+"",a,o,s=Math.round(r[5])+"",f,u,l,c,d,h,v,p,y;c=new Bt({props:{id:"cancel-sending",disabled:!1,click:r[19],$$slots:{default:[yo]},$$scope:{ctx:r}}});let g=r[1].length>0&&Hn(r);return{c(){e=O("div"),t=O("div"),n=O("h4"),a=F(i),o=F(": "),f=F(s),u=F("%"),l=k(),it(c.$$.fragment),d=k(),h=O("div"),v=O("div"),p=k(),g&&g.c(),this.h()},l(w){e=T(w,"DIV",{class:!0});var A=N(e);t=T(A,"DIV",{class:!0});var x=N(t);n=T(x,"H4",{class:!0});var m=N(n);a=L(m,i),o=L(m,": "),f=L(m,s),u=L(m,"%"),m.forEach(C),l=U(x),at(c.$$.fragment,x),x.forEach(C),d=U(A),h=T(A,"DIV",{class:!0});var S=N(h);v=T(S,"DIV",{class:!0,style:!0}),N(v).forEach(C),S.forEach(C),p=U(A),g&&g.l(A),A.forEach(C),this.h()},h(){E(n,"class","svelte-w4s86g"),E(t,"class","progress-header svelte-w4s86g"),E(v,"class","progress-fill svelte-w4s86g"),Er(v,"width",r[5]+"%"),E(h,"class","progress-bar svelte-w4s86g"),E(e,"class","progress-section svelte-w4s86g")},m(w,A){j(w,e,A),_(e,t),_(t,n),_(n,a),_(n,o),_(n,f),_(n,u),_(t,l),ot(c,t,null),_(e,d),_(e,h),_(h,v),_(e,p),g&&g.m(e,null),y=!0},p(w,A){(!y||A[0]&1024)&&i!==(i=w[10]("clipboard.file_transfer.sending_progress")+"")&&Z(a,i),(!y||A[0]&32)&&s!==(s=Math.round(w[5])+"")&&Z(f,s);const x={};A[0]&1024|A[1]&512&&(x.$$scope={dirty:A,ctx:w}),c.$set(x),(!y||A[0]&32)&&Er(v,"width",w[5]+"%"),w[1].length>0?g?g.p(w,A):(g=Hn(w),g.c(),g.m(e,null)):g&&(g.d(1),g=null)},i(w){y||(he(c.$$.fragment,w),y=!0)},o(w){xe(c.$$.fragment,w),y=!1},d(w){w&&C(e),st(c),g&&g.d()}}}function yo(r){let e=r[10]("clipboard.file_transfer.cancel_sending")+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&1024&&e!==(e=n[10]("clipboard.file_transfer.cancel_sending")+"")&&Z(t,e)},d(n){n&&C(t)}}}function Hn(r){let e,t,n=r[10]("clipboard.file_transfer.sending_files")+"",i,a,o=[],s=new Map,f=mt(r[1]);const u=l=>l[35].name+l[37];for(let l=0;l<f.length;l+=1){let c=Bn(r,f,l),d=u(c);s.set(d,o[l]=Gn(d,c))}return{c(){e=O("div"),t=O("h5"),i=F(n),a=k();for(let l=0;l<o.length;l+=1)o[l].c();this.h()},l(l){e=T(l,"DIV",{class:!0});var c=N(e);t=T(c,"H5",{class:!0});var d=N(t);i=L(d,n),d.forEach(C),a=U(c);for(let h=0;h<o.length;h+=1)o[h].l(c);c.forEach(C),this.h()},h(){E(t,"class","svelte-w4s86g"),E(e,"class","sending-files svelte-w4s86g")},m(l,c){j(l,e,c),_(e,t),_(t,i),_(e,a);for(let d=0;d<o.length;d+=1)o[d]&&o[d].m(e,null)},p(l,c){c[0]&1024&&n!==(n=l[10]("clipboard.file_transfer.sending_files")+"")&&Z(i,n),c[0]&2&&(f=mt(l[1]),o=jr(o,c,u,1,l,f,s,e,Yr,Gn,null,Bn))},d(l){l&&C(e);for(let c=0;c<o.length;c+=1)o[c].d()}}}function Gn(r,e){let t,n,i=e[35].name+"",a,o,s,f,u=er(e[35].size)+"",l,c,d,h,v="📤",p;return{key:r,first:null,c(){t=O("div"),n=O("span"),a=F(i),o=k(),s=O("span"),f=F("("),l=F(u),c=F(")"),d=k(),h=O("span"),h.textContent=v,p=k(),this.h()},l(y){t=T(y,"DIV",{class:!0});var g=N(t);n=T(g,"SPAN",{class:!0});var w=N(n);
1a=L(w,i),w.forEach(C),o=U(g),s=T(g,"SPAN",{class:!0});var A=N(s);f=L(A,"("),l=L(A,u),c=L(A,")"),A.forEach(C),d=U(g),h=T(g,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(h)!=="svelte-x71gvi"&&(h.textContent=v),p=U(g),g.forEach(C),this.h()},h(){E(n,"class","file-name svelte-w4s86g"),E(s,"class","file-size svelte-w4s86g"),E(h,"class","sending-indicator svelte-w4s86g"),E(t,"class","file-item sending svelte-w4s86g"),this.first=t},m(y,g){j(y,t,g),_(t,n),_(n,a),_(t,o),_(t,s),_(s,f),_(s,l),_(s,c),_(t,d),_(t,h),_(t,p)},p(y,g){e=y,g[0]&2&&i!==(i=e[35].name+"")&&Z(a,i),g[0]&2&&u!==(u=er(e[35].size)+"")&&Z(l,u)},d(y){y&&C(t)}}}function Xn(r){let e,t,n,i=r[10]("clipboard.file_transfer.receiving_progress")+"",a,o,s=Math.round(r[5])+"",f,u,l,c,d,h,v,p;return c=new Bt({props:{id:"cancel-receiving",disabled:!1,click:r[20],$$slots:{default:[xo]},$$scope:{ctx:r}}}),{c(){e=O("div"),t=O("div"),n=O("h4"),a=F(i),o=F(": "),f=F(s),u=F("%"),l=k(),it(c.$$.fragment),d=k(),h=O("div"),v=O("div"),this.h()},l(y){e=T(y,"DIV",{class:!0});var g=N(e);t=T(g,"DIV",{class:!0});var w=N(t);n=T(w,"H4",{class:!0});var A=N(n);a=L(A,i),o=L(A,": "),f=L(A,s),u=L(A,"%"),A.forEach(C),l=U(w),at(c.$$.fragment,w),w.forEach(C),d=U(g),h=T(g,"DIV",{class:!0});var x=N(h);v=T(x,"DIV",{class:!0,style:!0}),N(v).forEach(C),x.forEach(C),g.forEach(C),this.h()},h(){E(n,"class","svelte-w4s86g"),E(t,"class","progress-header svelte-w4s86g"),E(v,"class","progress-fill svelte-w4s86g"),Er(v,"width",r[5]+"%"),E(h,"class","progress-bar svelte-w4s86g"),E(e,"class","progress-section svelte-w4s86g")},m(y,g){j(y,e,g),_(e,t),_(t,n),_(n,a),_(n,o),_(n,f),_(n,u),_(t,l),ot(c,t,null),_(e,d),_(e,h),_(h,v),p=!0},p(y,g){(!p||g[0]&1024)&&i!==(i=y[10]("clipboard.file_transfer.receiving_progress")+"")&&Z(a,i),(!p||g[0]&32)&&s!==(s=Math.round(y[5])+"")&&Z(f,s);const w={};g[0]&1024|g[1]&512&&(w.$$scope={dirty:g,ctx:y}),c.$set(w),(!p||g[0]&32)&&Er(v,"width",y[5]+"%")},i(y){p||(he(c.$$.fragment,y),p=!0)},o(y){xe(c.$$.fragment,y),p=!1},d(y){y&&C(e),st(c)}}}function xo(r){let e=r[10]("clipboard.file_transfer.cancel_receiving")+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&1024&&e!==(e=n[10]("clipboard.file_transfer.cancel_receiving")+"")&&Z(t,e)},d(n){n&&C(t)}}}function wo(r){let e,t=r[10]("clipboard.file_transfer.no_received_files")+"",n;return{c(){e=O("div"),n=F(t),this.h()},l(i){e=T(i,"DIV",{class:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","empty-state svelte-w4s86g")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1024&&t!==(t=i[10]("clipboard.file_transfer.no_received_files")+"")&&Z(n,t)},d(i){i&&C(e)}}}function Ao(r){let e,t=[],n=new Map,i=mt(r[2]);const a=o=>o[35].name+o[37];for(let o=0;o<i.length;o+=1){let s=Mn(r,i,o),f=a(s);n.set(f,t[o]=Wn(f,s))}return{c(){e=O("div");for(let o=0;o<t.length;o+=1)t[o].c();this.h()},l(o){e=T(o,"DIV",{class:!0});var s=N(e);for(let f=0;f<t.length;f+=1)t[f].l(s);s.forEach(C),this.h()},h(){E(e,"class","file-list svelte-w4s86g"),Te(e,"desktop-scroll-guard",r[2].length>zn)},m(o,s){j(o,e,s);for(let f=0;f<t.length;f+=1)t[f]&&t[f].m(e,null)},p(o,s){s[0]&6292484&&(i=mt(o[2]),t=jr(t,s,a,1,o,i,n,e,Yr,Wn,null,Mn)),s[0]&4&&Te(e,"desktop-scroll-guard",o[2].length>zn)},d(o){o&&C(e);for(let s=0;s<t.length;s+=1)t[s].d()}}}function Wn(r,e){let t,n,i=e[35].name+"",a,o,s,f,u=er(e[35].size)+"",l,c,d,h,v,p=e[10]("clipboard.file_transfer.download")+"",y,g,w,A,x,m,S,b;function D(){return e[28](e[35])}function M(){return e[29](e[37])}return{key:r,first:null,c(){t=O("div"),n=O("span"),a=F(i),o=k(),s=O("span"),f=F("("),l=F(u),c=F(")"),d=k(),h=O("div"),v=O("button"),y=F(p),g=k(),w=O("button"),A=F("❌"),m=k(),this.h()},l(G){t=T(G,"DIV",{class:!0});var W=N(t);n=T(W,"SPAN",{class:!0});var V=N(n);a=L(V,i),V.forEach(C),o=U(W),s=T(W,"SPAN",{class:!0});var z=N(s);f=L(z,"("),l=L(z,u),c=L(z,")"),z.forEach(C),d=U(W),h=T(W,"DIV",{class:!0});var Q=N(h);v=T(Q,"BUTTON",{class:!0});var de=N(v);y=L(de,p),de.forEach(C),g=U(Q),w=T(Q,"BUTTON",{class:!0,"aria-label":!0});var re=N(w);A=L(re,"❌"),re.forEach(C),Q.forEach(C),m=U(W),W.forEach(C),this.h()},h(){E(n,"class","file-name svelte-w4s86g"),E(s,"class","file-size svelte-w4s86g"),E(v,"class","download-btn svelte-w4s86g"),E(w,"class","remove-file svelte-w4s86g"),E(w,"aria-label",x=e[10]("clipboard.file_transfer.remove")),E(h,"class","file-actions svelte-w4s86g"),E(t,"class","file-item svelte-w4s86g"),this.first=t},m(G,W){j(G,t,W),_(t,n),_(n,a),_(t,o),_(t,s),_(s,f),_(s,l),_(s,c),_(t,d),_(t,h),_(h,v),_(v,y),_(h,g),_(h,w),_(w,A),_(t,m),S||(b=[Ie(v,"click",D),Ie(w,"click",M)],S=!0)},p(G,W){e=G,W[0]&4&&i!==(i=e[35].name+"")&&Z(a,i),W[0]&4&&u!==(u=er(e[35].size)+"")&&Z(l,u),W[0]&1024&&p!==(p=e[10]("clipboard.file_transfer.download")+"")&&Z(y,p),W[0]&1024&&x!==(x=e[10]("clipboard.file_transfer.remove"))&&E(w,"aria-label",x)},d(G){G&&C(t),S=!1,cr(b)}}}function mo(r){let e,t,n,i,a=r[10]("clipboard.file_transfer.send_files")+"",o,s,f,u,l,c,d,h,v,p,y,g=r[10]("clipboard.received_files")+"",w,A,x,m,S,b,D=r[9]&&Ln(r);function M(X,R){return X[7]?vo:ho}let G=M(r),W=G(r),V=r[1].length>0&&!r[3]&&kn(r),z=r[3]&&Vn(r),Q=r[4]&&Xn(r);function de(X,R){if(X[2].length>0)return Ao;if(!X[4])return wo}
1let re=de(r),Y=re&&re(r);return{c(){D&&D.c(),e=k(),t=O("div"),n=O("div"),i=O("h4"),o=F(a),s=k(),f=O("div"),W.c(),u=k(),l=O("input"),d=k(),V&&V.c(),h=k(),z&&z.c(),v=k(),p=O("div"),y=O("h4"),w=F(g),A=k(),Q&&Q.c(),x=k(),Y&&Y.c(),this.h()},l(X){D&&D.l(X),e=U(X),t=T(X,"DIV",{class:!0});var R=N(t);n=T(R,"DIV",{class:!0});var ee=N(n);i=T(ee,"H4",{class:!0});var pe=N(i);o=L(pe,a),pe.forEach(C),s=U(ee),f=T(ee,"DIV",{class:!0,role:!0,tabindex:!0});var H=N(f);W.l(H),u=U(H),l=T(H,"INPUT",{type:!0,style:!0}),H.forEach(C),d=U(ee),V&&V.l(ee),h=U(ee),z&&z.l(ee),ee.forEach(C),v=U(R),p=T(R,"DIV",{class:!0});var J=N(p);y=T(J,"H4",{class:!0});var le=N(y);w=L(le,g),le.forEach(C),A=U(J),Q&&Q.l(J),x=U(J),Y&&Y.l(J),J.forEach(C),R.forEach(C),this.h()},h(){E(i,"class","svelte-w4s86g"),E(l,"type","file"),l.multiple=!0,l.disabled=r[7],Er(l,"display","none"),E(f,"class","file-drop-zone svelte-w4s86g"),E(f,"role","button"),E(f,"tabindex",c=r[7]?-1:0),Te(f,"dragover",r[0]),Te(f,"disabled",r[7]),E(n,"class","send-files svelte-w4s86g"),E(y,"class","svelte-w4s86g"),E(p,"class","received-files svelte-w4s86g"),E(t,"class","file-transfer-section svelte-w4s86g"),Te(t,"has-received-files",r[2].length>0)},m(X,R){D&&D.m(X,R),j(X,e,R),j(X,t,R),_(t,n),_(n,i),_(i,o),_(n,s),_(n,f),W.m(f,null),_(f,u),_(f,l),r[25](l),_(n,d),V&&V.m(n,null),_(n,h),z&&z.m(n,null),_(t,v),_(t,p),_(p,y),_(y,w),_(p,A),Q&&Q.m(p,null),_(p,x),Y&&Y.m(p,null),m=!0,S||(b=[Ie(l,"change",r[11]),Ie(l,"focus",r[13]),Ie(f,"dragover",r[14]),Ie(f,"dragleave",r[15]),Ie(f,"drop",r[16]),Ie(f,"click",r[12]),Ie(f,"keydown",r[26])],S=!0)},p(X,R){X[9]?D?D.p(X,R):(D=Ln(X),D.c(),D.m(e.parentNode,e)):D&&(D.d(1),D=null),(!m||R[0]&1024)&&a!==(a=X[10]("clipboard.file_transfer.send_files")+"")&&Z(o,a),G===(G=M(X))&&W?W.p(X,R):(W.d(1),W=G(X),W&&(W.c(),W.m(f,u))),(!m||R[0]&128)&&(l.disabled=X[7]),(!m||R[0]&128&&c!==(c=X[7]?-1:0))&&E(f,"tabindex",c),(!m||R[0]&1)&&Te(f,"dragover",X[0]),(!m||R[0]&128)&&Te(f,"disabled",X[7]),X[1].length>0&&!X[3]?V?(V.p(X,R),R[0]&10&&he(V,1)):(V=kn(X),V.c(),he(V,1),V.m(n,h)):V&&(Rt(),xe(V,1,1,()=>{V=null}),Pt()),X[3]?z?(z.p(X,R),R[0]&8&&he(z,1)):(z=Vn(X),z.c(),he(z,1),z.m(n,null)):z&&(Rt(),xe(z,1,1,()=>{z=null}),Pt()),(!m||R[0]&1024)&&g!==(g=X[10]("clipboard.received_files")+"")&&Z(w,g),X[4]?Q?(Q.p(X,R),R[0]&16&&he(Q,1)):(Q=Xn(X),Q.c(),he(Q,1),Q.m(p,x)):Q&&(Rt(),xe(Q,1,1,()=>{Q=null}),Pt()),re===(re=de(X))&&Y?Y.p(X,R):(Y&&Y.d(1),Y=re&&re(X),Y&&(Y.c(),Y.m(p,null))),(!m||R[0]&4)&&Te(t,"has-received-files",X[2].length>0)},i(X){m||(he(V),he(z),he(Q),m=!0)},o(X){xe(V),xe(z),xe(Q),m=!1},d(X){X&&(C(e),C(t)),D&&D.d(X),W.d(),r[25](null),V&&V.d(),z&&z.d(),Q&&Q.d(),Y&&Y.d(),S=!1,cr(b)}}}function Eo(r){let e,t;return e=new En({props:{title:r[10]("clipboard.file_transfer.title"),sectionId:"file-transfer",$$slots:{default:[mo]},$$scope:{ctx:r}}}
1),{c(){it(e.$$.fragment)},l(n){at(e.$$.fragment,n)},m(n,i){ot(e,n,i),t=!0},p(n,i){const a={};i[0]&1024&&(a.title=n[10]("clipboard.file_transfer.title")),i[0]&2047|i[1]&512&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(n){t||(he(e.$$.fragment,n),t=!0)},o(n){xe(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}const zn=200;function er(r){if(r===0)return"0 B";const e=1024,t=["B","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return parseFloat((r/Math.pow(e,n)).toFixed(2))+" "+t[n]}function Co(r,e,t){let n;$t(r,ht,H=>t(10,n=H));const i=Ir();let{files:a}=e,{receivedFiles:o}=e,{sendingFiles:s}=e,{receivingFiles:f}=e,{transferProgress:u}=e,{dragover:l}=e,{peerConnected:c}=e,{isTransferring:d=!1}=e,h,v=!1,p=!1;function y(){typeof window<"u"&&t(23,p=window.innerWidth<1024)}let g=o.length;const w=200*1024*1024;function A(H){const J=H.filter(Ee=>Ee.size>w);if(J.length>0){const Ee=Math.round(w/1048576),ce=J.map(ge=>`${ge.name} (${er(ge.size)})`).join(", ");alert(`Some files exceed ${Ee}MB and cannot be sent:\\n${ce}`)}const le=H.filter(Ee=>Ee.size<=w);le.length!==0&&i("filesSelected",{files:le})}function x(H){if(d)return;const J=H.target;J.files&&(i("fileSelectionComplete"),A(Array.from(J.files)))}function m(){d||(i("prepareFileSelection"),h==null||h.click())}function S(){i("prepareFileSelection")}function b(H){d||(H.preventDefault(),t(0,l=!0))}function D(){d||t(0,l=!1)}function M(H){var J;if(d){H.preventDefault();return}H.preventDefault(),t(0,l=!1),(J=H.dataTransfer)!=null&&J.files&&A(Array.from(H.dataTransfer.files))}function G(H){i("removeFile",{index:H})}function W(){i("sendFiles")}function V(){i("cancelSending")}function z(){i("cancelReceiving")}function Q(H){i("downloadFile",{file:H})}function de(H){i("removeReceivedFile",{index:H})}let re;zr(()=>{y(),re=()=>y(),typeof window<"u"&&window.addEventListener("resize",re)}),mn(()=>{typeof window<"u"&&re&&window.removeEventListener("resize",re)});function Y(H){Jt[H?"unshift":"push"](()=>{h=H,t(8,h)})}const X=H=>!d&&H.key==="Enter"&&m(),R=H=>G(H),ee=H=>Q(H),pe=H=>de(H);return r.$$set=H=>{"files"in H&&t(1,a=H.files),"receivedFiles"in H&&t(2,o=H.receivedFiles),"sendingFiles"in H&&t(3,s=H.sendingFiles),"receivingFiles"in H&&t(4,f=H.receivingFiles),"transferProgress"in H&&t(5,u=H.transferProgress),"dragover"in H&&t(0,l=H.dragover),"peerConnected"in H&&t(6,c=H.peerConnected),"isTransferring"in H&&t(7,d=H.isTransferring)},r.$$.update=()=>{r.$$.dirty[0]&25165828&&(o.length>g&&(y(),p&&(t(9,v=!0),setTimeout(()=>{t(9,v=!1)},3e3))),t(24,g=o.length))},[l,a,o,s,f,u,c,d,h,v,n,x,m,S,b,D,M,G,W,V,z,Q,de,p,g,Y,X,R,ee,pe]}class Io extends dr{constructor(e){super(),hr(this,e,Co,Eo,lr,{files:1,receivedFiles:2,sendingFiles:3,receivingFiles:4,transferProgress:5,dragover:0,peerConnected:6,isTransferring:7},null,[-1,-1])}}function So(r,e){var t=Object.setPrototypeOf;t?t(r,e):r.__proto__=e}function bo(r,e){e===void 0&&(e=r.constructor);var t=Error.captureStackTrace;t&&t(r,e)}var Oo=function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),To=function(r){Oo(e,r);function e(t,n){var i=this.constructor,a=r.call(this,t,n)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),So(a,i.prototype),bo(a),a}return e}(Error),Do=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ct=function(r){Do(e,r);function e(t){t===void 0&&(t=void 0);var n=r.call(this,t)||this;return n.message=t,n}return e.prototype.getKind=function(){var t=this.constructor;return t.kind},e.kind="Exception",e}(To),No=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
1e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),We=function(r){No(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArgumentException",e}(Ct),Ro=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ue=function(r){Ro(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e}(Ct),va=function(){function r(e){if(this.binarizer=e,e===null)throw new ue("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(e,t,n,i){var a=this.binarizer.getLuminanceSource().crop(e,t,n,i);return new r(this.binarizer.createBinarizer(a))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(e))},r.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(e))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Po=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ze=function(r){Po(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(Ct),Mo=function(){function r(e){this.source=e}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),Le=function(){function r(){}return r.arraycopy=function(e,t,n,i,a){for(;a--;)n[i++]=e[t++]},r.currentTimeMillis=function(){return Date.now()},r}(),Bo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Cn=function(r){Bo(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e}(Ct),Fo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),jn=function(r){Fo(e,r);function e(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=t,i.message=n,i}return e.kind="ArrayIndexOutOfBoundsException",e}(Cn),Lo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$e=function(){function r(){}return r.fill=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]=t},r.fillWithin=function(e,t,n,i){r.rangeCheck(e.length,t,n);for(var a=t;a<n;a++)e[a]=i},r.rangeCheck=function(e,t,n){if(t>n)throw new ue("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new jn(t);
1if(n>e)throw new jn(n)},r.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},r.create=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Array.from({length:t}).fill(n)})},r.createInt32Array=function(e,t,n){var i=Array.from({length:e});return i.map(function(a){return Int32Array.from({length:t}).fill(n)})},r.equals=function(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0},r.hashCode=function(e){var t,n;if(e===null)return 0;var i=1;try{for(var a=Lo(e),o=a.next();!o.done;o=a.next()){var s=o.value;i=31*i+s}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},r.fillUint8Array=function(e,t){for(var n=0;n!==e.length;n++)e[n]=t},r.copyOf=function(e,t){return e.slice(0,t)},r.copyOfUint8Array=function(e,t){if(e.length<=t){var n=new Uint8Array(t);return n.set(e),n}return e.slice(0,t)},r.copyOfRange=function(e,t,n){var i=n-t,a=new Int32Array(i);return Le.arraycopy(e,t,a,0,i),a},r.binarySearch=function(e,t,n){n===void 0&&(n=r.numberComparator);for(var i=0,a=e.length-1;i<=a;){var o=a+i>>1,s=n(t,e[o]);if(s>0)i=o+1;else if(s<0)a=o-1;else return o}return-i-1},r.numberComparator=function(e,t){return e-t},r}(),me=function(){function r(){}return r.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},r.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},r.toHexString=function(e){return e.toString(16)},r.toBinaryString=function(e){return String(parseInt(String(e),2))},r.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},r.truncDivision=function(e,t){return Math.trunc(e/t)},r.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),nt=function(){function r(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=r.makeArray(e):this.bits=t)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var t=r.makeArray(e);Le.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}},r.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},r.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},r.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},r.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=n[i]}var s=i*32+me.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,i=Math.floor(e/32),a=~n[i];a&=~((1<<(e&31))-1);for(var o=n.length;a===0;){if(++i===o)return t;a=~n[i]}var s=i*32+me.numberOfTrailingZeros(a);return s>t?t:s},r.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},r.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new ue;if(t!==e){t--;for(var n=Math.floor(e/32),i=Math.floor(t/32),a=this.bits,o=n;o<=i;o++){var s=o>n?0:e&31,f=o<i?31:t&31,u=(2<<f)-(1<<s);a[o]|=u}}},r.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,n=0;n<e;n++)t[n]=0},r.prototype.isRange=function(e,t,n){if(t<e||e<0||t>this.size)throw new ue;if(t===e)return!0;t--;for(var i=Math.floor(e/32),a=Math.floor(t/32),o=this.bits,s=i;s<=a;s++){var f=s>i?0:e&31,u=s<a?31:t&31,l=(2<<u)-(1<<f)&4294967295;if((o[s]&l)!==(n?l:0))return!1}return!0},r.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(e,t){if(t<0||t>32)throw new ue("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)},r.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n<t;n++)this.appendBit(e.get(n))},r.prototype.xor=function(e){if(this.size!==e.size)throw new ue("Sizes don't match");for(var t=this.bits,n=0,i=t.length;n<i;n++)t[n]^=e.bits[n]},r.prototype.toBytes=function(e,t,n,i){for(var a=0;a<i;a++){for(var o=0,s=0;s<8;s++)this.get(e)&&(o|=1<<7-s),e++;t[n+a]=o}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),n=t+1,i=this.bits,a=0;a<n;a++){var o=i[a];o=o>>1&1431655765|(o&1431655765)<<1,o=o>>2&858993459|(o&858993459)<<2,o=o>>4&252645135|(o&252645135)<<4,o=o>>8&16711935|(o&16711935)<<8,o=o>>16&65535|(o&65535)<<16,e[t-a]=o}if(this.size!==n*32){for(var s=n*32-this.size,f=e[0]>>>s,a=1;a<n;a++){var u=e[a];f|=u<<32-s,e[a-1]=f,f=u>>>s}e[n-1]=f}this.bits=e},r.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.size===t.size&&$e.equals(this.bits,t.bits)}
1,r.prototype.hashCode=function(){return 31*this.size+$e.hashCode(this.bits)},r.prototype.toString=function(){for(var e="",t=0,n=this.size;t<n;t++)t&7||(e+=" "),e+=this.get(t)?"X":".";return e},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var e=[],t=0,n=this.size;t<n;t++)e.push(this.get(t));return e},r}(),dn;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",r[r.ASSUME_GS1=8]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"})(dn||(dn={}));const ke=dn;var ko=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),$=function(r){ko(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(Ct),Uo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Pe;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(Pe||(Pe={}));var Qe=function(){function r(e,t,n){for(var i,a,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,typeof t=="number"?this.values=Int32Array.from([t]):this.values=t,this.otherEncodingNames=o,r.VALUE_IDENTIFIER_TO_ECI.set(e,this),r.NAME_TO_ECI.set(n,this);for(var f=this.values,u=0,l=f.length;u!==l;u++){var c=f[u];r.VALUES_TO_ECI.set(c,this)}try{for(var d=Uo(o),h=d.next();!h.done;h=d.next()){var v=h.value;r.NAME_TO_ECI.set(v,this)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new $("incorect value");var t=r.VALUES_TO_ECI.get(e);if(t===void 0)throw new $("incorect value");return t},r.getCharacterSetECIByName=function(e){var t=r.NAME_TO_ECI.get(e);if(t===void 0)throw new $("incorect value");return t},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.getName()===t.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(Pe.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(Pe.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(Pe.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(Pe.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(Pe.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(Pe.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(Pe.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(Pe.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(Pe.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(Pe.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(Pe.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(Pe.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(Pe.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(Pe.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(Pe.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(Pe.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(Pe.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(Pe.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(Pe.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(Pe.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(Pe.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(Pe.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(Pe.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(Pe.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(Pe.Big5,28,"Big5"),r.GB18030=new r(Pe.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(Pe.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),Vo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
1e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Br=function(r){Vo(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e}(Ct),Ot=function(){function r(){}return r.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},r.shouldDecodeOnFallback=function(e){return!r.isBrowser()&&e==="ISO-8859-1"},r.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(e){return typeof e=="string"?e:e.getName()},r.encodingCharacterSet=function(e){return e instanceof Qe?e:Qe.getCharacterSetECIByName(e)},r.decodeFallback=function(e,t){var n=this.encodingCharacterSet(t);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=e.length;a<o;a++){var s=e[a].toString(16);s.length<2&&(s="0"+s),i+="%"+s}return decodeURIComponent(i)}if(n.equals(Qe.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new Br("Encoding "+this.encodingName(t)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(e){return e.equals(Qe.UTF8)||e.equals(Qe.ISO8859_1)||e.equals(Qe.ASCII)},r.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))),n=t.split(""),i=[],a=0;a<n.length;a++)i.push(n[a].charCodeAt(0));return new Uint8Array(i)},r}(),Ce=function(){function r(){}return r.castAsNonUtf8Char=function(e,t){t===void 0&&(t=null);var n=t?t.getName():this.ISO88591;return Ot.decode(new Uint8Array([e]),n)},r.guessEncoding=function(e,t){if(t!=null&&t.get(ke.CHARACTER_SET)!==void 0)return t.get(ke.CHARACTER_SET).toString();for(var n=e.length,i=!0,a=!0,o=!0,s=0,f=0,u=0,l=0,c=0,d=0,h=0,v=0,p=0,y=0,g=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,A=0;A<n&&(i||a||o);A++){var x=e[A]&255;o&&(s>0?x&128?s--:o=!1:x&128&&(x&64?(s++,x&32?(s++,x&16?(s++,x&8?o=!1:l++):u++):f++):o=!1)),i&&(x>127&&x<160?i=!1:x>159&&(x<192||x===215||x===247)&&g++),a&&(c>0?x<64||x===127||x>252?a=!1:c--:x===128||x===160||x>239?a=!1:x>160&&x<224?(d++,v=0,h++,h>p&&(p=h)):x>127?(c++,h=0,v++,v>y&&(y=v)):(h=0,v=0))}return o&&s>0&&(o=!1),a&&c>0&&(a=!1),o&&(w||f+u+l>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||p>=3||y>=3)?r.SHIFT_JIS:i&&a?p===2&&d===2||g*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=-1;function a(s,f,u,l,c,d){if(s==="%%")return"%";if(t[++i]!==void 0){s=l?parseInt(l.substr(1)):void 0;var h=c?parseInt(c.substr(1)):void 0,v;switch(d){case"s":v=t[i];break;case"c":v=t[i][0];break;case"f":v=parseFloat(t[i]).toFixed(s);break;case"p":v=parseFloat(t[i]).toPrecision(s);break;case"e":v=parseFloat(t[i]).toExponential(s);break;case"x":v=parseInt(t[i]).toString(h||16);break;case"d":v=parseFloat(parseInt(t[i],h||10).toPrecision(s)).toFixed(0);break}v=typeof v=="object"?JSON.stringify(v):(+v).toString(h);for(var p=parseInt(u),y=u&&u[0]+""=="0"?"0":" ";v.length<p;)v=f!==void 0?v+y:y+v;return v}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(o,a)},r.getBytes=function(e,t){return Ot.encode(e,t)},r.getCharCode=function(e,t){return t===void 0&&(t=0),e.charCodeAt(t)},r.getCharAt=function(e){return String.fromCharCode(e)},r.SHIFT_JIS=Qe.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=Qe.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=Qe.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),we=function(){function r(e){e===void 0&&(e=""),this.value=e}return r.prototype.enableDecoding=function(e){return this.encoding=e,this},r.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=Ce.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},r.prototype.appendChars=function(e,t,n){for(var i=t;t<t+n;i++)this.append(e[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(e){return this.value.charAt(e)},r.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},r.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},r.prototype.substring=function(e,t){return this.value.substring(e,t)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},r}(),Ft=function(){function r(e,t,n,i){if(this.width=e,this.height=t,this.rowSize=n,this.bits=i,t==null&&(t=e),this.height=t,e<1||t<1)throw new ue("Both dimensions must be greater than 0");n==null&&(n=Math.floor((e+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(e){for(var t=e.length,n=e[0].length,i=new r(n,t),a=0;a<t;a++)for(var o=e[a],s=0;s<n;s++)o[s]&&i.set(s,a);return i},r.parseFromString=function(e,t,n){if(e===null)throw new ue("stringRepresentation cannot be null");for(var i=new Array(e.length),a=0,o=0,s=-1,f=0,u=0;u<e.length;)if(e.charAt(u)===`
2`||e.charAt(u)==="\r"){if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new ue("row lengths do not match");o=a,f++}u++}else if(e.substring(u,u+t.length)===t)u+=t.length,i[a]=!0,a++;else if(e.substring(u,u+n.length)===n)u+=n.length,i[a]=!1,a++;else throw new ue("illegal character encountered: "+e.substring(u));if(a>o){if(s===-1)s=a-o;else if(a-o!==s)throw new ue("row lengths do not match");f++}for(var l=new r(s,f),c=0;c<a;c++)i[c]&&l.set(Math.floor(c%s),Math.floor(c/s));return l},r.prototype.get=function(e,t){var n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(e&31)&1)!==0},r.prototype.set=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295},r.prototype.unset=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)},r.prototype.flip=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295},r.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new ue("input matrix dimensions do not match");for(var t=new nt(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,a=0,o=this.height;a<o;a++)for(var s=a*n,f=e.getRow(a,t).getBitArray(),u=0;u<n;u++)i[s+u]^=f[u]},r.prototype.clear=function(){for(var e=this.bits,t=e.length,n=0;n<t;n++)e[n]=0},r.prototype.setRegion=function(e,t,n,i){if(t<0||e<0)throw new ue("Left and top must be nonnegative");if(i<1||n<1)throw new ue("Height and width must be at least 1");var a=e+n,o=t+i;if(o>this.height||a>this.width)throw new ue("The region must fit inside the matrix");for(var s=this.rowSize,f=this.bits,u=t;u<o;u++)for(var l=u*s,c=e;c<a;c++)f[l+Math.floor(c/32)]|=1<<(c&31)&4294967295},r.prototype.getRow=function(e,t){t==null||t.getSize()<this.width?t=new nt(this.width):t.clear();for(var n=this.rowSize,i=this.bits,a=e*n,o=0;o<n;o++)t.setBulk(o*32,i[a+o]);return t},r.prototype.setRow=function(e,t){Le.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),n=new nt(e),i=new nt(e),a=0,o=Math.floor((t+1)/2);a<o;a++)n=this.getRow(a,n),i=this.getRow(t-1-a,i),n.reverse(),i.reverse(),this.setRow(a,i),this.setRow(t-1-a,n)},r.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,n=this.rowSize,i=this.bits,a=e,o=t,s=-1,f=-1,u=0;u<t;u++)for(var l=0;l<n;l++){var c=i[u*n+l];if(c!==0){if(u<o&&(o=u),u>f&&(f=u),l*32<a){for(var d=0;!(c<<31-d&4294967295);)d++;l*32+d<a&&(a=l*32+d)}if(l*32+31>s){for(var d=31;!(c>>>d);)d--;l*32+d>s&&(s=l*32+d)}}}return s<a||f<o?null:Int32Array.from([a,o,s-a+1,f-o+1])},r.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,n=0;n<t.length&&t[n]===0;)n++;
2if(n===t.length)return null;for(var i=n/e,a=n%e*32,o=t[n],s=0;!(o<<31-s&4294967295);)s++;return a+=s,Int32Array.from([a,i])},r.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,n=t.length-1;n>=0&&t[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/e),a=Math.floor(n%e)*32,o=t[n],s=31;!(o>>>s);)s--;return a+=s,Int32Array.from([a,i])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&$e.equals(this.bits,t.bits)},r.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+$e.hashCode(this.bits),e},r.prototype.toString=function(e,t,n){return e===void 0&&(e="X "),t===void 0&&(t="  "),n===void 0&&(n=`
3`),this.buildToString(e,t,n)},r.prototype.buildToString=function(e,t,n){for(var i=new we,a=0,o=this.height;a<o;a++){for(var s=0,f=this.width;s<f;s++)i.append(this.get(s,a)?e:t);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),Ho=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),B=function(r){Ho(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(Ct),Go=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Xo=function(r){Go(e,r);function e(t){var n=r.call(this,t)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return e.prototype.getBlackRow=function(t,n){var i=this.getLuminanceSource(),a=i.getWidth();n==null||n.getSize()<a?n=new nt(a):n.clear(),this.initArrays(a);for(var o=i.getRow(t,this.luminances),s=this.buckets,f=0;f<a;f++)s[(o[f]&255)>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(a<3)for(var f=0;f<a;f++)(o[f]&255)<u&&n.set(f);else for(var l=o[0]&255,c=o[1]&255,f=1;f<a-1;f++){var d=o[f+1]&255;(c*4-l-d)/2<u&&n.set(f),l=c,c=d}return n},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),n=t.getWidth(),i=t.getHeight(),a=new Ft(n,i);this.initArrays(n);for(var o=this.buckets,s=1;s<5;s++)for(var f=Math.floor(i*s/5),u=t.getRow(f,this.luminances),l=Math.floor(n*4/5),c=Math.floor(n/5);c<l;c++){var d=u[c]&255;o[d>>e.LUMINANCE_SHIFT]++}for(var h=e.estimateBlackPoint(o),v=t.getMatrix(),s=0;s<i;s++)for(var p=s*n,c=0;c<n;c++){var d=v[p+c]&255;d<h&&a.set(c,s)}return a},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var n=this.buckets,i=0;i<e.LUMINANCE_BUCKETS;i++)n[i]=0},e.estimateBlackPoint=function(t){for(var n=t.length,i=0,a=0,o=0,s=0;s<n;s++)t[s]>o&&(a=s,o=t[s]),t[s]>i&&(i=t[s]);for(var f=0,u=0,s=0;s<n;s++){var l=s-a,c=t[s]*l*l;c>u&&(f=s,u=c)}if(a>f){var d=a;a=f,f=d}if(f-a<=n/16)throw new B;for(var h=f-1,v=-1,s=f-1;s>a;s--){var p=s-a,c=p*p*(f-s)*(i-t[s]);c>v&&(h=s,v=c)}return h<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(Mo),Wo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
3e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),pa=function(r){Wo(e,r);function e(t){var n=r.call(this,t)||this;return n.matrix=null,n}return e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var t=this.getLuminanceSource(),n=t.getWidth(),i=t.getHeight();if(n>=e.MINIMUM_DIMENSION&&i>=e.MINIMUM_DIMENSION){var a=t.getMatrix(),o=n>>e.BLOCK_SIZE_POWER;n&e.BLOCK_SIZE_MASK&&o++;var s=i>>e.BLOCK_SIZE_POWER;i&e.BLOCK_SIZE_MASK&&s++;var f=e.calculateBlackPoints(a,o,s,n,i),u=new Ft(n,i);e.calculateThresholdForBlock(a,o,s,n,i,f,u),this.matrix=u}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,n,i,a,o,s,f){for(var u=o-e.BLOCK_SIZE,l=a-e.BLOCK_SIZE,c=0;c<i;c++){var d=c<<e.BLOCK_SIZE_POWER;d>u&&(d=u);for(var h=e.cap(c,2,i-3),v=0;v<n;v++){var p=v<<e.BLOCK_SIZE_POWER;p>l&&(p=l);for(var y=e.cap(v,2,n-3),g=0,w=-2;w<=2;w++){var A=s[h+w];g+=A[y-2]+A[y-1]+A[y]+A[y+1]+A[y+2]}var x=g/25;e.thresholdBlock(t,p,d,x,a,f)}}},e.cap=function(t,n,i){return t<n?n:t>i?i:t},e.thresholdBlock=function(t,n,i,a,o,s){for(var f=0,u=i*o+n;f<e.BLOCK_SIZE;f++,u+=o)for(var l=0;l<e.BLOCK_SIZE;l++)(t[u+l]&255)<=a&&s.set(n+l,i+f)},e.calculateBlackPoints=function(t,n,i,a,o){for(var s=o-e.BLOCK_SIZE,f=a-e.BLOCK_SIZE,u=new Array(i),l=0;l<i;l++){u[l]=new Int32Array(n);var c=l<<e.BLOCK_SIZE_POWER;c>s&&(c=s);for(var d=0;d<n;d++){var h=d<<e.BLOCK_SIZE_POWER;h>f&&(h=f);for(var v=0,p=255,y=0,g=0,w=c*a+h;g<e.BLOCK_SIZE;g++,w+=a){for(var A=0;A<e.BLOCK_SIZE;A++){var x=t[w+A]&255;v+=x,x<p&&(p=x),x>y&&(y=x)}if(y-p>e.MIN_DYNAMIC_RANGE)for(g++,w+=a;g<e.BLOCK_SIZE;g++,w+=a)for(var A=0;A<e.BLOCK_SIZE;A++)v+=t[w+A]&255}var m=v>>e.BLOCK_SIZE_POWER*2;if(y-p<=e.MIN_DYNAMIC_RANGE&&(m=p/2,l>0&&d>0)){var S=(u[l-1][d]+2*u[l][d-1]+u[l-1][d-1])/4;p<S&&(m=S)}u[l][d]=m}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=e.BLOCK_SIZE*5,e.MIN_DYNAMIC_RANGE=24,e}(Xo),Sr=function(){function r(e,t){this.width=e,this.height=t}return r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.isCropSupported=function(){return!1},r.prototype.crop=function(e,t,n,i){throw new Br("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new Br("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new Br("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new we,n=0;n<this.height;n++){for(var i=this.getRow(n,e),a=0;a<this.width;a++){var o=i[a]&255,s=void 0;o<64?s="#":o<128?s="+":o<192?s=".":s=" ",t.append(s)}t.append(`
4`)}return t.toString()},r}(),zo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Zr=function(r){zo(e,r);function e(t){var n=r.call(this,t.getWidth(),t.getHeight())||this;return n.delegate=t,n}return e.prototype.getRow=function(t,n){for(var i=this.delegate.getRow(t,n),a=this.getWidth(),o=0;o<a;o++)i[o]=255-(i[o]&255);return i},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),a=0;a<n;a++)i[a]=255-(t[a]&255);return i},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,n,i,a){return new e(this.delegate.crop(t,n,i,a))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(Sr),jo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
4e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Yo=function(r){jo(e,r);function e(t,n){n===void 0&&(n=!1);var i=r.call(this,t.width,t.height)||this;return i.canvas=t,i.tempCanvasElement=null,i.buffer=e.makeBufferFromCanvasImageData(t,n),i}return e.makeBufferFromCanvasImageData=function(t,n){n===void 0&&(n=!1);var i=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(i.data,t.width,t.height,n)},e.toGrayscaleBuffer=function(t,n,i,a){a===void 0&&(a=!1);var o=new Uint8ClampedArray(n*i);if(e.FRAME_INDEX=!e.FRAME_INDEX,e.FRAME_INDEX||!a)for(var s=0,f=0,u=t.length;s<u;s+=4,f++){var l=void 0,c=t[s+3];if(c===0)l=255;else{var d=t[s],h=t[s+1],v=t[s+2];l=306*d+601*h+117*v+512>>10}o[f]=l}else for(var s=0,f=0,p=t.length;s<p;s+=4,f++){var l=void 0,c=t[s+3];if(c===0)l=255;else{var d=t[s],h=t[s+1],v=t[s+2];l=306*d+601*h+117*v+512>>10}o[f]=255-l}return o},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new ue("Requested row is outside the image: "+t);var i=this.getWidth(),a=t*i;return n===null?n=this.buffer.slice(a,a+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(a,a+i))),n},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,n,i,a){return r.prototype.crop.call(this,t,n,i,a),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var n=this.getTempCanvasElement(),i=n.getContext("2d"),a=t*e.DEGREE_TO_RADIANS,o=this.canvas.width,s=this.canvas.height,f=Math.ceil(Math.abs(Math.cos(a))*o+Math.abs(Math.sin(a))*s),u=Math.ceil(Math.abs(Math.sin(a))*o+Math.abs(Math.cos(a))*s);return n.width=f,n.height=u,i.translate(f/2,u/2),i.rotate(a),i.drawImage(this.canvas,o/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(n),this},e.prototype.invert=function(){return new Zr(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e.FRAME_INDEX=!0,e}(Sr),Zo=function(){function r(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}return r.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},r}(),_t=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(c){o(c)}}function f(l){try{u(n.throw(l))}catch(c){o(c)}}function u(l){l.done?a(l.value):i(l.value).then(s,f)}u((n=n.apply(r,e||[])).next())})},yt=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return f([u,l])}}function f(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ko=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vr=function(){function r(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"}
4,enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return _t(this,void 0,void 0,function(){var e,t,n,i,a,o,s,f,u,l,c,d;return yt(this,function(h){switch(h.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(n=Ko(e),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(s=a.deviceId||a.id,f=a.label||"Video device "+(t.length+1),u=a.groupId,l={deviceId:s,label:f,kind:o,groupId:u},t.push(l))}catch(v){c={error:v}}finally{try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(c)throw c.error}}return[2,t]}})})},r.prototype.getVideoInputDevices=function(){return _t(this,void 0,void 0,function(){var e;return yt(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(n){return new Zo(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(e){return _t(this,void 0,void 0,function(){var t;return yt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(i){return i.deviceId===e})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(e,t){return _t(this,void 0,void 0,function(){return yt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return _t(this,void 0,void 0,function(){var n,i;return yt(this,function(a){switch(a.label){case 0:return this.reset(),e?n={deviceId:{exact:e}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,t)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return _t(this,void 0,void 0,function(){var n;return yt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return _t(this,void 0,void 0,function(){var n,i;return yt(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=a.sent(),[4,this.decodeOnce(n)];case 2:return i=a.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return _t(this,void 0,void 0,function(){return yt(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return _t(this,void 0,void 0,function(){var i,a;return yt(this,function(o){switch(o.label){case 0:return e?i={deviceId:{exact:e}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,t,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return _t(this,void 0,void 0,function(){var i;return yt(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return i=a.sent(),[4,this.decodeFromStream(i,t,n)];case 2:return[2,a.sent()]}})})},r.prototype.decodeFromStream=function(e,t,n){return _t(this,void 0,void 0,function(){var i;return yt(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return i=a.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,a.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(e,t){return _t(this,void 0,void 0,function(){var n;return yt(this,function(i){switch(i.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,i){return t.playVideoOnLoad(e,function(){return n()})})},r.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},r.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},r.prototype.tryPlayVideo=function(e){return _t(this,void 0,void 0,function(){return yt(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new We("element with id '"+e+"' not found");if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new We("element with id '"+e+"' must be an "+t+" element");return n},r.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new We("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},r.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new We("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},r.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new We("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},r.prototype.decodeFromImageElement=function(e){if(!e)throw new We("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);this.imageElement=t;var n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n},r.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},r.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},r.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new We("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},r.prototype.decodeFromImageUrl=function(e){if(!e)throw new We("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},r.prototype.decodeFromVideoUrl=function(e){if(!e)throw new We("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},r.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new We("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,t);return n.src=e,i},r.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,i){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,i)},e.addEventListener("load",t.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(e){return _t(this,void 0,void 0,function(){return yt(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(e,t){return _t(this,void 0,void 0,function(){return yt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},r.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWi
4dth===0)},r.prototype.prepareImageElement=function(e){var t;return typeof e>"u"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},r.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document<"u"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.prototype.decodeOnce=function(e,t,n){var i=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var a=function(o,s){if(i._stopAsyncDecode){s(new B("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var f=i.decode(e);o(f)}catch(d){var u=t&&d instanceof B,l=d instanceof ze||d instanceof $,c=l&&n;if(u||c)return setTimeout(a,i._timeBetweenDecodingAttempts,o,s);s(d)}};return new Promise(function(o,s){return a(o,s)})},r.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var a=n.decode(e);t(a,null),setTimeout(i,n.timeBetweenScansMillis)}catch(f){t(null,f);var o=f instanceof ze||f instanceof $,s=f instanceof B;(o||s)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},r.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var n=this.getCaptureCanvas(e),i=new Yo(n,t),a=new pa(i);return new va(a)},r.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},r.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var t=document.createElement("canvas"),n,i;return typeof e<"u"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,i=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,i=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=i+"px",t.width=n,t.height=i,t},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},r.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},r}(),pt=function(){function r(e,t,n,i,a,o){n===void 0&&(n=t==null?0:8*t.length),o===void 0&&(o=Le.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=i,this.format=a,this.timestamp=o,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=i,this.format=a,this.resultMetadata=null,o==null?this.timestamp=Le.currentTimeMillis():this.timestamp=o}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},r.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},r.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=new Array(t.length+e.length);Le.arraycopy(t,0,n,0,t.length),Le.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),hn;
4(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(hn||(hn={}));const fe=hn;var vn;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(vn||(vn={}));const lt=vn;var Kr=function(){function r(e,t,n,i,a,o){a===void 0&&(a=-1),o===void 0&&(o=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=a,this.structuredAppendParity=o,this.numBits=e==null?0:8*e.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(e){this.numBits=e},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(e){this.erasures=e},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(e){this.other=e},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),wr=function(){function r(){}return r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new ue;return this.logTable[e]},r.addOrSubtract=function(e,t){return e^t},r}(),zt=function(){function r(e,t){if(t.length===0)throw new ue;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var i=1;i<n&&t[i]===0;)i++;i===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-i),Le.arraycopy(t,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},r.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var t=this.coefficients,n;if(e===1){n=0;for(var i=0,a=t.length;i!==a;i++){var o=t[i];n=wr.addOrSubtract(n,o)}return n}n=t[0];for(var s=t.length,f=this.field,i=1;i<s;i++)n=wr.addOrSubtract(f.multiply(e,n),t[i]);return n},r.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new ue("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var t=this.coefficients,n=e.coefficients;if(t.length>n.length){var i=t;t=n,n=i}var a=new Int32Array(n.length),o=n.length-t.length;Le.arraycopy(n,0,a,0,o);for(var s=o;s<n.length;s++)a[s]=wr.addOrSubtract(t[s-o],n[s]);return new r(this.field,a)},r.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new ue("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var t=this.coefficients,n=t.length,i=e.coefficients,a=i.length,o=new Int32Array(n+a-1),s=this.field,f=0;f<n;f++)for(var u=t[f],l=0;l<a;l++)o[f+l]=wr.addOrSubtract(o[f+l],s.multiply(u,i[l]));return new r(s,o)},r.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var t=this.coefficients.length,n=this.field,i=new Int32Array(t),a=this.coefficients,o=0;o<t;o++)i[o]=n.multiply(a[o],e);return new r(n,i)},r.prototype.multiplyByMonomial=function(e,t){if(e<0)throw new ue;if(t===0)return this.field.getZero();for(var n=this.coefficients,i=n.length,a=new Int32Array(i+e),o=this.field,s=0;s<i;s++)a[s]=o.multiply(n[s],t);return new r(o,a)},r.prototype.divide=function(e){if(!this.field.equals(e.field))throw new ue("GenericGFPolys do n
4ot have same GenericGF field");if(e.isZero())throw new ue("Divide by 0");for(var t=this.field,n=t.getZero(),i=this,a=e.getCoefficient(e.getDegree()),o=t.inverse(a);i.getDegree()>=e.getDegree()&&!i.isZero();){var s=i.getDegree()-e.getDegree(),f=t.multiply(i.getCoefficient(i.getDegree()),o),u=e.multiplyByMonomial(s,f),l=t.buildMonomial(s,f);n=n.addOrSubtract(l),i=i.addOrSubtract(u)}return[n,i]},r.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){var i=this.field.log(n);i===0?e+="1":i===1?e+="a":(e+="a^",e+=i)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e},r}(),qo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ga=function(r){qo(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArithmeticException",e}(Ct),Qo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Et=function(r){Qo(e,r);function e(t,n,i){var a=r.call(this)||this;a.primitive=t,a.size=n,a.generatorBase=i;for(var o=new Int32Array(n),s=1,f=0;f<n;f++)o[f]=s,s*=2,s>=n&&(s^=t,s&=n-1);a.expTable=o;for(var u=new Int32Array(n),f=0;f<n-1;f++)u[o[f]]=f;return a.logTable=u,a.zero=new zt(a,Int32Array.from([0])),a.one=new zt(a,Int32Array.from([1])),a}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,n){if(t<0)throw new ue;if(n===0)return this.zero;var i=new Int32Array(t+1);return i[0]=n,new zt(this,i)},e.prototype.inverse=function(t){if(t===0)throw new ga;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,n){return t===0||n===0?0:this.expTable[(this.logTable[t]+this.logTable[n])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+me.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(t){return t===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(wr),$o=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Dr=function(r){$o(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ReedSolomonException",e}(Ct),Jo=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),br=function(r){Jo(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalStateException",e}(Ct),qr=function(){function r(e){this.field=e}return r.prototype.decode=function(e,t){for(var n=this.field,i=new zt(n,e),a=new Int32Array(t),o=!0,s=0;s<t;s++){var f=i.evaluateAt(n.exp(s+n.getGeneratorBase()));a[a.length-1-s]=f,f!==0&&(o=!1)}if(!o)for(var u=new zt(n,a),l=this.runEuclideanAlgorithm(n.buildMonomial(t,1),u,t),c=l[0],d=l[1],h=this.findErrorLocations(c),v=this.findErrorMagnitudes(d,h),s=0;s<h.length;s++){var p=e.length-1-n.log(h[s]);if(p<0)throw new Dr("Bad error location");e[p]=Et.addOrSubtract(e[p],v[s])}},r.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var i=e;e=t,t=i}for(var a=this.field,o=e,s=t,f=a.getZero(),u=a.getOne();s.getDegree()>=(n/2|0);){var l=o,c=f;if(o=s,f=u,o.isZero())throw new Dr("r_{i-1} was zero");s=l;for(var d=a.getZero(),h=o.getCoefficient(o.getDegree()),v=a.inverse(h);s.getDegree()>=o.getDegree()&&!s.isZero();){var p=s.getDegree()-o.getDegree(),y=a.multiply(s.getCoefficient(s.getDegree()),v);d=d.addOrSubtract(a.buildMonomial(p,y)),s=s.addOrSubtract(o.multiplyByMonomial(p,y))}if(u=d.multiply(f).addOrSubtract(c),s.getDegree()>=o.getDegree())throw new br("Division algorithm failed to reduce polynomial?")}var g=u.getCoefficient(0);if(g===0)throw new Dr("sigmaTilde(0) was zero");var w=a.inverse(g),A=u.multiplyScalar(w),x=s.multiplyScalar(w);return[A,x]},r.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),i=0,a=this.field,o=1;o<a.getSize()&&i<t;o++)e.evaluateAt(o)===0&&(n[i]=a.inverse(o),i++);if(i!==t)throw new Dr("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(e,t){for(var n=t.length,i=new Int32Array(n),a=this.field,o=0;o<n;o++){for(var s=a.inverse(t[o]),f=1,u=0;u<n;u++)if(o!==u){var l=a.multiply(t[u],s),c=l&1?l&-2:l|1;f=a.multiply(f,c)}i[o]=a.multiply(e.evaluateAt(s),a.inverse(f)),a.getGeneratorBase()!==0&&(i[o]=a.multiply(i[o],s))}return i},r}(),ft;(function(r){r[r.UPPER=0]="UPPER",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.DIGIT=3]="DIGIT",r[r.PUNCT=4]="PUNCT",r[r.BINARY=5]="BINARY"})(ft||(ft={}));var Yn=function(){function r(){}return r.prototype.decode=function(e){this.ddata=e;var t=e.getBits(),n=this.extractBits(t),i=this.correctBits(n),a=r.convertBoolArrayToByteArray(i),o=r.getEncodedData(i),s=new Kr(a,o,null,
4null);return s.setNumBits(i.length),s},r.highLevelDecode=function(e){return this.getEncodedData(e)},r.getEncodedData=function(e){for(var t=e.length,n=ft.UPPER,i=ft.UPPER,a="",o=0;o<t;)if(i===ft.BINARY){if(t-o<5)break;var s=r.readCode(e,o,5);if(o+=5,s===0){if(t-o<11)break;s=r.readCode(e,o,11)+31,o+=11}for(var f=0;f<s;f++){if(t-o<8){o=t;break}var u=r.readCode(e,o,8);a+=Ce.castAsNonUtf8Char(u),o+=8}i=n}else{var l=i===ft.DIGIT?4:5;if(t-o<l)break;var u=r.readCode(e,o,l);o+=l;var c=r.getCharacter(i,u);c.startsWith("CTRL_")?(n=i,i=r.getTable(c.charAt(5)),c.charAt(6)==="L"&&(n=i)):(a+=c,i=n)}return a},r.getTable=function(e){switch(e){case"L":return ft.LOWER;case"P":return ft.PUNCT;case"M":return ft.MIXED;case"D":return ft.DIGIT;case"B":return ft.BINARY;case"U":default:return ft.UPPER}},r.getCharacter=function(e,t){switch(e){case ft.UPPER:return r.UPPER_TABLE[t];case ft.LOWER:return r.LOWER_TABLE[t];case ft.MIXED:return r.MIXED_TABLE[t];case ft.PUNCT:return r.PUNCT_TABLE[t];case ft.DIGIT:return r.DIGIT_TABLE[t];default:throw new br("Bad table")}},r.prototype.correctBits=function(e){var t,n;this.ddata.getNbLayers()<=2?(n=6,t=Et.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,t=Et.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,t=Et.AZTEC_DATA_10):(n=12,t=Et.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=e.length/n;if(a<i)throw new $;for(var o=e.length%n,s=new Int32Array(a),f=0;f<a;f++,o+=n)s[f]=r.readCode(e,o,n);try{var u=new qr(t);u.decode(s,a-i)}catch(y){throw new $(y)}for(var l=(1<<n)-1,c=0,f=0;f<i;f++){var d=s[f];if(d===0||d===l)throw new $;(d===1||d===l-1)&&c++}for(var h=new Array(i*n-c),v=0,f=0;f<i;f++){var d=s[f];if(d===1||d===l-1)h.fill(d>1,v,v+n-1),v+=n-1;else for(var p=n-1;p>=0;--p)h[v++]=(d&1<<p)!==0}return h},r.prototype.extractBits=function(e){var t=this.ddata.isCompact(),n=this.ddata.getNbLayers(),i=(t?11:14)+n*4,a=new Int32Array(i),o=new Array(this.totalBitsInLayer(n,t));if(t)for(var s=0;s<a.length;s++)a[s]=s;else for(var f=i+1+2*me.truncDivision(me.truncDivision(i,2)-1,15),u=i/2,l=me.truncDivision(f,2),s=0;s<u;s++){var c=s+me.truncDivision(s,15);a[u-s-1]=l-c-1,a[u+s]=l+c+1}for(var s=0,d=0;s<n;s++){for(var h=(n-s)*4+(t?9:12),v=s*2,p=i-1-v,y=0;y<h;y++)for(var g=y*2,w=0;w<2;w++)o[d+g+w]=e.get(a[v+w],a[v+y]),o[d+2*h+g+w]=e.get(a[v+y],a[p-w]),o[d+4*h+g+w]=e.get(a[p-w],a[p-y]),o[d+6*h+g+w]=e.get(a[p-y],a[v+w]);d+=h*8}return o},r.readCode=function(e,t,n){for(var i=0,a=t;a<t+n;a++)i<<=1,e[a]&&(i|=1);return i},r.readByte=function(e,t){var n=e.length-t;return n>=8?r.readCode(e,t,8):r.readCode(e,t,n)<<8-n},r.convertBoolArrayToByteArray=function(e){for(var t=new Uint8Array((e.length+7)/8),n=0;n<t.length;n++)t[n]=r.readByte(e,8*n);return t},r.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},r.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],r.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],r.MIXED_TABLE=["CTRL_PS"," ","�","�","�","�","�","�","\x07","\b","	",`
5`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],r.PUNCT_TABLE=["","\r",`\r
6`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),Oe=function(){function r(){}return r.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},r.distance=function(e,t,n,i){var a=e-n,o=t-i;return Math.sqrt(a*a+o*o)},r.sum=function(e){for(var t=0,n=0,i=e.length;n!==i;n++){var a=e[n];t+=a}return t},r}(),pn=function(){function r(){}return r.floatToIntBits=function(e){return e},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),ie=function(){function r(e,t){this.x=e,this.y=t}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(e){if(e instanceof r){var t=e;return this.x===t.x&&this.y===t.y}return!1}
6,r.prototype.hashCode=function(){return 31*pn.floatToIntBits(this.x)+pn.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(e){var t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),i=this.distance(e[0],e[2]),a,o,s;if(n>=t&&n>=i?(o=e[0],a=e[1],s=e[2]):i>=n&&i>=t?(o=e[1],a=e[0],s=e[2]):(o=e[2],a=e[0],s=e[1]),this.crossProductZ(a,o,s)<0){var f=a;a=s,s=f}e[0]=a,e[1]=o,e[2]=s},r.distance=function(e,t){return Oe.distance(e.x,e.y,t.x,t.y)},r.crossProductZ=function(e,t,n){var i=t.x,a=t.y;return(n.x-i)*(e.y-a)-(n.y-a)*(e.x-i)},r}(),In=function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),es=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ts=function(r){es(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n)||this;return s.compact=i,s.nbDatablocks=a,s.nbLayers=o,s}return e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(In),gn=function(){function r(e,t,n,i){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=r.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),i==null&&(i=e.getHeight()/2|0);var a=t/2|0;if(this.leftInit=n-a,this.rightInit=n+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new B}return r.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,i=this.downInit,a=!1,o=!0,s=!1,f=!1,u=!1,l=!1,c=!1,d=this.width,h=this.height;o;){o=!1;for(var v=!0;(v||!f)&&t<d;)v=this.containsBlackPoint(n,i,t,!1),v?(t++,o=!0,f=!0):f||t++;if(t>=d){a=!0;break}for(var p=!0;(p||!u)&&i<h;)p=this.containsBlackPoint(e,t,i,!0),p?(i++,o=!0,u=!0):u||i++;if(i>=h){a=!0;break}for(var y=!0;(y||!l)&&e>=0;)y=this.containsBlackPoint(n,i,e,!1),y?(e--,o=!0,l=!0):l||e--;if(e<0){a=!0;break}for(var g=!0;(g||!c)&&n>=0;)g=this.containsBlackPoint(e,t,n,!0),g?(n--,o=!0,c=!0):c||n--;if(n<0){a=!0;break}
6o&&(s=!0)}if(!a&&s){for(var w=t-e,A=null,x=1;A===null&&x<w;x++)A=this.getBlackPointOnSegment(e,i-x,e+x,i);if(A==null)throw new B;for(var m=null,x=1;m===null&&x<w;x++)m=this.getBlackPointOnSegment(e,n+x,e+x,n);if(m==null)throw new B;for(var S=null,x=1;S===null&&x<w;x++)S=this.getBlackPointOnSegment(t,n+x,t-x,n);if(S==null)throw new B;for(var b=null,x=1;b===null&&x<w;x++)b=this.getBlackPointOnSegment(t,i-x,t-x,i);if(b==null)throw new B;return this.centerEdges(b,A,S,m)}else throw new B},r.prototype.getBlackPointOnSegment=function(e,t,n,i){for(var a=Oe.round(Oe.distance(e,t,n,i)),o=(n-e)/a,s=(i-t)/a,f=this.image,u=0;u<a;u++){var l=Oe.round(e+u*o),c=Oe.round(t+u*s);if(f.get(l,c))return new ie(l,c)}return null},r.prototype.centerEdges=function(e,t,n,i){var a=e.getX(),o=e.getY(),s=t.getX(),f=t.getY(),u=n.getX(),l=n.getY(),c=i.getX(),d=i.getY(),h=r.CORR;return a<this.width/2?[new ie(c-h,d+h),new ie(s+h,f+h),new ie(u-h,l-h),new ie(a+h,o-h)]:[new ie(c+h,d+h),new ie(s+h,f-h),new ie(u-h,l+h),new ie(a-h,o-h)]},r.prototype.containsBlackPoint=function(e,t,n,i){var a=this.image;if(i){for(var o=e;o<=t;o++)if(a.get(o,n))return!0}else for(var s=e;s<=t;s++)if(a.get(n,s))return!0;return!1},r.INIT_SIZE=10,r.CORR=1,r}(),Zn=function(){function r(){}return r.checkAndNudgePoints=function(e,t){for(var n=e.getWidth(),i=e.getHeight(),a=!0,o=0;o<t.length&&a;o+=2){var s=Math.floor(t[o]),f=Math.floor(t[o+1]);if(s<-1||s>n||f<-1||f>i)throw new B;a=!1,s===-1?(t[o]=0,a=!0):s===n&&(t[o]=n-1,a=!0),f===-1?(t[o+1]=0,a=!0):f===i&&(t[o+1]=i-1,a=!0)}a=!0;for(var o=t.length-2;o>=0&&a;o-=2){var s=Math.floor(t[o]),f=Math.floor(t[o+1]);if(s<-1||s>n||f<-1||f>i)throw new B;a=!1,s===-1?(t[o]=0,a=!0):s===n&&(t[o]=n-1,a=!0),f===-1?(t[o+1]=0,a=!0):f===i&&(t[o+1]=i-1,a=!0)}},r}(),_a=function(){function r(e,t,n,i,a,o,s,f,u){this.a11=e,this.a21=t,this.a31=n,this.a12=i,this.a22=a,this.a32=o,this.a13=s,this.a23=f,this.a33=u}return r.quadrilateralToQuadrilateral=function(e,t,n,i,a,o,s,f,u,l,c,d,h,v,p,y){var g=r.quadrilateralToSquare(e,t,n,i,a,o,s,f),w=r.squareToQuadrilateral(u,l,c,d,h,v,p,y);return w.times(g)},r.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,i=this.a12,a=this.a13,o=this.a21,s=this.a22,f=this.a23,u=this.a31,l=this.a32,c=this.a33,d=0;d<t;d+=2){var h=e[d],v=e[d+1],p=a*h+f*v+c;e[d]=(n*h+o*v+u)/p,e[d+1]=(i*h+s*v+l)/p}},r.prototype.transformPointsWithValues=function(e,t){for(var n=this.a11,i=this.a12,a=this.a13,o=this.a21,s=this.a22,f=this.a23,u=this.a31,l=this.a32,c=this.a33,d=e.length,h=0;h<d;h++){var v=e[h],p=t[h],y=a*v+f*p+c;e[h]=(n*v+o*p+u)/y,t[h]=(i*v+s*p+l)/y}},r.squareToQuadrilateral=function(e,t,n,i,a,o,s,f){var u=e-n+a-s,l=t-i+o-f;if(u===0&&l===0)return new r(n-e,a-n,e,i-t,o-i,t,0,0,1);var c=n-a,d=s-a,h=i-o,v=f-o,p=c*v-d*h,y=(u*v-d*l)/p,g=(c*l-u*h)/p;return new r(n-e+y*n,s-e+g*s,e,i-t+y*i,f-t+g*f,t,y,g,1)},r.quadrilateralToSquare=function(e,t,n,i,a,o,s,f){return r.squareToQuadrilateral(e,t,n,i,a,o,s,f).buildAdjoint()},r.prototype.buildAdjoint=function(){return new r(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},r.prototype.times=function(e){return new r(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},r}(),rs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ns=function(r){rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.sampleGrid=function(t,n,i,a,o,s,f,u,l,c,d,h,v,p,y,g,w,A,x){var m=_a.quadrilateralToQuadrilateral(a,o,s,f,u,l,c,d,h,v,p,y,g,w,A,x);return this.sampleGridWithTransform(t,n,i,m)},e.prototype.sampleGridWithTransform=function(t,n,i,a){if(n<=0||i<=0)throw new B;for(var o=new Ft(n,i),s=new Float32Array(2*n),f=0;f<i;f++){for(var u=s.length,l=f+.5,c=0;c<u;c+=2)s[c]=c/2+.5,s[c+1]=l;a.transformPoints(s),Zn.checkAndNudgePoints(t,s);try{for(var c=0;c<u;c+=2)t.get(Math.floor(s[c]),Math.floor(s[c+1]))&&o.set(c/2,f)}catch{throw new B}}return o},e}(Zn),Sn=function(){function r(){}return r.setGridSampler=function(e){r.gridSampler=e},r.getInstance=function(){return r.gridSampler},r.gridSampler=new ns,r}(),At=function(){function r(e,t){this.x=e,this.y=t}return r.prototype.toResultPoint=function(){return new ie(this.getX(),this.getY())},r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r}(),is=function(){function r(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return r.prototype.detect=function(){return this.detectMirror(!1)},r.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),n=this.getBullsEyeCorners(t);if(e){var i=n[0];n[0]=n[2],n[2]=i}this.extractParameters(n);var a=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[
6(this.shift+2)%4],n[(this.shift+3)%4]),o=this.getMatrixCornerPoints(n);return new ts(a,o,this.compact,this.nbDataBlocks,this.nbLayers)},r.prototype.extractParameters=function(e){if(!this.isValidPoint(e[0])||!this.isValidPoint(e[1])||!this.isValidPoint(e[2])||!this.isValidPoint(e[3]))throw new B;var t=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(n,t);for(var i=0,a=0;a<4;a++){var o=n[(this.shift+a)%4];this.compact?(i<<=7,i+=o>>1&127):(i<<=10,i+=(o>>2&992)+(o>>1&31))}var s=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)},r.prototype.getRotation=function(e,t){var n=0;e.forEach(function(a,o,s){var f=(a>>t-2<<1)+(a&1);n=(n<<3)+f}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(me.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new B},r.prototype.getCorrectedParameterData=function(e,t){var n,i;t?(n=7,i=2):(n=10,i=4);for(var a=n-i,o=new Int32Array(n),s=n-1;s>=0;--s)o[s]=e&15,e>>=4;try{var f=new qr(Et.AZTEC_PARAM);f.decode(o,a)}catch{throw new B}for(var u=0,s=0;s<i;s++)u=(u<<4)+o[s];return u},r.prototype.getBullsEyeCorners=function(e){var t=e,n=e,i=e,a=e,o=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(t,o,1,-1),f=this.getFirstDifferent(n,o,1,1),u=this.getFirstDifferent(i,o,-1,1),l=this.getFirstDifferent(a,o,-1,-1);if(this.nbCenterLayers>2){var c=this.distancePoint(l,s)*this.nbCenterLayers/(this.distancePoint(a,t)*(this.nbCenterLayers+2));if(c<.75||c>1.25||!this.isWhiteOrBlackRectangle(s,f,u,l))break}t=s,n=f,i=u,a=l,o=!o}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new B;this.compact=this.nbCenterLayers===5;var d=new ie(t.getX()+.5,t.getY()-.5),h=new ie(n.getX()+.5,n.getY()+.5),v=new ie(i.getX()-.5,i.getY()+.5),p=new ie(a.getX()-.5,a.getY()-.5);return this.expandSquare([d,h,v,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var e,t,n,i;try{var a=new gn(this.image).detect();e=a[0],t=a[1],n=a[2],i=a[3]}catch{var o=this.image.getWidth()/2,s=this.image.getHeight()/2;e=this.getFirstDifferent(new At(o+7,s-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new At(o+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new At(o-7,s+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new At(o-7,s-7),!1,-1,-1).toResultPoint()}var f=Oe.round((e.getX()+i.getX()+t.getX()+n.getX())/4),u=Oe.round((e.getY()+i.getY()+t.getY()+n.getY())/4);try{var a=new gn(this.image,15,f,u).detect();e=a[0],t=a[1],n=a[2],i=a[3]}catch{e=this.getFirstDifferent(new At(f+7,u-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new At(f+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new At(f-7,u+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new At(f-7,u-7),!1,-1,-1).toResultPoint()}return f=Oe.round((e.getX()+i.getX()+t.getX()+n.getX())/4),u=Oe.round((e.getY()+i.getY()+t.getY()+n.getY())/4),new At(f,u)},r.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(e,t,n,i,a){var o=Sn.getInstance(),s=this.getDimension(),f=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return o.sampleGrid(e,s,s,f,f,u,f,u,u,f,u,t.getX(),t.getY(),n.getX(),n.getY(),i.getX(),i.getY(),a.getX(),a.getY())},r.prototype.sampleLine=function(e,t,n){for(var i=0,a=this.distanceResultPoint(e,t),o=a/n,s=e.getX(),f=e.getY(),u=o*(t.getX()-e.getX())/a,l=o*(t.getY()-e.getY())/a,c=0;c<n;c++)this.image.get(Oe.round(s+c*u),Oe.round(f+c*l))&&(i|=1<<n-c-1);return i},r.prototype.isWhiteOrBlackRectangle=function(e,t,n,i){var a=3;e=new At(e.getX()-a,e.getY()+a),t=new At(t.getX()-a,t.getY()-a),n=new At(n.getX()+a,n.getY()-a),i=new At(i.getX()+a,i.getY()+a);var o=this.getColor(i,e);if(o===0)return!1;var s=this.getColor(e,t);return s!==o||(s=this.getColor(t,n),s!==o)?!1:(s=this.getColor(n,i),s===o)},r.prototype.getColor=function(e,t){for(var n=this.distancePoint(e,t),i=(t.getX()-e.getX())/n,a=(t.getY()-e.getY())/n,o=0,s=e.getX(),f=e.getY(),u=this.image.get(e.getX(),e.getY()),l=Math.ceil(n),c=0;c<l;c++)s+=i,f+=a,this.image.get(Oe.round(s),Oe.round(f))!==u&&o++;var d=o/n;return d>.1&&d<.9?0:d<=.1===u?1:-1},r.prototype.getFirstDifferent=function(e,t,n,i){for(var a=e.getX()+n,o=e.getY()+i;this.isValid(a,o)&&this.image.get(a,o)===t;)a+=n,o+=i;for(a-=n,o-=i;this.isValid(a,o)&&this.image.get(a,o)===t;)a+=n;for(a-=n;this.isValid(a,o)&&this.image.get(a,o)===t;)o+=i;return o-=i,new At(a,o)},r.prototype.expandSquare=function(e,t,n){var i=n/(2*t),a=e[0].getX()-e[2].getX(),o=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,f=(e[0].getY()+e[2].getY())/2,u=new ie(s+i*a,f+i*o),l=new ie(s-i*a,f-i*o);a=e[1].getX()-e[3].getX(),o=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,f=(e[1].getY()+e[3].getY())/2;var c=new ie(s+i*a,f+i*o),d=new ie(s-i*a,f-i*o),h=[u,c,l,d];return h},r.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},r.prototype.isValidPoint=function(e){var t=Oe.round(e.getX()),n=Oe.round(e.getY());return this.isValid(t,n)},r.prototype.distancePoint=function(e,t){return Oe.distance(e.getX(),e.getY(),t.getX(),t.getY())},r.prototype.distanceResultPoint=function(e,t){return Oe.distance(e.getX(),e.getY(),t.getX(),t.getY())},r.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(me.truncDivision(this.nbLayers-4,8)+1)+15},r}(),Ur=function(){function r(){}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n=null,i=new is(e.getBlackMatrix()),a=null,o=null;try{var s=i.detectMirror(!1);a=s.getPoints(),this.reportFoundResultPoints(t,a),o=new Yn().decode(s)}catch(c){n=c}if(o==null)try{var s=i.detectMirror(!0);a=s.getPoints(),this.reportFoundResultPoints(t,a),o=new Yn().decode(s)}catch(c){throw n??c}var f=new pt(o.getText(),o.getRawBytes(),o.getNumBits(),a,fe.AZTEC,Le.currentTimeMillis()),u=o.getByteSegments();u!=null&&f.putMetadata(lt.BYTE_SEGMENTS,u);var l=o.getECLevel();return l!=null&&f.putMetadata(lt.ERROR_CORRECTION_LEVEL,l),f},r.prototype.reportFoundResultPoints=function(e,t){if(e!=null){var n=e.get(ke.NEED_RESULT_POINT_CALLBACK);n!=null&&t.forEach(function(i,a,o){n.foundPossibleResultPoint(i)})}},r.prototype.reset=function(){},r}(),as=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){as(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Ur,t)||this}return e})(vr);var Je=function(){function r(){}return r.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch{var n=t&&t.get(ke.TRY_HARDER)===!0;if(n&&e.isRotateSupported()){var i=e.rotateCounterClockwise(),a=this.doDecode(i,t),o=a.getResultMetadata(),s=270;o!==null&&o.get(lt.ORIENTATION)===!0&&(s=s+o.get(lt.ORIENTATION)%360),a.putMetadata(lt.ORIENTATION,s);var f=a.getResultPoints();if(f!==null)for(var u=i.getHeight(),l=0;l<f.length;l++)f[l]=new ie(u-f[l].getY()-1,f[l].getX());return a}else throw new B}},r.prototype.reset=function(){},r.prototype.doDecode=function(e,t){var n=e.getWidth(),i=e.getHeight(),a=new nt(n),o=t&&t.get(ke.TRY_HARDER)===!0,s=Math.max(1,i>>(o?8:5)),f;o?f=i:f=15;for(var u=Math.trunc(i/2),l=0;l<f;l++){var c=Math.trunc((l+1)/2),d=(l&1)===0,h=u+s*(d?c:-c);if(h<0||h>=i)break;try{a=e.getBlackRow(h,a)}catch{continue}for(var v=function(w){if(w===1&&(a.reverse(),t&&t.get(ke.NEED_RESULT_POINT_CALLBACK)===!0)){var A=new Map;t.forEach(function(S,b){return A.set(b,S)}),A.delete(ke.NEED_RESULT_POINT_CALLBACK),t=A}try{var x=p.decodeRow(h,a,t);if(w===1){x.putMetadata(lt.ORIENTATION,180);var m=x.getResultPoints();
6m!==null&&(m[0]=new ie(n-m[0].getX()-1,m[0].getY()),m[1]=new ie(n-m[1].getX()-1,m[1].getY()))}return{value:x}}catch{}},p=this,y=0;y<2;y++){var g=v(y);if(typeof g=="object")return g.value}}throw new B},r.recordPattern=function(e,t,n){for(var i=n.length,a=0;a<i;a++)n[a]=0;var o=e.getSize();if(t>=o)throw new B;for(var s=!e.get(t),f=0,u=t;u<o;){if(e.get(u)!==s)n[f]++;else{if(++f===i)break;n[f]=1,s=!s}u++}if(!(f===i||f===i-1&&u===o))throw new B},r.recordPatternInReverse=function(e,t,n){for(var i=n.length,a=e.get(t);t>0&&i>=0;)e.get(--t)!==a&&(i--,a=!a);if(i>=0)throw new B;r.recordPattern(e,t+1,n)},r.patternMatchVariance=function(e,t,n){for(var i=e.length,a=0,o=0,s=0;s<i;s++)a+=e[s],o+=t[s];if(a<o)return Number.POSITIVE_INFINITY;var f=a/o;n*=f;for(var u=0,l=0;l<i;l++){var c=e[l],d=t[l]*f,h=c>d?c-d:d-c;if(h>n)return Number.POSITIVE_INFINITY;u+=h}return u/a},r}(),os=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Kn=function(r){os(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.findStartPattern=function(t){for(var n=t.getSize(),i=t.getNextSet(0),a=0,o=Int32Array.from([0,0,0,0,0,0]),s=i,f=!1,u=6,l=i;l<n;l++)if(t.get(l)!==f)o[a]++;else{if(a===u-1){for(var c=e.MAX_AVG_VARIANCE,d=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var v=Je.patternMatchVariance(o,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);v<c&&(c=v,d=h)}if(d>=0&&t.isRange(Math.max(0,s-(l-s)/2),s,!1))return Int32Array.from([s,l,d]);s+=o[0]+o[1],o=o.slice(2,o.length),o[a-1]=0,o[a]=0,a--}else a++;o[a]=1,f=!f}throw new B},e.decodeCode=function(t,n,i){Je.recordPattern(t,i,n);for(var a=e.MAX_AVG_VARIANCE,o=-1,s=0;s<e.CODE_PATTERNS.length;s++){var f=e.CODE_PATTERNS[s],u=this.patternMatchVariance(n,f,e.MAX_INDIVIDUAL_VARIANCE);u<a&&(a=u,o=s)}if(o>=0)return o;throw new B},e.prototype.decodeRow=function(t,n,i){var a=i&&i.get(ke.ASSUME_GS1)===!0,o=e.findStartPattern(n),s=o[2],f=0,u=new Uint8Array(20);u[f++]=s;var l;switch(s){case e.CODE_START_A:l=e.CODE_CODE_A;break;case e.CODE_START_B:l=e.CODE_CODE_B;break;case e.CODE_START_C:l=e.CODE_CODE_C;break;default:throw new $}for(var c=!1,d=!1,h="",v=o[0],p=o[1],y=Int32Array.from([0,0,0,0,0,0]),g=0,w=0,A=s,x=0,m=!0,S=!1,b=!1;!c;){var D=d;switch(d=!1,g=w,w=e.decodeCode(n,y,p),u[f++]=w,w!==e.CODE_STOP&&(m=!0),w!==e.CODE_STOP&&(x++,A+=x*w),v=p,p+=y.reduce(function(Y,X){return Y+X},0),w){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new $}switch(l){case e.CODE_CODE_A:if(w<64)b===S?h+=String.fromCharCode(32+w):h+=String.fromCharCode(32+w+128),b=!1;else if(w<96)b===S?h+=String.fromCharCode(w-64):h+=String.fromCharCode(w+64),b=!1;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!S&&b?(S=!0,b=!1):S&&b?(S=!1,b=!1):b=!0;break;case e.CODE_SHIFT:d=!0,l=e.CODE_CODE_B;break;case e.CODE_CODE_B:l=e.CODE_CODE_B;break;case e.CODE_CODE_C:l=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0;break}break;case e.CODE_CODE_B:if(w<96)b===S?h+=String.fromCharCode(32+w):h+=String.fromCharCode(32+w+128),b=!1;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!S&&b?(S=!0,b=!1):S&&b?(S=!1,b=!1):b=!0;break;case e.CODE_SHIFT:d=!0,l=e.CODE_CODE_A;break;case e.CODE_CODE_A:l=e.CODE_CODE_A;break;case e.CODE_CODE_C:l=e.CODE_CODE_C;break;case e.CODE_STOP:c=!0;break}break;case e.CODE_CODE_C:if(w<100)w<10&&(h+="0"),h+=w;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:a&&(h.length===0?h+="]C1":h+="�");break;case e.CODE_CODE_A:l=e.CODE_CODE_A;break;case e.CODE_CODE_B:l=e.CODE_CODE_B;break;case e.CODE_STOP:c=!0;break}break}D&&(l=l===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var M=p-v;if(p=n.getNextUnset(p),!n.isRange(p,Math.min(n.getSize(),p+(p-v)/2),!1))throw new B;if(A-=x*g,A%103!==g)throw new ze;var G=h.length;if(G===0)throw new B;G>0&&m&&(l===e.CODE_CODE_C?h=h.substring(0,G-2):h=h.substring(0,G-1));for(var W=(o[1]+o[0])/2,V=v+M/2,z=u.length,Q=new Uint8Array(z),de=0;de<z;de++)Q[de]=u[de];var re=[new ie(W,t),new ie(V,t)];return new pt(h,Q,0,re,fe.CODE_128,new Date().getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIA
6NCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(Je),ss=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Jr=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qn=function(r){ss(e,r);function e(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=t,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return e.prototype.decodeRow=function(t,n,i){var a,o,s,f,u=this.counters;u.fill(0),this.decodeRowResult="";var l=e.findAsteriskPattern(n,u),c=n.getNextSet(l[1]),d=n.getSize(),h,v;do{e.recordPattern(n,c,u);var p=e.toNarrowWidePattern(u);if(p<0)throw new B;h=e.patternToChar(p),this.decodeRowResult+=h,v=c;try{for(var y=(a=void 0,Jr(u)),g=y.next();!g.done;g=y.next()){var w=g.value;c+=w}}catch(z){a={error:z}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(a)throw a.error}}c=n.getNextSet(c)}while(h!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var A=0;try{for(var x=Jr(u),m=x.next();!m.done;m=x.next()){var w=m.value;A+=w}}catch(z){s={error:z}}finally{try{m&&!m.done&&(f=x.return)&&f.call(x)}finally{if(s)throw s.error}}var S=c-v-A;if(c!==d&&S*2<A)throw new B;if(this.usingCheckDigit){for(var b=this.decodeRowResult.length-1,D=0,M=0;M<b;M++)D+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(M));if(this.decodeRowResult.charAt(b)!==e.ALPHABET_STRING.charAt(D%43))throw new ze;this.decodeRowResult=this.decodeRowResult.substring(0,b)}if(this.decodeRowResult.length===0)throw new B;var G;this.extendedMode?G=e.decodeExtended(this.decodeRowResult):G=this.decodeRowResult;var W=(l[1]+l[0])/2,V=v+A/2;return new pt(G,null,0,[new ie(W,t),new ie(V,t)],fe.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(t,n){for(var i=t.getSize(),a=t.getNextSet(0),o=0,s=a,f=!1,u=n.length,l=a;l<i;l++)if(t.get(l)!==f)n[o]++;else{if(o===u-1){if(this.toNarrowWidePattern(n)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,s-Math.floor((l-s)/2)),s,!1))return[s,l];s+=n[0]+n[1],n.copyWithin(0,2,2+o-1),n[o-1]=0,n[o]=0,o--}else o++;n[o]=1,f=!f}throw new B},e.toNarrowWidePattern=function(t){var n,i,a=t.length,o=0,s;do{var f=2147483647;try{for(var u=(n=void 0,Jr(t)),l=u.next();!l.done;l=u.next()){var c=l.value;c<f&&c>o&&(f=c)}}catch(p){n={error:p}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}o=f,s=0;for(var d=0,h=0,v=0;v<a;v++){var c=t[v];c>o&&(h|=1<<a-1-v,s++,d+=c)}if(s===3){for(var v=0;v<a&&s>0;v++){var c=t[v];if(c>o&&(s--,c*2>=d))return-1}return h}}while(s>3);return-1},e.patternToChar=function(t){for(var n=0;n<e.CHARACTER_ENCODINGS.length;n++)if(e.CHARACTER_ENCODINGS[n]===t)return e.ALPHABET_STRING.charAt(n);if(t===e.ASTERISK_ENCODING)return"*";throw new B},e.decodeExtended=function(t){for(var n=t.length,i="",a=0;a<n;a++){var o=t.charAt(a);if(o==="+"||o==="$"||o==="%"||o==="/"){var s=t.charAt(a+1),f="\0";switch(o){case"+":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)+32);else throw new $;break;case"$":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)-64);else throw new $;break;case"%":if(s>="A"&&s<="E")f=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")f=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")f=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")f="\0";else if(s==="V")f="@";else if(s==="W")f="`";else if(s==="X"||s==="Y"||s==="Z")f="�";else throw new $;break;case"/":if(s>="A"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")f=":";else throw new $;break}i+=f,a++}else i+=o}return i},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Je),fs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),en=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qn=function(r){fs(e,r);function e(){var t=r.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return e.prototype.decodeRow=function(t,n,i){var a,o,s,f,u=this.findAsteriskPattern(n),l=n.getNextSet(u[1]),c=n.getSize(),d=this.counters;d.fill(0),this.decodeRowResult="";var h,v;do{e.recordPattern(n,l,d);var p=this.toPattern(d);if(p<0)throw new B;h=this.patternToChar(p),this.decodeRowResult+=h,v=l;try{for(var y=(a=void 0,en(d)),g=y.next();!g.done;g=y.next()){var w=g.value;l+=w}}catch(M){a={error:M}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(a)throw a.error}}l=n.getNextSet(l)}while(h!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var A=0;try{for(var x=en(d),m=x.next();!m.done;m=x.next()){var w=m.value;A+=w}}catch(M){s={error:M}}finally{try{m&&!m.done&&(f=x.return)&&f.call(x)}finally{if(s)throw s.error}}if(l===c||!n.get(l))throw new B;if(this.decodeRowResult.length<2)throw new B;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var S=this.decodeExtended(this.decodeRowResult),b=(u[1]+u[0])/2,D=v+A/2;return new pt(S,null,0,[new ie(b,t),new ie(D,t)],fe.CODE_93,new Date().getTime())},e.prototype.findAsteriskPattern=function(t){var n=t.getSize(),i=t.getNextSet(0);this.counters.fill(0);for(var a=this.counters,o=i,s=!1,f=a.length,u=0,l=i;l<n;l++)if(t.get(l)!==s)a[u]++;else{if(u===f-1){if(this.toPattern(a)===e.ASTERISK_ENCODING)return new Int32Array([o,l]);o+=a[0]+a[1],a.copyWithin(0,2,2+u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,s=!s}throw new B},e.prototype.toPattern=function(t){var n,i,a=0;try{for(var o=en(t),s=o.next();!s.done;s=o.next()){var f=s.value;a+=f}}catch(v){n={error:v}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}for(var u=0,l=t.length,c=0;c<l;c++){var d=Math.round(t[c]*9/a);if(d<1||d>4)return-1;if(c&1)u<<=d;else for(var h=0;h<d;h++)u=u<<1|1}return u},e.prototype.patternToChar=function(t){for(var n=0;n<e.CHARACTER_ENCODINGS.length;n++)if(e.CHARACTER_ENCODINGS[n]===t)return e.ALPHABET_STRING.charAt(n);throw new B},e.prototype.decodeExtended=function(t){for(var n=t.length,i="",a=0;a<n;a++){var o=t.charAt(a);if(o>="a"&&o<="d"){if(a>=n-1)throw new $;var s=t.charAt(a+1),f="\0";switch(o){case"d":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)+32);else throw new $;break;case"a":if(s>="A"&&s<="Z")f=String.fromCharCode(s.charCodeAt(0)-64);else throw new $;break;case"b":if(s>="A"&&s<="E")f=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")f=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")f=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")f="\0";else if(s==="V")f="@";else if(s==="W")f="`";else if(s>="X"&&s<="Z")f="�";else throw new $;break;case"c":if(s>="A"&&s<="O")f=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")f=":";else throw new $;break}i+=f,a++}else i+=o}return i},e.prototype.checkChecksums=function(t){var n=t.length;this.checkOneChecksum(t,n-2,20),this.checkOneChecksum(t,n-1,15)},e.prototype.checkOneChecksum=function(t,n,i){for(var a=1,o=0,s=n-1;s>=0;s--)o+=a*e.ALPHABET_STRING.indexOf(t.charAt(s)),++a>i&&(a=1);if(t.charAt(n)!==e.ALPHABET_STRING[o%47])throw new ze},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e}(Je),us=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ls=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$n=function(r){us(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return e.prototype.decodeRow=function(t,n,i){var a,o,s=this.decodeStart(n),f=this.decodeEnd(n),u=new we;e.decodeMiddle(n,s[1],f[0],u);var l=u.toString(),c=null;i!=null&&(c=i.get(ke.ALLOWED_LENGTHS)),c==null&&(c=e.DEFAULT_ALLOWED_LENGTHS);var d=l.length,h=!1,v=0;try{for(var p=ls(c),y=p.next();!y.done;y=p.next()){var g=y.value;if(d===g){h=!0;break}g>v&&(v=g)}}catch(x){a={error:x}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}if(!h&&d>v&&(h=!0),!h)throw new $;var w=[new ie(s[1],t),new ie(f[0],t)],A=new pt(l,null,0,w,fe.ITF,new Date().getTime());return A},e.decodeMiddle=function(t,n,i,a){var o=new Int32Array(10),s=new Int32Array(5),f=new Int32Array(5);for(o.fill(0),s.fill(0),f.fill(0);n<i;){Je.recordPattern(t,n,o);for(var u=0;u<5;u++){var l=2*u;s[u]=o[l],f[u]=o[l+1]}var c=e.decodeDigit(s);a.append(c.toString()),c=this.decodeDigit(f),a.append(c.toString()),o.forEach(function(d){n+=d})}},e.prototype.decodeStart=function(t){var n=e.skipWhiteSpace(t),i=e.findGuardPattern(t,n,e.START_PATTERN);return this.narrowLineWidth=(i[1]-i[0])/4,this.validateQuietZone(t,i[0]),i},e.prototype.validateQuietZone=function(t,n){var i=this.narrowLineWidth*10;i=i<n?i:n;for(var a=n-1;i>0&&a>=0&&!t.get(a);a--)i--;if(i!==0)throw new B},e.skipWhiteSpace=function(t){var n=t.getSize(),i=t.getNextSet(0);if(i===n)throw new B;return i},e.prototype.decodeEnd=function(t){t.reverse();try{var n=e.skipWhiteSpace(t),i=void 0;try{i=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[0])}catch(o){o instanceof B&&(i=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,i[0]);var a=i[0];return i[0]=t.getSize()-i[1],i[1]=t.getSize()-a,i}finally{t.reverse()}},e.findGuardPattern=function(t,n,i){var a=i.length,o=new Int32Array(a),s=t.getSize(),f=!1,u=0,l=n;o.fill(0);for(var c=n;c<s;c++)if(t.get(c)!==f)o[u]++;else{if(u===a-1){if(Je.patternMatchVariance(o,i,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[l,c];l+=o[0]+o[1],Le.arraycopy(o,2,o,0,u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,f=!f}throw new B},e.decodeDigit=function(t){for(var n=e.MAX_AVG_VARIANCE,i=-1,a=e.PATTERNS.length,o=0;o<a;o++){var s=e.PATTERNS[o],f=Je.patternMatchVariance(t,s,e.MAX_INDIVIDUAL_VARIANCE);f<n?(n=f,i=o):f===n&&(i=-1)}if(i>=0)return i%10;throw new B},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Je),cs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ur=function(r){cs(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return e.findStartGuardPattern=function(t){for(var n=!1,i,a=0,o=Int32Array.from([0,0,0]);!n;){o=Int32Array.from([0,0,0]),i=e.findGuardPattern(t,a,!1,this.START_END_PATTERN,o);var s=i[0];a=i[1];var f=s-(a-s);f>=0&&(n=t.isRange(f,s,!1))}return i},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var i=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===i},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,i=0,a=n-1;a>=0;
6a-=2){var o=t.charAt(a).charCodeAt(0)-48;if(o<0||o>9)throw new $;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=t.charAt(a).charCodeAt(0)-48;if(o<0||o>9)throw new $;i+=o}return(1e3-i)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,n,i,a){return this.findGuardPattern(t,n,i,a,new Int32Array(a.length))},e.findGuardPattern=function(t,n,i,a,o){var s=t.getSize();n=i?t.getNextUnset(n):t.getNextSet(n);for(var f=0,u=n,l=a.length,c=i,d=n;d<s;d++)if(t.get(d)!==c)o[f]++;else{if(f===l-1){if(Je.patternMatchVariance(o,a,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,d]);u+=o[0]+o[1];for(var h=o.slice(2,o.length),v=0;v<f-1;v++)o[v]=h[v];o[f-1]=0,o[f]=0,f--}else f++;o[f]=1,c=!c}throw new B},e.decodeDigit=function(t,n,i,a){this.recordPattern(t,i,n);for(var o=this.MAX_AVG_VARIANCE,s=-1,f=a.length,u=0;u<f;u++){var l=a[u],c=Je.patternMatchVariance(n,l,e.MAX_INDIVIDUAL_VARIANCE);c<o&&(o=c,s=u)}if(s>=0)return s;throw new B},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Je),ds=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hs=function(){function r(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(e,t,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(t,n,i),o=i.toString(),s=r.parseExtensionString(o),f=[new ie((n[0]+n[1])/2,e),new ie(a,e)],u=new pt(o,null,0,f,fe.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},r.prototype.decodeMiddle=function(e,t,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=e.getSize(),f=t[1],u=0,l=0;l<5&&f<s;l++){var c=ur.decodeDigit(e,o,f,ur.L_AND_G_PATTERNS);n+=String.fromCharCode(48+c%10);try{for(var d=(i=void 0,ds(o)),h=d.next();!h.done;h=d.next()){var v=h.value;f+=v}}catch(y){i={error:y}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}c>=10&&(u|=1<<4-l),l!==4&&(f=e.getNextSet(f),f=e.getNextUnset(f))}if(n.length!==5)throw new B;var p=this.determineCheckDigit(u);if(r.extensionChecksum(n.toString())!==p)throw new B;return f},r.extensionChecksum=function(e){for(var t=e.length,n=0,i=t-2;i>=0;i-=2)n+=e.charAt(i).charCodeAt(0)-48;n*=3;for(var i=t-1;i>=0;i-=2)n+=e.charAt(i).charCodeAt(0)-48;return n*=3,n%10},r.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new B},r.parseExtensionString=function(e){if(e.length!==5)return null;var t=r.parseExtension5String(e);return t==null?null:new Map([[lt.SUGGESTED_PRICE,t]])},r.parseExtension5String=function(e){var t;switch(e.charAt(0)){case"0":t="£";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t="";break}var n=parseInt(e.substring(1)),i=(n/100).toString(),a=n%100,o=a<10?"0"+a:a.toString();return t+i+"."+o},r}(),vs=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ps=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(e,t,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(t,n,i),o=i.toString(),s=r.parseExtensionString(o),f=[new ie((n[0]+n[1])/2,e),new ie(a,e)],u=new pt(o,null,0,f,fe.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},r.prototype.decodeMiddle=function(e,t,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var s=e.getSize(),f=t[1],u=0,l=0;l<2&&f<s;l++){var c=ur.decodeDigit(e,o,f,ur.L_AND_G_PATTERNS);n+=String.fromCharCode(48+c%10);try{for(var d=(i=void 0,vs(o)),h=d.next();!h.done;h=d.next()){var v=h.value;f+=v}}catch(p){i={error:p}}
6finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}c>=10&&(u|=1<<1-l),l!==1&&(f=e.getNextSet(f),f=e.getNextUnset(f))}if(n.length!==2)throw new B;if(parseInt(n.toString())%4!==u)throw new B;return f},r.parseExtensionString=function(e){return e.length!==2?null:new Map([[lt.ISSUE_NUMBER,parseInt(e)]])},r}(),gs=function(){function r(){}return r.decodeRow=function(e,t,n){var i=ur.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var a=new hs;return a.decodeRow(e,t,i)}catch{var o=new ps;return o.decodeRow(e,t,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),_s=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),qe=function(r){_s(e,r);function e(){var t=r.call(this)||this;t.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var i=e.L_PATTERNS[n-10],a=new Int32Array(i.length),o=0;o<i.length;o++)a[o]=i[i.length-o-1];e.L_AND_G_PATTERNS[n]=a}return t}return e.prototype.decodeRow=function(t,n,i){var a=e.findStartGuardPattern(n),o=i==null?null:i.get(ke.NEED_RESULT_POINT_CALLBACK);if(o!=null){var s=new ie((a[0]+a[1])/2,t);o.foundPossibleResultPoint(s)}var f=this.decodeMiddle(n,a,this.decodeRowStringBuffer),u=f.rowOffset,l=f.resultString;if(o!=null){var c=new ie(u,t);o.foundPossibleResultPoint(c)}var d=e.decodeEnd(n,u);if(o!=null){var h=new ie((d[0]+d[1])/2,t);o.foundPossibleResultPoint(h)}var v=d[1],p=v+(v-d[0]);if(p>=n.getSize()||!n.isRange(v,p,!1))throw new B;var y=l.toString();if(y.length<8)throw new $;if(!e.checkChecksum(y))throw new ze;var g=(a[1]+a[0])/2,w=(d[1]+d[0])/2,A=this.getBarcodeFormat(),x=[new ie(g,t),new ie(w,t)],m=new pt(y,null,0,x,A,new Date().getTime()),S=0;try{var b=gs.decodeRow(t,n,d[1]);m.putMetadata(lt.UPC_EAN_EXTENSION,b.getText()),m.putAllMetadata(b.getResultMetadata()),m.addResultPoints(b.getResultPoints()),S=b.getText().length}catch{}var D=i==null?null:i.get(ke.ALLOWED_EAN_EXTENSIONS);if(D!=null){var M=!1;for(var G in D)if(S.toString()===G){M=!0;break}if(!M)throw new B}return A===fe.EAN_13||fe.UPC_A,m},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var i=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===i},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,i=0,a=n-1;a>=0;a-=2){var o=t.charAt(a).charCodeAt(0)-48;if(o<0||o>9)throw new $;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=t.charAt(a).charCodeAt(0)-48;if(o<0||o>9)throw new $;i+=o}return(1e3-i)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(ur),ys=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Jn=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_n=function(r){ys(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,i){var a,o,s,f,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var l=t.getSize(),c=n[1],d=0,h=0;h<6&&c<l;h++){var v=qe.decodeDigit(t,u,c,qe.L_AND_G_PATTERNS);i+=String.fromCharCode(48+v%10);try{for(var p=(a=void 0,Jn(u)),y=p.next();!y.done;y=p.next()){var g=y.value;c+=g}}catch(m){a={error:m}}
6finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}v>=10&&(d|=1<<5-h)}i=e.determineFirstDigit(i,d);var w=qe.findGuardPattern(t,c,!0,qe.MIDDLE_PATTERN,new Int32Array(qe.MIDDLE_PATTERN.length).fill(0));c=w[1];for(var h=0;h<6&&c<l;h++){var v=qe.decodeDigit(t,u,c,qe.L_PATTERNS);i+=String.fromCharCode(48+v);try{for(var A=(s=void 0,Jn(u)),x=A.next();!x.done;x=A.next()){var g=x.value;c+=g}}catch(b){s={error:b}}finally{try{x&&!x.done&&(f=A.return)&&f.call(A)}finally{if(s)throw s.error}}}return{rowOffset:c,resultString:i}},e.prototype.getBarcodeFormat=function(){return fe.EAN_13},e.determineFirstDigit=function(t,n){for(var i=0;i<10;i++)if(n===this.FIRST_DIGIT_ENCODINGS[i])return t=String.fromCharCode(48+i)+t,t;throw new B},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(qe),xs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ei=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ti=function(r){xs(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,i){var a,o,s,f,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var l=t.getSize(),c=n[1],d=0;d<4&&c<l;d++){var h=qe.decodeDigit(t,u,c,qe.L_PATTERNS);i+=String.fromCharCode(48+h);try{for(var v=(a=void 0,ei(u)),p=v.next();!p.done;p=v.next()){var y=p.value;c+=y}}catch(x){a={error:x}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}var g=qe.findGuardPattern(t,c,!0,qe.MIDDLE_PATTERN,new Int32Array(qe.MIDDLE_PATTERN.length).fill(0));c=g[1];for(var d=0;d<4&&c<l;d++){var h=qe.decodeDigit(t,u,c,qe.L_PATTERNS);i+=String.fromCharCode(48+h);try{for(var w=(s=void 0,ei(u)),A=w.next();!A.done;A=w.next()){var y=A.value;c+=y}}catch(S){s={error:S}}finally{try{A&&!A.done&&(f=w.return)&&f.call(w)}finally{if(s)throw s.error}}}return{rowOffset:c,resultString:i}},e.prototype.getBarcodeFormat=function(){return fe.EAN_8},e}(qe),ws=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ri=function(r){ws(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ean13Reader=new _n,t}return e.prototype.getBarcodeFormat=function(){return fe.UPC_A},e.prototype.decode=function(t,n){return this.maybeReturnResult(this.ean13Reader.decode(t))},e.prototype.decodeRow=function(t,n,i){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,n,i))},e.prototype.decodeMiddle=function(t,n,i){return this.ean13Reader.decodeMiddle(t,n,i)},e.prototype.maybeReturnResult=function(t){var n=t.getText();if(n.charAt(0)==="0"){var i=new pt(n.substring(1),null,null,t.getResultPoints(),fe.UPC_A);return t.getResultMetadata()!=null&&i.putAllMetadata(t.getResultMetadata()),i}else throw new B},e.prototype.reset=function(){this.ean13Reader.reset()},e}(qe),As=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ms=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ni=function(r){As(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return e.prototype.decodeMiddle=function(t,n,i){var a,o,s=this.decodeMiddleCounters.map(function(y){return y});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var f=t.getSize(),u=n[1],l=0,c=0;c<6&&u<f;c++){var d=e.decodeDigit(t,s,u,e.L_AND_G_PATTERNS);i+=String.fromCharCode(48+d%10);try{for(var h=(a=void 0,ms(s)),v=h.next();!v.done;v=h.next()){var p=v.value;u+=p}}catch(y){a={error:y}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}d>=10&&(l|=1<<5-c)}return e.determineNumSysAndCheckDigit(new we(i),l),u},e.prototype.decodeEnd=function(t,n){return e.findGuardPatternWithoutCounters(t,n,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return qe.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,n){for(var i=0;i<=1;i++)for(var a=0;a<10;a++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][a]){t.insert(0,"0"+i),t.append("0"+a);return}throw B.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return fe.UPC_E},e.convertUPCEtoUPCA=function(t){var n=t.slice(1,7).split("").map(function(o){return o.charCodeAt(0)}),i=new we;i.append(t.charAt(0));var a=n[5];switch(a){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(a),i.append("0000"),i.appendChars(n,2,3);break;case 3:i.appendChars(n,0,3),i.append("00000"),i.appendChars(n,3,2);break;case 4:i.appendChars(n,0,4),i.append("00000"),i.append(n[4]);break;default:i.appendChars(n,0,5),i.append("0000"),i.append(a);break}return t.length>=8&&i.append(t.charAt(7)),i.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(qe),Es=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ii=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},tn=function(r){Es(e,r);function e(t){var n=r.call(this)||this,i=t==null?null:t.get(ke.POSSIBLE_FORMATS),a=[];return i!=null&&(i.indexOf(fe.EAN_13)>-1&&a.push(new _n),i.indexOf(fe.UPC_A)>-1&&a.push(new ri),i.indexOf(fe.EAN_8)>-1&&a.push(new ti),i.indexOf(fe.UPC_E)>-1&&a.push(new ni)),a.length===0&&(a.push(new _n),a.push(new ri),a.push(new ti),a.push(new ni)),n.readers=a,n}return e.prototype.decodeRow=function(t,n,i){var a,o;try{for(var s=ii(this.readers),f=s.next();!f.done;f=s.next()){var u=f.value;try{var l=u.decodeRow(t,n,i),c=l.getBarcodeFormat()===fe.EAN_13&&l.getText().charAt(0)==="0",d=i==null?null:i.get(ke.POSSIBLE_FORMATS),h=d==null||d.includes(fe.UPC_A);if(c&&h){var v=l.getRawBytes(),p=new pt(l.getText().substring(1),v,v?v.length:null,l.getResultPoints(),fe.UPC_A);return p.putAllMetadata(l.getResultMetadata()),p}return l}catch{}}}catch(y){a={error:y}}finally{try{f&&!f.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}throw new B},e.prototype.reset=function(){var t,n;try{for(var i=ii(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;o.reset()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e}(Je),Cs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Is=function(r){Cs(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},t}return e.prototype.decodeRow=function(t,n,i){var a=this.getValidRowData(n);if(!a)throw new B;var o=this.codaBarDecodeRow(a.row);if(!o)throw new B;return new pt(o,null,0,[new ie(a.left,t),new ie(a.right,t)],fe.CODABAR,new Date().getTime())},e.prototype.getValidRowData=function(t){var n=t.toArray(),i=n.indexOf(!0);if(i===-1)return null;var a=n.lastIndexOf(!0);if(a<=i)return null;n=n.slice(i,a+1);for(var o=[],s=n[0],f=1,u=1;u<n.length;u++)n[u]===s?f++:(s=n[u],o.push(f),f=1);return o.push(f),o.length<23&&(o.length+1)%8!==0?null:{row:o,left:i,right:a}},e.prototype.codaBarDecodeRow=function(t){for(var n=[],i=Math.ceil(t.reduce(function(f,u){return(f+u)/2},0));t.length>0;){var a=t.splice(0,8).splice(0,7),o=a.map(function(f){return f<i?"n":"w"}).join("");if(this.CODA_BAR_CHAR_SET[o]===void 0)return null;n.push(this.CODA_BAR_CHAR_SET[o])}var s=n.join("");return this.validCodaBarString(s)?s:null},e.prototype.validCodaBarString=function(t){var n=/^[A-D].{1,}[A-D]$/;return n.test(t)},e}(Je),Ss=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),bs=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kt=function(r){Ss(e,r);function e(){var t=r.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,n){for(var i=0;i<n.length;
6i++)if(Je.patternMatchVariance(t,n[i],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return i;throw new B},e.count=function(t){return Oe.sum(new Int32Array(t))},e.increment=function(t,n){for(var i=0,a=n[0],o=1;o<t.length;o++)n[o]>a&&(a=n[o],i=o);t[i]++},e.decrement=function(t,n){for(var i=0,a=n[0],o=1;o<t.length;o++)n[o]<a&&(a=n[o],i=o);t[i]--},e.isFinderPattern=function(t){var n,i,a=t[0]+t[1],o=a+t[2]+t[3],s=a/o;if(s>=e.MIN_FINDER_PATTERN_RATIO&&s<=e.MAX_FINDER_PATTERN_RATIO){var f=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var l=bs(t),c=l.next();!c.done;c=l.next()){var d=c.value;d>u&&(u=d),d<f&&(f=d)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return u<10*f}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(Je),Vr=function(){function r(e,t){this.value=e,this.checksumPortion=t}return r.prototype.getValue=function(){return this.value},r.prototype.getChecksumPortion=function(){return this.checksumPortion},r.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.value===t.value&&this.checksumPortion===t.checksumPortion},r.prototype.hashCode=function(){return this.value^this.checksumPortion},r}(),ya=function(){function r(e,t,n,i,a){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new ie(n,a)),this.resultPoints.push(new ie(i,a))}return r.prototype.getValue=function(){return this.value},r.prototype.getStartEnd=function(){return this.startEnd},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.value===t.value},r.prototype.hashCode=function(){return this.value},r}(),Os=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ir=function(){function r(){}return r.getRSSvalue=function(e,t,n){var i,a,o=0;try{for(var s=Os(e),f=s.next();!f.done;f=s.next()){var u=f.value;o+=u}}catch(w){i={error:w}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}for(var l=0,c=0,d=e.length,h=0;h<d-1;h++){var v=void 0;for(v=1,c|=1<<h;v<e[h];v++,c&=~(1<<h)){var p=r.combins(o-v-1,d-h-2);if(n&&c===0&&o-v-(d-h-1)>=d-h-1&&(p-=r.combins(o-v-(d-h),d-h-2)),d-h-1>1){for(var y=0,g=o-v-(d-h-2);g>t;g--)y+=r.combins(o-v-g-1,d-h-3);p-=y*(d-1-h)}else o-v>t&&p--;l+=p}o-=v}return l},r.combins=function(e,t){var n,i;e-t>t?(i=t,n=e-t):(i=e-t,n=t);for(var a=1,o=1,s=e;s>n;s--)a*=s,o<=i&&(a/=o,o++);for(;o<=i;)a/=o,o++;return a},r}(),Ts=function(){function r(){}return r.buildBitArray=function(e){var t=e.length*2-1;e[e.length-1].getRightChar()==null&&(t-=1);for(var n=12*t,i=new nt(n),a=0,o=e[0],s=o.getRightChar().getValue(),f=11;f>=0;--f)s&1<<f&&i.set(a),a++;for(var f=1;f<e.length;++f){for(var u=e[f],l=u.getLeftChar().getValue(),c=11;c>=0;--c)l&1<<c&&i.set(a),a++;if(u.getRightChar()!==null)for(var d=u.getRightChar().getValue(),c=11;c>=0;--c)d&1<<c&&i.set(a),a++}return i},r}(),Yt=function(){function r(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}return r.prototype.getDecodedInformation=function(){return this.decodedInformation},r.prototype.isFinished=function(){return this.finished},r}(),bn=function(){function r(e){this.newPosition=e}return r.prototype.getNewPosition=function(){return this.newPosition},r}(),Ds=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Tt=function(r){Ds(e,r);function e(t,n){var i=r.call(this,t)||this;return i.value=n,i}return e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(bn),Ns=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Zt=function(r){Ns(e,r);function e(t,n,i){var a=r.call(this,t)||this;return i?(a.remaining=!0,a.remainingValue=a.remainingValue):(a.remaining=!1,a.remainingValue=0),a.newString=n,a}return e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(bn),Rs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),tr=function(r){Rs(e,r);function e(t,n,i){var a=r.call(this,t)||this;if(n<0||n>10||i<0||i>10)throw new $;return a.firstDigit=n,a.secondDigit=i,a}return e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(bn),Nr=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ps=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(e){var t,n,i,a,o,s,f,u;if(!e)return null;if(e.length<2)throw new B;var l=e.substring(0,2);try{for(var c=Nr(r.TWO_DIGIT_DATA_LENGTH),d=c.next();!d.done;d=c.next()){var h=d.value;if(h[0]===l)return h[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,h[2],e):r.processFixedAI(2,h[1],e)}}catch(S){t={error:S}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(e.length<3)throw new B;var v=e.substring(0,3);try{for(var p=Nr(r.THREE_DIGIT_DATA_LENGTH),y=p.next();!y.done;y=p.next()){var h=y.value;if(h[0]===v)return h[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,h[2],e):r.processFixedAI(3,h[1],e)}}catch(S){i={error:S}}finally{try{y&&!y.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}try{for(var g=Nr(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=g.next();!w.done;w=g.next()){var h=w.value;if(h[0]===v)return h[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,h[2],e):r.processFixedAI(4,h[1],e)}}catch(S){o={error:S}}finally{try{w&&!w.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}if(e.length<4)throw new B;var A=e.substring(0,4);try{for(var x=Nr(r.FOUR_DIGIT_DATA_LENGTH),m=x.next();!m.done;m=x.next()){var h=m.value;if(h[0]===A)return h[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,h[2],e):r.processFixedAI(4,h[1],e)}}catch(S){f={error:S}}finally{try{m&&!m.done&&(u=x.return)&&u.call(x)}finally{if(f)throw f.error}}throw new B},r.processFixedAI=function(e,t,n){if(n.length<e)throw new B;var i=n.substring(0,e);if(n.length<e+t)throw new B;var a=n.substring(e,e+t),o=n.substring(e+t),s="("+i+")"+a,f=r.parseFieldsInGeneralPurpose(o);return f==null?s:s+f},r.processVariableAI=function(e,t,n){var i=n.substring(0,e),a;n.length<e+t?a=n.length:a=e+t;var o=n.substring(e,a),s=n.substring(a),f="("+i+")"+o,u=r.parseFieldsInGeneralPurpose(s);return u==null?f:f+u},r.VARIABLE_LENGTH=[],r.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",r.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",r.VARIABLE_LENGTH,20],["22",r.VARIABLE_LENGTH,29],["30",r.VARIABLE_LENGTH,8],["37",r.VARIABLE_LENGTH,8],["90",r.VARIABLE_LENGTH,30],["91",r.VARIABLE_LENGTH,30],["92",r.VARIABLE_LENGTH,30],["93",r.VARIABLE_LENGTH,30],["94",r.VARIABLE_LENGTH,30],["95",r.VARIABLE_LENGTH,30],["96",r.VARIABLE_LENGTH,30],["97",r.VARIABLE_LENGTH,3],["98",r.VARIABLE_LENGTH,30],["99",r.VARIABLE_LENGTH,30]],r.THREE_DIGIT_DATA_LENGTH=[["240",r.VARIABLE_LENGTH,30],["241",r.VARIABLE_LENGTH,30],["242",r.VARIABLE_LENGTH,6],["250",r.VARIABLE_LENGTH,30],["251",r.VARIABLE_LENGTH,30],["253",r.VARIABLE_LENGTH,17],["254",r.VARIABLE_LENGTH,20],["400",r.VARIABLE_LENGTH,30],["401",r.VARIABLE_LENGTH,30],["402",17],["403",r.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",r.VARIABLE_LENGTH,20],["421",r.VARIABLE_LENGTH,15],["422",3],["423",r.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["3
660",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",r.VARIABLE_LENGTH,15],["391",r.VARIABLE_LENGTH,18],["392",r.VARIABLE_LENGTH,15],["393",r.VARIABLE_LENGTH,18],["703",r.VARIABLE_LENGTH,30]],r.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",r.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",r.VARIABLE_LENGTH,20],["8003",r.VARIABLE_LENGTH,30],["8004",r.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",r.VARIABLE_LENGTH,30],["8008",r.VARIABLE_LENGTH,12],["8018",18],["8020",r.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",r.VARIABLE_LENGTH,70],["8200",r.VARIABLE_LENGTH,70]],r}(),Fr=function(){function r(e){this.buffer=new we,this.information=e}return r.prototype.decodeAllCodes=function(e,t){var n=t,i=null;do{var a=this.decodeGeneralPurposeField(n,i),o=Ps.parseFieldsInGeneralPurpose(a.getNewString());if(o!=null&&e.append(o),a.isRemaining()?i=""+a.getRemainingValue():i=null,n===a.getNewPosition())break;n=a.getNewPosition()}while(!0);return e.toString()},r.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},r.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return t===0?new tr(this.information.getSize(),tr.FNC1,tr.FNC1):new tr(this.information.getSize(),t-1,tr.FNC1)}var n=this.extractNumericValueFromBitArray(e,7),i=(n-8)/11,a=(n-8)%11;return new tr(e+7,i,a)},r.prototype.extractNumericValueFromBitArray=function(e,t){return r.extractNumericValueFromBitArray(this.information,e,t)},r.extractNumericValueFromBitArray=function(e,t,n){for(var i=0,a=0;a<n;++a)e.get(t+a)&&(i|=1<<n-a-1);return i},r.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),t!=null&&this.buffer.append(t),this.current.setPosition(e);var n=this.parseBlocks();return n!=null&&n.isRemaining()?new Zt(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new Zt(this.current.getPosition(),this.buffer.toString())},r.prototype.parseBlocks=function(){var e,t;do{var n=this.current.getPosition();this.current.isAlpha()?(t=this.parseAlphaBlock(),e=t.isFinished()):this.current.isIsoIec646()?(t=this.parseIsoIec646Block(),e=t.isFinished()):(t=this.parseNumericBlock(),e=t.isFinished());var i=n!==this.current.getPosition();if(!i&&!e)break}while(!e);return t.getDecodedInformation()},r.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return e.isSecondDigitFNC1()?t=new Zt(this.current.getPosition(),this.buffer.toString()):t=new Zt(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new Yt(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){var t=new Zt(this.current.getPosition(),this.buffer.toString());return new Yt(!0,t)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Yt(!1)},r.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new Zt(this.current.getPosition(),this.buffer.toString());return new Yt(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Yt(!1)},r.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new Zt(this.current.getPosition(),this.buffer.toString());return new Yt(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Yt(!1)},r.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;
6if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var i=this.extractNumericValueFromBitArray(e,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Tt(e+5,Tt.FNC1);if(t>=5&&t<15)return new Tt(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new Tt(e+7,""+(n+1));if(n>=90&&n<116)return new Tt(e+7,""+(n+7));var i=this.extractNumericValueFromBitArray(e,8),a;switch(i){case 232:a="!";break;case 233:a='"';break;case 234:a="%";break;case 235:a="&";break;case 236:a="'";break;case 237:a="(";break;case 238:a=")";break;case 239:a="*";break;case 240:a="+";break;case 241:a=",";break;case 242:a="-";break;case 243:a=".";break;case 244:a="/";break;case 245:a=":";break;case 246:a=";";break;case 247:a="<";break;case 248:a="=";break;case 249:a=">";break;case 250:a="?";break;case 251:a="_";break;case 252:a=" ";break;default:throw new $}return new Tt(e+8,a)},r.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new Tt(e+5,Tt.FNC1);if(t>=5&&t<15)return new Tt(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new Tt(e+6,""+(n+33));var i;switch(n){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new br("Decoding invalid alphanumeric value: "+n)}return new Tt(e+6,i)},r.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(t===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},r.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},r.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},r}(),xa=function(){function r(e){this.information=e,this.generalDecoder=new Fr(e)}return r.prototype.getInformation=function(){return this.information},r.prototype.getGeneralDecoder=function(){return this.generalDecoder},r}(),Ms=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Dt=function(r){Ms(e,r);function e(t){return r.call(this,t)||this}return e.prototype.encodeCompressedGtin=function(t,n){t.append("(01)");var i=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,n,i)},e.prototype.encodeCompressedGtinWithoutAI=function(t,n,i){for(var a=0;a<4;++a){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(n+10*a,10);o/100===0&&t.append("0"),o/10===0&&t.append("0"),t.append(o)}e.appendCheckDigit(t,i)},e.appendCheckDigit=function(t,n){for(var i=0,a=0;a<13;a++){var o=t.charAt(a+n).charCodeAt(0)-48;i+=a&1?o:3*o}i=10-i%10,i===10&&(i=0),t.append(i)},e.GTIN_SIZE=40,e}(xa),Bs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Fs=function(r){Bs(e,r);function e(t){return r.call(this,t)||this}return e.prototype.parseInformation=function(){var t=new we;t.append("(01)");var n=t.length(),i=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(i),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,n),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Dt),Ls=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ks=function(r){Ls(e,r);function e(t){return r.call(this,t)||this}return e.prototype.parseInformation=function(){var t=new we;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(xa),Us=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Lr=function(r){Us(e,r);function e(t){return r.call(this,t)||this}return e.prototype.encodeCompressedWeight=function(t,n,i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(n,i);this.addWeightCode(t,a);for(var o=this.checkWeight(a),s=1e5,f=0;f<5;++f)o/s===0&&t.append("0"),s/=10;t.append(o)},e}(Dt),Vs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wa=function(r){Vs(e,r);function e(t){return r.call(this,t)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+Lr.GTIN_SIZE+e.WEIGHT_SIZE)throw new B;var t=new we;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+Lr.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(Lr),Hs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Gs=function(r){Hs(e,r);function e(t){return r.call(this,t)||this}return e.prototype.addWeightCode=function(t,n){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(wa),Xs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ws=function(r){Xs(e,r);function e(t){return r.call(this,t)||this}return e.prototype.addWeightCode=function(t,n){n<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(wa),zs=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),js=function(r){zs(e,r);function e(t){return r.call(this,t)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Dt.GTIN_SIZE)throw new B;var t=new we;this.encodeCompressedGtin(t,e.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Dt.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(n),t.append(")");var i=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Dt.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(i.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Dt),Ys=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Zs=function(r){Ys(e,r);function e(t){return r.call(this,t)||this}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Dt.GTIN_SIZE)throw new B;var t=new we;this.encodeCompressedGtin(t,e.HEADER_SIZE);var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Dt.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(n),t.append(")");var i=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Dt.GTIN_SIZE+e.LA
6ST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);i/100===0&&t.append("0"),i/10===0&&t.append("0"),t.append(i);var a=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Dt.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(a.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Dt),Ks=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Gt=function(r){Ks(e,r);function e(t,n,i){var a=r.call(this,t)||this;return a.dateCode=i,a.firstAIdigits=n,a}return e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new B;var t=new we;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),t.toString()},e.prototype.encodeCompressedDate=function(t,n){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(n,e.DATE_SIZE);if(i!==38400){t.append("("),t.append(this.dateCode),t.append(")");var a=i%32;i/=32;var o=i%12+1;i/=12;var s=i;s/10===0&&t.append("0"),t.append(s),o/10===0&&t.append("0"),t.append(o),a/10===0&&t.append("0"),t.append(a)}},e.prototype.addWeightCode=function(t,n){t.append("("),t.append(this.firstAIdigits),t.append(n/1e5),t.append(")")},e.prototype.checkWeight=function(t){return t%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(Lr);function qs(r){try{if(r.get(1))return new Fs(r);if(!r.get(2))return new ks(r);var e=Fr.extractNumericValueFromBitArray(r,1,4);switch(e){case 4:return new Gs(r);case 5:return new Ws(r)}var t=Fr.extractNumericValueFromBitArray(r,1,5);switch(t){case 12:return new js(r);case 13:return new Zs(r)}var n=Fr.extractNumericValueFromBitArray(r,1,7);switch(n){case 56:return new Gt(r,"310","11");case 57:return new Gt(r,"320","11");case 58:return new Gt(r,"310","13");case 59:return new Gt(r,"320","13");case 60:return new Gt(r,"310","15");case 61:return new Gt(r,"320","15");case 62:return new Gt(r,"310","17");case 63:return new Gt(r,"320","17")}}catch(i){throw console.log(i),new br("unknown decoder: "+r)}}var ai=function(){function r(e,t,n,i){this.leftchar=e,this.rightchar=t,this.finderpattern=n,this.maybeLast=i}return r.prototype.mayBeLast=function(){return this.maybeLast},r.prototype.getLeftChar=function(){return this.leftchar},r.prototype.getRightChar=function(){return this.rightchar},r.prototype.getFinderPattern=function(){return this.finderpattern},r.prototype.mustBeLast=function(){return this.rightchar==null},r.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},r.equals=function(e,t){return e instanceof r?r.equalsOrNull(e.leftchar,t.leftchar)&&r.equalsOrNull(e.rightchar,t.rightchar)&&r.equalsOrNull(e.finderpattern,t.finderpattern):!1},r.equalsOrNull=function(e,t){return e===null?t===null:r.equals(e,t)},r.prototype.hashCode=function(){var e=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return e},r}(),Qs=function(){function r(e,t,n){this.pairs=e,this.rowNumber=t,this.wasReversed=n}return r.prototype.getPairs=function(){return this.pairs},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.isReversed=function(){return this.wasReversed},r.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},r.prototype.toString=function(){return"{ "+this.pairs+" }"},r.prototype.equals=function(e,t){return e instanceof r?this.checkEqualitity(e,t)&&e.wasReversed===t.wasReversed:!1},r.prototype.checkEqualitity=function(e,t){if(!(!e||!t)){var n;return e.forEach(function(i,a){t.forEach(function(o){i.getLeftChar().getValue()===o.getLeftChar().getValue()&&i.getRightChar().getValue()===o.getRightChar().getValue()&&i.getFinderPatter().getValue()===o.getFinderPatter().getValue()&&(n=!0)})}),n}},r}(),$s=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
6e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Xt=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Js=function(r){$s(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.pairs=new Array(e.MAX_PAIRS),t.rows=new Array,t.startEnd=[2],t}return e.prototype.decodeRow=function(t,n,i){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,n))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,n){for(var i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,t))}catch(s){if(s instanceof B){if(!this.pairs.length)throw new B;i=!0}}if(this.checkChecksum())return this.pairs;var a;if(this.rows.length?a=!0:a=!1,this.storeRow(t,!1),a){var o=this.checkRowsBoolean(!1);if(o!=null||(o=this.checkRowsBoolean(!0),o!=null))return o}throw new B},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(i){console.log(i)}return t&&(this.rows=this.rows.reverse()),n},e.prototype.checkRows=function(t,n){for(var i,a,o=n;o<this.rows.length;o++){var s=this.rows[o];this.pairs.length=0;try{for(var f=(i=void 0,Xt(t)),u=f.next();!u.done;u=f.next()){var l=u.value;this.pairs.push(l.getPairs())}}catch(d){i={error:d}}finally{try{u&&!u.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}if(this.pairs.push(s.getPairs()),!!e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var c=new Array(t);c.push(s);try{return this.checkRows(c,o+1)}catch(d){console.log(d)}}}throw new B},e.isValidSequence=function(t){var n,i;try{for(var a=Xt(e.FINDER_PATTERN_SEQUENCES),o=a.next();!o.done;o=a.next()){var s=o.value;if(!(t.length>s.length)){for(var f=!0,u=0;u<t.length;u++)if(t[u].getFinderPattern().getValue()!==s[u]){f=!1;break}if(f)return!0}}}catch(l){n={error:l}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return!1},e.prototype.storeRow=function(t,n){for(var i=0,a=!1,o=!1;i<this.rows.length;){var s=this.rows[i];if(s.getRowNumber()>t){o=s.isEquivalent(this.pairs);break}a=s.isEquivalent(this.pairs),i++}o||a||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new Qs(this.pairs,t,n)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,n){var i,a,o,s,f,u;try{for(var l=Xt(n),c=l.next();!c.done;c=l.next()){var d=c.value;if(d.getPairs().length!==t.length){var h=!0;try{for(var v=(o=void 0,Xt(d.getPairs())),p=v.next();!p.done;p=v.next()){var y=p.value,g=!1;try{for(var w=(f=void 0,Xt(t)),A=w.next();!A.done;A=w.next()){var x=A.value;if(ai.equals(y,x)){g=!0;break}}}catch(m){f={error:m}}finally{try{A&&!A.done&&(u=w.return)&&u.call(w)}finally{if(f)throw f.error}}g||(h=!1)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}}}}catch(m){i={error:m}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}},e.isPartialRow=function(t,n){var i,a,o,s,f,u;try{for(var l=Xt(n),c=l.next();!c.done;c=l.next()){var d=c.value,h=!0;try{for(var v=(o=void 0,Xt(t)),p=v.next();!p.done;p=v.next()){var y=p.value,g=!1;try{for(var w=(f=void 0,Xt(d.getPairs())),A=w.next();!A.done;A=w.next()){var x=A.value;if(y.equals(x)){g=!0;break}}}catch(m){f={error:m}}finally{try{A&&!A.done&&(u=w.return)&&u.call(w)}finally{if(f)throw f.error}}if(!g){h=!1;break}}}catch(m){o={error:m}}finally{try{p&&!p.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}if(h)return!0}}catch(m){i={error:m}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var n=Ts.buildBitArray(t),i=qs(n),a=i.parseInformation(),o=t[0].getFinderPattern().getResultPoints(),s=t[t.length-1].getFinderPattern().getResultPoints(),f=[o[0],o[1],s[0],s[1]];return new pt(a,null,null,f,fe.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),n=t.getLeftChar(),i=t.getRightChar();if(i===null)return!1;for(var a=i.getChecksumPortion(),o=2,s=1;s<this.pairs.size();++s){var f=this.pairs.get(s);a+=f.getLeftChar().getChecksumPortion(),o++;var u=f.getRightChar();u!=null&&(a+=u.getChecksumPortion(),o++)}a%=211;var l=211*(o-4)+a;return l===n.getValue()},e.getNextSecondBar=function(t,n){var i;return t.get(n)?(i=t.getNextUnset(n),i=t.getNextSet(i)):(i=t.getNextSet(n),i=t.getNextUnset(i)),i},e.prototype.retrieveNextPair=function(t,n,i){var a=n.length%2===0;this.startFromEven&&(a=!a);var o,s=!0,f=-1;do this.findNextPair(t,n,f),o=this.parseFoundFinderPattern(t,i,a),o===null?f=e.getNextSecondBar(t,this.startEnd[0]):s=!1;while(s);var u=this.decodeDataCharacter(t,o,a,!0);if(!this.isEmptyPair(n)&&n[n.length-1].mustBeLast())throw new B;var l;try{l=this.decodeDataCharacter(t,o,a,!1)}catch(c){l=null,console.log(c)}return new ai(u,l,o,!0)},e.prototype.isEmptyPair=function(t){return t.length===0},e.prototype.findNextPair=function(t,n,i){var a=this.getDecodeFinderCounters();a[0]=0,a[1]=0,a[2]=0,a[3]=0;var o=t.getSize(),s;if(i>=0)s=i;else if(this.isEmptyPair(n))s=0;else{var f=n[n.length-1];s=f.getFinderPattern().getStartEnd()[1]}var u=n.length%2!==0;this.startFromEven&&(u=!u);for(var l=!1;s<o&&(l=!t.get(s),!!l);)s++;for(var c=0,d=s,h=s;h<o;h++)if(t.get(h)!==l)a[c]++;else{if(c===3){if(u&&e.reverseCounters(a),e.isFinderPattern(a)){this.startEnd[0]=d,this.startEnd[1]=h;return}u&&e.reverseCounters(a),d+=a[0]+a[1],a[0]=a[2],a[1]=a[3],a[2]=0,a[3]=0,c--}else c++;a[c]=1,l=!l}throw new B},e.reverseCounters=function(t){for(var n=t.length,i=0;i<n/2;++i){var a=t[i];t[i]=t[n-i-1],t[n-i-1]=a}},e.prototype.parseFoundFinderPattern=function(t,n,i){var a,o,s;if(i){for(var f=this.startEnd[0]-1;f>=0&&!t.get(f);)f--;f++,a=this.startEnd[0]-f,o=f,s=this.startEnd[1]}else o=this.startEnd[0],s=t.getNextUnset(this.startEnd[1]+1),a=s-this.startEnd[1];var u=this.getDecodeFinderCounters();Le.arraycopy(u,0,u,1,u.length-1),u[0]=a;var l;try{l=this.parseFinderValue(u,e.FINDER_PATTERNS)}catch{return null}return new ya(l,[o,s],o,s,n)},e.prototype.decodeDataCharacter=function(t,n,i,a){for(var o=this.getDataCharacterCounters(),s=0;s<o.length;s++)o[s]=0;if(a)e.recordPatternInReverse(t,n.getStartEnd()[0],o);else{e.recordPattern(t,n.getStartEnd()[1],o);for(var f=0,u=o.length-1;f<u;f++,u--){var l=o[f];o[f]=o[u],o[u]=l}}var c=17,d=Oe.sum(new Int32Array(o))/c,h=(n.getStartEnd()[1]-n.getStartEnd()[0])/15;if(Math.abs(d-h)/h>.3)throw new B;for(var v=this.getOddCounts(),p=this.getEvenCounts(),y=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors(),f=0;f<o.length;f++){var w=1*o[f]/d,A=w+.5;if(A<1){if(w<.3)throw new B;A=1}else if(A>8){if(w>8.7)throw new B;A=8}var x=f/2;f&1?(p[x]=A,g[x]=w-A):(v[x]=A,y[x]=w-A)}this.adjustOddEvenCounts(c);for(var m=4*n.getValue()+(i?0:2)+(a?0:1)-1,S=0,b=0,f=v.length-1;f>=0;f--){if(e.isNotA1left(n,i,a)){var D=e.WEIGHTS[m][2*f];b+=v[f]*D}S+=v[f]}for(var M=0,f=p.length-1;f>=0;f--)if(e.isNotA1left(n,i,a)){var D=e.WEIGHTS[m][2*f+1];M+=p[f]*D}var G=b+M;if(S&1||S>13||S<4)throw new B;var W=(13-S)/2,V=e.SYMBOL_WIDEST[W],z=9-V,Q=ir.getRSSvalue(v,V,!0),de=ir.getRSSvalue(p,z,!1),re=e.EVEN_TOTAL_SUBSET[W],Y=e.GSUM[W],X=Q*re+de+Y;return new Vr(X,G)},e.isNotA1left=function(t,n,i){return!(t.getValue()===0&&n&&i)},e.prototype.adjustOddEvenCounts=function(t){var n=Oe.sum(new Int32Array(this.getOddCounts())),i=Oe.sum(new Int32Array(this.getEvenCounts())),a=!1,o=!1;n>13?o=!0:n<4&&(a=!0);var s=!1,f=!1;i>13?f=!0:i<4&&(s=!0);var u=n+i-t,l=(n&1)===1,c=(i&1)===0;if(u===1)if(l){if(c)throw new B;o=!0}else{if(!c)throw new B;f=!0}else if(u===-1)if(l){if(c)throw new B;a=!0}else{if(!c)throw new B;s=!0}else if(u===0){if(l){if(!c)throw new B;n<i?(a=!0,f=!0):(o=!0,s=!0)}else if(c)throw new B}else throw new B;if(a){if(o)throw new B;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}
6if(o&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(f)throw new B;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}f&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(Kt),ef=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),tf=function(r){ef(e,r);function e(t,n,i){var a=r.call(this,t,n)||this;return a.count=0,a.finderPattern=i,a}return e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(Vr),rf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),rn=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oi=function(r){rf(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return e.prototype.decodeRow=function(t,n,i){var a,o,s,f,u=this.decodePair(n,!1,t,i);e.addOrTally(this.possibleLeftPairs,u),n.reverse();var l=this.decodePair(n,!0,t,i);e.addOrTally(this.possibleRightPairs,l),n.reverse();try{for(var c=rn(this.possibleLeftPairs),d=c.next();!d.done;d=c.next()){var h=d.value;if(h.getCount()>1)try{for(var v=(s=void 0,rn(this.possibleRightPairs)),p=v.next();!p.done;p=v.next()){var y=p.value;if(y.getCount()>1&&e.checkChecksum(h,y))return e.constructResult(h,y)}}catch(g){s={error:g}}finally{try{p&&!p.done&&(f=v.return)&&f.call(v)}finally{if(s)throw s.error}}}}catch(g){a={error:g}}
6finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}throw new B},e.addOrTally=function(t,n){var i,a;if(n!=null){var o=!1;try{for(var s=rn(t),f=s.next();!f.done;f=s.next()){var u=f.value;if(u.getValue()===n.getValue()){u.incrementCount(),o=!0;break}}}catch(l){i={error:l}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}o||t.push(n)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,n){for(var i=4537077*t.getValue()+n.getValue(),a=new String(i).toString(),o=new we,s=13-a.length;s>0;s--)o.append("0");o.append(a);for(var f=0,s=0;s<13;s++){var u=o.charAt(s).charCodeAt(0)-48;f+=s&1?u:3*u}f=10-f%10,f===10&&(f=0),o.append(f.toString());var l=t.getFinderPattern().getResultPoints(),c=n.getFinderPattern().getResultPoints();return new pt(o.toString(),null,0,[l[0],l[1],c[0],c[1]],fe.RSS_14,new Date().getTime())},e.checkChecksum=function(t,n){var i=(t.getChecksumPortion()+16*n.getChecksumPortion())%79,a=9*t.getFinderPattern().getValue()+n.getFinderPattern().getValue();return a>72&&a--,a>8&&a--,i===a},e.prototype.decodePair=function(t,n,i,a){try{var o=this.findFinderPattern(t,n),s=this.parseFoundFinderPattern(t,i,n,o),f=a==null?null:a.get(ke.NEED_RESULT_POINT_CALLBACK);if(f!=null){var u=(o[0]+o[1])/2;n&&(u=t.getSize()-1-u),f.foundPossibleResultPoint(new ie(u,i))}var l=this.decodeDataCharacter(t,s,!0),c=this.decodeDataCharacter(t,s,!1);return new tf(1597*l.getValue()+c.getValue(),l.getChecksumPortion()+4*c.getChecksumPortion(),s)}catch{return null}},e.prototype.decodeDataCharacter=function(t,n,i){for(var a=this.getDataCharacterCounters(),o=0;o<a.length;o++)a[o]=0;if(i)Je.recordPatternInReverse(t,n.getStartEnd()[0],a);else{Je.recordPattern(t,n.getStartEnd()[1]+1,a);for(var s=0,f=a.length-1;s<f;s++,f--){var u=a[s];a[s]=a[f],a[f]=u}}for(var l=i?16:15,c=Oe.sum(new Int32Array(a))/l,d=this.getOddCounts(),h=this.getEvenCounts(),v=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors(),s=0;s<a.length;s++){var y=a[s]/c,g=Math.floor(y+.5);g<1?g=1:g>8&&(g=8);var w=Math.floor(s/2);s&1?(h[w]=g,p[w]=y-g):(d[w]=g,v[w]=y-g)}this.adjustOddEvenCounts(i,l);for(var A=0,x=0,s=d.length-1;s>=0;s--)x*=9,x+=d[s],A+=d[s];for(var m=0,S=0,s=h.length-1;s>=0;s--)m*=9,m+=h[s],S+=h[s];var b=x+3*m;if(i){if(A&1||A>12||A<4)throw new B;var D=(12-A)/2,M=e.OUTSIDE_ODD_WIDEST[D],G=9-M,W=ir.getRSSvalue(d,M,!1),V=ir.getRSSvalue(h,G,!0),z=e.OUTSIDE_EVEN_TOTAL_SUBSET[D],Q=e.OUTSIDE_GSUM[D];return new Vr(W*z+V+Q,b)}else{if(S&1||S>10||S<4)throw new B;var D=(10-S)/2,M=e.INSIDE_ODD_WIDEST[D],G=9-M,W=ir.getRSSvalue(d,M,!0),V=ir.getRSSvalue(h,G,!1),de=e.INSIDE_ODD_TOTAL_SUBSET[D],Q=e.INSIDE_GSUM[D];return new Vr(V*de+W+Q,b)}},e.prototype.findFinderPattern=function(t,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),o=!1,s=0;s<a&&(o=!t.get(s),n!==o);)s++;for(var f=0,u=s,l=s;l<a;l++)if(t.get(l)!==o)i[f]++;else{if(f===3){if(Kt.isFinderPattern(i))return[u,l];u+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,f--}else f++;i[f]=1,o=!o}throw new B},e.prototype.parseFoundFinderPattern=function(t,n,i,a){for(var o=t.get(a[0]),s=a[0]-1;s>=0&&o!==t.get(s);)s--;s++;var f=a[0]-s,u=this.getDecodeFinderCounters(),l=new Int32Array(u.length);Le.arraycopy(u,0,l,1,u.length-1),l[0]=f;var c=this.parseFinderValue(l,e.FINDER_PATTERNS),d=s,h=a[1];return i&&(d=t.getSize()-1-d,h=t.getSize()-1-h),new ya(c,[s,a[1]],d,h,n)},e.prototype.adjustOddEvenCounts=function(t,n){var i=Oe.sum(new Int32Array(this.getOddCounts())),a=Oe.sum(new Int32Array(this.getEvenCounts())),o=!1,s=!1,f=!1,u=!1;t?(i>12?s=!0:i<4&&(o=!0),a>12?u=!0:a<4&&(f=!0)):(i>11?s=!0:i<5&&(o=!0),a>10?u=!0:a<4&&(f=!0));var l=i+a-n,c=(i&1)===(t?1:0),d=(a&1)===1;if(l===1)if(c){if(d)throw new B;s=!0}else{if(!d)throw new B;u=!0}else if(l===-1)if(c){if(d)throw new B;o=!0}else{if(!d)throw new B;f=!0}else if(l===0){if(c){if(!d)throw new B;i<a?(o=!0,u=!0):(s=!0,f=!0)}else if(d)throw new B}else throw new B;if(o){if(s)throw new B;Kt.increment(this.getOddCounts(),this.getOddRoundingErrors())}
6if(s&&Kt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),f){if(u)throw new B;Kt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&Kt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(Kt),nf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),ar=function(r){nf(e,r);function e(t){var n=r.call(this)||this;n.readers=[];var i=t?t.get(ke.POSSIBLE_FORMATS):null,a=t&&t.get(ke.ASSUME_CODE_39_CHECK_DIGIT)!==void 0,o=t&&t.get(ke.ENABLE_CODE_39_EXTENDED_MODE)!==void 0;return i&&((i.includes(fe.EAN_13)||i.includes(fe.UPC_A)||i.includes(fe.EAN_8)||i.includes(fe.UPC_E))&&n.readers.push(new tn(t)),i.includes(fe.CODE_39)&&n.readers.push(new qn(a,o)),i.includes(fe.CODE_93)&&n.readers.push(new Qn),i.includes(fe.CODE_128)&&n.readers.push(new Kn),i.includes(fe.ITF)&&n.readers.push(new $n),i.includes(fe.CODABAR)&&n.readers.push(new Is),i.includes(fe.RSS_14)&&n.readers.push(new oi),i.includes(fe.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),n.readers.push(new Js))),n.readers.length===0&&(n.readers.push(new tn(t)),n.readers.push(new qn),n.readers.push(new Qn),n.readers.push(new tn(t)),n.readers.push(new Kn),n.readers.push(new $n),n.readers.push(new oi)),n}return e.prototype.decodeRow=function(t,n,i){for(var a=0;a<this.readers.length;a++)try{return this.readers[a].decodeRow(t,n,i)}catch{}throw new B},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(Je),af=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){af(e,r);function e(t,n){return t===void 0&&(t=500),r.call(this,new ar(n),t,n)||this}return e})(vr);var si=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Re=function(){function r(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),De=function(){function r(e,t){this.count=e,this.dataCodewords=t}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),of=function(){function r(e,t,n,i,a,o){var s,f;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=a,this.ecBlocks=o;var u=0,l=o.getECCodewords(),c=o.getECBlocks();try{for(var d=si(c),h=d.next();!h.done;h=d.next()){var v=h.value;u+=v.getCount()*(v.getDataCodewords()+l)}}catch(p){s={error:p}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(s)throw s.error}}this.totalCodewords=u}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(e,t){var n,i;if(e&1||t&1)throw new $;try{for(var a=si(r.VERSIONS),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===t)return s}}catch(f){n={error:f}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}throw new $},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new Re(5,new De(1,3))),new r(2,12,12,10,10,new Re(7,new De(1,5))),new r(3,14,14,12,12,new Re(10,new De(1,8))),new r(4,16,16,14,14,new Re(12,new De(1,12))),new r(5,18,18,16,16,new Re(14,new De(1,18))),new r(6,20,20,18,18,new Re(18,new De(1,22))),new r(7,22,22,20,20,new Re(20,new De(1,30))),new r(8,24,24,22,22,new Re(24,new De(1,36))),new r(9,26,26,24,24,new Re(28,new De(1,44))),new r(10,32,32,14,14,new Re(36,new De(1,62))),new r(11,36,36,16,16,new Re(42,new De(1,86))),new r(12,40,40,18,18,new Re(48,new De(1,114))),new r(13,44,44,20,20,new Re(56,new De(1,144))),new r(14,48,48,22,22,new Re(68,new De(1,174))),new r(15,52,52,24,24,new Re(42,new De(2,102))),new r(16,64,64,14,14,new Re(56,new De(2,140))),new r(17,72,72,16,16,new Re(36,new De(4,92))),new r(18,80,80,18,18,new Re(48,new De(4,114))),new r(19,88,88,20,20,new Re(56,new De(4,144))),new r(20,96,96,22,22,new Re(68,new De(4,174))),new r(21,104,104,24,24,new Re(56,new De(6,136))),new r(22,120,120,18,18,new Re(68,new De(6,175))),new r(23,132,132,20,20,new Re(62,new De(8,163))),new r(24,144,144,22,22,new Re(62,new De(8,156),new De(2,155))),new r(25,8,18,6,16,new Re(7,new De(1,5))),new r(26,8,32,6,14,new Re(11,new De(1,10))),new r(27,12,26,10,24,new Re(14,new De(1,16))),new r(28,12,36,10,16,new Re(18,new De(1,22))),new r(29,16,36,14,16,new Re(24,new De(1,32))),new r(30,16,48,14,22,new Re(28,new De(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),sf=function(){function r(e){var t=e.getHeight();if(t<8||t>144||t&1)throw new $;this.version=r.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new Ft(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return of.getVersionForDimensions(t,n)},r.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,i=0,a=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth(),s=!1,f=!1,u=!1,l=!1;do if(n===a&&i===0&&!s)e[t++]=this.readCorner1(a,o)&255,n-=2,i+=2,s=!0;else if(n===a-2&&i===0&&o&3&&!f)e[t++]=this.readCorner2(a,o)&255,n-=2,i+=2,f=!0;else if(n===a+4&&i===2&&!(o&7)&&!u)e[t++]=this.readCorner3(a,o)&255,n-=2,i+=2,u=!0;else if(n===a-2&&i===0&&(o&7)===4&&!l)e[t++]=this.readCorner4(a,o)&255,n-=2,i+=2,l=!0;else{do n<a&&i>=0&&!this.readMappingMatrix.get(i,n)&&(e[t++]=this.readUtah(n,i,a,o)&255),n-=2,i+=2;while(n>=0&&i<o);n+=1,i+=3;do n>=0&&i<o&&!this.readMappingMatrix.get(i,n)&&(e[t++]=this.readUtah(n,i,a,o)&255),n+=2,i-=2;while(n<a&&i>=0);n+=3,i+=1}while(n<a||i<o);if(t!==this.version.getTotalCodewords())throw new $;return e},r.prototype.readModule=function(e,t,n,i){return e<0&&(e+=n,t+=4-(n+4&7)),t<0&&(t+=i,e+=4-(i+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},r.prototype.readUtah=function(e,t,n,i){var a=0;return this.readModule(e-2,t-2,n,i)&&(a|=1),a<<=1,this.readModule(e-2,t-1,n,i)&&(a|=1),a<<=1,this.readModule(e-1,t-2,n,i)&&(a|=1),a<<=1,this.readModule(e-1,t-1,n,i)&&(a|=1),a<<=1,this.readModule(e-1,t,n,i)&&(a|=1),a<<=1,this.readModule(e,t-2,n,i)&&(a|=1),a<<=1,this.readModule(e,t-1,n,i)&&(a|=1),a<<=1,this.readModule(e,t,n,i)&&(a|=1),a},r.prototype.readCorner1=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,1,e,t)&&(n|=1),n<<=1,this.readModule(e-1,2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},r.prototype.readCorner2=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-4,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},r.prototype.readCorner3=function(e,t){var n=0;return this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(0,t-3,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-3,e,t)&&(n|=1),n<<=1,this.readModule(1,t-2,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n},r.prototype.readCorner4=function(e,t){var n=0;return this.readModule(e-3,0,e,t)&&(n|=1),n<<=1,this.readModule(e-2,0,e,t)&&(n|=1),n<<=1,this.readModule(e-1,0,e,t)&&(n|=1),n<<=1,this.readModule(0,t-2,e,t)&&(n|=1),n<<=1,this.readModule(0,t-1,e,t)&&(n|=1),n<<=1,this.readModule(1,t-1,e,t)&&(n|=1),n<<=1,this.readModule(2,t-1,e,t)&&(n|=1),n<<=1,this.readModule(3,t-1,e,t)&&(n|=1),n},r.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new ue("Dimension of bitMatrix must match the version size");for(var i=this.version.getDataRegionSizeRows(),a=this.version.getDataRegionSizeColumns(),o=t/i|0,s=n/a|0,f=o*i,u=s*a,l=new Ft(u,f),c=0;c<o;++c)for(var d=c*i,h=0;h<s;++h)for(var v=h*a,p=0;p<i;++p)for(var y=c*(i+2)+1+p,g=d+p,w=0;w<a;++w){var A=h*(a+2)+1+w;if(e.get(A,y)){var x=v+w;l.set(x,g)}}return l},r}(),fi=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
6,ff=function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t){var n,i,a,o,s=t.getECBlocks(),f=0,u=s.getECBlocks();try{for(var l=fi(u),c=l.next();!c.done;c=l.next()){var d=c.value;f+=d.getCount()}}catch(Q){n={error:Q}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}var h=new Array(f),v=0;try{for(var p=fi(u),y=p.next();!y.done;y=p.next())for(var d=y.value,g=0;g<d.getCount();g++){var w=d.getDataCodewords(),A=s.getECCodewords()+w;h[v++]=new r(w,new Uint8Array(A))}}catch(Q){a={error:Q}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}for(var x=h[0].codewords.length,m=x-s.getECCodewords(),S=m-1,b=0,g=0;g<S;g++)for(var D=0;D<v;D++)h[D].codewords[g]=e[b++];for(var M=t.getVersionNumber()===24,G=M?8:v,D=0;D<G;D++)h[D].codewords[m-1]=e[b++];for(var W=h[0].codewords.length,g=m;g<W;g++)for(var D=0;D<v;D++){var V=M?(D+8)%v:D,z=M&&V>7?g-1:g;h[V].codewords[z]=e[b++]}if(b!==e.length)throw new ue;return h},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),Aa=function(){function r(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new ue(""+e);var t=0,n=this.bitOffset,i=this.byteOffset,a=this.bytes;if(n>0){var o=8-n,s=e<o?e:o,f=o-s,u=255>>8-s<<f;t=(a[i]&u)>>f,e-=s,n+=s,n===8&&(n=0,i++)}if(e>0){for(;e>=8;)t=t<<8|a[i]&255,i++,e-=8;if(e>0){var f=8-e,u=255>>f<<f;t=t<<e|(a[i]&u)>>f,n+=e}}return this.bitOffset=n,this.byteOffset=i,t},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}(),Ze;(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(Ze||(Ze={}));var uf=function(){function r(){}return r.decode=function(e){var t=new Aa(e),n=new we,i=new we,a=new Array,o=Ze.ASCII_ENCODE;do if(o===Ze.ASCII_ENCODE)o=this.decodeAsciiSegment(t,n,i);else{switch(o){case Ze.C40_ENCODE:this.decodeC40Segment(t,n);break;case Ze.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case Ze.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case Ze.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case Ze.BASE256_ENCODE:this.decodeBase256Segment(t,n,a);break;default:throw new $}o=Ze.ASCII_ENCODE}while(o!==Ze.PAD_ENCODE&&t.available()>0);return i.length()>0&&n.append(i.toString()),new Kr(e,n.toString(),a.length===0?null:a,null)},r.decodeAsciiSegment=function(e,t,n){var i=!1;do{var a=e.readBits(8);if(a===0)throw new $;if(a<=128)return i&&(a+=128),t.append(String.fromCharCode(a-1)),Ze.ASCII_ENCODE;if(a===129)return Ze.PAD_ENCODE;if(a<=229){var o=a-130;o<10&&t.append("0"),t.append(""+o)}else switch(a){case 230:return Ze.C40_ENCODE;case 231:return Ze.BASE256_ENCODE;case 232:t.append("�");break;case 233:case 234:break;case 235:i=!0;break;case 236:t.append("[)>�05�"),n.insert(0,"��");break;case 237:t.append("[)>�06�"),n.insert(0,"��");break;case 238:return Ze.ANSIX12_ENCODE;case 239:return Ze.TEXT_ENCODE;case 240:return Ze.EDIFACT_ENCODE;case 241:break;default:if(a!==254||e.available()!==0)throw new $;break}}while(e.available()>0);return Ze.ASCII_ENCODE},r.decodeC40Segment=function(e,t){var n=!1,i=[],a=0;do{if(e.available()===8)return;var o=e.readBits(8);if(o===254)return;this.parseTwoBytes(o,e.readBits(8),i);for(var s=0;s<3;s++){var f=i[s];switch(a){case 0:if(f<3)a=f+1;else if(f<this.C40_BASIC_SET_CHARS.length){var u=this.C40_BASIC_SET_CHARS[f];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else throw new $;break;case 1:n?(t.append(String.fromCharCode(f+128)),n=!1):t.append(String.fromCharCode(f)),a=0;break;case 2:if(f<this.C40_SHIFT2_SET_CHARS.length){var u=this.C40_SHIFT2_SET_CHARS[f];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}
6else switch(f){case 27:t.append("�");break;case 30:n=!0;break;default:throw new $}a=0;break;case 3:n?(t.append(String.fromCharCode(f+224)),n=!1):t.append(String.fromCharCode(f+96)),a=0;break;default:throw new $}}}while(e.available()>0)},r.decodeTextSegment=function(e,t){var n=!1,i=[],a=0;do{if(e.available()===8)return;var o=e.readBits(8);if(o===254)return;this.parseTwoBytes(o,e.readBits(8),i);for(var s=0;s<3;s++){var f=i[s];switch(a){case 0:if(f<3)a=f+1;else if(f<this.TEXT_BASIC_SET_CHARS.length){var u=this.TEXT_BASIC_SET_CHARS[f];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else throw new $;break;case 1:n?(t.append(String.fromCharCode(f+128)),n=!1):t.append(String.fromCharCode(f)),a=0;break;case 2:if(f<this.TEXT_SHIFT2_SET_CHARS.length){var u=this.TEXT_SHIFT2_SET_CHARS[f];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u)}else switch(f){case 27:t.append("�");break;case 30:n=!0;break;default:throw new $}a=0;break;case 3:if(f<this.TEXT_SHIFT3_SET_CHARS.length){var u=this.TEXT_SHIFT3_SET_CHARS[f];n?(t.append(String.fromCharCode(u.charCodeAt(0)+128)),n=!1):t.append(u),a=0}else throw new $;break;default:throw new $}}}while(e.available()>0)},r.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var i=e.readBits(8);if(i===254)return;this.parseTwoBytes(i,e.readBits(8),n);for(var a=0;a<3;a++){var o=n[a];switch(o){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(o<14)t.append(String.fromCharCode(o+44));else if(o<40)t.append(String.fromCharCode(o+51));else throw new $;break}}}while(e.available()>0)},r.parseTwoBytes=function(e,t,n){var i=(e<<8)+t-1,a=Math.floor(i/1600);n[0]=a,i-=a*1600,a=Math.floor(i/40),n[1]=a,n[2]=i-a*40},r.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var i=e.readBits(6);if(i===31){var a=8-e.getBitOffset();a!==8&&e.readBits(a);return}i&32||(i|=64),t.append(String.fromCharCode(i))}}while(e.available()>0)},r.decodeBase256Segment=function(e,t,n){var i=1+e.getByteOffset(),a=this.unrandomize255State(e.readBits(8),i++),o;if(a===0?o=e.available()/8|0:a<250?o=a:o=250*(a-249)+this.unrandomize255State(e.readBits(8),i++),o<0)throw new $;for(var s=new Uint8Array(o),f=0;f<o;f++){if(e.available()<8)throw new $;s[f]=this.unrandomize255State(e.readBits(8),i++)}n.push(s);try{t.append(Ot.decode(s,Ce.ISO88591))}catch(u){throw new br("Platform does not support required encoding: "+u.message)}},r.unrandomize255State=function(e,t){var n=149*t%255+1,i=e-n;return i>=0?i:i+256},r.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","�"],r}(),lf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cf=function(){function r(){this.rsDecoder=new qr(Et.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(e){var t,n,i=new sf(e),a=i.getVersion(),o=i.readCodewords(),s=ff.getDataBlocks(o,a),f=0;try{for(var u=lf(s),l=u.next();!l.done;l=u.next()){var c=l.value;f+=c.getNumDataCodewords()}}catch(A){t={error:A}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}for(var d=new Uint8Array(f),h=s.length,v=0;v<h;v++){var p=s[v],y=p.getCodewords(),g=p.getNumDataCodewords();this.correctErrors(y,g);for(var w=0;w<g;w++)d[w*h+v]=y[w]}return uf.decode(d)},r.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new ze}for(var i=0;i<t;i++)e[i]=n[i]},r}(),df=function(){function r(e){this.image=e,this.rectangleDetector=new gn(this.image)}return r.prototype.detect=function(){var e=this.rectangleDetector.detect(),t=this.detectSolid1(e);if(t=this.detectSolid2(t),t[3]=this.correctTopRight(t),!t[3])throw new B;t=this.shiftToModuleCenter(t);var n=t[0],i=t[1],a=t[2],o=t[3],s=this.transitionsBetween(n,o)+1,f=this.transitionsBetween(a,o)+1;(s&1)===1&&(s+=1),(f&1)===1&&(f+=1),4*s<7*f&&4*f<7*s&&(s=f=Math.max(s,f));var u=r.sampleGrid(this.image,n,i,a,o,s,f);return new In(u,[n,i,a,o])},r.shiftPoint=function(e,t,n){var i=(t.getX()-e.getX())/(n+1),a=(t.getY()-e.getY())/(n+1);return new ie(e.getX()+i,e.getY()+a)},r.moveAway=function(e,t,n){var i=e.getX(),a=e.getY();return i<t?i-=1:i+=1,a<n?a-=1:a+=1,new ie(i,a)},r.prototype.detectSolid1=function(e){var t=e[0],n=e[1],i=e[3],a=e[2],o=this.transitionsBetween(t,n),s=this.transitionsBetween(n,i),f=this.transitionsBetween(i,a),u=this.transitionsBetween(a,t),l=o,c=[a,t,n,i];return l>s&&(l=s,c[0]=t,c[1]=n,c[2]=i,c[3]=a),l>f&&(l=f,c[0]=n,c[1]=i,c[2]=a,c[3]=t),l>u&&(c[0]=i,c[1]=a,c[2]=t,c[3]=n),c},r.prototype.detectSolid2=function(e){var t=e[0],n=e[1],i=e[2],a=e[3],o=this.transitionsBetween(t,a),s=r.shiftPoint(n,i,(o+1)*4),f=r.shiftPoint(i,n,(
6o+1)*4),u=this.transitionsBetween(s,t),l=this.transitionsBetween(f,a);return u<l?(e[0]=t,e[1]=n,e[2]=i,e[3]=a):(e[0]=n,e[1]=i,e[2]=a,e[3]=t),e},r.prototype.correctTopRight=function(e){var t=e[0],n=e[1],i=e[2],a=e[3],o=this.transitionsBetween(t,a),s=this.transitionsBetween(n,a),f=r.shiftPoint(t,n,(s+1)*4),u=r.shiftPoint(i,n,(o+1)*4);o=this.transitionsBetween(f,a),s=this.transitionsBetween(u,a);var l=new ie(a.getX()+(i.getX()-n.getX())/(o+1),a.getY()+(i.getY()-n.getY())/(o+1)),c=new ie(a.getX()+(t.getX()-n.getX())/(s+1),a.getY()+(t.getY()-n.getY())/(s+1));if(!this.isValid(l))return this.isValid(c)?c:null;if(!this.isValid(c))return l;var d=this.transitionsBetween(f,l)+this.transitionsBetween(u,l),h=this.transitionsBetween(f,c)+this.transitionsBetween(u,c);return d>h?l:c},r.prototype.shiftToModuleCenter=function(e){var t=e[0],n=e[1],i=e[2],a=e[3],o=this.transitionsBetween(t,a)+1,s=this.transitionsBetween(i,a)+1,f=r.shiftPoint(t,n,s*4),u=r.shiftPoint(i,n,o*4);o=this.transitionsBetween(f,a)+1,s=this.transitionsBetween(u,a)+1,(o&1)===1&&(o+=1),(s&1)===1&&(s+=1);var l=(t.getX()+n.getX()+i.getX()+a.getX())/4,c=(t.getY()+n.getY()+i.getY()+a.getY())/4;t=r.moveAway(t,l,c),n=r.moveAway(n,l,c),i=r.moveAway(i,l,c),a=r.moveAway(a,l,c);var d,h;return f=r.shiftPoint(t,n,s*4),f=r.shiftPoint(f,a,o*4),d=r.shiftPoint(n,t,s*4),d=r.shiftPoint(d,i,o*4),u=r.shiftPoint(i,a,s*4),u=r.shiftPoint(u,n,o*4),h=r.shiftPoint(a,i,s*4),h=r.shiftPoint(h,t,o*4),[f,d,u,h]},r.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},r.sampleGrid=function(e,t,n,i,a,o,s){var f=Sn.getInstance();return f.sampleGrid(e,o,s,.5,.5,o-.5,.5,o-.5,s-.5,.5,s-.5,t.getX(),t.getY(),a.getX(),a.getY(),i.getX(),i.getY(),n.getX(),n.getY())},r.prototype.transitionsBetween=function(e,t){var n=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.trunc(t.getX()),o=Math.trunc(t.getY()),s=Math.abs(o-i)>Math.abs(a-n);if(s){var f=n;n=i,i=f,f=a,a=o,o=f}for(var u=Math.abs(a-n),l=Math.abs(o-i),c=-u/2,d=i<o?1:-1,h=n<a?1:-1,v=0,p=this.image.get(s?i:n,s?n:i),y=n,g=i;y!==a;y+=h){var w=this.image.get(s?g:y,s?y:g);if(w!==p&&(v++,p=w),c+=l,c>0){if(g===o)break;g+=d,c-=u}}return v},r}(),Hr=function(){function r(){this.decoder=new cf}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n,i;if(t!=null&&t.has(ke.PURE_BARCODE)){var a=r.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(a),i=r.NO_POINTS}else{var o=new df(e.getBlackMatrix()).detect();n=this.decoder.decode(o.getBits()),i=o.getPoints()}var s=n.getRawBytes(),f=new pt(n.getText(),s,8*s.length,i,fe.DATA_MATRIX,Le.currentTimeMillis()),u=n.getByteSegments();u!=null&&f.putMetadata(lt.BYTE_SEGMENTS,u);var l=n.getECLevel();return l!=null&&f.putMetadata(lt.ERROR_CORRECTION_LEVEL,l),f},r.prototype.reset=function(){},r.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new B;var i=this.moduleSize(t,e),a=t[1],o=n[1],s=t[0],f=n[0],u=(f-s+1)/i,l=(o-a+1)/i;if(u<=0||l<=0)throw new B;var c=i/2;a+=c,s+=c;for(var d=new Ft(u,l),h=0;h<l;h++)for(var v=a+h*i,p=0;p<u;p++)e.get(s+p*i,v)&&d.set(p,h);return d},r.moduleSize=function(e,t){for(var n=t.getWidth(),i=e[0],a=e[1];i<n&&t.get(i,a);)i++;if(i===n)throw new B;var o=i-e[0];if(o===0)throw new B;return o},r.NO_POINTS=[],r}(),hf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){hf(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Hr,t)||this}return e})(vr);var or;(function(r){r[r.L=0]="L",r[r.M=1]="M",r[r.Q=2]="Q",r[r.H=3]="H"})(or||(or={}));var vf=function(){function r(e,t,n){this.value=e,this.stringValue=t,this.bits=n,r.FOR_BITS.set(n,this),r.FOR_VALUE.set(e,this)}return r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.fromString=function(e){switch(e){case"L":return r.L;case"M":return r.M;case"Q":return r.Q;case"H":return r.H;default:throw new We(e+"not available")}},r.prototype.toString=function(){return this.stringValue},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.value===t.value},r.forBits=function(e){if(e<0||e>=r.FOR_BITS.size)throw new ue;return r.FOR_BITS.get(e)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(or.L,"L",1),r.M=new r(or.M,"M",0),r.Q=new r(or.Q,"Q",3),r.H=new r(or.H,"H",2),r}(),pf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ma=function(){function r(e){this.errorCorrectionLevel=vf.forBits(e>>3&3),this.dataMask=e&7}return r.numBitsDiffering=function(e,t){return me.bitCount(e^t)},r.decodeFormatInformation=function(e,t){var n=r.doDecodeFormatInformation(e,t);return n!==null?n:r.doDecodeFormatInformation(e^r.FORMAT_INFO_MASK_QR,t^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(e,t){var n,i,a=Number.MAX_SAFE_INTEGER,o=0;try{for(var s=pf(r.FORMAT_INFO_DECODE_LOOKUP),f=s.next();!f.done;f=s.next()){var u=f.value,l=u[0];if(l===e||l===t)return new r(u[1]);var c=r.numBitsDiffering(e,l);c<a&&(o=u[1],a=c),e!==t&&(c=r.numBitsDiffering(t,l),c<a&&(o=u[1],a=c))}}catch(d){n={error:d}}finally{try{f&&!f.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a<=3?new r(o):null},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getDataMask=function(){return this.dataMask},r.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.errorCorrectionLevel===t.errorCorrectionLevel&&this.dataMask===t.dataMask},r.FORMAT_INFO_MASK_QR=21522,r.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],r}(),gf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},P=function(){function r(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.ecCodewordsPerBlock=e,this.ecBlocks=t}return r.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},r.prototype.getNumBlocks=function(){var e,t,n=0,i=this.ecBlocks;try{for(var a=gf(i),o=a.next();!o.done;o=a.next()){var s=o.value;n+=s.getCount()}}catch(f){e={error:f}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return n},r.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),I=function(){function r(e,t){this.count=e,this.dataCodewords=t}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),_f=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qt=function(){function r(e,t){for(var n,i,a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=a;var s=0,f=a[0].getECCodewordsPerBlock(),u=a[0].getECBlocks();try{for(var l=_f(u),c=l.next();!c.done;c=l.next()){var d=c.value;s+=d.getCount()*(d.getDataCodewords()+f)}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}this.totalCodewords=s}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},r.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},r.getProvisionalVersionForDimension=function(e){if(e%4!==1)throw new $;try{return this.getVersionForNumber((e-17)/4)}catch{throw new $}},r.getVersionForNumber=function(e){if(e<1||e>40)throw new ue;return r.VERSIONS[e-1]},r.decodeVersionInformation=function(e){for(var t=Number.MAX_SAFE_INTEGER,n=0,i=0;i<r.VERSION_DECODE_INFO.length;i++){var a=r.VERSION_DECODE_INFO[i];if(a===e)return r.getVersionForNumber(i+7);var o=ma.numBitsDiffering(e,a);o<t&&(n=i+7,t=o)}return t<=3?r.getVersionForNumber(n):null},r.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new Ft(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var n=this.alignmentPatternCenters.length,i=0;i<n;i++)for(var a=this.alignmentPatternCenters[i]-2,o=0;o<n;o++)i===0&&(o===0||o===n-1)||i===n-1&&o===0||t.setRegion(this.alignmentPatternCenters[o]-2,a,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},r.prototype.toString=function(){return""+this.versionNumber},r.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),r.VERSIONS=[new r(1,new Int32Array(0),new P(7,new I(1,19)),new P(10,new I(1,16)),new P(13,new I(1,13)),new P(17,new I(1,9))),new r(2,Int32Array.from([6,18]),new P(10,new I(1,34)),new P(16,new I(1,28)),new P(22,new I(1,22)),new P(28,new I(1,16))),new r(3,Int32Array.from([6,22]),new P(15,new I(1,55)),new P(26,new I(1,44)),new P(18,new I(2,17)),new P(22,new I(2,13))),new r(4,Int32Array.from([6,26]),new P(20,new I(1,80)),new P(18,new I(2,32)),new P(26,new I(2,24)),new P(16,new I(4,9))),new r(5,Int32Array.from([6,30]),new P(26,new I(1,108)),new P(24,new I(2,43)),new P(18,new I(2,15),new I(2,16)),new P(22,new I(2,11),new I(2,12))),new r(6,Int32Array.from([6,34]),new P(18,new I(2,68)),new P(16,new I(4,27)),new P(24,new I(4,19)),new P(28,new I(4,15))),new r(7,Int32Array.from([6,22,38]),new P(20,new I(2,78)),new P(18,new I(4,31)),new P(18,new I(2,14),new I(4,15)),new P(26,new I(4,13),new I(1,14))),new r(8,Int32Array.from([6,24,42]),new P(24,new I(2,97)),new P(22,new I(2,38),new I(2,39)),new P(22,new I(4,18),new I(2,19)),new P(26,new I(4,14),new I(2,15))),new r(9,Int32Array.from([6,26,46]),new P(30,new I(2,116)),new P(22,new I(3,36),new I(2,37)),new P(20,new I(4,16),new I(4,17)),new P(24,new I(4,12),new I(4,13))),new r(10,Int32Array.from([6,28,50]),new P(18,new I(2,68),new I(2,69)),new P(26,new I(4,43),new I(1,44)),new P(24,new I(6,19),new I(2,20)),new P(28,new I(6,15),new I(2,16))),new r(11,Int32Array.from([6,30,54]),new P(20,new I(4,81)),new P(30,new I(1,50),new I(4,51)),new P(28,new I(4,22),new I(4,23)),new P(24,new I(3,12),new I(8,13))),new r(12,Int32Array.from([6,32,58]),new P(24,new I(2,92),new I(2,93)),new P(22,new I(6,36),new I(2,37)),new P(26,new I(4,20),new I(6,21)),new P(28,new I(7,14),new I(4,15))),new r(13,Int32Array.from([6,34,62]),new P(26,new I(4,107)),new P(22,new I(8,37),new I(1,38)),new P(24,new I(8,20),new I(4,21)),new P(22,new I(12,11),new I(4,12))),new r(14,Int32Array.from([6,26,46,66]),new P(30,new I(3,115),new I(1,116)),new P(24,new I(4,40),new I(5,41)),new P(20,new I(11,16),new I(5,17)),new P(24,new I(11,12),new I(5,13))),new r(15,Int32Array.from([6,26,48,70]),new P(22,new I(5,87),new I(1,88)),new P(24,new I(5,41),new I(5,42)),new P(30,new I(5,24),new I(7,25)),new P(24,new I(11,12),new I(7,13))),new r(16,Int32Array.from([6,26,50,74]),new P(24,new I(5,98),new I(1,99)),new P(28,new I(7,45),new I(3,46)),new P(24,new I(15,19),new I(2,20)),new P(30,new I(3,15),new I(13,16))),new r(17,Int32Array.from([6,30,54,78]),new P(28,new I(1,107),new I(5,108)),new P(28,new I(10,46),new I(1,47)),new P(28,new I(1,22),new I(15,23)),new P(28,new I(2,14),new I(17,15))),new r(18,Int32Array.from([6,30,56,82]),new P(30,new I(5,120),new I(1,121)),new P(26,new I(9,43),new I(4,44)),new P(28,new I(17,22),new I(1,23)),new P(28,new I(2,14),new I(19,15))),new r(19,Int32Array.from([6,30,58,86]),new P(28,new I(3,113),new I(4,114)),new P(26,new I(3,44),new I(11,45)),new P(26,new I(17,21),new I(4,22)),new P(26,new I(9,13),new I(16,14))),new r(20,Int32Array.from([6,34,62,90]),new P(28,new I(3,107),new I(5,108)),new P(26,new I(3,41),new I(13,42)),new P(30,new I(15,24),new I(5,25)),new P(28,new I(15,15),new I(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new P(28,new I(4,116),new I(4,117)),new P(26,new I(17,42)),new P(28,new I(17,22),new I(6,23)),new P(30,new I(19,16),new I(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new P(28,new I(2,111),new I(7,112)),new P(28,new I(17,46)),new P(30,new I(7,24),new I(16,25)),new P(24,new I(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new P(30,new I(4,121),new I(5,122)),new P(28,new I(4,47),new I(14,48)),new P(30,new I(11,24),new I(14,25)),new P(30,new I(16,15),new I(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new P(30,new I(6,117),new I(4,118)),new P(28,new I(6,45),new I(14,46)),new P(30,new I(11,24),new I(16,25)),new P(30,new I(30,16),new I(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new P(26,new I(8,106),new I(4,107)),new P(28,new I(8,47),new I(13,48)),new P(30,new I(7,24),new I(22,25)),new P(30,new I(22,15),new I(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new P(28,new I(10,114),new I(2,115)),new P(28,new I(19,46),new I(4,47)),new P(28,new I(28,22),new I(6,23)),new P(30,new I(33,16),new I(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new P(30,new I(8,122),new I(4,123)),new P(28,new I(22,45),new I(3,46)),new P(30,new I(8,23),new I(26,24)),new P(30,new I(12,15),new I(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new P(30,new I(3,117),new I(10,118)),new P(28,new I(3,45),new I(23,46)),new P(30,new I(4,24),new I(31,25)),new P(30,new I(11,15),new I(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new P(30,new I(7,116),new I(7,117)),new P(28,new I(21,45),new I(7,46)),new P(30,new I(1,23),new I(37,24)),new P(30,new I(19,15),new I(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new P(30,new I(5,115),new I(10,116)),new P(28,new I(19,47),new I(10,48)),new P(30,new I(15,24),new I(25,25)),new P(30,new I(23,15),new I(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new P(30,new I(13,115),new I(3,116)),new P(28,new I(2,46),new I(29,47)),new P(30,new I(42,24),new I(1,25)),new P(30,new I(23,15),new I(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new P(30,new I(17,115)),new P(28,new I(10,46),new I(23,47)),new P(30,new I(10,24),new I(35,25)),new P(30,new I(19,15),new I(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new P(30,new I(17,115),new I(1,116)),new P(28,new I(14,46),new I(21,47)),new P(30,new I(29,24),new I(19,25)),new P(30,new I(11,15),new I(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new P(30,new I(13,115),new I(6,116)),new P(28,new I(14,46),new I(23,47)),new P(30,new I(44,24),new I(7,25)),new P(30,new I(59,16),new I(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150
6]),new P(30,new I(12,121),new I(7,122)),new P(28,new I(12,47),new I(26,48)),new P(30,new I(39,24),new I(14,25)),new P(30,new I(22,15),new I(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new P(30,new I(6,121),new I(14,122)),new P(28,new I(6,47),new I(34,48)),new P(30,new I(46,24),new I(10,25)),new P(30,new I(2,15),new I(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new P(30,new I(17,122),new I(4,123)),new P(28,new I(29,46),new I(14,47)),new P(30,new I(49,24),new I(10,25)),new P(30,new I(24,15),new I(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new P(30,new I(4,122),new I(18,123)),new P(28,new I(13,46),new I(32,47)),new P(30,new I(48,24),new I(14,25)),new P(30,new I(42,15),new I(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new P(30,new I(20,117),new I(4,118)),new P(28,new I(40,47),new I(7,48)),new P(30,new I(43,24),new I(22,25)),new P(30,new I(10,15),new I(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new P(30,new I(19,118),new I(6,119)),new P(28,new I(18,47),new I(31,48)),new P(30,new I(34,24),new I(34,25)),new P(30,new I(20,15),new I(61,16)))],r}(),tt;(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(tt||(tt={}));var ui=function(){function r(e,t){this.value=e,this.isMasked=t}return r.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n<t;n++)for(var i=0;i<t;i++)this.isMasked(n,i)&&e.flip(i,n)},r.values=new Map([[tt.DATA_MASK_000,new r(tt.DATA_MASK_000,function(e,t){return(e+t&1)===0})],[tt.DATA_MASK_001,new r(tt.DATA_MASK_001,function(e,t){return(e&1)===0})],[tt.DATA_MASK_010,new r(tt.DATA_MASK_010,function(e,t){return t%3===0})],[tt.DATA_MASK_011,new r(tt.DATA_MASK_011,function(e,t){return(e+t)%3===0})],[tt.DATA_MASK_100,new r(tt.DATA_MASK_100,function(e,t){return(Math.floor(e/2)+Math.floor(t/3)&1)===0})],[tt.DATA_MASK_101,new r(tt.DATA_MASK_101,function(e,t){return e*t%6===0})],[tt.DATA_MASK_110,new r(tt.DATA_MASK_110,function(e,t){return e*t%6<3})],[tt.DATA_MASK_111,new r(tt.DATA_MASK_111,function(e,t){return(e+t+e*t%3&1)===0})]]),r}(),yf=function(){function r(e){var t=e.getHeight();if(t<21||(t&3)!==1)throw new $;this.bitMatrix=e}return r.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var n=5;n>=0;n--)e=this.copyBit(8,n,e);for(var i=this.bitMatrix.getHeight(),a=0,o=i-7,n=i-1;n>=o;n--)a=this.copyBit(8,n,a);for(var t=i-8;t<i;t++)a=this.copyBit(t,8,a);if(this.parsedFormatInfo=ma.decodeFormatInformation(e,a),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new $},r.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return Qt.getVersionForNumber(t);for(var n=0,i=e-11,a=5;a>=0;a--)for(var o=e-9;o>=i;o--)n=this.copyBit(o,a,n);var s=Qt.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;n=0;for(var o=5;o>=0;o--)for(var a=e-9;a>=i;a--)n=this.copyBit(o,a,n);if(s=Qt.decodeVersionInformation(n),s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new $},r.prototype.copyBit=function(e,t,n){var i=this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=ui.values.get(e.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var a=t.buildFunctionPattern(),o=!0,s=new Uint8Array(t.getTotalCodewords()),f=0,u=0,l=0,c=i-1;c>0;c-=2){c===6&&c--;for(var d=0;d<i;d++)for(var h=o?i-1-d:d,v=0;v<2;v++)a.get(c-v,h)||(l++,u<<=1,this.bitMatrix.get(c-v,h)&&(u|=1),l===8&&(s[f++]=u,l=0,u=0));o=!o}if(f!==t.getTotalCodewords())throw new $;return s},r.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=ui.values.get(this.parsedFormatInfo.getDataMask()),t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},r.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},r.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,n=e.getWidth();t<n;t++)for(var i=t+1,a=e.getHeight();i<a;i++)e.get(t,i)!==e.get(i,t)&&(e.flip(i,t),e.flip(t,i))},r}(),li=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}
6,xf=function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t,n){var i,a,o,s;if(e.length!==t.getTotalCodewords())throw new ue;var f=t.getECBlocksForLevel(n),u=0,l=f.getECBlocks();try{for(var c=li(l),d=c.next();!d.done;d=c.next()){var h=d.value;u+=h.getCount()}}catch(z){i={error:z}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}var v=new Array(u),p=0;try{for(var y=li(l),g=y.next();!g.done;g=y.next())for(var h=g.value,w=0;w<h.getCount();w++){var A=h.getDataCodewords(),x=f.getECCodewordsPerBlock()+A;v[p++]=new r(A,new Uint8Array(x))}}catch(z){o={error:z}}finally{try{g&&!g.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}for(var m=v[0].codewords.length,S=v.length-1;S>=0;){var b=v[S].codewords.length;if(b===m)break;S--}S++;for(var D=m-f.getECCodewordsPerBlock(),M=0,w=0;w<D;w++)for(var G=0;G<p;G++)v[G].codewords[w]=e[M++];for(var G=S;G<p;G++)v[G].codewords[D]=e[M++];for(var W=v[0].codewords.length,w=D;w<W;w++)for(var G=0;G<p;G++){var V=G<S?w:w+1;v[G].codewords[V]=e[M++]}return v},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),St;(function(r){r[r.TERMINATOR=0]="TERMINATOR",r[r.NUMERIC=1]="NUMERIC",r[r.ALPHANUMERIC=2]="ALPHANUMERIC",r[r.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",r[r.BYTE=4]="BYTE",r[r.ECI=5]="ECI",r[r.KANJI=6]="KANJI",r[r.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",r[r.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",r[r.HANZI=9]="HANZI"})(St||(St={}));var Ve=function(){function r(e,t,n,i){this.value=e,this.stringValue=t,this.characterCountBitsForVersions=n,this.bits=i,r.FOR_BITS.set(i,this),r.FOR_VALUE.set(e,this)}return r.forBits=function(e){var t=r.FOR_BITS.get(e);if(t===void 0)throw new ue;return t},r.prototype.getCharacterCountBits=function(e){var t=e.getVersionNumber(),n;return t<=9?n=0:t<=26?n=1:n=2,this.characterCountBitsForVersions[n]},r.prototype.getValue=function(){return this.value},r.prototype.getBits=function(){return this.bits},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.value===t.value},r.prototype.toString=function(){return this.stringValue},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.TERMINATOR=new r(St.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),r.NUMERIC=new r(St.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),r.ALPHANUMERIC=new r(St.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),r.STRUCTURED_APPEND=new r(St.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),r.BYTE=new r(St.BYTE,"BYTE",Int32Array.from([8,16,16]),4),r.ECI=new r(St.ECI,"ECI",Int32Array.from([0,0,0]),7),r.KANJI=new r(St.KANJI,"KANJI",Int32Array.from([8,10,12]),8),r.FNC1_FIRST_POSITION=new r(St.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),r.FNC1_SECOND_POSITION=new r(St.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),r.HANZI=new r(St.HANZI,"HANZI",Int32Array.from([8,10,12]),13),r}(),wf=function(){function r(){}return r.decode=function(e,t,n,i){var a=new Aa(e),o=new we,s=new Array,f=-1,u=-1;try{var l=null,c=!1,d=void 0;do{if(a.available()<4)d=Ve.TERMINATOR;else{var h=a.readBits(4);d=Ve.forBits(h)}switch(d){case Ve.TERMINATOR:break;case Ve.FNC1_FIRST_POSITION:case Ve.FNC1_SECOND_POSITION:c=!0;break;case Ve.STRUCTURED_APPEND:if(a.available()<16)throw new $;f=a.readBits(8),u=a.readBits(8);break;case Ve.ECI:var v=r.parseECIValue(a);if(l=Qe.getCharacterSetECIByValue(v),l===null)throw new $;break;case Ve.HANZI:var p=a.readBits(4),y=a.readBits(d.getCharacterCountBits(t));p===r.GB2312_SUBSET&&r.decodeHanziSegment(a,o,y);break;default:var g=a.readBits(d.getCharacterCountBits(t));switch(d){case Ve.NUMERIC:r.decodeNumericSegment(a,o,g);break;case Ve.ALPHANUMERIC:r.decodeAlphanumericSegment(a,o,g,c);break;case Ve.BYTE:r.decodeByteSegment(a,o,g,l,s,i);break;case Ve.KANJI:r.decodeKanjiSegment(a,o,g);break;default:throw new $}break}}while(d!==Ve.TERMINATOR)}catch{throw new $}return new Kr(e,o.toString(),s.length===0?null:s,n===null?null:n.toString(),f,u)},r.decodeHanziSegment=function(e,t,n){if(n*13>e.available())throw new $;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=e.readBits(13),s=o/96<<8&4294967295|o%96;s<959?s+=41377:s+=42657,i[a]=s>>8&255,i[a+1]=s&255,a+=2,n--}try{t.append(Ot.decode(i,Ce.GB2312))}catch(f){throw new $(f)}},r.decodeKanjiSegment=function(e,t,n){if(n*13>e.available())throw new $;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=e.readBits(13),s=o/192<<8&4294967295|o%192;s<7936?s+=33088:s+=49472,i[a]=s>>8,i[a+1]=s,a+=2,n--}try{t.append(Ot.decode(i,Ce.SHIFT_JIS))}catch(f){throw new $(f)}},r.decodeByteSegment=function(e,t,n,i,a,o){if(8*n>e.available())throw new $;for(var s=new Uint8Array(n),f=0;f<n;f++)s[f]=e.readBits(8);var u;i===null?u=Ce.guessEncoding(s,o):u=i.getName();try{t.append(Ot.decode(s,u))}catch(l){throw new $(l)}a.push(s)},r.toAlphaNumericChar=function(e){if(e>=r.ALPHANUMERIC_CHARS.length)throw new $;return r.ALPHANUMERIC_CHARS[e]},r.decodeAlphanumericSegment=function(e,t,n,i){for(var a=t.length();n>1;){if(e.available()<11)throw new $;var o=e.readBits(11);t.append(r.toAlphaNumericChar(Math.floor(o/45))),t.append(r.toAlphaNumericChar(o%45)),n-=2}if(n===1){if(e.available()<6)throw new $;t.append(r.toAlphaNumericChar(e.readBits(6)))}if(i)for(var s=a;s<t.length();s++)t.charAt(s)==="%"&&(s<t.length()-1&&t.charAt(s+1)==="%"?t.deleteCharAt(s+1):t.setCharAt(s,"�"))},r.decodeNumericSegment=function(e,t,n){for(;n>=3;){if(e.available()<10)throw new $;var i=e.readBits(10);if(i>=1e3)throw new $;t.append(r.toAlphaNumericChar(Math.floor(i/100))),t.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),t.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(e.available()<7)throw new $;var a=e.readBits(7);if(a>=100)throw new $;t.append(r.toAlphaNumericChar(Math.floor(a/10))),t.append(r.toAlphaNumericChar(a%10))}else if(n===1){if(e.available()<4)throw new $;var o=e.readBits(4);if(o>=10)throw new $;t.append(r.toAlphaNumericChar(o))}},r.parseECIValue=function(e){var t=e.readBits(8);if(!(t&128))return t&127;
6if((t&192)===128){var n=e.readBits(8);return(t&63)<<8&4294967295|n}if((t&224)===192){var i=e.readBits(16);return(t&31)<<16&4294967295|i}throw new $},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),Ea=function(){function r(e){this.mirrored=e}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},r}(),ci=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Af=function(){function r(){this.rsDecoder=new qr(Et.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(Ft.parseFromBooleanArray(e),t)},r.prototype.decodeBitMatrix=function(e,t){var n=new yf(e),i=null;try{return this.decodeBitMatrixParser(n,t)}catch(o){i=o}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var a=this.decodeBitMatrixParser(n,t);return a.setOther(new Ea(!0)),a}catch(o){throw i!==null?i:o}},r.prototype.decodeBitMatrixParser=function(e,t){var n,i,a,o,s=e.readVersion(),f=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),l=xf.getDataBlocks(u,s,f),c=0;try{for(var d=ci(l),h=d.next();!h.done;h=d.next()){var v=h.value;c+=v.getNumDataCodewords()}}catch(S){n={error:S}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var p=new Uint8Array(c),y=0;try{for(var g=ci(l),w=g.next();!w.done;w=g.next()){var v=w.value,A=v.getCodewords(),x=v.getNumDataCodewords();this.correctErrors(A,x);for(var m=0;m<x;m++)p[y++]=A[m]}}catch(S){a={error:S}}
6finally{try{w&&!w.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}return wf.decode(p,s,f,t)},r.prototype.correctErrors=function(e,t){var n=new Int32Array(e);try{this.rsDecoder.decode(n,e.length-t)}catch{throw new ze}for(var i=0;i<t;i++)e[i]=n[i]},r}(),mf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ef=function(r){mf(e,r);function e(t,n,i){var a=r.call(this,t,n)||this;return a.estimatedModuleSize=i,a}return e.prototype.aboutEquals=function(t,n,i){if(Math.abs(n-this.getY())<=t&&Math.abs(i-this.getX())<=t){var a=Math.abs(t-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,n,i){var a=(this.getX()+n)/2,o=(this.getY()+t)/2,s=(this.estimatedModuleSize+i)/2;return new e(a,o,s)},e}(ie),Cf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},If=function(){function r(e,t,n,i,a,o,s){this.image=e,this.startX=t,this.startY=n,this.width=i,this.height=a,this.moduleSize=o,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var e=this.startX,t=this.height,n=this.width,i=e+n,a=this.startY+t/2,o=new Int32Array(3),s=this.image,f=0;f<t;f++){var u=a+(f&1?-Math.floor((f+1)/2):Math.floor((f+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var l=e;l<i&&!s.get(l,u);)l++;for(var c=0;l<i;){if(s.get(l,u))if(c===1)o[1]++;else if(c===2){if(this.foundPatternCross(o)){var d=this.handlePossibleCenter(o,u,l);if(d!==null)return d}o[0]=o[2],o[1]=1,o[2]=0,c=1}else o[++c]++;else c===1&&c++,o[c]++;l++}if(this.foundPatternCross(o)){var d=this.handlePossibleCenter(o,u,i);if(d!==null)return d}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new B},r.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},r.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,n=t/2,i=0;i<3;i++)if(Math.abs(t-e[i])>=n)return!1;return!0},r.prototype.crossCheckVertical=function(e,t,n,i){var a=this.image,o=a.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var f=e;f>=0&&a.get(t,f)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&!a.get(t,f)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=e+1;f<o&&a.get(t,f)&&s[1]<=n;)s[1]++,f++;if(f===o||s[1]>n)return NaN;for(;f<o&&!a.get(t,f)&&s[2]<=n;)s[2]++,f++;if(s[2]>n)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.handlePossibleCenter=function(e,t,n){var i,a,o=e[0]+e[1]+e[2],s=r.centerFromEnd(e,n),f=this.crossCheckVertical(t,s,2*e[1],o);if(!isNaN(f)){var u=(e[0]+e[1]+e[2])/3;try{for(var l=Cf(this.possibleCenters),c=l.next();!c.done;c=l.next()){var d=c.value;if(d.aboutEquals(u,f,s))return d.combineEstimate(f,s,u)}}catch(v){i={error:v}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var h=new Ef(s,f,u);this.possibleCenters.push(h),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(h)}return null},r}(),Sf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),bf=function(r){Sf(e,r);function e(t,n,i,a){var o=r.call(this,t,n)||this;return o.estimatedModuleSize=i,o.count=a,a===void 0&&(o.count=1),o}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,n,i){if(Math.abs(n-this.getY())<=t&&Math.abs(i-this.getX())<=t){var a=Math.abs(t-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,n,i){var a=this.count+1,o=(this.count*this.getX()+n)/a,s=(this.count*this.getY()+t)/a,f=(this.count*this.estimatedModuleSize+i)/
6a;return new e(o,s,f,a)},e}(ie),Of=function(){function r(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),_r=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tf=function(){function r(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(e){var t=e!=null&&e.get(ke.TRY_HARDER)!==void 0,n=e!=null&&e.get(ke.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),s=Math.floor(3*a/(4*r.MAX_MODULES));(s<r.MIN_SKIP||t)&&(s=r.MIN_SKIP);for(var f=!1,u=new Int32Array(5),l=s-1;l<a&&!f;l+=s){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var c=0,d=0;d<o;d++)if(i.get(d,l))(c&1)===1&&c++,u[c]++;else if(c&1)u[c]++;else if(c===4)if(r.foundPatternCross(u)){var h=this.handlePossibleCenter(u,l,d,n);if(h===!0)if(s=2,this.hasSkipped===!0)f=this.haveMultiplyConfirmedCenters();else{var v=this.findRowSkip();v>u[2]&&(l+=v-u[2]-s,d=o-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,c=3;continue}c=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,c=3;else u[++c]++;if(r.foundPatternCross(u)){var h=this.handlePossibleCenter(u,l,o,n);h===!0&&(s=u[0],this.hasSkipped&&(f=this.haveMultiplyConfirmedCenters()))}}var p=this.selectBestPatterns();return ie.orderBestPatterns(p),new Of(p)},r.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},r.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var i=e[n];if(i===0)return!1;t+=i}if(t<7)return!1;var a=t/7,o=a/2;return Math.abs(a-e[0])<o&&Math.abs(a-e[1])<o&&Math.abs(3*a-e[2])<3*o&&Math.abs(a-e[3])<o&&Math.abs(a-e[4])<o},r.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},r.prototype.crossCheckDiagonal=function(e,t,n,i){for(var a=this.getCrossCheckStateCount(),o=0,s=this.image;e>=o&&t>=o&&s.get(t-o,e-o);)a[2]++,o++;if(e<o||t<o)return!1;for(;e>=o&&t>=o&&!s.get(t-o,e-o)&&a[1]<=n;)a[1]++,o++;if(e<o||t<o||a[1]>n)return!1;for(;e>=o&&t>=o&&s.get(t-o,e-o)&&a[0]<=n;)a[0]++,o++;if(a[0]>n)return!1;var f=s.getHeight(),u=s.getWidth();for(o=1;e+o<f&&t+o<u&&s.get(t+o,e+o);)a[2]++,o++;if(e+o>=f||t+o>=u)return!1;for(;e+o<f&&t+o<u&&!s.get(t+o,e+o)&&a[3]<n;)a[3]++,o++;if(e+o>=f||t+o>=u||a[3]>=n)return!1;for(;e+o<f&&t+o<u&&s.get(t+o,e+o)&&a[4]<n;)a[4]++,o++;if(a[4]>=n)return!1;var l=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(l-i)<2*i&&r.foundPatternCross(a)},r.prototype.crossCheckVertical=function(e,t,n,i){for(var a=this.image,o=a.getHeight(),s=this.getCrossCheckStateCount(),f=e;f>=0&&a.get(t,f);)s[2]++,f--;if(f<0)return NaN;for(;f>=0&&!a.get(t,f)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&a.get(t,f)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=e+1;f<o&&a.get(t,f);)s[2]++,f++;if(f===o)return NaN;for(;f<o&&!a.get(t,f)&&s[3]<n;)s[3]++,f++;if(f===o||s[3]>=n)return NaN;for(;f<o&&a.get(t,f)&&s[4]<n;)s[4]++,f++;if(s[4]>=n)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-i)>=2*i?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.crossCheckHorizontal=function(e,t,n,i){for(var a=this.image,o=a.getWidth(),s=this.getCrossCheckStateCount(),f=e;f>=0&&a.get(f,t);)s[2]++,f--;if(f<0)return NaN;for(;f>=0&&!a.get(f,t)&&s[1]<=n;)s[1]++,f--;if(f<0||s[1]>n)return NaN;for(;f>=0&&a.get(f,t)&&s[0]<=n;)s[0]++,f--;if(s[0]>n)return NaN;for(f=e+1;f<o&&a.get(f,t);)s[2]++,f++;if(f===o)return NaN;for(;f<o&&!a.get(f,t)&&s[3]<n;)s[3]++,f++;if(f===o||s[3]>=n)return NaN;for(;f<o&&a.get(f,t)&&s[4]<n;)s[4]++,f++;if(s[4]>=n)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-i)>=i?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,f):NaN},r.prototype.handlePossibleCenter=function(e,t,n,i){var a=e[0]+e[1]+e[2]+e[3]+e[4],o=r.centerFromEnd(e,n),s=this.crossCheckVertical(t,Math.floor(o),e[2],a);if(!isNaN(s)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(s),e[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(s),Math.floor(o),e[2],a)))){for(var f=a/7,u=!1,l=this.possibleCenters,c=0,d=l.length;c<d;c++){var h=l[c];if(h.aboutEquals(f,s,o)){l[c]=h.combineEstimate(s,o,f),u=!0;break}}if(!u){var v=new bf(o,s,f);l.push(v),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(v)}return!0}return!1},r.prototype.findRowSkip=function(){var e,t,n=this.possibleCenters.length;if(n<=1)return 0;var i=null;try{for(var a=_r(this.possibleCenters),o=a.next();!o.done;o=a.next()){var s=o.value;if(s.getCount()>=r.CENTER_QUORUM)if(i==null)i=s;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-s.getX())-Math.abs(i.getY()-s.getY()))/2)}}catch(f){e={error:f}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var e,t,n,i,a=0,o=0,s=this.possibleCenters.length;try{for(var f=_r(this.possibleCenters),u=f.next();!u.done;u=f.next()){var l=u.value;l.getCount()>=r.CENTER_QUORUM&&(a++,o+=l.getEstimatedModuleSize())}}catch(p){e={error:p}}finally{try{u&&!u.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}if(a<3)return!1;var c=o/s,d=0;try{for(var h=_r(this.possibleCenters),v=h.next();!v.done;v=h.next()){var l=v.value;d+=Math.abs(l.getEstimatedModuleSize()-c)}}catch(p){n={error:p}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return d<=.05*o},r.prototype.selectBestPatterns=function(){var e,t,n,i,a=this.possibleCenters.length;if(a<3)throw new B;var o=this.possibleCenters,s;if(a>3){var f=0,u=0;try{for(var l=_r(this.possibleCenters),c=l.next();!c.done;c=l.next()){var d=c.value,h=d.getEstimatedModuleSize();f+=h,u+=h*h}}catch(m){e={error:m}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}s=f/a;var v=Math.sqrt(u/a-s*s);o.sort(function(m,S){var b=Math.abs(S.getEstimatedModuleSize()-s),D=Math.abs(m.getEstimatedModuleSize()-s);return b<D?-1:b>D?1:0});for(var p=Math.max(.2*s,v),y=0;y<o.length&&o.length>3;y++){var g=o[y];Math.abs(g.getEstimatedModuleSize()-s)>p&&(o.splice(y,1),y--)}}if(o.length>3){var f=0;try{for(var w=_r(o),A=w.next();!A.done;A=w.next()){var x=A.value;f+=x.getEstimatedModuleSize()}}catch(S){n={error:S}}finally{try{A&&!A.done&&(i=w.return)&&i.call(w)}finally{if(n)throw n.error}}s=f/o.length,o.sort(function(S,b){if(b.getCount()===S.getCount()){var D=Math.abs(b.getEstimatedModuleSize()-s),M=Math.abs(S.getEstimatedModuleSize()-s);return D<M?1:D>M?-1:0}else return b.getCount()-S.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),Df=function(){function r(e){this.image=e}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(ke.NEED_RESULT_POINT_CALLBACK);var t=new Tf(this.image,this.resultPointCallback),n=t.find(e);return this.processFinderPatternInfo(n)}
6,r.prototype.processFinderPatternInfo=function(e){var t=e.getTopLeft(),n=e.getTopRight(),i=e.getBottomLeft(),a=this.calculateModuleSize(t,n,i);if(a<1)throw new B("No pattern found in proccess finder.");var o=r.computeDimension(t,n,i,a),s=Qt.getProvisionalVersionForDimension(o),f=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-t.getX()+i.getX(),c=n.getY()-t.getY()+i.getY(),d=1-3/f,h=Math.floor(t.getX()+d*(l-t.getX())),v=Math.floor(t.getY()+d*(c-t.getY())),p=4;p<=16;p<<=1)try{u=this.findAlignmentInRegion(a,h,v,p);break}catch(A){if(!(A instanceof B))throw A}var y=r.createTransform(t,n,i,u,o),g=r.sampleGrid(this.image,y,o),w;return u===null?w=[i,t,n]:w=[i,t,n,u],new In(g,w)},r.createTransform=function(e,t,n,i,a){var o=a-3.5,s,f,u,l;return i!==null?(s=i.getX(),f=i.getY(),u=o-3,l=u):(s=t.getX()-e.getX()+n.getX(),f=t.getY()-e.getY()+n.getY(),u=o,l=o),_a.quadrilateralToQuadrilateral(3.5,3.5,o,3.5,u,l,3.5,o,e.getX(),e.getY(),t.getX(),t.getY(),s,f,n.getX(),n.getY())},r.sampleGrid=function(e,t,n){var i=Sn.getInstance();return i.sampleGridWithTransform(e,n,n,t)},r.computeDimension=function(e,t,n,i){var a=Oe.round(ie.distance(e,t)/i),o=Oe.round(ie.distance(e,n)/i),s=Math.floor((a+o)/2)+7;switch(s&3){case 0:s++;break;case 2:s--;break;case 3:throw new B("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},r.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,i){var a=this.sizeOfBlackWhiteBlackRun(e,t,n,i),o=1,s=e-(n-e);s<0?(o=e/(e-s),s=0):s>=this.image.getWidth()&&(o=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var f=Math.floor(t-(i-t)*o);return o=1,f<0?(o=t/(t-f),f=0):f>=this.image.getHeight()&&(o=(this.image.getHeight()-1-t)/(f-t),f=this.image.getHeight()-1),s=Math.floor(e+(s-e)*o),a+=this.sizeOfBlackWhiteBlackRun(e,t,s,f),a-1},r.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,i){var a=Math.abs(i-t)>Math.abs(n-e);if(a){var o=e;e=t,t=o,o=n,n=i,i=o}for(var s=Math.abs(n-e),f=Math.abs(i-t),u=-s/2,l=e<n?1:-1,c=t<i?1:-1,d=0,h=n+l,v=e,p=t;v!==h;v+=l){var y=a?p:v,g=a?v:p;if(d===1===this.image.get(y,g)){if(d===2)return Oe.distance(v,p,e,t);d++}if(u+=f,u>0){if(p===i)break;p+=c,u-=s}}return d===2?Oe.distance(n+l,i,e,t):NaN},r.prototype.findAlignmentInRegion=function(e,t,n,i){var a=Math.floor(i*e),o=Math.max(0,t-a),s=Math.min(this.image.getWidth()-1,t+a);if(s-o<e*3)throw new B("Alignment top exceeds estimated module size.");var f=Math.max(0,n-a),u=Math.min(this.image.getHeight()-1,n+a);if(u-f<e*3)throw new B("Alignment bottom exceeds estimated module size.");var l=new If(this.image,o,f,s-o,u-f,e,this.resultPointCallback);return l.find()},r}(),Gr=function(){function r(){this.decoder=new Af}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(e,t){var n,i;if(t!=null&&t.get(ke.PURE_BARCODE)!==void 0){var a=r.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(a,t),i=r.NO_POINTS}else{var o=new Df(e.getBlackMatrix()).detect(t);n=this.decoder.decodeBitMatrix(o.getBits(),t),i=o.getPoints()}n.getOther()instanceof Ea&&n.getOther().applyMirroredCorrection(i);var s=new pt(n.getText(),n.getRawBytes(),void 0,i,fe.QR_CODE,void 0),f=n.getByteSegments();f!==null&&s.putMetadata(lt.BYTE_SEGMENTS,f);var u=n.getECLevel();return u!==null&&s.putMetadata(lt.ERROR_CORRECTION_LEVEL,u),n.hasStructuredAppend()&&(s.putMetadata(lt.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(lt.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},r.prototype.reset=function(){},r.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t===null||n===null)throw new B;var i=this.moduleSize(t,e),a=t[1],o=n[1],s=t[0],f=n[0];if(s>=f||a>=o)throw new B;if(o-a!==f-s&&(f=s+(o-a),f>=e.getWidth()))throw new B;var u=Math.round((f-s+1)/i),l=Math.round((o-a+1)/i);if(u<=0||l<=0)throw new B;if(l!==u)throw new B;var c=Math.floor(i/2);a+=c,s+=c;var d=s+Math.floor((u-1)*i)-f;if(d>0){if(d>c)throw new B;s-=d}var h=a+Math.floor((l-1)*i)-o;if(h>0){if(h>c)throw new B;a-=h}for(var v=new Ft(u,l),p=0;p<l;p++)for(var y=a+Math.floor(p*i),g=0;g<u;g++)e.get(s+Math.floor(g*i),y)&&v.set(g,p);return v},r.moduleSize=function(e,t){for(var n=t.getHeight(),i=t.getWidth(),a=e[0],o=e[1],s=!0,f=0;a<i&&o<n;){if(s!==t.get(a,o)){if(++f===5)break;s=!s}a++,o++}if(a===i||o===n)throw new B;return(a-e[0])/7},r.NO_POINTS=new Array,r}(),Nf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Se=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(e){return Oe.sum(e)},r.toIntArray=function(e){var t,n;if(e==null||!e.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(e.length),a=0;try{for(var o=Nf(e),s=o.next();!s.done;s=o.next()){var f=s.value;i[a++]=f}}catch(u){t={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i},r.getCodeword=function(e){var t=$e.binarySearch(r.SYMBOL_TABLE,e&262143);return t<0?-1:(r.CODEWORD_TABLE[t]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r
vendor: 18,272 bytes, line 6
6.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),
6r
vendor: 12,861 bytes, line 6
6.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),
6r}(),Rf=function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),Pf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Mf=function(){function r(){}return r.detectMultiple=function(e,t,n){var i=e.getBlackMatrix(),a=r.detect(n,i);return a.length||(i=i.clone(),i.rotate180(),a=r.detect(n,i)),new Rf(i,a)},r.detect=function(e,t){for(var n,i,a=new Array,o=0,s=0,f=!1;o<t.getHeight();){var u=r.findVertices(t,o,s);if(u[0]==null&&u[3]==null){if(!f)break;f=!1,s=0;try{for(var l=(n=void 0,Pf(a)),c=l.next();!c.done;c=l.next()){var d=c.value;d[1]!=null&&(o=Math.trunc(Math.max(o,d[1].getY()))),d[3]!=null&&(o=Math.max(o,Math.trunc(d[3].getY())))}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}o+=r.ROW_STEP;continue}if(f=!0,a.push(u),!e)break;u[2]!=null?(s=Math.trunc(u[2].getX()),o=Math.trunc(u[2].getY())):(s=Math.trunc(u[4].getX()),o=Math.trunc(u[4].getY()))}return a},r.findVertices=function(e,t,n){var i=e.getHeight(),a=e.getWidth(),o=new Array(8);return r.copyToResult(o,r.findRowsWithPattern(e,i,a,t,n,r.START_PATTERN),r.INDEXES_START_PATTERN),o[4]!=null&&(n=Math.trunc(o[4].getX()),t=Math.trunc(o[4].getY())),r.copyToResult(o,r.findRowsWithPattern(e,i,a,t,n,r.STOP_PATTERN),r.INDEXES_STOP_PATTERN),o},r.copyToResult=function(e,t,n){for(var i=0;i<n.length;i++)e[n[i]]=t[i]},r.findRowsWithPattern=function(e,t,n,i,a,o){for(var s=new Array(4),f=!1,u=new Int32Array(o.length);i<t;i+=r.ROW_STEP){var l=r.findGuardPattern(e,a,i,n,!1,o,u);if(l!=null){for(;i>0;){var c=r.findGuardPattern(e,a,--i,n,!1,o,u);if(c!=null)l=c;else{i++;break}}s[0]=new ie(l[0],i),s[1]=new ie(l[1],i),f=!0;break}}var d=i+1;if(f){for(var h=0,c=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);d<t;d++){var l=r.findGuardPattern(e,c[0],d,n,!1,o,u);if(l!=null&&Math.abs(c[0]-l[0])<r.MAX_PATTERN_DRIFT&&Math.abs(c[1]-l[1])<r.MAX_PATTERN_DRIFT)c=l,h=0;else{if(h>r.SKIPPED_ROW_COUNT_MAX)break;h++}}d-=h+1,s[2]=new ie(c[0],d),s[3]=new ie(c[1],d)}return d-i<r.BARCODE_MIN_HEIGHT&&$e.fill(s,null),s},r.findGuardPattern=function(e,t,n,i,a,o,s){$e.fillWithin(s,0,s.length,0);for(var f=t,u=0;e.get(f,n)&&f>0&&u++<r.MAX_PIXEL_DRIFT;)f--;for(var l=f,c=0,d=o.length,h=a;l<i;l++){var v=e.get(l,n);if(v!==h)s[c]++;else{if(c===d-1){if(r.patternMatchVariance(s,o,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE)return new Int32Array([f,l]);f+=s[0]+s[1],Le.arraycopy(s,2,s,0,c-1),s[c-1]=0,s[c]=0,c--}else c++;s[c]=1,h=!h}}return c===d-1&&r.patternMatchVariance(s,o,r.MAX_INDIVIDUAL_VARIANCE)<r.MAX_AVG_VARIANCE?new Int32Array([f,l-1]):null},r.patternMatchVariance=function(e,t,n){for(var i=e.length,a=0,o=0,s=0;s<i;s++)a+=e[s],o+=t[s];if(a<o)return 1/0;var f=a/o;n*=f;for(var u=0,l=0;l<i;l++){var c=e[l],d=t[l]*f,h=c>d?c-d:d-c;if(h>n)return 1/0;u+=h}return u/a},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),Bf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qt=function(){function r(e,t){if(t.length===0)throw new ue;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var i=1;i<n&&t[i]===0;)i++;i===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-i),Le.arraycopy(t,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},r.prototype.evaluateAt=function(e){var t,n;if(e===0)return this.getCoefficient(0);if(e===1){var i=0;try{for(var a=Bf(this.coefficients),o=a.next();!o.done;o=a.next()){var s=o.value;i=this.field.add(i,s)}}catch(c){t={error:c}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i}for(var f=this.coefficients[0],u=this.coefficients.length,l=1;l<u;l++)f=this.field.add(this.field.multiply(e,f),this.coefficients[l]);return f},r.prototype.add=function(e){if(!this.field.equals(e.field))throw new ue("ModulusPolys do n
6ot have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var t=this.coefficients,n=e.coefficients;if(t.length>n.length){var i=t;t=n,n=i}var a=new Int32Array(n.length),o=n.length-t.length;Le.arraycopy(n,0,a,0,o);for(var s=o;s<n.length;s++)a[s]=this.field.add(t[s-o],n[s]);return new r(this.field,a)},r.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new ue("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},r.prototype.multiply=function(e){return e instanceof r?this.multiplyOther(e):this.multiplyScalar(e)},r.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new ue("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new r(this.field,new Int32Array([0]));for(var t=this.coefficients,n=t.length,i=e.coefficients,a=i.length,o=new Int32Array(n+a-1),s=0;s<n;s++)for(var f=t[s],u=0;u<a;u++)o[s+u]=this.field.add(o[s+u],this.field.multiply(f,i[u]));return new r(this.field,o)},r.prototype.negative=function(){for(var e=this.coefficients.length,t=new Int32Array(e),n=0;n<e;n++)t[n]=this.field.subtract(0,this.coefficients[n]);return new r(this.field,t)},r.prototype.multiplyScalar=function(e){if(e===0)return new r(this.field,new Int32Array([0]));if(e===1)return this;for(var t=this.coefficients.length,n=new Int32Array(t),i=0;i<t;i++)n[i]=this.field.multiply(this.coefficients[i],e);return new r(this.field,n)},r.prototype.multiplyByMonomial=function(e,t){if(e<0)throw new ue;if(t===0)return new r(this.field,new Int32Array([0]));for(var n=this.coefficients.length,i=new Int32Array(n+e),a=0;a<n;a++)i[a]=this.field.multiply(this.coefficients[a],t);return new r(this.field,i)},r.prototype.toString=function(){for(var e=new we,t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},r}(),Ff=function(){function r(){}return r.prototype.add=function(e,t){return(e+t)%this.modulus},r.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new ue;return this.logTable[e]},r.prototype.inverse=function(e){if(e===0)throw new ga;return this.expTable[this.modulus-this.logTable[e]-1]},r.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(e){return e===this},r}(),Lf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),kf=function(r){Lf(e,r);function e(t,n){var i=r.call(this)||this;i.modulus=t,i.expTable=new Int32Array(t),i.logTable=new Int32Array(t);for(var a=1,o=0;o<t;o++)i.expTable[o]=a,a=a*n%t;for(var o=0;o<t-1;o++)i.logTable[i.expTable[o]]=o;return i.zero=new qt(i,new Int32Array([0])),i.one=new qt(i,new Int32Array([1])),i}return e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(t,n){if(t<0)throw new ue;if(n===0)return this.zero;var i=new Int32Array(t+1);return i[0]=n,new qt(this,i)},e.PDF417_GF=new e(Se.NUMBER_OF_CODEWORDS,3),e}(Ff),Uf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vf=function(){function r(){this.field=kf.PDF417_GF}return r.prototype.decode=function(e,t,n){for(var i,a,o=new qt(this.field,e),s=new Int32Array(t),f=!1,u=t;u>0;u--){var l=o.evaluateAt(this.field.exp(u));s[t-u]=l,l!==0&&(f=!0)}if(!f)return 0;var c=this.field.getOne();if(n!=null)try{for(var d=Uf(n),h=d.next();!h.done;h=d.next()){var v=h.value,p=this.field.exp(e.length-1-v),y=new qt(this.field,new Int32Array([this.field.subtract(0,p),1]));c=c.multiply(y)}}catch(D){i={error:D}}
6finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}for(var g=new qt(this.field,s),w=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),g,t),A=w[0],x=w[1],m=this.findErrorLocations(A),S=this.findErrorMagnitudes(x,A,m),u=0;u<m.length;u++){var b=e.length-1-this.field.log(m[u]);if(b<0)throw ze.getChecksumInstance();e[b]=this.field.subtract(e[b],S[u])}return m.length},r.prototype.runEuclideanAlgorithm=function(e,t,n){if(e.getDegree()<t.getDegree()){var i=e;e=t,t=i}for(var a=e,o=t,s=this.field.getZero(),f=this.field.getOne();o.getDegree()>=Math.round(n/2);){var u=a,l=s;if(a=o,s=f,a.isZero())throw ze.getChecksumInstance();o=u;for(var c=this.field.getZero(),d=a.getCoefficient(a.getDegree()),h=this.field.inverse(d);o.getDegree()>=a.getDegree()&&!o.isZero();){var v=o.getDegree()-a.getDegree(),p=this.field.multiply(o.getCoefficient(o.getDegree()),h);c=c.add(this.field.buildMonomial(v,p)),o=o.subtract(a.multiplyByMonomial(v,p))}f=c.multiply(s).subtract(l).negative()}var y=f.getCoefficient(0);if(y===0)throw ze.getChecksumInstance();var g=this.field.inverse(y),w=f.multiply(g),A=o.multiply(g);return[w,A]},r.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),i=0,a=1;a<this.field.getSize()&&i<t;a++)e.evaluateAt(a)===0&&(n[i]=this.field.inverse(a),i++);if(i!==t)throw ze.getChecksumInstance();return n},r.prototype.findErrorMagnitudes=function(e,t,n){for(var i=t.getDegree(),a=new Int32Array(i),o=1;o<=i;o++)a[i-o]=this.field.multiply(o,t.getCoefficient(o));for(var s=new qt(this.field,a),f=n.length,u=new Int32Array(f),o=0;o<f;o++){var l=this.field.inverse(n[o]),c=this.field.subtract(0,e.evaluateAt(l)),d=this.field.inverse(s.evaluateAt(l));u[o]=this.field.multiply(c,d)}return u},r}(),yn=function(){function r(e,t,n,i,a){e instanceof r?this.constructor_2(e):this.constructor_1(e,t,n,i,a)}return r.prototype.constructor_1=function(e,t,n,i,a){var o=t==null||n==null,s=i==null||a==null;if(o&&s)throw new B;o?(t=new ie(0,i.getY()),n=new ie(0,a.getY())):s&&(i=new ie(e.getWidth()-1,t.getY()),a=new ie(e.getWidth()-1,n.getY())),this.image=e,this.topLeft=t,this.bottomLeft=n,this.topRight=i,this.bottomRight=a,this.minX=Math.trunc(Math.min(t.getX(),n.getX())),this.maxX=Math.trunc(Math.max(i.getX(),a.getX())),this.minY=Math.trunc(Math.min(t.getY(),i.getY())),this.maxY=Math.trunc(Math.max(n.getY(),a.getY()))},r.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},r.merge=function(e,t){return e==null?t:t==null?e:new r(e.image,e.topLeft,e.bottomLeft,t.topRight,t.bottomRight)},r.prototype.addMissingRows=function(e,t,n){var i=this.topLeft,a=this.bottomLeft,o=this.topRight,s=this.bottomRight;if(e>0){var f=n?this.topLeft:this.topRight,u=Math.trunc(f.getY()-e);u<0&&(u=0);var l=new ie(f.getX(),u);n?i=l:o=l}if(t>0){var c=n?this.bottomLeft:this.bottomRight,d=Math.trunc(c.getY()+t);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new ie(c.getX(),d);n?a=h:s=h}return new r(this.image,i,a,o,s)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),Hf=function(){function r(e,t,n,i){this.columnCount=e,this.errorCorrectionLevel=i,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),On=function(){function r(){this.buffer=""}return r.form=function(e,t){var n=-1;function i(o,s,f,u,l,c){if(o==="%%")return"%";if(t[++n]!==void 0){o=u?parseInt(u.substr(1)):void 0;var d=l?parseInt(l.substr(1)):void 0,h;switch(c){case"s":h=t[n];break;case"c":h=t[n][0];break;case"f":h=parseFloat(t[n]).toFixed(o);break;case"p":h=parseFloat(t[n]).toPrecision(o);break;case"e":h=parseFloat(t[n]).toExponential(o);break;case"x":h=parseInt(t[n]).toString(d||16);break;case"d":h=parseFloat(parseInt(t[n],d||10).toPrecision(o)).toFixed(0);break}h=typeof h=="object"?JSON.stringify(h):(+h).toString(d);for(var v=parseInt(f),p=f&&f[0]+""=="0"?"0":" ";h.length<v;)h=s!==void 0?h+p:p+h;return h}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,i)},r.prototype.format=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.buffer+=r.form(e,t)},r.prototype.toString=function(){return this.buffer},r}(),Gf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ca=function(){function r(e){this.boundingBox=new yn(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return r.prototype.getCodewordNearby=function(e){var t=this.getCodeword(e);if(t!=null)return t;for(var n=1;n<r.MAX_NEARBY_DISTANCE;n++){var i=this.imageRowToCodewordIndex(e)-n;if(i>=0&&(t=this.codewords[i],t!=null)||(i=this.imageRowToCodewordIndex(e)+n,i<this.codewords.length&&(t=this.codewords[i],t!=null)))return t}return null},r.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()}
6,r.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},r.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.getCodewords=function(){return this.codewords},r.prototype.toString=function(){var e,t,n=new On,i=0;try{for(var a=Gf(this.codewords),o=a.next();!o.done;o=a.next()){var s=o.value;if(s==null){n.format("%3d:    |   %n",i++);continue}n.format("%3d: %3d|%3d%n",i++,s.getRowNumber(),s.getValue())}}catch(f){e={error:f}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return n.toString()},r.MAX_NEARBY_DISTANCE=5,r}(),Xf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wf=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return a},Ar=function(){function r(){this.values=new Map}return r.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t==null&&(t=0),t++,this.values.set(e,t)},r.prototype.getValue=function(){var e,t,n=-1,i=new Array,a=function(c,d){var h={getKey:function(){return c},getValue:function(){return d}};h.getValue()>n?(n=h.getValue(),i=[],i.push(h.getKey())):h.getValue()===n&&i.push(h.getKey())};try{for(var o=Xf(this.values.entries()),s=o.next();!s.done;s=o.next()){var f=Wf(s.value,2),u=f[0],l=f[1];a(u,l)}}catch(c){e={error:c}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return Se.toIntArray(i)},r.prototype.getConfidence=function(e){return this.values.get(e)},r}(),zf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),nn=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},di=function(r){zf(e,r);function e(t,n){var i=r.call(this,t)||this;return i._isLeft=n,i}return e.prototype.setRowNumbers=function(){var t,n;try{for(var i=nn(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;o!=null&&o.setRowNumberAsRowIndicatorColumn()}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,t);for(var i=this.getBoundingBox(),a=this._isLeft?i.getTopLeft():i.getTopRight(),o=this._isLeft?i.getBottomLeft():i.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),f=this.imageRowToCodewordIndex(Math.trunc(o.getY())),u=-1,l=1,c=0,d=s;d<f;d++)if(n[d]!=null){var h=n[d],v=h.getRowNumber()-u;if(v===0)c++;else if(v===1)l=Math.max(l,c),c=1,u=h.getRowNumber();else if(v<0||h.getRowNumber()>=t.getRowCount()||v>d)n[d]=null;else{var p=void 0;l>2?p=(l-2)*v:p=v;for(var y=p>=d,g=1;g<=p&&!y;g++)y=n[d-g]!=null;y?n[d]=null:(u=h.getRowNumber(),c=1)}}},e.prototype.getRowHeights=function(){var t,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var a=new Int32Array(i.getRowCount());try{for(var o=nn(this.getCodewords()),s=o.next();!s.done;s=o.next()){var f=s.value;if(f!=null){var u=f.getRowNumber();if(u>=a.length)continue;a[u]++}}}
6catch(l){t={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),a=this._isLeft?n.getBottomLeft():n.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),f=this.getCodewords(),u=-1,l=o;l<s;l++)if(f[l]!=null){var c=f[l];c.setRowNumberAsRowIndicatorColumn();var d=c.getRowNumber()-u;d===0||(d===1?u=c.getRowNumber():c.getRowNumber()>=t.getRowCount()?f[l]=null:u=c.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,n,i=this.getCodewords(),a=new Ar,o=new Ar,s=new Ar,f=new Ar;try{for(var u=nn(i),l=u.next();!l.done;l=u.next()){var c=l.value;if(c!=null){c.setRowNumberAsRowIndicatorColumn();var d=c.getValue()%30,h=c.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:o.setValue(d*3+1);break;case 1:f.setValue(d/3),s.setValue(d%3);break;case 2:a.setValue(d+1);break}}}}catch(p){t={error:p}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}if(a.getValue().length===0||o.getValue().length===0||s.getValue().length===0||f.getValue().length===0||a.getValue()[0]<1||o.getValue()[0]+s.getValue()[0]<Se.MIN_ROWS_IN_BARCODE||o.getValue()[0]+s.getValue()[0]>Se.MAX_ROWS_IN_BARCODE)return null;var v=new Hf(a.getValue()[0],o.getValue()[0],s.getValue()[0],f.getValue()[0]);return this.removeIncorrectCodewords(i,v),v},e.prototype.removeIncorrectCodewords=function(t,n){for(var i=0;i<t.length;i++){var a=t[i];if(t[i]!=null){var o=a.getValue()%30,s=a.getRowNumber();if(s>n.getRowCount()){t[i]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:o*3+1!==n.getRowCountUpperPart()&&(t[i]=null);break;case 1:(Math.trunc(o/3)!==n.getErrorCorrectionLevel()||o%3!==n.getRowCountLowerPart())&&(t[i]=null);break;case 2:o+1!==n.getColumnCount()&&(t[i]=null);break}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
7`+r.prototype.toString.call(this)},e}(Ca),jf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Yf=function(){function r(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e=Se.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<t);return this.detectionResultColumns},r.prototype.adjustIndicatorColumnRowNumbers=function(e){e!=null&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},r.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var n=this.detectionResultColumns[t].getCodewords(),i=0;i<n.length;i++)n[i]!=null&&(n[i].hasValidRowNumber()||this.adjustRowNumbers(t,i,n));return e},r.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var e=this.adjustRowNumbersFromLRI();return e+this.adjustRowNumbersFromRRI()},r.prototype.adjustRowNumbersFromBothRI=function(){if(!(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)){for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(var i=1;i<=this.barcodeColumnCount;i++){var a=this.detectionResultColumns[i].getCodewords()[n];a!=null&&(a.setRowNumber(e[n].getRowNumber()),a.hasValidRowNumber()||(this.detectionResultColumns[i].getCodewords()[n]=null))}}},r.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var e=0,t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<t.length;n++)if(t[n]!=null)for(var i=t[n].getRowNumber(),a=0,o=this.barcodeColumnCount+1;o>0&&a<this.ADJUST_ROW_NUMBER_SKIP;o--){var s=this.detectionResultColumns[o].getCodewords()[n];s!=null&&(a=r.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||e++)}return e},r.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var e=0,t=this.detectionResultColumns[0].getCodewords(),n=0;n<t.length;n++)if(t[n]!=null)for(var i=t[n].getRowNumber(),a=0,o=1;o<this.barcodeColumnCount+1&&a<this.ADJUST_ROW_NUMBER_SKIP;o++){var s=this.detectionResultColumns[o].getCodewords()[n];s!=null&&(a=r.adjustRowNumberIfValid(i,a,s),s.hasValidRowNumber()||e++)}return e},r.adjustRowNumberIfValid=function(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t},r.prototype.adjustRowNumbers=function(e,t,n){var i,a;if(this.detectionResultColumns[e-1]!=null){var o=n[t],s=this.detectionResultColumns[e-1].getCodewords(),f=s;this.detectionResultColumns[e+1]!=null&&(f=this.detectionResultColumns[e+1].getCodewords());var u=new Array(14);u[2]=s[t],u[3]=f[t],t>0&&(u[0]=n[t-1],u[4]=s[t-1],u[5]=f[t-1]),t>1&&(u[8]=n[t-2],u[10]=s[t-2],u[11]=f[t-2]),t<n.length-1&&(u[1]=n[t+1],u[6]=s[t+1],u[7]=f[t+1
7]),t<n.length-2&&(u[9]=n[t+2],u[12]=s[t+2],u[13]=f[t+2]);try{for(var l=jf(u),c=l.next();!c.done;c=l.next()){var d=c.value;if(r.adjustRowNumber(o,d))return}}catch(h){i={error:h}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}}},r.adjustRowNumber=function(e,t){return t==null?!1:t.hasValidRowNumber()&&t.getBucket()===e.getBucket()?(e.setRowNumber(t.getRowNumber()),!0):!1},r.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},r.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},r.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},r.prototype.setBoundingBox=function(e){this.boundingBox=e},r.prototype.getBoundingBox=function(){return this.boundingBox},r.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},r.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},r.prototype.toString=function(){var e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var t=new On,n=0;n<e.getCodewords().length;n++){t.format("CW %3d:",n);for(var i=0;i<this.barcodeColumnCount+2;i++){if(this.detectionResultColumns[i]==null){t.format("    |   ");continue}var a=this.detectionResultColumns[i].getCodewords()[n];if(a==null){t.format("    |   ");continue}t.format(" %3d|%3d",a.getRowNumber(),a.getValue())}t.format("%n")}return t.toString()},r}(),Zf=function(){function r(e,t,n,i){this.rowNumber=r.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(t),this.bucket=Math.trunc(n),this.value=Math.trunc(i)}return r.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},r.prototype.isValidRowNumber=function(e){return e!==r.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},r.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))},r.prototype.getWidth=function(){return this.endX-this.startX},r.prototype.getStartX=function(){return this.startX},r.prototype.getEndX=function(){return this.endX},r.prototype.getBucket=function(){return this.bucket},r.prototype.getValue=function(){return this.value},r.prototype.getRowNumber=function(){return this.rowNumber},r.prototype.setRowNumber=function(e){this.rowNumber=e},r.prototype.toString=function(){return this.rowNumber+"|"+this.value},r.BARCODE_ROW_UNKNOWN=-1,r}(),Kf=function(){function r(){}return r.initialize=function(){for(var e=0;e<Se.SYMBOL_TABLE.length;e++)for(var t=Se.SYMBOL_TABLE[e],n=t&1,i=0;i<Se.BARS_IN_MODULE;i++){for(var a=0;(t&1)===n;)a+=1,t>>=1;n=t&1,r.RATIOS_TABLE[e]||(r.RATIOS_TABLE[e]=new Array(Se.BARS_IN_MODULE)),r.RATIOS_TABLE[e][Se.BARS_IN_MODULE-i-1]=Math.fround(a/Se.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(e){var t=r.getDecodedCodewordValue(r.sampleBitCounts(e));return t!==-1?t:r.getClosestDecodedValue(e)},r.sampleBitCounts=function(e){for(var t=Oe.sum(e),n=new Int32Array(Se.BARS_IN_MODULE),i=0,a=0,o=0;o<Se.MODULES_IN_CODEWORD;o++){var s=t/(2*Se.MODULES_IN_CODEWORD)+o*t/Se.MODULES_IN_CODEWORD;a+e[i]<=s&&(a+=e[i],i++),n[i]++}return n},r.getDecodedCodewordValue=function(e){var t=r.getBitValue(e);return Se.getCodeword(t)===-1?-1:t},r.getBitValue=function(e){for(var t=0,n=0;n<e.length;n++)for(var i=0;i<e[n];i++)t=t<<1|(n%2===0?1:0);return Math.trunc(t)},r.getClosestDecodedValue=function(e){var t=Oe.sum(e),n=new Array(Se.BARS_IN_MODULE);if(t>1)for(var i=0;i<n.length;
7i++)n[i]=Math.fround(e[i]/t);var a=pn.MAX_VALUE,o=-1;this.bSymbolTableReady||r.initialize();for(var s=0;s<r.RATIOS_TABLE.length;s++){for(var f=0,u=r.RATIOS_TABLE[s],l=0;l<Se.BARS_IN_MODULE;l++){var c=Math.fround(u[l]-n[l]);if(f+=Math.fround(c*c),f>=a)break}f<a&&(a=f,o=Se.SYMBOL_TABLE[s])}return o},r.bSymbolTableReady=!1,r.RATIOS_TABLE=new Array(Se.SYMBOL_TABLE.length).map(function(e){return new Array(Se.BARS_IN_MODULE)}),r}(),qf=function(){function r(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return r.prototype.getSegmentIndex=function(){return this.segmentIndex},r.prototype.setSegmentIndex=function(e){this.segmentIndex=e},r.prototype.getFileId=function(){return this.fileId},r.prototype.setFileId=function(e){this.fileId=e},r.prototype.getOptionalData=function(){return this.optionalData},r.prototype.setOptionalData=function(e){this.optionalData=e},r.prototype.isLastSegment=function(){return this.lastSegment},r.prototype.setLastSegment=function(e){this.lastSegment=e},r.prototype.getSegmentCount=function(){return this.segmentCount},r.prototype.setSegmentCount=function(e){this.segmentCount=e},r.prototype.getSender=function(){return this.sender||null},r.prototype.setSender=function(e){this.sender=e},r.prototype.getAddressee=function(){return this.addressee||null},r.prototype.setAddressee=function(e){this.addressee=e},r.prototype.getFileName=function(){return this.fileName},r.prototype.setFileName=function(e){this.fileName=e},r.prototype.getFileSize=function(){return this.fileSize},r.prototype.setFileSize=function(e){this.fileSize=e},r.prototype.getChecksum=function(){return this.checksum},r.prototype.setChecksum=function(e){this.checksum=e},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.setTimestamp=function(e){this.timestamp=e},r}(),hi=function(){function r(){}return r.parseLong=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r}(),Qf=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),$f=function(r){Qf(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="NullPointerException",e}(Ct),Jf=function(){function r(){}return r.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},r.prototype.writeBytesOffset=function(e,t,n){if(e==null)throw new $f;if(t<0||t>e.length||n<0||t+n>e.length||t+n<0)throw new Cn;if(n===0)return;for(var i=0;i<n;i++)this.write(e[t+i])},r.prototype.flush=function(){},r.prototype.close=function(){},r}(),e1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),t1=function(r){e1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ct),r1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),n1=function(r){r1(e,r);function e(t){t===void 0&&(t=32);var n=r.call(this)||this;if(n.count=0,t<0)throw new ue("Negative initial size: "+t);return n.buf=new Uint8Array(t),n}return e.prototype.ensureCapacity=function(t){t-this.buf.length>0&&this.grow(t)},e.prototype.grow=function(t){var n=this.buf.length,i=n<<1;if(i-t<0&&(i=t),i<0){if(t<0)throw new t1;i=me.MAX_VALUE}this.buf=$e.copyOfUint8Array(this.buf,i)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,n,i){if(n<0||n>t.length||i<0||n+i-t.length>0)throw new Cn;this.ensureCapacity(this.count+i),Le.arraycopy(t,n,this.buf,this.count,i),this.count+=i},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return $e.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?typeof t=="string"?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Jf),Be;(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Be||(Be={}));function Ia(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var Rr;function Wt(r){if(typeof Rr>"u"&&(Rr=Ia()),Rr===null)throw new Error("BigInt is not supported!");return Rr(r)}function i1(){var r=[];r[0]=Wt(1);var e=Wt(900);r[1]=e;for(var t=2;t<16;t++)r[t]=r[t-1]*e;return r}var a1=function(){function r(){}return r.decode=function(e,t){var n=new we(""),i=Qe.ISO8859_1;n.enableDecoding(i);for(var a=1,o=e[a++],s=new qf;a<e[0];){switch(o){case r.TEXT_COMPACTION_MODE_LATCH:a=r.textCompaction(e,a,n);break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:a=r.byteCompaction(o,e,i,a,n);break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[a++]);break;case r.NUMERIC_COMPACTION_MODE_LATCH:a=r.numericCompaction(e,a,n);break;case r.ECI_CHARSET:Qe.getCharacterSetECIByValue(e[a++]);break;case r.ECI_GENERAL_PURPOSE:a+=2;break;case r.ECI_USER_DEFINED:a++;break;case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:a=r.decodeMacroBlock(e,a,s);break;case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:throw new $;default:a--,a=r.textCompaction(e,a,n);break}if(a<e.length)o=e[a++];else throw $.getFormatInstance()}if(n.length()===0)throw $.getFormatInstance();var f=new Kr(null,n.toString(),null,t);return f.setOther(s),f},r.decodeMacroBlock=function(e,t,n){if(t+r.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw $.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a<r.NUMBER_OF_SEQUENCE_CODEWORDS;a++,t++)i[a]=e[t];n.setSegmentIndex(me.parseInt(r.decodeBase900toBase10(i,r.NUMBER_OF_SEQUENCE_CODEWORDS)));var o=new we;t=r.textCompaction(e,t,o),n.setFileId(o.toString());var s=-1;for(e[t]===r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=t+1);t<e[0];)switch(e[t]){case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t++,e[t]){case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var f=new we;t=r.textCompaction(e,t+1,f),n.setFileName(f.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new we;t=r.textCompaction(e,t+1,u),n.setSender(u.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var l=new we;t=r.textCompaction(e,t+1,l),n.setAddressee(l.toString());break;case r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var c=new we;t=r.numericCompaction(e,t+1,c),n.setSegmentCount(me.parseInt(c.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var d=new we;t=r.numericCompaction(e,t+1,d),n.setTimestamp(hi.parseLong(d.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var h=new we;t=r.numericCompaction(e,t+1,h),n.setChecksum(me.parseInt(h.toString()));break;case r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var v=new we;t=r.numericCompaction(e,t+1,v),n.setFileSize(hi.parseLong(v.toString()));break;default:throw $.getFormatInstance()}break;case r.MACRO_PDF417_TERMINATOR:t++,n.setLastSegment(!0);break;default:throw $.getFormatInstance()}if(s!==-1){var p=t-s;n.isLastSegment()&&p--,n.setOptionalData($e.copyOfRange(e,s,s+p))}return t},r.textCompaction=function(e,t,n){for(var i=new Int32Array((e[0]-t)*2),a=new Int32Array((e[0]-t)*2),o=0,s=!1;t<e[0]&&!s;){var f=e[t++];if(f<r.TEXT_COMPACTION_MODE_LATCH)i[o]=f/30,i[o+1]=f%30,o+=2;else switch(f){case r.TEXT_COMPACTION_MODE_LATCH:i[o++]=r.TEXT_COMPACTION_MODE_LATCH;break;case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:t--,s=!0;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[o]=r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,f=e[t++],a[o]=f,o++;break}}return r.decodeTextCompaction(i,a,o,n),t},r.decodeTextCompaction=function(e,t,n,i){for(var a=Be.ALPHA,o=Be.ALPHA,s=0;s<n;){var f=e[s],u="";switch(a){case Be.ALPHA:if(f<26)u=String.fromCharCode(65+f);else switch(f){case 26:u=" ";break;case r.LL:a=Be.LOWER;break;case r.ML:a=Be.MIXED;break;case r.PS:o=a,a=Be.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(t[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break;case Be.LOWER:if(f<26)u=String.fromCharCode(97+f);else switch(f){case 26:u=" ";break;case r.AS:o=a,a=Be.ALPHA_SHIFT;break;case r.ML:a=Be.MIXED;break;case r.PS:o=a,a=Be.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(t[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break;case Be.MIXED:if(f<r.PL)u=r.MIXED_CHARS[f];else switch(f){case r.PL:a=Be.PUNCT;break;case 26:u=" ";break;case r.LL:a=Be.LOWER;break;case r.AL:a=Be.ALPHA;break;case r.PS:o=a,a=Be.PUNCT_SHIFT;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(t[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break;case Be.PUNCT:if(f<r.PAL)u=r.PUNCT_CHARS[f];else switch(f){case r.PAL:a=Be.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(t[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break;case Be.ALPHA_SHIFT:if(a=o,f<26)u=String.fromCharCode(65+f);else switch(f){case 26:u=" ";break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break;case Be.PUNCT_SHIFT:if(a=o,f<r.PAL)u=r.PUNCT_CHARS[f];else switch(f){case r.PAL:a=Be.ALPHA;break;case r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(t[s]);break;case r.TEXT_COMPACTION_MODE_LATCH:a=Be.ALPHA;break}break}u!==""&&i.append(u),s++}},r.byteCompaction=function(e,t,n,i,a){var o=new n1,s=0,f=0,u=!1;switch(e){case r.BYTE_COMPACTION_MODE_LATCH:for(var l=new Int32Array(6),c=t[i++];i<t[0]&&!u;)switch(l[s++]=c,f=900*f+c,c=t[i++],c){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:i--,u=!0;break;default:if(s%5===0&&s>0){for(var d=0;d<6;++d)o.write(Number(Wt(f)>>Wt(8*(5-d))));f=0,s=0}break}i===t[0]&&c<r.TEXT_COMPACTION_MODE_LATCH&&(l[s++]=c);for(var h=0;h<s;h++)o.write(l[h]);break;case r.BYTE_COMPACTION_MODE_LATCH_6:for(;i<t[0]&&!u;){var v=t[i++];if(v<r.TEXT_COMPACTION_MODE_LATCH)s++,f=900*f+v;else switch(v){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.NUMERIC_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:i--,u=!0;break}if(s%5===0&&s>0){for(var d=0;d<6;++d)o.write(Number(Wt(f)>>Wt(8*(5-d))));f=0,s=0}}break}return a.append(Ot.decode(o.toByteArray(),n)),i},r.numericCompaction=function(e,t,n){for(var i=0,a=!1,o=new Int32Array(r.MAX_NUMERIC_CODEWORDS);t<e[0]&&!a;){var s=e[t++];if(t===e[0]&&(a=!0),s<r.TEXT_COMPACTION_MODE_LATCH)o[i]=s,i++;else switch(s){case r.TEXT_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH:case r.BYTE_COMPACTION_MODE_LATCH_6:case r.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case r.MACRO_PDF417_TERMINATOR:t--,a=!0;break}(i%r.MAX_NUMERIC_CODEWORDS===0||s===r.NUMERIC_COMPACTION_MODE_LATCH||a)&&i>0&&(n.append(r.decodeBase900toBase10(o,i)),i=0)}return t},r.decodeBase900toBase10=function(e,t){for(var n=Wt(0),i=0;i<t;i++)n+=r.EXP900[t-i-1]*Wt(e[i]);var a=n.toString();if(a.charAt(0)!=="1")throw new $;return a.substring(1)},r.TEXT_COMPACTION_MODE_LATCH=900,r.BYTE_COMPACTION_MODE_LATCH=901,r.NUMERIC_COMPACTION_MODE_LATCH=902,r.BYTE_COMPACTION_MODE_LATCH_6=924,r.ECI_USER_DEFINED=925,r.ECI_GENERAL_PURPOSE=926,r.ECI_CHARSET=927,r.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,r.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,r.MACRO_PDF417_TERMINATOR=922,r.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,r.MAX_NUMERIC_CODEWORDS=15,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,r.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,r.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,r.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,r.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,r.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,r.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,r.PL=25,r.LL=27,r.AS=27,r.ML=28,r.AL=28,r.PS=29,r.PAL=29,r.PUNCT_CHARS=`;<>@[\\]_\`~!\r	,:
8-.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r	,:#-.$/+%*=^",r.EXP900=Ia()?i1():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),yr=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o1=function(){function r(){}return r.decode=function(e,t,n,i,a,o,s){for(var f=new yn(e,t,n,i,a),u=null,l=null,c,d=!0;;d=!1){if(t!=null&&(u=r.getRowIndicatorColumn(e,f,t,!0,o,s)),i!=null&&(l=r.getRowIndicatorColumn(e,f,i,!1,o,s)),c=r.merge(u,l),c==null)throw B.getNotFoundInstance();var h=c.getBoundingBox();if(d&&h!=null&&(h.getMinY()<f.getMinY()||h.getMaxY()>f.getMaxY()))f=h;else break}c.setBoundingBox(f);var v=c.getBarcodeColumnCount()+1;c.setDetectionResultColumn(0,u),c.setDetectionResultColumn(v,l);for(var p=u!=null,y=1;y<=v;y++){var g=p?y:v-y;if(c.getDetectionResultColumn(g)===void 0){var w=void 0;
8g===0||g===v?w=new di(f,g===0):w=new Ca(f),c.setDetectionResultColumn(g,w);for(var A=-1,x=A,m=f.getMinY();m<=f.getMaxY();m++){if(A=r.getStartColumn(c,g,m,p),A<0||A>f.getMaxX()){if(x===-1)continue;A=x}var S=r.detectCodeword(e,f.getMinX(),f.getMaxX(),p,A,m,o,s);S!=null&&(w.setCodeword(m,S),x=A,o=Math.min(o,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return r.createDecoderResult(c)},r.merge=function(e,t){if(e==null&&t==null)return null;var n=r.getBarcodeMetadata(e,t);if(n==null)return null;var i=yn.merge(r.adjustBoundingBox(e),r.adjustBoundingBox(t));return new Yf(n,i)},r.adjustBoundingBox=function(e){var t,n;if(e==null)return null;var i=e.getRowHeights();if(i==null)return null;var a=r.getMax(i),o=0;try{for(var s=yr(i),f=s.next();!f.done;f=s.next()){var u=f.value;if(o+=a-u,u>0)break}}catch(h){t={error:h}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}for(var l=e.getCodewords(),c=0;o>0&&l[c]==null;c++)o--;for(var d=0,c=i.length-1;c>=0&&(d+=a-i[c],!(i[c]>0));c--);for(var c=l.length-1;d>0&&l[c]==null;c--)d--;return e.getBoundingBox().addMissingRows(o,d,e.isLeft())},r.getMax=function(e){var t,n,i=-1;try{for(var a=yr(e),o=a.next();!o.done;o=a.next()){var s=o.value;i=Math.max(i,s)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},r.getBarcodeMetadata=function(e,t){var n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();var i;return t==null||(i=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(e,t,n,i,a,o){for(var s=new di(t,i),f=0;f<2;f++)for(var u=f===0?1:-1,l=Math.trunc(Math.trunc(n.getX())),c=Math.trunc(Math.trunc(n.getY()));c<=t.getMaxY()&&c>=t.getMinY();c+=u){var d=r.detectCodeword(e,0,e.getWidth(),i,l,c,a,o);d!=null&&(s.setCodeword(c,d),i?l=d.getStartX():l=d.getEndX())}return s},r.adjustCodewordCount=function(e,t){var n=t[0][1],i=n.getValue(),a=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-r.getNumberOfECCodeWords(e.getBarcodeECLevel());if(i.length===0){if(a<1||a>Se.MAX_CODEWORDS_IN_BARCODE)throw B.getNotFoundInstance();n.setValue(a)}else i[0]!==a&&n.setValue(a)},r.createDecoderResult=function(e){var t=r.createBarcodeMatrix(e);r.adjustCodewordCount(e,t);for(var n=new Array,i=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),a=[],o=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var f=0;f<e.getBarcodeColumnCount();f++){var u=t[s][f+1].getValue(),l=s*e.getBarcodeColumnCount()+f;u.length===0?n.push(l):u.length===1?i[l]=u[0]:(o.push(l),a.push(u))}for(var c=new Array(a.length),d=0;d<c.length;d++)c[d]=a[d];return r.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),i,Se.toIntArray(n),Se.toIntArray(o),c)},r.createDecoderResultFromAmbiguousValues=function(e,t,n,i,a){for(var o=new Int32Array(i.length),s=100;s-- >0;){for(var f=0;f<o.length;f++)t[i[f]]=a[f][o[f]];try{return r.decodeCodewords(t,e,n)}catch(l){var u=l instanceof ze;if(!u)throw l}if(o.length===0)throw ze.getChecksumInstance();for(var f=0;f<o.length;f++)if(o[f]<a[f].length-1){o[f]++;break}else if(o[f]=0,f===o.length-1)throw ze.getChecksumInstance()}throw ze.getChecksumInstance()},r.createBarcodeMatrix=function(e){for(var t,n,i,a,o=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),s=0;s<o.length;s++)for(var f=0;f<o[s].length;f++)o[s][f]=new Ar;var u=0;try{for(var l=yr(e.getDetectionResultColumns()),c=l.next();!c.done;c=l.next()){var d=c.value;if(d!=null)try{for(var h=(i=void 0,yr(d.getCodewords())),v=h.next();!v.done;v=h.next()){var p=v.value;if(p!=null){var y=p.getRowNumber();if(y>=0){if(y>=o.length)continue;o[y][u].setValue(p.getValue())}}}}catch(g){i={error:g}}finally{try{v&&!v.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}u++}}catch(g){t={error:g}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},r.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},r.getStartColumn=function(e,t,n,i){var a,o,s=i?1:-1,f=null;if(r.isValidBarcodeColumn(e,t-s)&&(f=e.getDetectionResultColumn(t-s).getCodeword(n)),f!=null)return i?f.getEndX():f.getStartX();if(f=e.getDetectionResultColumn(t).getCodewordNearby(n),f!=null)return i?f.getStartX():f.getEndX();if(r.isValidBarcodeColumn(e,t-s)&&(f=e.getDetectionResultColumn(t-s).getCodewordNearby(n)),f!=null)return i?f.getEndX():f.getStartX();for(var u=0;r.isValidBarcodeColumn(e,t-s);){t-=s;try{for(var l=(a=void 0,yr(e.getDetectionResultColumn(t).getCodewords())),c=l.next();!c.done;c=l.next()){var d=c.value;if(d!=null)return(i?d.getEndX():d.getStartX())+s*u*(d.getEndX()-d.getStartX())}}catch(h){a={error:h}}
8finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}u++}return i?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},r.detectCodeword=function(e,t,n,i,a,o,s,f){a=r.adjustCodewordStartColumn(e,t,n,i,a,o);var u=r.getModuleBitCount(e,t,n,i,a,o);if(u==null)return null;var l,c=Oe.sum(u);if(i)l=a+c;else{for(var d=0;d<u.length/2;d++){var h=u[d];u[d]=u[u.length-1-d],u[u.length-1-d]=h}l=a,a=l-c}if(!r.checkCodewordSkew(c,s,f))return null;var v=Kf.getDecodedValue(u),p=Se.getCodeword(v);return p===-1?null:new Zf(a,l,r.getCodewordBucketNumber(v),p)},r.getModuleBitCount=function(e,t,n,i,a,o){for(var s=a,f=new Int32Array(8),u=0,l=i?1:-1,c=i;(i?s<n:s>=t)&&u<f.length;)e.get(s,o)===c?(f[u]++,s+=l):(u++,c=!c);return u===f.length||s===(i?n:t)&&u===f.length-1?f:null},r.getNumberOfECCodeWords=function(e){return 2<<e},r.adjustCodewordStartColumn=function(e,t,n,i,a,o){for(var s=a,f=i?-1:1,u=0;u<2;u++){for(;(i?s>=t:s<n)&&i===e.get(s,o);){if(Math.abs(a-s)>r.CODEWORD_SKEW_SIZE)return a;s+=f}f=-f,i=!i}return s},r.checkCodewordSkew=function(e,t,n){return t-r.CODEWORD_SKEW_SIZE<=e&&e<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(e,t,n){if(e.length===0)throw $.getFormatInstance();var i=1<<t+1,a=r.correctErrors(e,n,i);r.verifyCodewordCount(e,i);var o=a1.decode(e,""+t);return o.setErrorsCorrected(a),o.setErasures(n.length),o},r.correctErrors=function(e,t,n){if(t!=null&&t.length>n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw ze.getChecksumInstance();return r.errorCorrection.decode(e,n,t)},r.verifyCodewordCount=function(e,t){if(e.length<4)throw $.getFormatInstance();var n=e[0];if(n>e.length)throw $.getFormatInstance();if(n===0)if(t<e.length)e[0]=e.length-t;else throw $.getFormatInstance()},r.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),n=0,i=t.length-1;!((e&1)!==n&&(n=e&1,i--,i<0));)t[i]++,e>>=1;return t},r.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},r.getCodewordBucketNumber_number=function(e){return r.getCodewordBucketNumber(r.getBitCountForCodeword(e))},r.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},r.toString=function(e){for(var t=new On,n=0;n<e.length;n++){t.format("Row %2d: ",n);for(var i=0;i<e[n].length;i++){var a=e[n][i];a.getValue().length===0?t.format("        ",null):t.format("%4d(%2d)",a.getValue()[0],a.getConfidence(a.getValue()[0]))}t.format("%n")}return t.toString()},r.CODEWORD_SKEW_SIZE=2,r.MAX_ERRORS=3,r.MAX_EC_CODEWORDS=512,r.errorCorrection=new Vf,r}(),s1=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Xr=function(){function r(){}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n=r.decode(e,t,!1);if(n==null||n.length===0||n[0]==null)throw B.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(e,t){t===void 0&&(t=null);try{return r.decode(e,t,!0)}catch(n){throw n instanceof $||n instanceof ze?B.getNotFoundInstance():n}},r.decode=function(e,t,n){var i,a,o=new Array,s=Mf.detectMultiple(e,t,n);try{for(var f=s1(s.getPoints()),u=f.next();!u.done;u=f.next()){var l=u.value,c=o1.decode(s.getBits(),l[4],l[5],l[6],l[7],r.getMinCodewordWidth(l),r.getMaxCodewordWidth(l)),d=new pt(c.getText(),c.getRawBytes(),void 0,l,fe.PDF_417);d.putMetadata(lt.ERROR_CORRECTION_LEVEL,c.getECLevel());var h=c.getOther();h!=null&&d.putMetadata(lt.PDF417_EXTRA_METADATA,h),o.push(d)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return o.map(function(v){return v})},r.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMinWidth=function(e,t){return e==null||t==null?me.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(r.getMaxWidth(e[0],e[4]),r.getMaxWidth(e[6],e[2])*Se.MODULES_IN_CODEWORD/Se.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(e[1],e[5]),r.getMaxWidth(e[7],e[3])*Se.MODULES_IN_CODEWORD/Se.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(r.getMinWidth(e[0],e[4]),r.getMinWidth(e[6],e[2])*Se.MODULES_IN_CODEWORD/Se.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(e[1],e[5]),r.getMinWidth(e[7],e[3])*Se.MODULES_IN_CODEWORD/Se.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),f1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}
8e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),vi=function(r){f1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ReaderException",e}(Ct),pi=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sa=function(){function r(){}return r.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},r.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},r.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(ke.TRY_HARDER)!==void 0,n=e==null?null:e.get(ke.POSSIBLE_FORMATS),i=new Array;if(n!=null){var a=n.some(function(o){return o===fe.UPC_A||o===fe.UPC_E||o===fe.EAN_13||o===fe.EAN_8||o===fe.CODABAR||o===fe.CODE_39||o===fe.CODE_93||o===fe.CODE_128||o===fe.ITF||o===fe.RSS_14||o===fe.RSS_EXPANDED});a&&!t&&i.push(new ar(e)),n.includes(fe.QR_CODE)&&i.push(new Gr),n.includes(fe.DATA_MATRIX)&&i.push(new Hr),n.includes(fe.AZTEC)&&i.push(new Ur),n.includes(fe.PDF_417)&&i.push(new Xr),a&&t&&i.push(new ar(e))}i.length===0&&(t||i.push(new ar(e)),i.push(new Gr),i.push(new Hr),i.push(new Ur),i.push(new Xr),t&&i.push(new ar(e))),this.readers=i},r.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=pi(this.readers),i=n.next();!i.done;i=n.next()){var a=i.value;a.reset()}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new vi("No readers where selected, nothing can be read.");try{for(var i=pi(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;try{return o.decode(e,this.hints)}catch(s){if(s instanceof vi)continue}}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}throw new B("No MultiFormat Readers were able to detect the code.")},r}(),u1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){u1(e,r);function e(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var i=this,a=new Sa;return a.setHints(t),i=r.call(this,a,n)||this,i}return e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e})(vr);var l1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){l1(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Xr,t)||this}return e})(vr);var c1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){c1(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new Gr,t)||this}return e})(vr);var xn;(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(xn||(xn={}));const Pr=xn;var ba=function(){function r(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new zt(e,Int32Array.from([1])))}return r.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],i=this.field,a=t.length;a<=e;a++){var o=n.multiply(new zt(i,Int32Array.from([1,i.exp(a-1+i.getGeneratorBase())])));t.push(o),n=o}return t[e]},r.prototype.encode=function(e,t){if(t===0)throw new ue("No error correction bytes");var n=e.length-t;if(n<=0)throw new ue("No data bytes provided");var i=this.buildGenerator(t),a=new Int32Array(n);Le.arraycopy(e,0,a,0,n);var o=new zt(this.field,a);o=o.multiplyByMonomial(t,1);for(var s=o.divide(i)[1],f=s.getCoefficients(),u=t-f.length,l=0;l<u;l++)e[n+l]=0;Le.arraycopy(f,0,e,n+u,f.length)},r}(),mr=function(){function r(){}
8return r.applyMaskPenaltyRule1=function(e){return r.applyMaskPenaltyRule1Internal(e,!0)+r.applyMaskPenaltyRule1Internal(e,!1)},r.applyMaskPenaltyRule2=function(e){for(var t=0,n=e.getArray(),i=e.getWidth(),a=e.getHeight(),o=0;o<a-1;o++)for(var s=n[o],f=0;f<i-1;f++){var u=s[f];u===s[f+1]&&u===n[o+1][f]&&u===n[o+1][f+1]&&t++}return r.N2*t},r.applyMaskPenaltyRule3=function(e){for(var t=0,n=e.getArray(),i=e.getWidth(),a=e.getHeight(),o=0;o<a;o++)for(var s=0;s<i;s++){var f=n[o];s+6<i&&f[s]===1&&f[s+1]===0&&f[s+2]===1&&f[s+3]===1&&f[s+4]===1&&f[s+5]===0&&f[s+6]===1&&(r.isWhiteHorizontal(f,s-4,s)||r.isWhiteHorizontal(f,s+7,s+11))&&t++,o+6<a&&n[o][s]===1&&n[o+1][s]===0&&n[o+2][s]===1&&n[o+3][s]===1&&n[o+4][s]===1&&n[o+5][s]===0&&n[o+6][s]===1&&(r.isWhiteVertical(n,s,o-4,o)||r.isWhiteVertical(n,s,o+7,o+11))&&t++}return t*r.N3},r.isWhiteHorizontal=function(e,t,n){t=Math.max(t,0),n=Math.min(n,e.length);for(var i=t;i<n;i++)if(e[i]===1)return!1;return!0},r.isWhiteVertical=function(e,t,n,i){n=Math.max(n,0),i=Math.min(i,e.length);for(var a=n;a<i;a++)if(e[a][t]===1)return!1;return!0},r.applyMaskPenaltyRule4=function(e){for(var t=0,n=e.getArray(),i=e.getWidth(),a=e.getHeight(),o=0;o<a;o++)for(var s=n[o],f=0;f<i;f++)s[f]===1&&t++;var u=e.getHeight()*e.getWidth(),l=Math.floor(Math.abs(t*2-u)*10/u);return l*r.N4},r.getDataMaskBit=function(e,t,n){var i,a;switch(e){case 0:i=n+t&1;break;case 1:i=n&1;break;case 2:i=t%3;break;case 3:i=(n+t)%3;break;case 4:i=Math.floor(n/2)+Math.floor(t/3)&1;break;case 5:a=n*t,i=(a&1)+a%3;break;case 6:a=n*t,i=(a&1)+a%3&1;break;case 7:a=n*t,i=a%3+(n+t&1)&1;break;default:throw new ue("Invalid mask pattern: "+e)}return i===0},r.applyMaskPenaltyRule1Internal=function(e,t){for(var n=0,i=t?e.getHeight():e.getWidth(),a=t?e.getWidth():e.getHeight(),o=e.getArray(),s=0;s<i;s++){for(var f=0,u=-1,l=0;l<a;l++){var c=t?o[s][l]:o[l][s];c===u?f++:(f>=5&&(n+=r.N1+(f-5)),f=1,u=c)}f>=5&&(n+=r.N1+(f-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),d1=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},h1=function(){function r(e,t){this.width=e,this.height=t;for(var n=new Array(t),i=0;i!==t;i++)n[i]=new Uint8Array(e);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(e,t){return this.bytes[t][e]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},r.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=n?1:0},r.prototype.clear=function(e){var t,n;try{for(var i=d1(this.bytes),a=i.next();!a.done;a=i.next()){var o=a.value;$e.fill(o,e)}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;if(this.width!==t.width||this.height!==t.height)return!1;for(var n=0,i=this.height;n<i;++n)for(var a=this.bytes[n],o=t.bytes[n],s=0,f=this.width;s<f;++s)if(a[s]!==o[s])return!1;return!0},r.prototype.toString=function(){for(var e=new we,t=0,n=this.height;t<n;++t){for(var i=this.bytes[t],a=0,o=this.width;a<o;++a)switch(i[a]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append("  ");break}e.append(`
9`)}return e.toString()},r}(),wn=function(){function r(){this.maskPattern=-1}return r.prototype.getMode=function(){return this.mode},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getVersion=function(){return this.version},r.prototype.getMaskPattern=function(){return this.maskPattern},r.prototype.getMatrix=function(){return this.matrix},r.prototype.toString=function(){var e=new we;return e.append(`<<
10`),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(`
11 ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(`
12 version: `),e.append(this.version?this.version.toString():"null"),e.append(`
13 maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(`
14 matrix:
15`),e.append(this.matrix.toString())):e.append(`
16 matrix: null
17`),e.append(`>>
18`),e.toString()},r.prototype.setMode=function(e){this.mode=e},r.prototype.setECLevel=function(e){this.ecLevel=e},r.prototype.setVersion=function(e){this.version=e},r.prototype.setMaskPattern=function(e){this.maskPattern=e}
18,r.prototype.setMatrix=function(e){this.matrix=e},r.isValidMaskPattern=function(e){return e>=0&&e<r.NUM_MASK_PATTERNS},r.NUM_MASK_PATTERNS=8,r}(),v1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Ue=function(r){v1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="WriterException",e}(Ct),gi=function(){function r(){}return r.clearMatrix=function(e){e.clear(255)},r.buildMatrix=function(e,t,n,i,a){r.clearMatrix(a),r.embedBasicPatterns(n,a),r.embedTypeInfo(t,i,a),r.maybeEmbedVersionInfo(n,a),r.embedDataBits(e,i,a)},r.embedBasicPatterns=function(e,t){r.embedPositionDetectionPatternsAndSeparators(t),r.embedDarkDotAtLeftBottomCorner(t),r.maybeEmbedPositionAdjustmentPatterns(e,t),r.embedTimingPatterns(t)},r.embedTypeInfo=function(e,t,n){var i=new nt;r.makeTypeInfoBits(e,t,i);for(var a=0,o=i.getSize();a<o;++a){var s=i.get(i.getSize()-1-a),f=r.TYPE_INFO_COORDINATES[a],u=f[0],l=f[1];if(n.setBoolean(u,l,s),a<8){var c=n.getWidth()-a-1,d=8;n.setBoolean(c,d,s)}else{var c=8,d=n.getHeight()-7+(a-8);n.setBoolean(c,d,s)}}},r.maybeEmbedVersionInfo=function(e,t){if(!(e.getVersionNumber()<7)){var n=new nt;r.makeVersionInfoBits(e,n);for(var i=6*3-1,a=0;a<6;++a)for(var o=0;o<3;++o){var s=n.get(i);i--,t.setBoolean(a,t.getHeight()-11+o,s),t.setBoolean(t.getHeight()-11+o,a,s)}}},r.embedDataBits=function(e,t,n){for(var i=0,a=-1,o=n.getWidth()-1,s=n.getHeight()-1;o>0;){for(o===6&&(o-=1);s>=0&&s<n.getHeight();){for(var f=0;f<2;++f){var u=o-f;if(r.isEmpty(n.get(u,s))){var l=void 0;i<e.getSize()?(l=e.get(i),++i):l=!1,t!==255&&mr.getDataMaskBit(t,u,s)&&(l=!l),n.setBoolean(u,s,l)}}s+=a}a=-a,s+=a,o-=2}if(i!==e.getSize())throw new Ue("Not all bits consumed: "+i+"/"+e.getSize())},r.findMSBSet=function(e){return 32-me.numberOfLeadingZeros(e)},r.calculateBCHCode=function(e,t){if(t===0)throw new ue("0 polynomial");var n=r.findMSBSet(t);for(e<<=n-1;r.findMSBSet(e)>=n;)e^=t<<r.findMSBSet(e)-n;return e},r.makeTypeInfoBits=function(e,t,n){if(!wn.isValidMaskPattern(t))throw new Ue("Invalid mask pattern");var i=e.getBits()<<3|t;n.appendBits(i,5);var a=r.calculateBCHCode(i,r.TYPE_INFO_POLY);n.appendBits(a,10);var o=new nt;if(o.appendBits(r.TYPE_INFO_MASK_PATTERN,15),n.xor(o),n.getSize()!==15)throw new Ue("should not happen but we got: "+n.getSize())},r.makeVersionInfoBits=function(e,t){t.appendBits(e.getVersionNumber(),6);var n=r.calculateBCHCode(e.getVersionNumber(),r.VERSION_INFO_POLY);if(t.appendBits(n,12),t.getSize()!==18)throw new Ue("should not happen but we got: "+t.getSize())},r.isEmpty=function(e){return e===255},r.embedTimingPatterns=function(e){for(var t=8;t<e.getWidth()-8;++t){var n=(t+1)%2;r.isEmpty(e.get(t,6))&&e.setNumber(t,6,n),r.isEmpty(e.get(6,t))&&e.setNumber(6,t,n)}},r.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new Ue;e.setNumber(8,e.getHeight()-8,1)},r.embedHorizontalSeparationPattern=function(e,t,n){for(var i=0;i<8;++i){if(!r.isEmpty(n.get(e+i,t)))throw new Ue;n.setNumber(e+i,t,0)}},r.embedVerticalSeparationPattern=function(e,t,n){for(var i=0;i<7;++i){if(!r.isEmpty(n.get(e,t+i)))throw new Ue;n.setNumber(e,t+i,0)}},r.embedPositionAdjustmentPattern=function(e,t,n){for(var i=0;i<5;++i)for(var a=r.POSITION_ADJUSTMENT_PATTERN[i],o=0;o<5;++o)n.setNumber(e+o,t+i,a[o])},r.embedPositionDetectionPattern=function(e,t,n){for(var i=0;i<7;++i)for(var a=r.POSITION_DETECTION_PATTERN[i],o=0;o<7;++o)n.setNumber(e+o,t+i,a[o])},r.embedPositionDetectionPatternsAndSeparators=function(e){var t=r.POSITION_DETECTION_PATTERN[0].length;r.embedPositionDetectionPattern(0,0,e),r.embedPositionDetectionPattern(e.getWidth()-t,0,e),r.embedPositionDetectionPattern(0,e.getWidth()-t,e);var n=8;r.embedHorizontalSeparationPattern(0,n-1,e),r.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e),r.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);var i=7;r.embedVerticalSeparationPattern(i,0,e),r.embedVerticalSeparationPattern(e.getHeight()-i-1,0,e),r.embedVerticalSeparationPattern(i,e.getHeight()-i,e)},r.maybeEmbedPositionAdjustmentPatterns=function(e,t){if(!(e.getVersionNumber()<2))for(var n=e.getVersionNumber()-1,i=r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],a=0,o=i.length;a!==o;a++){var s=i[a];if(s>=0)for(var f=0;f!==o;f++){var u=i[f];u>=0&&r.isEmpty(t.get(u,s))&&r.embedPositionAdjustmentPattern(u-2,s-2,t)}}},r.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),r.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),p1=function(){function r(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),_i=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function r(){}
18return r.calculateMaskPenalty=function(e){return mr.applyMaskPenaltyRule1(e)+mr.applyMaskPenaltyRule2(e)+mr.applyMaskPenaltyRule3(e)+mr.applyMaskPenaltyRule4(e)},r.encode=function(e,t,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,a=n!==null&&n.get(Pr.CHARACTER_SET)!==void 0;a&&(i=n.get(Pr.CHARACTER_SET).toString());var o=this.chooseMode(e,i),s=new nt;if(o===Ve.BYTE&&(a||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var f=Qe.getCharacterSetECIByName(i);f!==void 0&&this.appendECI(f,s)}this.appendModeInfo(o,s);var u=new nt;this.appendBytes(e,o,u,i);var l;if(n!==null&&n.get(Pr.QR_VERSION)!==void 0){var c=Number.parseInt(n.get(Pr.QR_VERSION).toString(),10);l=Qt.getVersionForNumber(c);var d=this.calculateBitsNeeded(o,s,u,l);if(!this.willFit(d,l,t))throw new Ue("Data too big for requested version")}else l=this.recommendVersion(t,o,s,u);var h=new nt;h.appendBitArray(s);var v=o===Ve.BYTE?u.getSizeInBytes():e.length;this.appendLengthInfo(v,l,o,h),h.appendBitArray(u);var p=l.getECBlocksForLevel(t),y=l.getTotalCodewords()-p.getTotalECCodewords();this.terminateBits(y,h);var g=this.interleaveWithECBytes(h,l.getTotalCodewords(),y,p.getNumBlocks()),w=new wn;w.setECLevel(t),w.setMode(o),w.setVersion(l);var A=l.getDimensionForVersion(),x=new h1(A,A),m=this.chooseMaskPattern(g,t,l,x);return w.setMaskPattern(m),gi.buildMatrix(g,t,l,m,x),w.setMatrix(x),w},r.recommendVersion=function(e,t,n,i){var a=this.calculateBitsNeeded(t,n,i,Qt.getVersionForNumber(1)),o=this.chooseVersion(a,e),s=this.calculateBitsNeeded(t,n,i,o);return this.chooseVersion(s,e)},r.calculateBitsNeeded=function(e,t,n,i){return t.getSize()+e.getCharacterCountBits(i)+n.getSize()},r.getAlphanumericCode=function(e){return e<r.ALPHANUMERIC_TABLE.length?r.ALPHANUMERIC_TABLE[e]:-1},r.chooseMode=function(e,t){if(t===void 0&&(t=null),Qe.SJIS.getName()===t&&this.isOnlyDoubleByteKanji(e))return Ve.KANJI;for(var n=!1,i=!1,a=0,o=e.length;a<o;++a){var s=e.charAt(a);if(r.isDigit(s))n=!0;else if(this.getAlphanumericCode(s.charCodeAt(0))!==-1)i=!0;else return Ve.BYTE}return i?Ve.ALPHANUMERIC:n?Ve.NUMERIC:Ve.BYTE},r.isOnlyDoubleByteKanji=function(e){var t;try{t=Ot.encode(e,Qe.SJIS)}catch{return!1}var n=t.length;if(n%2!==0)return!1;for(var i=0;i<n;i+=2){var a=t[i]&255;if((a<129||a>159)&&(a<224||a>235))return!1}return!0},r.chooseMaskPattern=function(e,t,n,i){for(var a=Number.MAX_SAFE_INTEGER,o=-1,s=0;s<wn.NUM_MASK_PATTERNS;s++){gi.buildMatrix(e,t,n,s,i);var f=this.calculateMaskPenalty(i);f<a&&(a=f,o=s)}return o},r.chooseVersion=function(e,t){for(var n=1;n<=40;n++){var i=Qt.getVersionForNumber(n);if(r.willFit(e,i,t))return i}throw new Ue("Data too big")},r.willFit=function(e,t,n){var i=t.getTotalCodewords(),a=t.getECBlocksForLevel(n),o=a.getTotalECCodewords(),s=i-o,f=(e+7)/8;return s>=f},r.terminateBits=function(e,t){var n=e*8;if(t.getSize()>n)throw new Ue("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(var i=0;i<4&&t.getSize()<n;++i)t.appendBit(!1);var a=t.getSize()&7;if(a>0)for(var i=a;i<8;i++)t.appendBit(!1);for(var o=e-t.getSizeInBytes(),i=0;i<o;++i)t.appendBits(i&1?17:236,8);if(t.getSize()!==n)throw new Ue("Bits size does not equal capacity")},r.getNumDataBytesAndNumECBytesForBlockID=function(e,t,n,i,a,o){if(i>=n)throw new Ue("Block ID too large");var s=e%n,f=n-s,u=Math.floor(e/n),l=u+1,c=Math.floor(t/n),d=c+1,h=u-c,v=l-d;if(h!==v)throw new Ue("EC bytes mismatch");if(n!==f+s)throw new Ue("RS blocks mismatch");if(e!==(c+h)*f+(d+v)*s)throw new Ue("Total bytes mismatch");i<f?(a[0]=c,o[0]=h):(a[0]=d,o[0]=v)},r.interleaveWithECBytes=function(e,t,n,i){var a,o,s,f;if(e.getSizeInBytes()!==n)throw new Ue("Number of bits and data bytes does not match");for(var u=0,l=0,c=0,d=new Array,h=0;h<i;++h){var v=new Int32Array(1),p=new Int32Array(1);r.getNumDataBytesAndNumECBytesForBlockID(t,n,i,h,v,p);var y=v[0],g=new Uint8Array(y);e.toBytes(8*u,g,0,y);var w=r.generateECBytes(g,p[0]);d.push(new p1(g,w)),l=Math.max(l,y),c=Math.max(c,w.length),u+=v[0]}if(n!==u)throw new Ue("Data bytes does not match offset");for(var A=new nt,h=0;h<l;++h)try{for(var x=(a=void 0,_i(d)),m=x.next();!m.done;m=x.next()){var S=m.value,g=S.getDataBytes();h<g.length&&A.appendBits(g[h],8)}}catch(G){a={error:G}}finally{try{m&&!m.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}for(var h=0;h<c;++h)try{for(var b=(s=void 0,_i(d)),D=b.next();!D.done;D=b.next()){var S=D.value,w=S.getErrorCorrectionBytes();h<w.length&&A.appendBits(w[h],8)}}catch(G){s={error:G}}finally{try{D&&!D.done&&(f=b.return)&&f.call(b)}finally{if(s)throw s.error}}if(t!==A.getSizeInBytes())throw new Ue("Interleaving error: "+t+" and "+A.getSizeInBytes()+" differ.");return A},r.generateECBytes=function(e,t){for(var n=e.length,i=new Int32Array(n+t),a=0;a<n;a++)i[a]=e[a]&255;new ba(Et.QR_CODE_FIELD_256).encode(i,t);for(var o=new Uint8Array(t),a=0;a<t;a++)o[a]=i[n+a];return o},r.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},r.appendLengthInfo=function(e,t,n,i){var a=n.getCharacterCountBits(t);if(e>=1<<a)throw new Ue(e+" is bigger than "+((1<<a)-1));i.appendBits(e,a)},r.appendBytes=function(e,t,n,i){switch(t){case Ve.NUMERIC:r.appendNumericBytes(e,n);break;case Ve.ALPHANUMERIC:r.appendAlphanumericBytes(e,n);break;case Ve.BYTE:r.append8BitBytes(e,n,i);break;case Ve.KANJI:r.appendKanjiBytes(e,n);break;default:throw new Ue("Invalid mode: "+t)}},r.getDigit=function(e){return e.charCodeAt(0)-48},r.isDigit=function(e){var t=r.getDigit(e);return t>=0&&t<=9},r.appendNumericBytes=function(e,t){for(var n=e.length,i=0;i<n;){var a=r.getDigit(e.charAt(i));if(i+2<n){var o=r.getDigit(e.charAt(i+1)),s=r.getDigit(e.charAt(i+2));t.appendBits(a*100+o*10+s,10),i+=3}else if(i+1<n){var o=r.getDigit(e.charAt(i+1));t.appendBits(a*10+o,7),i+=2}else t.appendBits(a,4),i++}
18},r.appendAlphanumericBytes=function(e,t){for(var n=e.length,i=0;i<n;){var a=r.getAlphanumericCode(e.charCodeAt(i));if(a===-1)throw new Ue;if(i+1<n){var o=r.getAlphanumericCode(e.charCodeAt(i+1));if(o===-1)throw new Ue;t.appendBits(a*45+o,11),i+=2}else t.appendBits(a,6),i++}},r.append8BitBytes=function(e,t,n){var i;try{i=Ot.encode(e,n)}catch(f){throw new Ue(f)}for(var a=0,o=i.length;a!==o;a++){var s=i[a];t.appendBits(s,8)}},r.appendKanjiBytes=function(e,t){var n;try{n=Ot.encode(e,Qe.SJIS)}catch(c){throw new Ue(c)}for(var i=n.length,a=0;a<i;a+=2){var o=n[a]&255,s=n[a+1]&255,f=o<<8&4294967295|s,u=-1;if(f>=33088&&f<=40956?u=f-33088:f>=57408&&f<=60351&&(u=f-49472),u===-1)throw new Ue("Invalid byte sequence");var l=(u>>8)*192+(u&255);t.appendBits(l,13)}},r.appendECI=function(e,t){t.appendBits(Ve.ECI.getBits(),4),t.appendBits(e.getValue(),8)},r.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),r.DEFAULT_BYTE_MODE_ENCODING=Qe.UTF8.getName(),r})();var g1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){g1(e,r);function e(t,n,i,a,o,s,f,u){var l=r.call(this,s,f)||this;if(l.yuvData=t,l.dataWidth=n,l.dataHeight=i,l.left=a,l.top=o,a+s>n||o+f>i)throw new ue("Crop rectangle does not fit within image data.");return u&&l.reverseHorizontal(s,f),l}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new ue("Requested row is outside the image: "+t);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var a=(t+this.top)*this.dataWidth+this.left;return Le.arraycopy(this.yuvData,a,n,0,i),n},e.prototype.getMatrix=function(){var t=this.getWidth(),n=this.getHeight();if(t===this.dataWidth&&n===this.dataHeight)return this.yuvData;var i=t*n,a=new Uint8ClampedArray(i),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Le.arraycopy(this.yuvData,o,a,0,i),a;for(var s=0;s<n;s++){var f=s*t;Le.arraycopy(this.yuvData,o,a,f,t),o+=this.dataWidth}return a},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,n,i,a){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+n,i,a,!1)},e.prototype.renderThumbnail=function(){for(var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,n=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,i=new Int32Array(t*n),a=this.yuvData,o=this.top*this.dataWidth+this.left,s=0;s<n;s++){for(var f=s*t,u=0;u<t;u++){var l=a[o+u*e.THUMBNAIL_SCALE_FACTOR]&255;i[f+u]=4278190080|l*65793}o+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return i},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(t,n){for(var i=this.yuvData,a=0,o=this.top*this.dataWidth+this.left;a<n;a++,o+=this.dataWidth)for(var s=o+t/2,f=o,u=o+t-1;f<s;f++,u--){var l=i[f];i[f]=i[u],i[u]=l}},e.prototype.invert=function(){return new Zr(this)},e.THUMBNAIL_SCALE_FACTOR=2,e})(Sr);var _1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){_1(e,r);function e(t,n,i,a,o,s,f){var u=r.call(this,n,i)||this;if(u.dataWidth=a,u.dataHeight=o,u.left=s,u.top=f,t.BYTES_PER_ELEMENT===4){for(var l=n*i,c=new Uint8ClampedArray(l),d=0;d<l;d++){var h=t[d],v=h>>16&255,p=h>>7&510,y=h&255;c[d]=(v+p+y)/4&255}u.luminances=c}else u.luminances=t;if(a===void 0&&(u.dataWidth=n),o===void 0&&(u.dataHeight=i),s===void 0&&(u.left=0),f===void 0&&(u.top=0),u.left+n>u.dataWidth||u.top+i>
18u.dataHeight)throw new ue("Crop rectangle does not fit within image data.");return u}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new ue("Requested row is outside the image: "+t);var i=this.getWidth();(n==null||n.length<i)&&(n=new Uint8ClampedArray(i));var a=(t+this.top)*this.dataWidth+this.left;return Le.arraycopy(this.luminances,a,n,0,i),n},e.prototype.getMatrix=function(){var t=this.getWidth(),n=this.getHeight();if(t===this.dataWidth&&n===this.dataHeight)return this.luminances;var i=t*n,a=new Uint8ClampedArray(i),o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return Le.arraycopy(this.luminances,o,a,0,i),a;for(var s=0;s<n;s++){var f=s*t;Le.arraycopy(this.luminances,o,a,f,t),o+=this.dataWidth}return a},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,n,i,a){return new e(this.luminances,i,a,this.dataWidth,this.dataHeight,this.left+t,this.top+n)},e.prototype.invert=function(){return new Zr(this)},e})(Sr);var y1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),x1=function(r){y1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.forName=function(t){return this.getCharacterSetECIByName(t)},e}(Qe),w1=function(){function r(){}return r.ISO_8859_1=Qe.ISO8859_1,r}(),An,A1=301,m1=function(r,e){for(var t=1,n=0;n<255;n++)e[n]=t,r[t]=n,t*=2,t>=256&&(t^=A1);return{LOG:r,ALOG:e}};An=m1([],[]),An.LOG;An.ALOG;var yi;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(yi||(yi={}));var xi=129,Oa=230,E1=231,C1=235,I1=236,S1=237,b1=238,O1=239,T1=240,an=254,D1=254,wi="[)>�05�",Ai="[)>�06�",mi="��",Me=0,ut=1,xt=2,Ke=3,rt=4,dt=5,N1=function(){function r(){}return r.prototype.getEncodingMode=function(){return Me},r.prototype.encode=function(e){var t=Nt.determineConsecutiveDigitCount(e.getMessage(),e.pos);if(t>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var n=e.getCurrentChar(),i=Nt.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case dt:e.writeCodeword(E1),e.signalEncoderChange(dt);return;case ut:e.writeCodeword(Oa),e.signalEncoderChange(ut);return;case Ke:e.writeCodeword(b1),e.signalEncoderChange(Ke);break;case xt:e.writeCodeword(O1),e.signalEncoderChange(xt);break;case rt:e.writeCodeword(T1),e.signalEncoderChange(rt);break;default:throw new Error("Illegal mode: "+i)}else Nt.isExtendedASCII(n)?(e.writeCodeword(C1),e.writeCodeword(n-128+1),e.pos++):(e.writeCodeword(n+1),e.pos++)}},r.prototype.encodeASCIIDigits=function(e,t){if(Nt.isDigit(e)&&Nt.isDigit(t)){var n=(e-48)*10+(t-48);return n+130}throw new Error("not digits: "+e+t)},r}(),R1=function(){function r(){}return r.prototype.getEncodingMode=function(){return dt},r.prototype.encode=function(e){var t=new we;for(t.append(0);e.hasMoreCharacters();){var n=e.getCurrentChar();t.append(n),e.pos++;var i=Nt.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){e.signalEncoderChange(Me);break}}var a=t.length()-1,o=1,s=e.getCodewordCount()+a+o;e.updateSymbolInfo(s);var f=e.getSymbolInfo().getDataCapacity()-s>0;if(e.hasMoreCharacters()||f)if(a<=249)t.setCharAt(0,Ce.getCharAt(a));else if(a<=1555)t.setCharAt(0,Ce.getCharAt(Math.floor(a/250)+249)),t.insert(1,Ce.getCharAt(a%250));else throw new Error("Message length not in valid ranges: "+a);for(var u=0,n=t.length();u<n;u++)e.writeCodeword(this.randomize255State(t.charAt(u).charCodeAt(0),e.getCodewordCount()+1))},r.prototype.randomize255State=function(e,t){var n=149*t%255+1,i=e+n;return i<=255?i:i-256},r}(),Tn=function(){function r(){}return r.prototype.getEncodingMode=function(){return ut},r.prototype.encodeMaximal=function(e){for(var t=new we,n=0,i=e.pos,a=0;e.hasMoreCharacters();){var o=e.getCurrentChar();e.pos++,n=this.encodeChar(o,t),t.length()%3===0&&(i=e.pos,a=t.length())}if(a!==t.length()){var s=Math.floor(t.length()/3*2),f=Math.floor(e.getCodewordCount()+s+1);e.updateSymbolInfo(f);var u=e.getSymbolInfo().getDataCapacity()-f,l=Math.floor(t.length()%3);(l===2&&u!==2||l===1&&(n>3||u!==1))&&(e.pos=i)}t.length()>0&&e.writeCodeword(Oa),this.handleEOD(e,t)},r.prototype.encode=function(e){for(var t=new we;e.hasMoreCharacters();){var n=e.getCurrentChar();e.pos++;var i=this.encodeChar(n,t),a=Math.floor(t.length()/3)*2,o=e.getCodewordCount()+a;e.updateSymbolInfo(o);var s=e.getSymbolInfo().getDataCapacity()-o;if(!e.hasMoreCharacters()){var f=new we;for(t.length()%3===2&&s!==2&&(i=this.backtrackOneCharacter(e,t,f,i));t.length()%3===1&&(i>3||s!==1);)i=this.backtrackOneCharacter(e,t,f,i);break}var u=t.length();if(u%3===0){var l=Nt.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(l!==this.getEncodingMode()){e.signalEncoderChange(Me);break}}}this.handleEOD(e,t)},r.prototype.backtrackOneCharacter=function(e,t,n,i){var a=t.length(),o=t.toString().substring(0,a-i);t.setLengthToZero(),t.append(o),e.pos--;var s=e.getCurrentChar();return i=this.encodeChar(s,n),e.resetSymbolInfo(),i},r.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(3);t.setLengthToZero(),t.append(n)},r.prototype.handleEOD=function(e,t){var n=Math.floor(t.length()/3*2),i=t.length()%3,a=e.getCodewordCount()+n;e.updateSymbolInfo(a);var o=e.getSymbolInfo().getDataCapacity()-a;if(i===2){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(an)}else if(o===1&&i===1){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(an),e.pos--}else if(i===0){for(;t.length()>=3;)this.writeNextTriplet(e,t);(o>0||e.hasMoreCharacters())&&e.writeCodeword(an)}else throw new Error("Unexpected case. Please report!");e.signalEncoderChange(Me)},r.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=65&&e<=90)return t.append(e-65+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e<=95)return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append("1�");var n=2;return n+=this.encodeChar(e-128,t),n},r.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,n=t/256,i=t%256,a=new we;return a.append(n),a.append(i),a.toString()},r}(),P1=function(){function r(){}return r.prototype.getEncodingMode=function(){return rt},r.prototype.encode=function(e){for(var t=new we;e.hasMoreCharacters();){var n=e.getCurrentChar();this.encodeChar(n,t),e.pos++;var i=t.length();if(i>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var a=t.toString().substring(4);t.setLengthToZero(),t.append(a);var o=Nt.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){e.signalEncoderChange(Me);break}}}t.append(Ce.getCharAt(31)),this.handleEOD(e,t)},r.prototype.handleEOD=function(e,t){try{var n=t.length();if(n===0)return;if(n===1){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),a=e.getRemainingCharacters();if(a>i&&(e.updateSymbolInfo(e.getCodewordCount()+1),i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),a<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var o=n-1,s=this.encodeToCodewords(t.toString()),f=!e.hasMoreCharacters(),u=f&&o<=2;if(o<=2){e.updateSymbolInfo(e.getCodewordCount()+o);var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();i>=3&&(u=!1,e.updateSymbolInfo(e.getCodewordCount()+s.length))}u?(e.resetSymbolInfo(),e.pos-=o):e.writeCodewords(s)}
18finally{e.signalEncoderChange(Me)}},r.prototype.encodeChar=function(e,t){e>=32&&e<=63?t.append(e):e>=64&&e<=94?t.append(Ce.getCharAt(e-64)):Nt.illegalCharacter(Ce.getCharAt(e))},r.prototype.encodeToCodewords=function(e){var t=e.length;if(t===0)throw new Error("StringBuilder must not be empty");var n=e.charAt(0).charCodeAt(0),i=t>=2?e.charAt(1).charCodeAt(0):0,a=t>=3?e.charAt(2).charCodeAt(0):0,o=t>=4?e.charAt(3).charCodeAt(0):0,s=(n<<18)+(i<<12)+(a<<6)+o,f=s>>16&255,u=s>>8&255,l=s&255,c=new we;return c.append(f),t>=2&&c.append(u),t>=3&&c.append(l),c.toString()},r}(),M1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),B1=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ne=function(){function r(e,t,n,i,a,o,s,f){s===void 0&&(s=0),f===void 0&&(f=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=a,this.dataRegions=o,this.rsBlockData=s,this.rsBlockError=f}return r.lookup=function(e,t,n,i,a){var o,s;t===void 0&&(t=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!0);try{for(var f=B1(L1),u=f.next();!u.done;u=f.next()){var l=u.value;if(!(t===1&&l.rectangular)&&!(t===2&&!l.rectangular)&&!(n!=null&&(l.getSymbolWidth()<n.getWidth()||l.getSymbolHeight()<n.getHeight()))&&!(i!=null&&(l.getSymbolWidth()>i.getWidth()||l.getSymbolHeight()>i.getHeight()))&&e<=l.dataCapacity)return l}}catch(c){o={error:c}}finally{try{u&&!u.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}if(a)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},r}(),F1=function(r){M1(e,r);function e(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return e.prototype.getInterleavedBlockCount=function(){return 10},e.prototype.getDataLengthForInterleavedBlock=function(t){return t<=8?156:155},e}(Ne),L1=[new Ne(!1,3,5,8,8,1),new Ne(!1,5,7,10,10,1),new Ne(!0,5,7,16,6,1),new Ne(!1,8,10,12,12,1),new Ne(!0,10,11,14,6,2),new Ne(!1,12,12,14,14,1),new Ne(!0,16,14,24,10,1),new Ne(!1,18,14,16,16,1),new Ne(!1,22,18,18,18,1),new Ne(!0,22,18,16,10,2),new Ne(!1,30,20,20,20,1),new Ne(!0,32,24,16,14,2),new Ne(!1,36,24,22,22,1),new Ne(!1,44,28,24,24,1),new Ne(!0,49,28,22,14,2),new Ne(!1,62,36,14,14,4),new Ne(!1,86,42,16,16,4),new Ne(!1,114,48,18,18,4),new Ne(!1,144,56,20,20,4),new Ne(!1,174,68,22,22,4),new Ne(!1,204,84,24,24,4,102,42),new Ne(!1,280,112,14,14,16,140,56),new Ne(!1,368,144,16,16,16,92,36),new Ne(!1,456,192,18,18,16,114,48),new Ne(!1,576,224,20,20,16,144,56),new Ne(!1,696,272,22,22,16,174,68),new Ne(!1,816,336,24,24,16,136,56),new Ne(!1,1050,408,18,18,36,175,68),new Ne(!1,1304,496,20,20,36,163,62),new F1],k1=function(){function r(e){this.msg=e,this.pos=0,this.skipAtEnd=0;
18for(var t=e.split("").map(function(s){return s.charCodeAt(0)}),n=new we,i=0,a=t.length;i<a;i++){var o=String.fromCharCode(t[i]&255);if(o==="?"&&e.charAt(i)!=="?")throw new Error("Message contains characters outside ISO-8859-1 encoding.");n.append(o)}this.msg=n.toString(),this.shape=0,this.codewords=new we,this.newEncoding=-1}return r.prototype.setSymbolShape=function(e){this.shape=e},r.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},r.prototype.getMessage=function(){return this.msg},r.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},r.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},r.prototype.getCodewords=function(){return this.codewords},r.prototype.writeCodewords=function(e){this.codewords.append(e)},r.prototype.writeCodeword=function(e){this.codewords.append(e)},r.prototype.getCodewordCount=function(){return this.codewords.length()},r.prototype.getNewEncoding=function(){return this.newEncoding},r.prototype.signalEncoderChange=function(e){this.newEncoding=e},r.prototype.resetEncoderSignal=function(){this.newEncoding=-1},r.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},r.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},r.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},r.prototype.getSymbolInfo=function(){return this.symbolInfo},r.prototype.updateSymbolInfo=function(e){e===void 0&&(e=this.getCodewordCount()),(this.symbolInfo==null||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=Ne.lookup(e,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),U1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),V1=function(r){U1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return Ke},e.prototype.encode=function(t){for(var n=new we;t.hasMoreCharacters();){var i=t.getCurrentChar();t.pos++,this.encodeChar(i,n);var a=n.length();if(a%3===0){this.writeNextTriplet(t,n);var o=Nt.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){t.signalEncoderChange(Me);break}}}this.handleEOD(t,n)},e.prototype.encodeChar=function(t,n){switch(t){case 13:n.append(0);break;case 42:n.append(1);break;case 62:n.append(2);break;case 32:n.append(3);break;default:t>=48&&t<=57?n.append(t-48+4):t>=65&&t<=90?n.append(t-65+14):Nt.illegalCharacter(Ce.getCharAt(t));break}return 1},e.prototype.handleEOD=function(t,n){t.updateSymbolInfo();var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),a=n.length();t.pos-=a,(t.getRemainingCharacters()>1||i>1||t.getRemainingCharacters()!==i)&&t.writeCodeword(D1),t.getNewEncoding()<0&&t.signalEncoderChange(Me)},e}(Tn),H1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),G1=function(r){H1(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return xt},e.prototype.encodeChar=function(t,n){if(t===32)return n.append(3),1;if(t>=48&&t<=57)return n.append(t-48+4),1;if(t>=97&&t<=122)return n.append(t-97+14),1;if(t<32)return n.append(0),n.append(t),2;if(t<=47)return n.append(1),n.append(t-33),2;if(t<=64)return n.append(1),n.append(t-58+15),2;if(t>=91&&t<=95)return n.append(1),n.append(t-91+22),2;if(t===96)return n.append(2),n.append(0),2;if(t<=90)return n.append(2),n.append(t-65+1),2;if(t<=127)return n.append(2),n.append(t-123+27),2;n.append("1�");var i=2;return i+=this.encodeChar(t-128,n),i},e}(Tn),X1=function(){function r(){}return r.randomize253State=function(e){var t=149*e%253+1,n=xi+t;return n<=254?n:n-254},r.encodeHighLevel=function(e,t,n,i,a){t===void 0&&(t=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!1);var o=new Tn,s=[new N1,o,new G1,new V1,new P1,new R1],f=new k1(e);f.setSymbolShape(t),f.setSizeConstraints(n,i),e.startsWith(wi)&&e.endsWith(mi)?(f.writeCodeword(I1),f.setSkipAtEnd(2),f.pos+=wi.length):e.startsWith(Ai)&&e.endsWith(mi)&&(f.writeCodeword(S1),f.setSkipAtEnd(2),f.pos+=Ai.length);var u=Me;
18for(a&&(o.encodeMaximal(f),u=f.getNewEncoding(),f.resetEncoderSignal());f.hasMoreCharacters();)s[u].encode(f),f.getNewEncoding()>=0&&(u=f.getNewEncoding(),f.resetEncoderSignal());var l=f.getCodewordCount();f.updateSymbolInfo();var c=f.getSymbolInfo().getDataCapacity();l<c&&u!==Me&&u!==dt&&u!==rt&&f.writeCodeword("þ");var d=f.getCodewords();for(d.length()<c&&d.append(xi);d.length()<c;)d.append(this.randomize253State(d.length()+1));return f.getCodewords().toString()},r.lookAheadTest=function(e,t,n){var i=this.lookAheadTestIntern(e,t,n);if(n===Ke&&i===Ke){for(var a=Math.min(t+3,e.length),o=t;o<a;o++)if(!this.isNativeX12(e.charCodeAt(o)))return Me}else if(n===rt&&i===rt){for(var a=Math.min(t+4,e.length),o=t;o<a;o++)if(!this.isNativeEDIFACT(e.charCodeAt(o)))return Me}return i},r.lookAheadTestIntern=function(e,t,n){if(t>=e.length)return n;var i;n===Me?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var a=0,o=new Uint8Array(6),s=[];;){if(t+a===e.length){$e.fill(o,0),$e.fill(s,0);var f=this.findMinimums(i,s,me.MAX_VALUE,o),u=this.getMinimumCount(o);if(s[Me]===f)return Me;if(u===1){if(o[dt]>0)return dt;if(o[rt]>0)return rt;if(o[xt]>0)return xt;if(o[Ke]>0)return Ke}return ut}var l=e.charCodeAt(t+a);if(a++,this.isDigit(l)?i[Me]+=.5:this.isExtendedASCII(l)?(i[Me]=Math.ceil(i[Me]),i[Me]+=2):(i[Me]=Math.ceil(i[Me]),i[Me]++),this.isNativeC40(l)?i[ut]+=2/3:this.isExtendedASCII(l)?i[ut]+=8/3:i[ut]+=4/3,this.isNativeText(l)?i[xt]+=2/3:this.isExtendedASCII(l)?i[xt]+=8/3:i[xt]+=4/3,this.isNativeX12(l)?i[Ke]+=2/3:this.isExtendedASCII(l)?i[Ke]+=13/3:i[Ke]+=10/3,this.isNativeEDIFACT(l)?i[rt]+=3/4:this.isExtendedASCII(l)?i[rt]+=17/4:i[rt]+=13/4,this.isSpecialB256(l)?i[dt]+=4:i[dt]++,a>=4){if($e.fill(o,0),$e.fill(s,0),this.findMinimums(i,s,me.MAX_VALUE,o),s[Me]<this.min(s[dt],s[ut],s[xt],s[Ke],s[rt]))return Me;if(s[dt]<s[Me]||s[dt]+1<this.min(s[ut],s[xt],s[Ke],s[rt]))return dt;if(s[rt]+1<this.min(s[dt],s[ut],s[xt],s[Ke],s[Me]))return rt;if(s[xt]+1<this.min(s[dt],s[ut],s[rt],s[Ke],s[Me]))return xt;if(s[Ke]+1<this.min(s[dt],s[ut],s[rt],s[xt],s[Me]))return Ke;if(s[ut]+1<this.min(s[Me],s[dt],s[rt],s[xt])){if(s[ut]<s[Ke])return ut;if(s[ut]===s[Ke]){for(var c=t+a+1;c<e.length;){var d=e.charCodeAt(c);if(this.isX12TermSep(d))return Ke;if(!this.isNativeX12(d))break;c++}return ut}}}}},r.min=function(e,t,n,i,a){var o=Math.min(e,Math.min(t,Math.min(n,i)));return a===void 0?o:Math.min(o,a)},r.findMinimums=function(e,t,n,i){for(var a=0;a<6;a++){var o=t[a]=Math.ceil(e[a]);n>o&&(n=o,$e.fill(i,0)),n===o&&(i[a]=i[a]+1)}return n},r.getMinimumCount=function(e){for(var t=0,n=0;n<6;n++)t+=e[n];return t||0},r.isDigit=function(e){return e>=48&&e<=57},r.isExtendedASCII=function(e){return e>=128&&e<=255},r.isNativeC40=function(e){return e===32||e>=48&&e<=57||e>=65&&e<=90},r.isNativeText=function(e){return e===32||e>=48&&e<=57||e>=97&&e<=122},r.isNativeX12=function(e){return this.isX12TermSep(e)||e===32||e>=48&&e<=57||e>=65&&e<=90},r.isX12TermSep=function(e){return e===13||e===42||e===62},r.isNativeEDIFACT=function(e){return e>=32&&e<=94},r.isSpecialB256=function(e){return!1},r.determineConsecutiveDigitCount=function(e,t){t===void 0&&(t=0);for(var n=e.length,i=t;i<n&&this.isDigit(e.charCodeAt(i));)i++;return i-t},r.illegalCharacter=function(e){var t=me.toHexString(e.charCodeAt(0));throw t="0000".substring(0,4-t.length)+t,new Error("Illegal character: "+e+" (0x"+t+")")},r}();const Nt=X1;var on=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ei=function(){function r(e){this.charset=e,this.name=e.name}return r.prototype.canEncode=function(e){try{return Ot.encode(e,this.charset)!=null}catch{return!1}},r}(),W1=function(){function r(e,t,n){var i,a,o,s,f,u;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","
18windows-1256","Shift_JIS"].map(function(M){return new Ei(x1.forName(M))}),this.encoders=[];var l=[];l.push(new Ei(w1.ISO_8859_1));for(var c=t!=null&&t.name.startsWith("UTF"),d=0;d<e.length;d++){var h=!1;try{for(var v=(i=void 0,on(l)),p=v.next();!p.done;p=v.next()){var y=p.value,g=e.charAt(d),w=g.charCodeAt(0);if(w===n||y.canEncode(g)){h=!0;break}}}catch(M){i={error:M}}finally{try{p&&!p.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}if(!h)try{for(var A=(o=void 0,on(this.ENCODERS)),x=A.next();!x.done;x=A.next()){var y=x.value;if(y.canEncode(e.charAt(d))){l.push(y),h=!0;break}}}catch(M){o={error:M}}finally{try{x&&!x.done&&(s=A.return)&&s.call(A)}finally{if(o)throw o.error}}h||(c=!0)}if(l.length===1&&!c)this.encoders=[l[0]];else{this.encoders=[];var m=0;try{for(var S=on(l),b=S.next();!b.done;b=S.next()){var y=b.value;this.encoders[m++]=y}}catch(M){f={error:M}}finally{try{b&&!b.done&&(u=S.return)&&u.call(S)}finally{if(f)throw f.error}}}var D=-1;if(t!=null){for(var d=0;d<this.encoders.length;d++)if(this.encoders[d]!=null&&t.name===this.encoders[d].name){D=d;break}}this.priorityEncoderIndex=D}return r.prototype.length=function(){return this.encoders.length},r.prototype.getCharsetName=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].name},r.prototype.getCharset=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].charset},r.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},r.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},r.prototype.canEncode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return!0},r.prototype.encode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return Ot.encode(Ce.getCharAt(e),this.encoders[t].name)},r}(),z1=3,j1=function(){function r(e,t,n){this.fnc1=n;var i=new W1(e,t,n);if(i.length()===1)for(var a=0;a<this.bytes.length;a++){var o=e.charAt(a).charCodeAt(0);this.bytes[a]=o===n?1e3:o}else this.bytes=this.encodeMinimally(e,i,n)}return r.prototype.getFNC1Character=function(){return this.fnc1},r.prototype.length=function(){return this.bytes.length},r.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var n=0;n<t;n++)if(this.isECI(e+n))return!1;return!0},r.prototype.charAt=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},r.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var n=new we,i=e;i<t;i++){if(this.isECI(i))throw new Error("value at "+i+" is not a character but an ECI");n.append(this.charAt(i))}return n.toString()},r.prototype.isECI=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},r.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]===1e3},r.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},r.prototype.addEdge=function(e,t,n){(e[t][n.encoderIndex]==null||e[t][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(e[t][n.encoderIndex]=n)},r.prototype.addEdges=function(e,t,n,i,a,o){var s=e.charAt(i).charCodeAt(0),f=0,u=t.length();t.getPriorityEncoderIndex()>=0&&(s===o||t.canEncode(s,t.getPriorityEncoderIndex()))&&(f=t.getPriorityEncoderIndex(),u=f+1);for(var l=f;l<u;l++)(s===o||t.canEncode(s,l))&&this.addEdge(n,i+1,new Ci(s,t,l,a,o))},r.prototype.encodeMinimally=function(e,t,n){var i=e.length,a=new Ci[i+1][t.length()];this.addEdges(e,t,a,0,null,n);for(var o=1;o<=i;o++){for(var s=0;s<t.length();s++)a[o][s]!=null&&o<i&&this.addEdges(e,t,a,o,a[o][s],n);for(var s=0;s<t.length();s++)a[o-1][s]=null}for(var f=-1,u=me.MAX_VALUE,s=0;s<t.length();s++)if(a[i][s]!=null){var l=a[i][s];l.cachedTotalSize<u&&(u=l.cachedTotalSize,f=s)}if(f<0)throw new Error('Failed to encode "'+e+'"');for(var c=[],d=a[i][f];d!=null;){if(d.isFNC1())c.unshift(1e3);else for(var h=t.encode(d.c,d.encoderIndex),o=h.length-1;o>=0;o--)c.unshift(h[o]&255);var v=d.previous===null?0:d.previous.encoderIndex;v!==d.encoderIndex&&c.unshift(256+t.getECIValue(d.encoderIndex)),d=d.previous}for(var p=[],o=0;o<p.length;o++)p[o]=c[o];return p},r}(),Ci=function(){function r(e,t,n,i,a){this.c=e,this.encoderSet=t,this.encoderIndex=n,this.previous=i,this.fnc1=a,this.c=e===a?1e3:e;var o=this.isFNC1()?1:t.encode(e,n).length,s=i===null?0:i.encoderIndex;
18s!==n&&(o+=z1),i!=null&&(o+=i.cachedTotalSize),this.cachedTotalSize=o}return r.prototype.isFNC1=function(){return this.c===1e3},r}(),Y1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();var Ii;(function(r){r[r.ASCII=0]="ASCII",r[r.C40=1]="C40",r[r.TEXT=2]="TEXT",r[r.X12=3]="X12",r[r.EDF=4]="EDF",r[r.B256=5]="B256"})(Ii||(Ii={}));(function(r){Y1(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.shape=a,s.macroId=o,s}return e.prototype.getMacroId=function(){return this.macroId},e.prototype.getShapeHint=function(){return this.shape},e})(j1);var Z1=function(){function r(){}return r.prototype.isCompact=function(){return this.compact},r.prototype.setCompact=function(e){this.compact=e},r.prototype.getSize=function(){return this.size},r.prototype.setSize=function(e){this.size=e},r.prototype.getLayers=function(){return this.layers},r.prototype.setLayers=function(e){this.layers=e},r.prototype.getCodeWords=function(){return this.codeWords},r.prototype.setCodeWords=function(e){this.codeWords=e},r.prototype.getMatrix=function(){return this.matrix}
18,r.prototype.setMatrix=function(e){this.matrix=e},r}(),Si=function(){function r(){}return r.singletonList=function(e){return[e]},r.min=function(e,t){return e.sort(t)[0]},r}(),K1=function(){function r(e){this.previous=e}return r.prototype.getPrevious=function(){return this.previous},r}(),q1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),Dn=function(r){q1(e,r);function e(t,n,i){var a=r.call(this,t)||this;return a.value=n,a.bitCount=i,a}return e.prototype.appendTo=function(t,n){t.appendBits(this.value,this.bitCount)},e.prototype.add=function(t,n){return new e(this,t,n)},e.prototype.addBinaryShift=function(t,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,t,n)},e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+me.toBinaryString(t|1<<this.bitCount).substring(1)+">"},e}(K1),Q1=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),$1=function(r){Q1(e,r);function e(t,n,i){var a=r.call(this,t,0,0)||this;return a.binaryShiftStart=n,a.binaryShiftByteCount=i,a}return e.prototype.appendTo=function(t,n){for(var i=0;i<this.binaryShiftByteCount;i++)(i===0||i===31&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):i===0?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(n[this.binaryShiftStart+i],8)},e.prototype.addBinaryShift=function(t,n){return new e(this,t,n)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e}(Dn);function J1(r,e,t){return new $1(r,e,t)}function xr(r,e,t){return new Dn(r,e,t)}var eu=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],jt=0,Wr=1,bt=2,Ta=3,Mt=4,tu=new Dn(null,0,0),sn=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])],ru=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function nu(r){var e,t;try{for(var n=ru(r),i=n.next();!i.done;i=n.next()){var a=i.value;$e.fill(a,-1)}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r[jt][Mt]=0,r[Wr][Mt]=0,r[Wr][jt]=28,r[Ta][Mt]=0,r[bt][Mt]=0,r[bt][jt]=15,r}var Da=nu($e.createInt32Array(6,6)),iu=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},au=function(){function r(e,t,n,i){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=i}return r.prototype.getMode=function(){return this.mode},r.prototype.getToken=function(){return this.token},r.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},r.prototype.getBitCount=function(){return this.bitCount},r.prototype.latchAndAppend=function(e,t){var n=this.bitCount,i=this.token;if(e!==this.mode){var a=sn[this.mode][e];i=xr(i,a&65535,a>>16),n+=a>>16}var o=e===bt?4:5;return i=xr(i,t,o),new r(i,e,0,n+o)},r.prototype.shiftAndAppend=function(e,t){var n=this.token,i=this.mode===bt?4:5;return n=xr(n,Da[this.mode][e],i),n=xr(n,t,5),new r(n,this.mode,0,this.bitCount+i+5)},r.prototype.addBinaryShiftChar=function(e){var t=this.token,n=this.mode,i=this.bitCount;if(this.mode===Mt||this.mode===bt){var a=sn[n][jt];t=xr(t,a&65535,a>>16),i+=a>>16,n=jt}var o=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new r(t,n,this.binaryShiftByteCount+1,i+o);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(e+1)),s},r.prototype.endBinaryShift=function(e){if(this.binaryShiftByteCount===0)return this;var t=this.token;return t=J1(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(t,this.mode,0,this.bitCount)}
18,r.prototype.isBetterThanOrEqualTo=function(e){var t=this.bitCount+(sn[this.mode][e.mode]>>16);return this.binaryShiftByteCount<e.binaryShiftByteCount?t+=r.calculateBinaryShiftCost(e)-r.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount},r.prototype.toBitArray=function(e){for(var t,n,i=[],a=this.endBinaryShift(e.length).token;a!==null;a=a.getPrevious())i.unshift(a);var o=new nt;try{for(var s=iu(i),f=s.next();!f.done;f=s.next()){var u=f.value;u.appendTo(o,e)}}catch(l){t={error:l}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},r.prototype.toString=function(){return Ce.format("%s bits=%d bytes=%d",eu[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(tu,jt,0,0),r}();function ou(r){var e=Ce.getCharCode(" "),t=Ce.getCharCode("."),n=Ce.getCharCode(",");r[jt][e]=1;for(var i=Ce.getCharCode("Z"),a=Ce.getCharCode("A"),o=a;o<=i;o++)r[jt][o]=o-a+2;r[Wr][e]=1;for(var s=Ce.getCharCode("z"),f=Ce.getCharCode("a"),o=f;o<=s;o++)r[Wr][o]=o-f+2;r[bt][e]=1;for(var u=Ce.getCharCode("9"),l=Ce.getCharCode("0"),o=l;o<=u;o++)r[bt][o]=o-l+2;r[bt][n]=12,r[bt][t]=13;for(var c=["\0"," ","�","�","�","�","�","�","\x07","\b","	",`
19`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�"],d=0;d<c.length;d++)r[Ta][Ce.getCharCode(c[d])]=d;for(var h=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"],d=0;d<h.length;d++)Ce.getCharCode(h[d])>0&&(r[Mt][Ce.getCharCode(h[d])]=d);return r}var fn=ou($e.createInt32Array(5,256)),Mr=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},su=function(){function r(e){this.text=e}return r.prototype.encode=function(){for(var e=Ce.getCharCode(" "),t=Ce.getCharCode(`
20`),n=Si.singletonList(au.INITIAL_STATE),i=0;i<this.text.length;i++){var a=void 0,o=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case Ce.getCharCode("\r"):a=o===t?2:0;break;case Ce.getCharCode("."):a=o===e?3:0;break;case Ce.getCharCode(","):a=o===e?4:0;break;case Ce.getCharCode(":"):a=o===e?5:0;break;default:a=0}a>0?(n=r.updateStateListForPair(n,i,a),i++):n=this.updateStateListForChar(n,i)}var s=Si.min(n,function(f,u){return f.getBitCount()-u.getBitCount()});return s.toBitArray(this.text)},r.prototype.updateStateListForChar=function(e,t){var n,i,a=[];try{for(var o=Mr(e),s=o.next();!s.done;s=o.next()){var f=s.value;this.updateStateForChar(f,t,a)}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r.simplifyStates(a)},r.prototype.updateStateForChar=function(e,t,n){for(var i=this.text[t]&255,a=fn[e.getMode()][i]>0,o=null,s=0;s<=Mt;s++){var f=fn[s][i];if(f>0){if(o==null&&(o=e.endBinaryShift(t)),!a||s===e.getMode()||s===bt){var u=o.latchAndAppend(s,f);n.push(u)}if(!a&&Da[e.getMode()][s]>=0){var l=o.shiftAndAppend(s,f);n.push(l)}}}if(e.getBinaryShiftByteCount()>0||fn[e.getMode()][i]===0){var c=e.addBinaryShiftChar(t);n.push(c)}},r.updateStateListForPair=function(e,t,n){var i,a,o=[];try{for(var s=Mr(e),f=s.next();!f.done;f=s.next()){var u=f.value;this.updateStateForPair(u,t,n,o)}}catch(l){i={error:l}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return this.simplifyStates(o)},r.updateStateForPair=function(e,t,n,i){var a=e.endBinaryShift(t);if(i.push(a.latchAndAppend(Mt,n)),e.getMode()!==Mt&&i.push(a.shiftAndAppend(Mt,n)),n===3||n===4){var o=a.latchAndAppend(bt,16-n).latchAndAppend(bt,1);i.push(o)}if(e.getBinaryShiftByteCount()>0){var s=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);i.push(s)}},r.simplifyStates=function(e){var t,n,i,a,o=[];try{for(var s=Mr(e),f=s.next();!f.done;f=s.next()){var u=f.value,l=!0,c=function(y){if(y.isBetterThanOrEqualTo(u))return l=!1,"break";u.isBetterThanOrEqualTo(y)&&(o=o.filter(function(g){return g!==y}))};try{for(var d=(i=void 0,Mr(o)),h=d.next();!h.done;h=d.next()){var v=h.value,p=c(v);if(p==="break")break}}catch(y){i={error:y}}
20finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}l&&o.push(u)}}catch(y){t={error:y}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},r}(),fu=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function r(){}return r.encodeBytes=function(e){return r.encode(e,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(e,t,n){var i=new su(e).encode(),a=me.truncDivision(i.getSize()*t,100)+11,o=i.getSize()+a,s,f,u,l,c;if(n!==r.DEFAULT_AZTEC_LAYERS){if(s=n<0,f=Math.abs(n),f>(s?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new ue(Ce.format("Illegal value %s for layers",n));u=r.totalBitsInLayer(f,s),l=r.WORD_SIZE[f];var d=u-u%l;if(c=r.stuffBits(i,l),c.getSize()+a>d)throw new ue("Data to large for user specified layer");if(s&&c.getSize()>l*64)throw new ue("Data to large for user specified layer")}else{l=0,c=null;for(var h=0;;h++){if(h>r.MAX_NB_BITS)throw new ue("Data too large for an Aztec code");if(s=h<=3,f=s?h+1:h,u=r.totalBitsInLayer(f,s),!(o>u)){(c==null||l!==r.WORD_SIZE[f])&&(l=r.WORD_SIZE[f],c=r.stuffBits(i,l));var d=u-u%l;if(!(s&&c.getSize()>l*64)&&c.getSize()+a<=d)break}}}var v=r.generateCheckWords(c,u,l),p=c.getSize()/l,y=r.generateModeMessage(s,f,p),g=(s?11:14)+f*4,w=new Int32Array(g),A;if(s){A=g;for(var h=0;h<w.length;h++)w[h]=h}else{A=g+1+2*me.truncDivision(me.truncDivision(g,2)-1,15);for(var x=me.truncDivision(g,2),m=me.truncDivision(A,2),h=0;h<x;h++){var S=h+me.truncDivision(h,15);w[x-h-1]=m-S-1,w[x+h]=m+S+1}}for(var b=new Ft(A),h=0,D=0;h<f;h++){for(var M=(f-h)*4+(s?9:12),G=0;G<M;G++)for(var W=G*2,V=0;V<2;V++)v.get(D+W+V)&&b.set(w[h*2+V],w[h*2+G]),v.get(D+M*2+W+V)&&b.set(w[h*2+G],w[g-1-h*2-V]),v.get(D+M*4+W+V)&&b.set(w[g-1-h*2-V],w[g-1-h*2-G]),v.get(D+M*6+W+V)&&b.set(w[g-1-h*2-G],w[h*2+V]);D+=M*8}if(r.drawModeMessage(b,s,A,y),s)r.drawBullsEye(b,me.truncDivision(A,2),5);else{r.drawBullsEye(b,me.truncDivision(A,2),7);for(var h=0,G=0;h<me.truncDivision(g,2)-1;h+=15,G+=16)for(var V=me.truncDivision(A,2)&1;V<A;V+=2)b.set(me.truncDivision(A,2)-G,V),b.set(me.truncDivision(A,2)+G,V),b.set(V,me.truncDivision(A,2)-G),b.set(V,me.truncDivision(A,2)+G)}var z=new Z1;return z.setCompact(s),z.setSize(A),z.setLayers(f),z.setCodeWords(p),z.setMatrix(b),z},r.drawBullsEye=function(e,t,n){for(var i=0;i<n;i+=2)for(var a=t-i;a<=t+i;a++)e.set(a,t-i),e.set(a,t+i),e.set(t-i,a),e.set(t+i,a);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)},r.generateModeMessage=function(e,t,n){var i=new nt;return e?(i.appendBits(t-1,2),i.appendBits(n-1,6),i=r.generateCheckWords(i,28,4)):(i.appendBits(t-1,5),i.appendBits(n-1,11),i=r.generateCheckWords(i,40,4)),i},r.drawModeMessage=function(e,t,n,i){var a=me.truncDivision(n,2);if(t)for(var o=0;o<7;o++){var s=a-3+o;i.get(o)&&e.set(s,a-5),i.get(o+7)&&e.set(a+5,s),i.get(20-o)&&e.set(s,a+5),i.get(27-o)&&e.set(a-5,s)}else for(var o=0;o<10;o++){var s=a-5+o+me.truncDivision(o,5);i.get(o)&&e.set(s,a-7),i.get(o+10)&&e.set(a+7,s),i.get(29-o)&&e.set(s,a+7),i.get(39-o)&&e.set(a-7,s)}},r.generateCheckWords=function(e,t,n){var i,a,o=e.getSize()/n,s=new ba(r.getGF(n)),f=me.truncDivision(t,n),u=r.bitsToWords(e,n,f);s.encode(u,f-o);var l=t%n,c=new nt;c.appendBits(0,l);try{for(var d=fu(Array.from(u)),h=d.next();!h.done;h=d.next()){var v=h.value;c.appendBits(v,n)}}catch(p){i={error:p}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}return c},r.bitsToWords=function(e,t,n){var i=new Int32Array(n),a,o;for(a=0,o=e.getSize()/t;a<o;a++){for(var s=0,f=0;f<t;f++)s|=e.get(a*t+f)?1<<t-f-1:0;i[a]=s}return i},r.getGF=function(e){switch(e){case 4:return Et.AZTEC_PARAM;case 6:return Et.AZTEC_DATA_6;case 8:return Et.AZTEC_DATA_8;case 10:return Et.AZTEC_DATA_10;case 12:return Et.AZTEC_DATA_12;default:throw new ue("Unsupported word size "+e)}},r.stuffBits=function(e,t){for(var n=new nt,i=e.getSize(),a=(1<<t)-2,o=0;o<i;o+=t){for(var s=0,f=0;f<t;f++)(o+f>=i||e.get(o+f))&&(s|=1<<t-1-f);(s&a)===a?(n.appendBits(s&a,t),o--):s&a?n.appendBits(s,t):(n.appendBits(s|1,t),o--)}return n},r.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},r.DEFAULT_EC_PERCENT=33,r.DEFAULT_AZTEC_LAYERS=0,r.MAX_NB_BITS=32,r.MAX_NB_BITS_COMPACT=4,r.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),r})();var uu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}
20e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),lu=function(r){uu(e,r);function e(t){var n=r.call(this,t.width,t.height)||this;return n.canvas=t,n.tempCanvasElement=null,n.buffer=e.makeBufferFromCanvasImageData(t),n}return e.makeBufferFromCanvasImageData=function(t){var n;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}if(!n)throw new Error("Couldn't get canvas context.");var i=n.getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(i.data,t.width,t.height)},e.toGrayscaleBuffer=function(t,n,i){for(var a=new Uint8ClampedArray(n*i),o=0,s=0,f=t.length;o<f;o+=4,s++){var u=void 0,l=t[o+3];if(l===0)u=255;else{var c=t[o],d=t[o+1],h=t[o+2];u=306*c+601*d+117*h+512>>10}a[s]=u}return a},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new ue("Requested row is outside the image: "+t);var i=this.getWidth(),a=t*i;return n===null?n=this.buffer.slice(a,a+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(a,a+i))),n},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(t,n,i,a){return r.prototype.crop.call(this,t,n,i,a),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new Zr(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement},e.prototype.rotate=function(t){var n=this.getTempCanvasElement();if(!n)throw new Error("Could not create a Canvas element.");var i=t*e.DEGREE_TO_RADIANS,a=this.canvas.width,o=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*o),f=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*o);n.width=s,n.height=f;var u=n.getContext("2d");if(!u)throw new Error("Could not create a Canvas Context element.");return u.translate(s/2,f/2),u.rotate(i),u.drawImage(this.canvas,a/-2,o/-2),this.buffer=e.makeBufferFromCanvasImageData(n),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(Sr);function Na(){return typeof navigator<"u"}function cu(){return Na()&&!!navigator.mediaDevices}function du(){return!!(cu()&&navigator.mediaDevices.enumerateDevices)}var sr=function(){return sr=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},sr.apply(this,arguments)},Ge=function(r,e,t,n){function i(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(l){try{u(n.next(l))}catch(c){o(c)}}function f(l){try{u(n.throw(l))}catch(c){o(c)}}function u(l){l.done?a(l.value):i(l.value).then(s,f)}u((n=n.apply(r,e||[])).next())})},Xe=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(l){return f([u,l])}}function f(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},un=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hu={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},pr=function(){function r(e,t,n){t===void 0&&(t=new Map),n===void 0&&(n={}),this.reader=e,this.hints=t,this.options=sr(sr({},hu),n)}return Object.defineProperty(r.prototype,"possibleFormats",{set:function(e){this.hints.set(ke.POSSIBLE_FORMATS,e)}
20,enumerable:!1,configurable:!0}),r.addVideoSource=function(e,t){try{e.srcObject=t}catch{console.error("got interrupted by new loading request")}},r.mediaStreamSetTorch=function(e,t){return Ge(this,void 0,void 0,function(){return Xe(this,function(n){switch(n.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:t?"flash":"off",torch:!!t}]})];case 1:return n.sent(),[2]}})})},r.mediaStreamIsTorchCompatible=function(e){var t,n,i=e.getVideoTracks();try{for(var a=un(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(r.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(f){t={error:f}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return!1},r.mediaStreamIsTorchCompatibleTrack=function(e){try{var t=e.getCapabilities();return"torch"in t}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},r.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},r.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new We("element with id '".concat(e,"' not found"));if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new We("element with id '".concat(e,"' must be an ").concat(t," element"));return n},r.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return r.getMediaElement(e,"video");if(!e&&typeof document<"u"){var t=document.createElement("video");return t.width=200,t.height=200,t}throw new Error("Couldn't get videoElement from videoSource!")},r.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return r.getMediaElement(e,"img");if(typeof e>"u"){var t=document.createElement("img");return t.width=200,t.height=200,t}throw new Error("Couldn't get imageElement from imageSource!")},r.prepareVideoElement=function(e){var t=r.createVideoElement(e);return t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},r.createBinaryBitmapFromCanvas=function(e){var t=new lu(e),n=new pa(t);return new va(n)},r.drawImageOnCanvas=function(e,t){e.drawImage(t,0,0)},r.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimensions!")},r.createCaptureCanvas=function(e){if(!e)throw new We("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var t=document.createElement("canvas"),n=r.getMediaElementDimensions(e),i=n.width,a=n.height;return t.style.width=i+"px",t.style.height=a+"px",t.width=i,t.height=a,t},r.tryPlayVideo=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(r.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[2,!0];case 3:return t=n.sent(),console.warn("It was not possible to play the video.",t),[2,!1];case 4:return[2]}})})},r.createCanvasFromMediaElement=function(e){var t=r.createCaptureCanvas(e),n=t.getContext("2d");if(!n)throw new Error("Couldn't find Canvas 2D Context.");return r.drawImageOnCanvas(n,e),t},r.createBinaryBitmapFromMediaElem=function(e){var t=r.createCanvasFromMediaElement(e);return r.createBinaryBitmapFromCanvas(t)},r.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},r.listVideoInputDevices=function(){return Ge(this,void 0,void 0,function(){var e,t,n,i,a,o,s,f,u,l,c,d;return Xe(this,function(h){switch(h.label){case 0:if(!Na())throw new Error("Can't enumerate devices, navigator is not present.");if(!du())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=h.sent(),t=[];try{for(n=un(e),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(s=a.deviceId||a.id,f=a.label||"Video device ".concat(t.length+1),u=a.groupId,l={deviceId:s,label:f,kind:o,groupId:u},t.push(l))}catch(v){c={error:v}}finally{try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(c)throw c.error}}return[2,t]}})})},r.findDeviceById=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:return[4,r.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(i){return i.deviceId===e})]:[2]}})})},r.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},r.releaseAllStreams=function(){r.streamTracker.length!==0&&r.streamTracker.forEach(function(e){e.getTracks().forEac
20h(function(t){return t.stop()})}),r.streamTracker=[]},r.playVideoOnLoadAsync=function(e,t){return Ge(this,void 0,void 0,function(){var n;return Xe(this,function(i){switch(i.label){case 0:return[4,r.tryPlayVideo(e)];case 1:return n=i.sent(),n?[2,!0]:[2,new Promise(function(a,o){var s=setTimeout(function(){r.isVideoPlaying(e)||(o(!1),e.removeEventListener("canplay",f))},t),f=function(){r.tryPlayVideo(e).then(function(u){clearTimeout(s),e.removeEventListener("canplay",f),a(u)})};e.addEventListener("canplay",f)})]}})})},r.attachStreamToVideo=function(e,t,n){return n===void 0&&(n=5e3),Ge(this,void 0,void 0,function(){var i;return Xe(this,function(a){switch(a.label){case 0:return i=r.prepareVideoElement(t),r.addVideoSource(i,e),[4,r.playVideoOnLoadAsync(i,n)];case 1:return a.sent(),[2,i]}})})},r._waitImageLoad=function(e){return new Promise(function(t,n){var i=1e4,a=setTimeout(function(){r.isImageLoaded(e)||(e.removeEventListener("load",o),n())},i),o=function(){clearTimeout(a),e.removeEventListener("load",o),t()};e.addEventListener("load",o)})},r.checkCallbackFnOrThrow=function(e){if(!e)throw new We("`callbackFn` is a required parameter, you cannot capture results without it.")},r.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(t){return t.stop()}),e=void 0},r.prototype.decode=function(e){var t=r.createCanvasFromMediaElement(e);return this.decodeFromCanvas(t)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},r.prototype.decodeFromCanvas=function(e){var t=r.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(t)},r.prototype.decodeFromImageElement=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:if(!e)throw new We("An image element must be provided.");return t=r.prepareImageElement(e),[4,this._decodeOnLoadImage(t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeFromImageUrl=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:if(!e)throw new We("An URL must be provided.");t=r.prepareImageElement(),t.src=e,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.decodeFromImageElement(t)];case 2:return[2,n.sent()];case 3:return r.destroyImageElement(t),[7];case 4:return[2]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return Ge(this,void 0,void 0,function(){var i,a;return Xe(this,function(o){switch(o.label){case 0:return r.checkCallbackFnOrThrow(n),[4,this.getUserMedia(e)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.decodeFromStream(i,t,n)];case 3:return[2,o.sent()];case 4:throw a=o.sent(),r.disposeMediaStream(i),a;case 5:return[2]}})})},r.prototype.decodeFromStream=function(e,t,n){return Ge(this,void 0,void 0,function(){var i,a,o,s,f,u,l,c,d,h=this;return Xe(this,function(v){switch(v.label){case 0:return r.checkCallbackFnOrThrow(n),i=this.options.tryPlayVideoTimeout,[4,r.attachStreamToVideo(e,t,i)];case 1:return a=v.sent(),o=function(){r.disposeMediaStream(e),r.cleanVideoSource(a)},s=this.scan(a,n,o),f=e.getVideoTracks(),u=sr(sr({},s),{stop:function(){s.stop()},streamVideoConstraintsApply:function(p,y){return Ge(this,void 0,void 0,function(){var g,w,A,x,m,S,b;return Xe(this,function(D){switch(D.label){case 0:g=y?f.filter(y):f,D.label=1;case 1:D.trys.push([1,6,7,8]),w=un(g),A=w.next(),D.label=2;case 2:return A.done?[3,5]:(x=A.value,[4,x.applyConstraints(p)]);case 3:D.sent(),D.label=4;case 4:return A=w.next(),[3,2];case 5:return[3,8];case 6:return m=D.sent(),S={error:m},[3,8];case 7:try{A&&!A.done&&(b=w.return)&&b.call(w)}finally{if(S)throw S.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(p){return f.find(p).getConstraints()},streamVideoSettingsGet:function(p){return f.find(p).getSettings()},streamVideoCapabilitiesGet:function(p){return f.find(p).getCapabilities()}}),l=r.mediaStreamIsTorchCompatible(e),l&&(c=f==null?void 0:f.find(function(p){return r.mediaStreamIsTorchCompatibleTrack(p)}),d=function(p){return Ge(h,void 0,void 0,function(){return Xe(this,function(y){switch(y.label){case 0:return[4,r.mediaStreamSetTorch(c,p)];case 1:return y.sent(),[2]}})})},u.switchTorch=d,u.stop=function(){return Ge(h,void 0,void 0,function(){return Xe(this,function(p){switch(p.label){case 0:return s.stop(),[4,d(!1)];case 1:return p.sent(),[2]}})})}),[2,u]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return Ge(this,void 0,void 0,function(){var i,a;return Xe(this,function(o){switch(o.label){case 0:return r.checkCallbackFnOrThrow(n),e?i={deviceId:{exact:e}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,t,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromVideoElement=function(e,t){return Ge(this,void 0,void 0,function(){var n,i;return Xe(this,function(a){switch(a.label){case 0:if(r.checkCallbackFnOrThrow(t),!e)throw new We("A video element must be provided.");return n=r.prepareVideoElement(e),i=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,i)];case 1:return a.sent(),[2,this.scan(n,t)]}})})},r.prototype.decodeFromVideoUrl=function(e,t){return Ge(this,void 0,void 0,function(){var n,i,a,o;return Xe(this,function(s){switch(s.label){case 0:if(r.checkCallbackFnOrThrow(t),!e)throw new We("An URL must be provided.");return n=r.prepareVideoElement(),n.src=e,i=function(){r.cleanVideoSource(n)},a=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(n,a)];case 1:return s.sent(),o=this.scan(n,t,i),[2,o]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return Ge(this,void 0,void 0,function(){var n;return Xe(this,function(i){switch(i.label){case 0:return[4,this.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return Ge(this,void 0,void 0,function(){var n,i,a;return Xe(this,function(o){switch(o.label){case 0:return n=!!t,[4,r.attachStreamToVideo(e,t)];case 1:i=o.sent(),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,this.scanOneResult(i)];case 3:return a=o.sent(),[2,a];case 4:return n||r.cleanVideoSource(i),[7];case 5:return[2]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return Ge(this,void 0,void 0,function(){var n,i;return Xe(this,function(a){switch(a.label){case 0:return e?n={deviceId:{exact:e}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,t)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromVideoElement=function(e){return Ge(this,void 0,void 0,function(){var t,n;return Xe(this,function(i){switch(i.label){case 0:if(!e)throw new We("A video element must be provided.");return t=r.prepareVideoElement(e),n=this.options.tryPlayVideoTimeout,[4,r.playVideoOnLoadAsync(t,n)];case 1:return i.sent(),[4,this.scanOneResult(t)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromVideoUrl=function(e){return Ge(this,void 0,void 0,function(){var t,n;return Xe(this,function(i){switch(i.label){case 0:if(!e)throw new We("An URL must be provided.");t=r.prepareVideoElement(),t.src=e,n=this.decodeOnceFromVideoElement(t),i.label=1;case 1:return i.trys.push([1,,3,4]),[4,n];case 2:return[2,i.sent()];case 3:return r.cleanVideoSource(t),[7];case 4:return[2]}})})},r.prototype.scanOneResult=function(e,t,n,i){var a=this;return t===void 0&&(t=!0),n===void 0&&(n=!0),i===void 0&&(i=!0),new Promise(function(o,s){a.scan(e,function(f,u,l){if(f){o(f),l.stop();return}if(u){if(u instanceof B&&t||u instanceof ze&&n||u instanceof $&&i)return;l.stop(),s(u)}})})},r.prototype.scan=function(e,t,n){var i=this;r.checkCallbackFnOrThrow(t);var a=r.createCaptureCanvas(e),o;try{o=a.getContext("2d",{willReadFrequently:!0})}catch{o=a.getContext("2d")}if(!o)throw new Error("Couldn't create canvas for visual element scan.");var s=function(){o=void 0,a=void 0},f=!1,u,l=function(){f=!0,clearTimeout(u),s(),n&&n()},c={stop:l},d=function(){if(!f)try{r.drawImageOnCanvas(o,e);var h=i.decodeFromCanvas(a);t(h,void 0,c),u=setTimeout(d,i.options.delayBetweenScanSuccess)}catch(g){t(void 0,g,c);var v=g instanceof ze,p=g instanceof $,y=g instanceof B;if(v||p||y){u=setTimeout(d,i.options.delayBetweenScanAttempts);return}s(),n&&n(g)}};return d(),c},r.prototype._decodeOnLoadImage=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:return t=r.isImageLoaded(e),t?[3,2]:[4,r._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},r.prototype.getUserMedia=function(e){return Ge(this,void 0,void 0,function(){var t;return Xe(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return t=n.sent(),r.streamTracker.push(t),[2,t]}})})},r.streamTracker=[],r}(),vu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}
20e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){vu(e,r);function e(t,n){return r.call(this,new Ur,t,n)||this}return e})(pr);var pu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){pu(e,r);function e(t,n){return r.call(this,new ar(t),t,n)||this}return e})(pr);var gu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){gu(e,r);function e(t,n){return r.call(this,new Hr,t,n)||this}return e})(pr);var _u=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){_u(e,r);function e(t,n){var i=this,a=new Sa;return a.setHints(t),i=r.call(this,a,t,n)||this,i.reader=a,i}return Object.defineProperty(e.prototype,"possibleFormats",{set:function(t){this.hints.set(ke.POSSIBLE_FORMATS,t),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e.prototype.setHints=function(t){this.hints=t,this.reader.setHints(this.hints)},e})(pr);var yu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();(function(r){yu(e,r);function e(t,n){return r.call(this,new Xr,t,n)||this}return e})(pr);var xu=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),wu=function(r){xu(e,r);function e(t,n){return r.call(this,new Gr,t,n)||this}return e}(pr);function bi(r){let e,t;return{c(){e=O("p"),t=F(r[1]),this.h()},l(n){e=T(n,"P",{class:!0});var i=N(e);
20t=L(i,r[1]),i.forEach(C),this.h()},h(){E(e,"class","error svelte-3bn48w")},m(n,i){j(n,e,i),_(e,t)},p(n,i){i&2&&Z(t,n[1])},d(n){n&&C(e)}}}function Au(r){let e,t,n,i,a,o,s,f=r[2]("clipboard.scan_instruction")+"",u,l,c=r[1]&&bi(r);return{c(){e=O("div"),t=O("div"),n=O("video"),i=k(),a=O("div"),o=k(),s=O("p"),u=F(f),l=k(),c&&c.c(),this.h()},l(d){e=T(d,"DIV",{class:!0});var h=N(e);t=T(h,"DIV",{class:!0});var v=N(t);n=T(v,"VIDEO",{class:!0}),N(n).forEach(C),i=U(v),a=T(v,"DIV",{class:!0}),N(a).forEach(C),v.forEach(C),o=U(h),s=T(h,"P",{class:!0});var p=N(s);u=L(p,f),p.forEach(C),l=U(h),c&&c.l(h),h.forEach(C),this.h()},h(){n.autoplay=!0,n.playsInline=!0,n.muted=!0,E(n,"class","svelte-3bn48w"),E(a,"class","viewfinder svelte-3bn48w"),E(t,"class","video-frame svelte-3bn48w"),E(s,"class","hint svelte-3bn48w"),E(e,"class","scanner-wrapper svelte-3bn48w")},m(d,h){j(d,e,h),_(e,t),_(t,n),r[3](n),_(t,i),_(t,a),_(e,o),_(e,s),_(s,u),_(e,l),c&&c.m(e,null)},p(d,[h]){h&4&&f!==(f=d[2]("clipboard.scan_instruction")+"")&&Z(u,f),d[1]?c?c.p(d,h):(c=bi(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:fr,o:fr,d(d){d&&C(e),r[3](null),c&&c.d()}}}function mu(r,e,t){let n;$t(r,ht,h=>t(2,n=h));const i=Ir();let a,o=null,s=null,f=!1,u="";async function l(){if(!f){if(typeof navigator>"u"||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){t(1,u=ht.get("clipboard.scan_camera_unsupported")),i("error",{message:u});return}try{o??(o=new wu),t(1,u=""),i("error",{message:""}),f=!0,s=await o.decodeFromVideoDevice(void 0,a,(h,v)=>{if(h){c(),i("result",{text:h.getText()});return}v&&v.name!=="NotFoundException"&&(console.error("QR decode error:",v),t(1,u=(v==null?void 0:v.message)??ht.get("clipboard.scan_decode_error")),i("error",{message:u}))})}catch(h){console.error("Unable to start camera",h),h instanceof DOMException&&h.name==="NotAllowedError"?t(1,u=ht.get("clipboard.scan_camera_error")):t(1,u=ht.get("clipboard.scan_camera_unsupported")),i("error",{message:u})}}}function c(){s==null||s.stop(),s=null,f=!1}zr(()=>(l(),()=>{c()})),mn(()=>{c()});function d(h){Jt[h?"unshift":"push"](()=>{a=h,t(0,a)})}return[a,u,n,d]}class Eu extends dr{constructor(e){super(),hr(this,e,mu,Au,lr,{})}}function Cu(r){let e,t,n,i,a,o,s,f,u,l,c=(r[6]?r[14]("clipboard.peer_connected"):r[14]("clipboard.waiting_peer"))+"",d,h,v,p,y,g=r[22]&&!r[6]&&Oi(r),w=!r[22]&&r[5]&&r[4]&&r[7]&&!r[6]&&Ti(r),A=!r[22]&&r[5]&&r[4]&&Di(r);return p=new Bt({props:{id:"leave-session",click:r[25],disabled:r[12],$$slots:{default:[Du]},$$scope:{ctx:r}}}),{c(){e=O("div"),t=O("div"),n=O("div"),g&&g.c(),i=k(),w&&w.c(),a=k(),A&&A.c(),o=k(),s=O("div"),f=O("div"),u=k(),l=O("span"),d=F(c),h=k(),v=O("div"),it(p.$$.fragment),this.h()},l(x){e=T(x,"DIV",{class:!0,id:!0});var m=N(e);t=T(m,"DIV",{class:!0});var S=N(t);n=T(S,"DIV",{class:!0});var b=N(n);g&&g.l(b),i=U(b),w&&w.l(b),a=U(b),A&&A.l(b),o=U(b),s=T(b,"DIV",{class:!0});var D=N(s);f=T(D,"DIV",{class:!0}),N(f).forEach(C),u=U(D),l=T(D,"SPAN",{class:!0});var M=N(l);d=L(M,c),M.forEach(C),D.forEach(C),b.forEach(C),S.forEach(C),m.forEach(C),h=U(x),v=T(x,"DIV",{class:!0});var G=N(v);at(p.$$.fragment,G),G.forEach(C),this.h()},h(){E(f,"class","status-indicator svelte-1lareey"),Te(f,"connected",r[6]),E(l,"class","svelte-1lareey"),E(s,"class","connection-status svelte-1lareey"),E(n,"class","session-details svelte-1lareey"),E(t,"class","session-info svelte-1lareey"),E(e,"class","session-info-wrapper svelte-1lareey"),E(e,"id","session-info"),E(v,"class","disconnect-section svelte-1lareey")},m(x,m){j(x,e,m),_(e,t),_(t,n),g&&g.m(n,null),_(n,i),w&&w.m(n,null),_(n,a),A&&A.m(n,null),_(n,o),_(n,s),_(s,f),_(s,u),_(s,l),_(l,d),j(x,h,m),j(x,v,m),ot(p,v,null),y=!0},p(x,m){x[22]&&!x[6]?g?g.p(x,m):(g=Oi(x),g.c(),g.m(n,i)):g&&(g.d(1),g=null),!x[22]&&x[5]&&x[4]&&x[7]&&!x[6]?w?w.p(x,m):(w=Ti(x),w.c(),w.m(n,a)):w&&(w.d(1),w=null),!x[22]&&x[5]&&x[4]?A?A.p(x,m):(A=Di(x),A.c(),A.m(n,o)):A&&(A.d(1),A=null),(!y||m[0]&64)&&Te(f,"connected",x[6]),(!y||m[0]&16448)&&c!==(c=(x[6]?x[14]("clipboard.peer_connected"):x[14]("clipboard.waiting_peer"))+"")&&Z(d,c);const S={};m[0]&4096&&(S.disabled=x[12]),m[0]&20512|m[1]&4096&&(S.$$scope={dirty:m,ctx:x}),p.$set(S)},i(x){y||(he(p.$$.fragment,x),y=!0)},o(x){xe(p.$$.fragment,x),y=!1},d(x){x&&(C(e),C(h),C(v)),g&&g.d(),w&&w.d(),A&&A.d(),st(p)}}}function Iu(r){let e,t,n,i;e=new En({props:{title:"",sectionId:"connection-setup",nolink:!0,$$slots:{default:[Fu]},$$scope:{ctx:r}}});let a=r[17]&&Fi(r);return{c(){it(e.$$.fragment),t=k(),a&&a.c(),n=vt()},l(o){at(e.$$.fragment,o),t=U(o),a&&a.l(o),n=vt()}
20,m(o,s){ot(e,o,s),j(o,t,s),a&&a.m(o,s),j(o,n,s),i=!0},p(o,s){const f={};s[0]&4091661|s[1]&4096&&(f.$$scope={dirty:s,ctx:o}),e.$set(f),o[17]?a?(a.p(o,s),s[0]&131072&&he(a,1)):(a=Fi(o),a.c(),he(a,1),a.m(n.parentNode,n)):a&&(Rt(),xe(a,1,1,()=>{a=null}),Pt())},i(o){i||(he(e.$$.fragment,o),he(a),i=!0)},o(o){xe(e.$$.fragment,o),xe(a),i=!1},d(o){o&&(C(t),C(n)),st(e,o),a&&a.d(o)}}}function Oi(r){let e,t,n=r[14]("clipboard.personal.opened_title")+"",i,a,o,s=r[14]("clipboard.personal.opened_hint")+"",f;return{c(){e=O("div"),t=O("h4"),i=F(n),a=k(),o=O("p"),f=F(s),this.h()},l(u){e=T(u,"DIV",{class:!0});var l=N(e);t=T(l,"H4",{class:!0});var c=N(t);i=L(c,n),c.forEach(C),a=U(l),o=T(l,"P",{class:!0});var d=N(o);f=L(d,s),d.forEach(C),l.forEach(C),this.h()},h(){E(t,"class","svelte-1lareey"),E(o,"class","svelte-1lareey"),E(e,"class","personal-ready-section svelte-1lareey")},m(u,l){j(u,e,l),_(e,t),_(t,i),_(e,a),_(e,o),_(o,f)},p(u,l){l[0]&16384&&n!==(n=u[14]("clipboard.personal.opened_title")+"")&&Z(i,n),l[0]&16384&&s!==(s=u[14]("clipboard.personal.opened_hint")+"")&&Z(f,s)},d(u){u&&C(e)}}}function Ti(r){let e,t,n=r[14]("clipboard.scan_qr")+"",i,a,o,s;return{c(){e=O("div"),t=O("h4"),i=F(n),a=k(),o=O("img"),this.h()},l(f){e=T(f,"DIV",{class:!0});var u=N(e);t=T(u,"H4",{class:!0});var l=N(t);i=L(l,n),l.forEach(C),a=U(u),o=T(u,"IMG",{src:!0,alt:!0,class:!0}),u.forEach(C),this.h()},h(){E(t,"class","svelte-1lareey"),Pn(o.src,s=r[7])||E(o,"src",s),E(o,"alt","QR Code"),E(o,"class","svelte-1lareey"),E(e,"class","qr-code svelte-1lareey")},m(f,u){j(f,e,u),_(e,t),_(t,i),_(e,a),_(e,o)},p(f,u){u[0]&16384&&n!==(n=f[14]("clipboard.scan_qr")+"")&&Z(i,n),u[0]&128&&!Pn(o.src,s=f[7])&&E(o,"src",s)},d(f){f&&C(e)}}}function Di(r){var K,Ae;let e,t,n=r[14]("clipboard.session_management")+"",i,a,o,s,f,u=r[14]("clipboard.session_id")+"",l,c,d,h,v,p,y,g,w,A,x,m,S=r[14]("clipboard.share_link")+"",b,D,M,G,W,V=((K=window==null?void 0:window.location)==null?void 0:K.origin)+"",z,Q=((Ae=window==null?void 0:window.location)==null?void 0:Ae.pathname)+"",de,re,Y,X,R,ee,pe,H,J;function le(ne,ve){return ne[15]?bu:Su}let Ee=le(r),ce=Ee(r);function ge(ne,ve){return ne[16]?Tu:Ou}let be=ge(r),_e=be(r);return{c(){e=O("div"),t=O("h4"),i=F(n),a=k(),o=O("div"),s=O("div"),f=O("span"),l=F(u),c=k(),d=O("div"),h=O("code"),v=F(r[4]),p=k(),y=O("button"),ce.c(),A=k(),x=O("div"),m=O("span"),b=F(S),D=k(),M=O("div"),G=O("div"),W=O("span"),z=F(V),de=F(Q),re=F("?session="),Y=F(r[4]),X=k(),R=O("button"),_e.c(),this.h()},l(ne){e=T(ne,"DIV",{class:!0});var ve=N(e);t=T(ve,"H4",{class:!0});var ae=N(t);i=L(ae,n),ae.forEach(C),a=U(ve),o=T(ve,"DIV",{class:!0});var q=N(o);s=T(q,"DIV",{class:!0});var se=N(s);f=T(se,"SPAN",{class:!0});var Fe=N(f);l=L(Fe,u),Fe.forEach(C),c=U(se),d=T(se,"DIV",{class:!0});var je=N(d);h=T(je,"CODE",{class:!0});var et=N(h);v=L(et,r[4]),et.forEach(C),p=U(je),y=T(je,"BUTTON",{class:!0,title:!0,"aria-label":!0});var wt=N(y);ce.l(wt),wt.forEach(C),je.forEach(C),se.forEach(C),A=U(q),x=T(q,"DIV",{class:!0});var Ye=N(x);m=T(Ye,"SPAN",{class:!0});var He=N(m);b=L(He,S),He.forEach(C),D=U(Ye),M=T(Ye,"DIV",{class:!0});var gt=N(M);G=T(gt,"DIV",{class:!0});var te=N(G);W=T(te,"SPAN",{class:!0});var ct=N(W);z=L(ct,V),de=L(ct,Q),re=L(ct,"?session="),Y=L(ct,r[4]),ct.forEach(C),te.forEach(C),X=U(gt),R=T(gt,"BUTTON",{class:!0,title:!0,"aria-label":!0});var kt=N(R);_e.l(kt),kt.forEach(C),gt.forEach(C),Ye.forEach(C),q.forEach(C),ve.forEach(C),this.h()},h(){E(t,"class","svelte-1lareey"),E(f,"class","info-label svelte-1lareey"),E(h,"class","session-code svelte-1lareey"),E(y,"class","copy-button svelte-1lareey"),E(y,"title",g=r[14]("clipboard.copy_session_id")),E(y,"aria-label",w=r[14]("clipboard.copy_session_id")),Te(y,"copied",r[15]),E(d,"class","info-content svelte-1lareey"),E(s,"class","info-item svelte-1lareey"),E(m,"class","info-label svelte-1lareey"),E(W,"class","link-text svelte-1lareey"),E(G,"class","link-display svelte-1lareey"),E(R,"class","copy-button svelte-1lareey"),E(R,"title",ee=r[14]("clipboard.copy_link")),E(R,"aria-label",pe=r[14]("clipboard.copy_link")),Te(R,"copied",r[16]),E(M,"class","info-content svelte-1lareey"),E(x,"class","info-item svelte-1lareey"),E(o,"class","info-grid svelte-1lareey"),E(e,"class","session-copy-section svelte-1lareey")},m(ne,ve){j(ne,e,ve),_(e,t),_(t,i),_(e,a),_(e,o),_(o,s),_(s,f),_(f,l),_(s,c),_(s,d),_(d,h),_(h,v),_(d,p),_(d,y),ce.m(y,null),_(o,A),_(o,x),_(x,m),_(m,b),_(x,D),_(x,M),_(M,G),_(G,W),_(W,z),_(W,de),_(W,re),_(W,Y),_(M,X),_(M,R),_e.m(
20R,null),H||(J=[Ie(y,"click",r[34]),Ie(R,"click",r[35])],H=!0)},p(ne,ve){ve[0]&16384&&n!==(n=ne[14]("clipboard.session_management")+"")&&Z(i,n),ve[0]&16384&&u!==(u=ne[14]("clipboard.session_id")+"")&&Z(l,u),ve[0]&16&&Z(v,ne[4]),Ee===(Ee=le(ne))&&ce?ce.p(ne,ve):(ce.d(1),ce=Ee(ne),ce&&(ce.c(),ce.m(y,null))),ve[0]&16384&&g!==(g=ne[14]("clipboard.copy_session_id"))&&E(y,"title",g),ve[0]&16384&&w!==(w=ne[14]("clipboard.copy_session_id"))&&E(y,"aria-label",w),ve[0]&32768&&Te(y,"copied",ne[15]),ve[0]&16384&&S!==(S=ne[14]("clipboard.share_link")+"")&&Z(b,S),ve[0]&16&&Z(Y,ne[4]),be===(be=ge(ne))&&_e?_e.p(ne,ve):(_e.d(1),_e=be(ne),_e&&(_e.c(),_e.m(R,null))),ve[0]&16384&&ee!==(ee=ne[14]("clipboard.copy_link"))&&E(R,"title",ee),ve[0]&16384&&pe!==(pe=ne[14]("clipboard.copy_link"))&&E(R,"aria-label",pe),ve[0]&65536&&Te(R,"copied",ne[16])},d(ne){ne&&C(e),ce.d(),_e.d(),H=!1,cr(J)}}}function Su(r){let e,t="📋",n,i,a=r[14]("clipboard.copy")+"",o;return{c(){e=O("span"),e.textContent=t,n=k(),i=O("span"),o=F(a),this.h()},l(s){e=T(s,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(e)!=="svelte-e01j3k"&&(e.textContent=t),n=U(s),i=T(s,"SPAN",{class:!0});var f=N(i);o=L(f,a),f.forEach(C),this.h()},h(){E(e,"class","copy-icon svelte-1lareey"),E(i,"class","copy-text svelte-1lareey")},m(s,f){j(s,e,f),j(s,n,f),j(s,i,f),_(i,o)},p(s,f){f[0]&16384&&a!==(a=s[14]("clipboard.copy")+"")&&Z(o,a)},d(s){s&&(C(e),C(n),C(i))}}}function bu(r){let e,t="✓",n,i,a=r[14]("clipboard.copied")+"",o;return{c(){e=O("span"),e.textContent=t,n=k(),i=O("span"),o=F(a),this.h()},l(s){e=T(s,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(e)!=="svelte-20dje3"&&(e.textContent=t),n=U(s),i=T(s,"SPAN",{class:!0});var f=N(i);o=L(f,a),f.forEach(C),this.h()},h(){E(e,"class","copy-icon svelte-1lareey"),E(i,"class","copy-text svelte-1lareey")},m(s,f){j(s,e,f),j(s,n,f),j(s,i,f),_(i,o)},p(s,f){f[0]&16384&&a!==(a=s[14]("clipboard.copied")+"")&&Z(o,a)},d(s){s&&(C(e),C(n),C(i))}}}function Ou(r){let e,t="🔗",n,i,a=r[14]("clipboard.copy")+"",o;return{c(){e=O("span"),e.textContent=t,n=k(),i=O("span"),o=F(a),this.h()},l(s){e=T(s,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(e)!=="svelte-2zs6fw"&&(e.textContent=t),n=U(s),i=T(s,"SPAN",{class:!0});var f=N(i);o=L(f,a),f.forEach(C),this.h()},h(){E(e,"class","copy-icon svelte-1lareey"),E(i,"class","copy-text svelte-1lareey")},m(s,f){j(s,e,f),j(s,n,f),j(s,i,f),_(i,o)},p(s,f){f[0]&16384&&a!==(a=s[14]("clipboard.copy")+"")&&Z(o,a)},d(s){s&&(C(e),C(n),C(i))}}}function Tu(r){let e,t="✓",n,i,a=r[14]("clipboard.copied")+"",o;return{c(){e=O("span"),e.textContent=t,n=k(),i=O("span"),o=F(a),this.h()},l(s){e=T(s,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(e)!=="svelte-20dje3"&&(e.textContent=t),n=U(s),i=T(s,"SPAN",{class:!0});var f=N(i);o=L(f,a),f.forEach(C),this.h()},h(){E(e,"class","copy-icon svelte-1lareey"),E(i,"class","copy-text svelte-1lareey")},m(s,f){j(s,e,f),j(s,n,f),j(s,i,f),_(i,o)},p(s,f){f[0]&16384&&a!==(a=s[14]("clipboard.copied")+"")&&Z(o,a)},d(s){s&&(C(e),C(n),C(i))}}}function Du(r){let e=(r[12]?r[14]("clipboard.leaving_session"):r[5]?r[14]("clipboard.end_session"):r[14]("clipboard.leave_session"))+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&20512&&e!==(e=(n[12]?n[14]("clipboard.leaving_session"):n[5]?n[14]("clipboard.end_session"):n[14]("clipboard.leave_session"))+"")&&Z(t,e)},d(n){n&&C(t)}}}function Ni(r){let e,t,n=r[14]("clipboard.entry.personal_transfer")+"",i,a,o,s,f,u,l=r[14]("clipboard.personal.two_device_limit")+"",c,d,h,v,p,y,g,w,A,x=!r[9]&&Ri(r);return p=new Bt({props:{id:"enter-personal-session",disabled:r[2]||r[3]||r[9],click:r[26],$$slots:{default:[Nu]},$$scope:{ctx:r}}}),w=new Bt({props:{id:"toggle-random-session",disabled:r[2]||r[3],click:r[27],$$slots:{default:[Ru]},$$scope:{ctx:r}}}),{c(){e=O("div"),t=O("h3"),i=F(n),a=k(),o=O("p"),s=F(r[19]),f=k(),u=O("p"),c=F(l),d=k(),x&&x.c(),h=k(),v=O("div"),it(p.$$.fragment),y=k(),g=O("div"),it(w.$$.fragment),this.h()},l(m){e=T(m,"DIV",{class:!0});var S=N(e);t=T(S,"H3",{class:!0});var b=N(t);i=L(b,n),b.forEach(C),a=U(S),o=T(S,"P",{class:!0});var D=N(o);s=L(D,r[19]),D.forEach(C),f=U(S),u=T(S,"P",{class:!0});var M=N(u);c=L(M,l),d=U(M),x&&x.l(M),M.forEach(C),h=U(S),v=T(S,"DIV",{class:!0});var G=N(v);
20at(p.$$.fragment,G),G.forEach(C),S.forEach(C),y=U(m),g=T(m,"DIV",{class:!0});var W=N(g);at(w.$$.fragment,W),W.forEach(C),this.h()},h(){E(t,"class","svelte-1lareey"),E(o,"class","svelte-1lareey"),E(u,"class","device-limit-hint svelte-1lareey"),E(v,"class","personal-actions svelte-1lareey"),E(e,"class","setup-option personal-session svelte-1lareey"),E(g,"class","random-drawer-toggle svelte-1lareey")},m(m,S){j(m,e,S),_(e,t),_(t,i),_(e,a),_(e,o),_(o,s),_(e,f),_(e,u),_(u,c),_(u,d),x&&x.m(u,null),_(e,h),_(e,v),ot(p,v,null),j(m,y,S),j(m,g,S),ot(w,g,null),A=!0},p(m,S){(!A||S[0]&16384)&&n!==(n=m[14]("clipboard.entry.personal_transfer")+"")&&Z(i,n),(!A||S[0]&524288)&&Z(s,m[19]),(!A||S[0]&16384)&&l!==(l=m[14]("clipboard.personal.two_device_limit")+"")&&Z(c,l),m[9]?x&&(x.d(1),x=null):x?x.p(m,S):(x=Ri(m),x.c(),x.m(u,null));const b={};S[0]&524&&(b.disabled=m[2]||m[3]||m[9]),S[0]&1048576|S[1]&4096&&(b.$$scope={dirty:S,ctx:m}),p.$set(b);const D={};S[0]&12&&(D.disabled=m[2]||m[3]),S[0]&24576|S[1]&4096&&(D.$$scope={dirty:S,ctx:m}),w.$set(D)},i(m){A||(he(p.$$.fragment,m),he(w.$$.fragment,m),A=!0)},o(m){xe(p.$$.fragment,m),xe(w.$$.fragment,m),A=!1},d(m){m&&(C(e),C(y),C(g)),x&&x.d(),st(p),st(w)}}}function Ri(r){let e,t,n,i,a,o;return{c(){e=O("span"),t=F("("),n=F(r[10]),i=F("/"),a=F(r[11]),o=F(")"),this.h()},l(s){e=T(s,"SPAN",{class:!0});var f=N(e);t=L(f,"("),n=L(f,r[10]),i=L(f,"/"),a=L(f,r[11]),o=L(f,")"),f.forEach(C),this.h()},h(){E(e,"class","svelte-1lareey")},m(s,f){j(s,e,f),_(e,t),_(e,n),_(e,i),_(e,a),_(e,o)},p(s,f){f[0]&1024&&Z(n,s[10]),f[0]&2048&&Z(a,s[11])},d(s){s&&C(e)}}}function Nu(r){let e;return{c(){e=F(r[20])},l(t){e=L(t,r[20])},m(t,n){j(t,e,n)},p(t,n){n[0]&1048576&&Z(e,t[20])},d(t){t&&C(e)}}}function Ru(r){let e=(r[13]?r[14]("clipboard.entry.hide_random_session"):r[14]("clipboard.entry.open_random_session"))+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&24576&&e!==(e=(n[13]?n[14]("clipboard.entry.hide_random_session"):n[14]("clipboard.entry.open_random_session"))+"")&&Z(t,e)},d(n){n&&C(t)}}}function Pi(r){let e,t,n,i,a=r[14]("clipboard.create_session")+"",o,s,f,u=r[14]("clipboard.create_description")+"",l,c,d,h,v,p,y=r[14]("general.or")+"",g,w,A,x,m=r[14]("clipboard.join_session")+"",S,b,D,M,G,W,V,z,Q,de,re,Y,X,R,ee=!r[8]&&Mi(r);d=new Bt({props:{id:"create-session",disabled:r[2],click:r[23],$$slots:{default:[Pu]},$$scope:{ctx:r}}}),M=new Bt({props:{id:"scan-session",disabled:r[3],click:r[29],$$slots:{default:[Mu]},$$scope:{ctx:r}}});let pe=r[18]&&!r[17]&&Bi(r);return re=new Bt({props:{id:"join-session",disabled:r[3]||!r[0].trim(),click:r[24],$$slots:{default:[Bu]},$$scope:{ctx:r}}}),{c(){ee&&ee.c(),e=k(),t=O("div"),n=O("div"),i=O("h3"),o=F(a),s=k(),f=O("p"),l=F(u),c=k(),it(d.$$.fragment),h=k(),v=O("div"),p=O("span"),g=F(y),w=k(),A=O("div"),x=O("h3"),S=F(m),b=k(),D=O("div"),it(M.$$.fragment),G=k(),pe&&pe.c(),W=k(),V=O("div"),z=O("input"),de=k(),it(re.$$.fragment),this.h()},l(H){ee&&ee.l(H),e=U(H),t=T(H,"DIV",{class:!0});var J=N(t);n=T(J,"DIV",{class:!0});var le=N(n);i=T(le,"H3",{class:!0});var Ee=N(i);o=L(Ee,a),Ee.forEach(C),s=U(le),f=T(le,"P",{class:!0});var ce=N(f);l=L(ce,u),ce.forEach(C),c=U(le),at(d.$$.fragment,le),le.forEach(C),h=U(J),v=T(J,"DIV",{class:!0});var ge=N(v);p=T(ge,"SPAN",{class:!0});var be=N(p);g=L(be,y),be.forEach(C),ge.forEach(C),w=U(J),A=T(J,"DIV",{class:!0});var _e=N(A);x=T(_e,"H3",{class:!0});var K=N(x);S=L(K,m),K.forEach(C),b=U(_e),D=T(_e,"DIV",{class:!0});var Ae=N(D);at(M.$$.fragment,Ae),G=U(Ae),pe&&pe.l(Ae),Ae.forEach(C),W=U(_e),V=T(_e,"DIV",{class:!0});var ne=N(V);z=T(ne,"INPUT",{type:!0,placeholder:!0,class:!0}),de=U(ne),at(re.$$.fragment,ne),ne.forEach(C),_e.forEach(C),J.forEach(C),this.h()},h(){E(i,"class","svelte-1lareey"),E(f,"class","svelte-1lareey"),E(n,"class","setup-option svelte-1lareey"),E(p,"class","svelte-1lareey"),E(v,"class","divider svelte-1lareey"),E(x,"class","svelte-1lareey"),E(D,"class","scan-option svelte-1lareey"),E(z,"type","text"),E(z,"placeholder",Q=r[14]("clipboard.enter_code")),z.disabled=r[3],E(z,"class","svelte-1lareey"),E(V,"class","join-form svelte-1lareey"),E(A,"class","setup-option svelte-1lareey"),E(t,"class","random-session-drawer svelte-1lareey")},m(H,J){ee&&ee.m(H,J),j(H,e,J),j(H,t,J),_(t,n),_(n,i),_(i,o),_(n,s),_(n,f),_(f,l),_(n,c),ot(d,n,null),_(t,h),_(t,v),_(v,p),_(p,g),_(t,w),_(t,A),_(A,x),_(x,S),_(A,b),_(A,D),ot(M,D,null),_(D,G),pe&&pe.m(D,null),_(A,W),_(A,V),_(V,z),kr(z,r[0]),_(V,de),ot(re,V,null),Y=!0,X||(R=Ie(z,"input",r[41]),X=!0)},p(H,J){H[8]?ee&&(ee.d(1),ee=null):ee?ee.p(H,J):(ee=Mi(H),ee.c(),ee.m(e.parentNode,e)),(!Y||J[0]&16384)&&a!==(a=H[14]("clipboard.create_session")+"")&&Z(o,a),(!Y||J[0]&16384)&&u!==(u=H[14]("clipboard.create_description")+"")&&Z(l,u);const le={};J[0]&4&&(le.disabled=H[2]),J[0]&16388|J[1]&4096&&(le.$$scope={dirty:J,ctx:H}),d.$set(le),(!Y||J[0]&16384)&&y!==(y=H[14]("general.or")+"")&&Z(g,y),(!Y||J[0]&16384)&&m!==(m=H[14]("clipboard.join_session")+"")&&Z(S,m);const Ee={};J[0]&8&&(Ee.disabled=H[3]),J[0]&16384|J[1]&4096&&(Ee.$$scope={dirty:J,ctx:H}),M.$set(Ee),H[18]&&!H[17]?pe?pe.p(H,J):(pe=Bi(H),pe.c(),pe.m(D,null)):pe&&(pe.d(1),pe=null),(!Y||J[0]&16384&&Q!==(Q=H[14]("clipboard.enter_code")))&&E(z,"placeholder",Q),(!Y||J[0]&8)&&(z.disabled=H[3]),J[0]&1&&z.value!==H[0]&&kr(z,H[0]);const ce={};J[0]&9&&(ce.disabled=H[3]||!H[0].trim()),J[0]&16392|J[1]&4096&&(ce.$$scope={dirty:J,ctx:H}),re.$set(ce)},i(H){Y||(he(d.$$.fragment,H),he(M.$$.fragment,H),he(re.$$.fragment,H),Y=!0)},o(H){xe(d.$$.fragment,H),xe(M.$$.fragment,H),xe(re.$$.fragment,H),Y=!1}
20,d(H){H&&(C(e),C(t)),ee&&ee.d(H),st(d),st(M),pe&&pe.d(),st(re),X=!1,R()}}}function Mi(r){let e,t,n=r[14]("clipboard.entry.personal_login_upsell")+"",i,a,o,s=r[14]("auth.sign_in")+"",f,u,l;return{c(){e=O("div"),t=O("p"),i=F(n),a=k(),o=O("button"),f=F(s),this.h()},l(c){e=T(c,"DIV",{class:!0});var d=N(e);t=T(d,"P",{class:!0});var h=N(t);i=L(h,n),h.forEach(C),a=U(d),o=T(d,"BUTTON",{type:!0,class:!0});var v=N(o);f=L(v,s),v.forEach(C),d.forEach(C),this.h()},h(){E(t,"class","login-upsell-hint svelte-1lareey"),E(o,"type","button"),E(o,"class","login-inline-action svelte-1lareey"),E(e,"class","login-upsell-box svelte-1lareey")},m(c,d){j(c,e,d),_(e,t),_(t,i),_(e,a),_(e,o),_(o,f),u||(l=Ie(o,"click",r[28]),u=!0)},p(c,d){d[0]&16384&&n!==(n=c[14]("clipboard.entry.personal_login_upsell")+"")&&Z(i,n),d[0]&16384&&s!==(s=c[14]("auth.sign_in")+"")&&Z(f,s)},d(c){c&&C(e),u=!1,l()}}}function Pu(r){let e=(r[2]?r[14]("clipboard.creating"):r[14]("clipboard.create"))+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&16388&&e!==(e=(n[2]?n[14]("clipboard.creating"):n[14]("clipboard.create"))+"")&&Z(t,e)},d(n){n&&C(t)}}}function Mu(r){let e=r[14]("clipboard.scan_with_camera")+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&16384&&e!==(e=n[14]("clipboard.scan_with_camera")+"")&&Z(t,e)},d(n){n&&C(t)}}}function Bi(r){let e,t;return{c(){e=O("p"),t=F(r[18]),this.h()},l(n){e=T(n,"P",{class:!0});var i=N(e);t=L(i,r[18]),i.forEach(C),this.h()},h(){E(e,"class","scan-error svelte-1lareey")},m(n,i){j(n,e,i),_(e,t)},p(n,i){i[0]&262144&&Z(t,n[18])},d(n){n&&C(e)}}}function Bu(r){let e=(r[3]?r[14]("clipboard.joining"):r[14]("clipboard.join"))+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&16392&&e!==(e=(n[3]?n[14]("clipboard.joining"):n[14]("clipboard.join"))+"")&&Z(t,e)},d(n){n&&C(t)}}}function Fu(r){let e,t,n,i=r[8]&&Ni(r),a=r[21]&&Pi(r);return{c(){e=O("div"),i&&i.c(),t=k(),a&&a.c(),this.h()},l(o){e=T(o,"DIV",{class:!0});var s=N(e);i&&i.l(s),t=U(s),a&&a.l(s),s.forEach(C),this.h()},h(){E(e,"class","connection-setup svelte-1lareey"),Te(e,"has-personal",r[8])},m(o,s){j(o,e,s),i&&i.m(e,null),_(e,t),a&&a.m(e,null),n=!0},p(o,s){o[8]?i?(i.p(o,s),s[0]&256&&he(i,1)):(i=Ni(o),i.c(),he(i,1),i.m(e,t)):i&&(Rt(),xe(i,1,1,()=>{i=null}),Pt()),o[21]?a?(a.p(o,s),s[0]&2097152&&he(a,1)):(a=Pi(o),a.c(),he(a,1),a.m(e,null)):a&&(Rt(),xe(a,1,1,()=>{a=null}),Pt()),(!n||s[0]&256)&&Te(e,"has-personal",o[8])},i(o){n||(he(i),he(a),n=!0)},o(o){xe(i),xe(a),n=!1},d(o){o&&C(e),i&&i.d(),a&&a.d()}}}function Fi(r){let e,t,n,i,a=r[14]("clipboard.scan_with_camera")+"",o,s,f,u,l,c,d,h,v,p,y,g,w;d=new Eu({}),d.$on("result",r[31]),d.$on("error",r[32]);let A=r[18]&&Li(r);return p=new Bt({props:{id:"cancel-scan",click:r[30],$$slots:{default:[Lu]},$$scope:{ctx:r}}}),{c(){e=O("div"),t=O("div"),n=O("div"),i=O("h4"),o=F(a),s=k(),f=O("button"),u=F("✕"),c=k(),it(d.$$.fragment),h=k(),A&&A.c(),v=k(),it(p.$$.fragment),this.h()},l(x){e=T(x,"DIV",{class:!0,role:!0,"aria-modal":!0,"aria-labelledby":!0,tabindex:!0});var m=N(e);t=T(m,"DIV",{class:!0});var S=N(t);n=T(S,"DIV",{class:!0});var b=N(n);i=T(b,"H4",{id:!0,class:!0});var D=N(i);o=L(D,a),D.forEach(C),s=U(b),f=T(b,"BUTTON",{class:!0,"aria-label":!0});var M=N(f);u=L(M,"✕"),M.forEach(C),b.forEach(C),c=U(S),at(d.$$.fragment,S),h=U(S),A&&A.l(S),v=U(S),at(p.$$.fragment,S),S.forEach(C),m.forEach(C),this.h()},h(){E(i,"id",ki),E(i,"class","svelte-1lareey"),E(f,"class","close-scanner svelte-1lareey"),E(f,"aria-label",l=r[14]("clipboard.scan_cancel")),E(n,"class","scanner-header svelte-1lareey"),E(t,"class","scanner-panel svelte-1lareey"),E(e,"class","scanner-overlay svelte-1lareey"),E(e,"role","dialog"),E(e,"aria-modal","true"),E(e,"aria-labelledby",ki),E(e,"tabindex","0")},m(x,m){j(x,e,m),_(e,t),_(t,n),_(n,i),_(i,o),_(n,s),_(n,f),_(f,u),_(t,c),ot(d,t,null),_(t,h),A&&A.m(t,null),_(t,v),ot(p,t,null),y=!0,g||(w=[Ie(f,"click",r[30]),Ie(t,"click",io(r[40])),Ie(e,"click",r[30]),Ie(e,"keydown",r[33])],g=!0)},p(x,m){(!y||m[0]&16384)&&a!==(a=x[14]("clipboard.scan_with_camera")+"")&&Z(o,a),(!y||m[0]&16384&&l!==(l=x[14]("clipboard.scan_cancel")))&&E(f,"aria-label",l),x[18]?A?A.p(x,m):(A=Li(x),A.c(),A.m(t,v)):A&&(A.d(1),A=null);const S={};m[0]&16384|m[1]&4096&&(S.$$scope={dirty:m,ctx:x}),p.$set(S)},i(x){y||(he(d.$$.fragment,x),he(p.$$.fragment,x),y=!0)},o(x){xe(d.$$.fragment,x),xe(p.$$.fragment,x),y=!1},d(x){x&&C(e),st(d),A&&A.d(),st(p),g=!1,cr(w)}}}function Li(r){let e,t;return{c(){e=O("p"),t=F(r[18]),this.h()},l(n){e=T(n,"P",{class:!0});var i=N(e);
20t=L(i,r[18]),i.forEach(C),this.h()},h(){E(e,"class","scanner-error svelte-1lareey")},m(n,i){j(n,e,i),_(e,t)},p(n,i){i[0]&262144&&Z(t,n[18])},d(n){n&&C(e)}}}function Lu(r){let e=r[14]("clipboard.scan_cancel")+"",t;return{c(){t=F(e)},l(n){t=L(n,e)},m(n,i){j(n,t,i)},p(n,i){i[0]&16384&&e!==(e=n[14]("clipboard.scan_cancel")+"")&&Z(t,e)},d(n){n&&C(t)}}}function ku(r){let e,t,n,i;const a=[Iu,Cu],o=[];function s(f,u){return f[1]?1:0}return e=s(r),t=o[e]=a[e](r),{c(){t.c(),n=vt()},l(f){t.l(f),n=vt()},m(f,u){o[e].m(f,u),j(f,n,u),i=!0},p(f,u){let l=e;e=s(f),e===l?o[e].p(f,u):(Rt(),xe(o[l],1,1,()=>{o[l]=null}),Pt(),t=o[e],t?t.p(f,u):(t=o[e]=a[e](f),t.c()),he(t,1),t.m(n.parentNode,n))},i(f){i||(he(t),i=!0)},o(f){xe(t),i=!1},d(f){f&&C(n),o[e].d(f)}}}const ki="clipboard-scanner-title";function Uu(r){if(!r)return null;const e=r.trim();try{const n=new URL(e),i=n.searchParams.get("session");if(i)return i;if(n.hash){const a=n.hash.match(/session=([^&]+)/i);if(a!=null&&a[1])return a[1]}}catch{}const t=e.match(/session=([^&]+)/i);return t!=null&&t[1]?t[1]:/^https?:\/\//i.test(e)?null:e}function Vu(r,e,t){let n,i,a,o,s;$t(r,ht,K=>t(14,s=K));const f=Ir();let{isConnected:u}=e,{isCreating:l}=e,{isJoining:c}=e,{joinCode:d}=e,{sessionId:h}=e,{isCreator:v}=e,{peerConnected:p}=e,{sessionType:y="random"}=e,{qrCodeUrl:g}=e,{hasSignedInSession:w=!1}=e,{personalStatusLoading:A=!1}=e,{personalRecommendedAction:x="create"}=e,{personalOnlinePeers:m=0}=e,{personalMaxPeers:S=2}=e,{personalCurrentDeviceConnected:b=!1}=e,{personalSessionState:D="empty"}=e,{isLeavingSession:M=!1}=e,G=!1,W=!1,V=!1,z=!1,Q=null;function de(){f("createSession")}function re(){f("joinSession")}function Y(){f("leaveSession")}function X(){f("enterPersonalSession")}function R(){t(13,z=!z)}function ee(){if(typeof window>"u")return;const K=window.location.href;fo({fallbackRedirectUrl:K,signUpFallbackRedirectUrl:K})}function pe(){t(18,Q=null),t(17,V=!0)}function H(){t(17,V=!1)}async function J(K){const Ae=Uu(K.detail.text);if(!Ae){t(18,Q=ht.get("clipboard.scan_decode_error"));return}t(0,d=Ae),t(18,Q=null),t(17,V=!1),await Cr(),re()}function le(K){var ne;const Ae=(ne=K.detail)==null?void 0:ne.message;if(!Ae){t(18,Q=null);return}t(18,Q=Ae??ht.get("clipboard.scan_decode_error"))}function Ee(K){(K.key==="Escape"||K.key==="Esc")&&(K.preventDefault(),H()),(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),H())}function ce(){h&&navigator.clipboard.writeText(h).then(()=>{t(15,G=!0),setTimeout(()=>{t(15,G=!1)},2e3)}).catch(K=>{console.error("Failed to copy session ID:",K)})}function ge(){if(h){const K=`${window.location.origin}${window.location.pathname}?session=${h}`;navigator.clipboard.writeText(K).then(()=>{t(16,W=!0),setTimeout(()=>{t(16,W=!1)},2e3)}).catch(Ae=>{console.error("Failed to copy link:",Ae)})}}function be(K){no.call(this,r,K)}function _e(){d=this.value,t(0,d)}return r.$$set=K=>{"isConnected"in K&&t(1,u=K.isConnected),"isCreating"in K&&t(2,l=K.isCreating),"isJoining"in K&&t(3,c=K.isJoining),"joinCode"in K&&t(0,d=K.joinCode),"sessionId"in K&&t(4,h=K.sessionId),"isCreator"in K&&t(5,v=K.isCreator),"peerConnected"in K&&t(6,p=K.peerConnected),"sessionType"in K&&t(36,y=K.sessionType),"qrCodeUrl"in K&&t(7,g=K.qrCodeUrl),"hasSignedInSession"in K&&t(8,w=K.hasSignedInSession),"personalStatusLoading"in K&&t(9,A=K.personalStatusLoading),"personalRecommendedAction"in K&&t(37,x=K.personalRecommendedAction),"personalOnlinePeers"in K&&t(10,m=K.personalOnlinePeers),"personalMaxPeers"in K&&t(11,S=K.personalMaxPeers),"personalCurrentDeviceConnected"in K&&t(38,b=K.personalCurrentDeviceConnected),"personalSessionState"in K&&t(39,D=K.personalSessionState),"isLeavingSession"in K&&t(12,M=K.isLeavingSession)},r.$$.update=()=>{r.$$.dirty[1]&32&&t(22,n=y==="personal"),r.$$.dirty[0]&8448&&t(21,i=!w||z),r.$$.dirty[0]&16896|r.$$.dirty[1]&64&&t(20,a=s(A?"clipboard.personal.checking":x==="restart"?"clipboard.personal.action_create":`clipboard.personal.action_${x}`)),r.$$.dirty[0]&16896|r.$$.dirty[1]&448&&t(19,o=s(A?"clipboard.personal.checking_hint":D==="waiting_creator_reconnect"?"clipboard.messages.waiting_creator_reconnect":b?"clipboard.personal.status_current_device":x==="join"?"clipboard.personal.status_other_device":x==="manage"?"clipboard.personal.status_full":"clipboard.personal.status_empty"))},[d,u,l,c,h,v,p,g,w,A,m,S,M,z,s,G,W,V,Q,o,a,i,n,de,re,Y,X,R,ee,pe,H,J,le,Ee,ce,ge,y,x,b,D,be,_e]}class Hu extends dr{constructor(e){super(),hr(this,e,Vu,ku,lr,{isConnected:1,isCreating:2,isJoining:3,joinCode:0,sessionId:4,isCreator:5,peerConnected:6,sessionType:36,qrCodeUrl:7,hasSignedInSession:8,personalStatusLoading:9,personalRecommendedAction:37,personalOnlinePeer
20s:10,personalMaxPeers:11,personalCurrentDeviceConnected:38,personalSessionState:39,isLeavingSession:12},null,[-1,-1])}}function Gu(r){let e,t,n,i=r[1]("clipboard.file_transfer.title")+"",a,o,s,f,u=r[1]("clipboard.send_text")+"",l,c,d;return{c(){e=O("div"),t=O("button"),n=F("📁 "),a=F(i),o=k(),s=O("button"),f=F("📝 "),l=F(u),this.h()},l(h){e=T(h,"DIV",{class:!0});var v=N(e);t=T(v,"BUTTON",{class:!0});var p=N(t);n=L(p,"📁 "),a=L(p,i),p.forEach(C),o=U(v),s=T(v,"BUTTON",{class:!0});var y=N(s);f=L(y,"📝 "),l=L(y,u),y.forEach(C),v.forEach(C),this.h()},h(){E(t,"class","tab-button svelte-1389xb7"),Te(t,"active",r[0]==="files"),E(s,"class","tab-button svelte-1389xb7"),Te(s,"active",r[0]==="text"),E(e,"class","tab-navigation svelte-1389xb7")},m(h,v){j(h,e,v),_(e,t),_(t,n),_(t,a),_(e,o),_(e,s),_(s,f),_(s,l),c||(d=[Ie(t,"click",r[3]),Ie(s,"click",r[4])],c=!0)},p(h,[v]){v&2&&i!==(i=h[1]("clipboard.file_transfer.title")+"")&&Z(a,i),v&1&&Te(t,"active",h[0]==="files"),v&2&&u!==(u=h[1]("clipboard.send_text")+"")&&Z(l,u),v&1&&Te(s,"active",h[0]==="text")},i:fr,o:fr,d(h){h&&C(e),c=!1,cr(d)}}}function Xu(r,e,t){let n;$t(r,ht,f=>t(1,n=f));let{activeTab:i}=e;const a=Ir(),o=()=>a("tabChange","files"),s=()=>a("tabChange","text");return r.$$set=f=>{"activeTab"in f&&t(0,i=f.activeTab)},[i,n,a,o,s]}class Wu extends dr{constructor(e){super(),hr(this,e,Xu,Gu,lr,{activeTab:0})}}function Ui(r,e,t){const n=r.slice();return n[32]=e[t],n}function zu(r){let e=[],t=new Map,n,i=mt(r[9]);const a=o=>o[32].id;for(let o=0;o<i.length;o+=1){let s=Ui(r,i,o),f=a(s);t.set(f,e[o]=Wi(f,s))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();n=vt()},l(o){for(let s=0;s<e.length;s+=1)e[s].l(o);n=vt()},m(o,s){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(o,s);j(o,n,s)},p(o,s){s[0]&462420&&(i=mt(o[9]),e=jr(e,s,a,1,o,i,t,n.parentNode,Yr,Wi,n,Ui))},d(o){o&&C(n);for(let s=0;s<e.length;s+=1)e[s].d(o)}}}function ju(r){let e,t,n='<svg width="38" height="38" viewBox="0 0 24 24"><path d="M21 15a4 4 0 0 1-4 4H8l-5 3V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path></svg>',i,a,o=r[10]("clipboard.chat.empty_title")+"",s,f,u,l=r[10]("clipboard.chat.empty_hint")+"",c;return{c(){e=O("div"),t=O("div"),t.innerHTML=n,i=k(),a=O("strong"),s=F(o),f=k(),u=O("span"),c=F(l),this.h()},l(d){e=T(d,"DIV",{class:!0});var h=N(e);t=T(h,"DIV",{class:!0,"aria-hidden":!0,"data-svelte-h":!0}),Lt(t)!=="svelte-1ivqx3b"&&(t.innerHTML=n),i=U(h),a=T(h,"STRONG",{class:!0});var v=N(a);s=L(v,o),v.forEach(C),f=U(h),u=T(h,"SPAN",{class:!0});var p=N(u);c=L(p,l),p.forEach(C),h.forEach(C),this.h()},h(){E(t,"class","empty-icon svelte-47ntu7"),E(t,"aria-hidden","true"),E(a,"class","svelte-47ntu7"),E(u,"class","svelte-47ntu7"),E(e,"class","empty-state svelte-47ntu7")},m(d,h){j(d,e,h),_(e,t),_(e,i),_(e,a),_(a,s),_(e,f),_(e,u),_(u,c)},p(d,h){h[0]&1024&&o!==(o=d[10]("clipboard.chat.empty_title")+"")&&Z(s,o),h[0]&1024&&l!==(l=d[10]("clipboard.chat.empty_hint")+"")&&Z(c,l)},d(d){d&&C(e)}}}function Yu(r){let e,t=r[32].text+"",n;return{c(){e=O("div"),n=F(t),this.h()},l(i){e=T(i,"DIV",{class:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","message-text svelte-47ntu7")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&512&&t!==(t=i[32].text+"")&&Z(n,t)},d(i){i&&C(e)}}}function Zu(r){let e,t=r[10]("clipboard.chat.burn_reveal")+"",n,i,a,o;function s(){return r[22](r[32])}return{c(){e=O("button"),n=F(t),this.h()},l(f){e=T(f,"BUTTON",{type:!0,class:!0});var u=N(e);n=L(u,t),u.forEach(C),this.h()},h(){E(e,"type","button"),E(e,"class","reveal-button svelte-47ntu7"),e.disabled=i=!r[2]},m(f,u){j(f,e,u),_(e,n),a||(o=Ie(e,"click",s),a=!0)},p(f,u){r=f,u[0]&1024&&t!==(t=r[10]("clipboard.chat.burn_reveal")+"")&&Z(n,t),u[0]&4&&i!==(i=!r[2])&&(e.disabled=i)},d(f){f&&C(e),a=!1,o()}}}function Vi(r){let e,t=(r[6]===r[32].id?r[10]("clipboard.chat.copied"):r[10]("clipboard.copy"))+"",n,i,a,o;function s(){return r[23](r[32])}return{c(){e=O("button"),n=F(t),this.h()},l(f){e=T(f,"BUTTON",{type:!0,class:!0,"aria-label":!0});var u=N(e);n=L(u,t),u.forEach(C),this.h()},h(){E(e,"type","button"),E(e,"class","copy-button svelte-47ntu7"),E(e,"aria-label",i=r[10]("clipboard.chat.copy_message"))},m(f,u){j(f,e,u),_(e,n),a||(o=Ie(e,"click",s),a=!0)},p(f,u){r=f,u[0]&1600&&t!==(t=(r[6]===r[32].id?r[10]("clipboard.chat.copied"):r[10]("clipboard.copy"))+"")&&Z(n,t),u[0]&1024&&i!==(i=r[10]("clipboard.chat.copy_message"))&&E(e,"aria-label",i)},d(f){f&&C(e),a=!1,o()}}}function Hi(r){let e,t=(r[32].expiresAt===void 0?r[10]("clipboard.chat.burn_waiting"):r[10]("clipboard.chat.burn_countdown").replace("{count}",String(Math.max(0,Math.ceil((r[32].expiresAt-r[4])/1e3)))))+"",n;return{c(){e=O("span"),n=F(t),this.h()},l(i){e=T(i,"SPAN",{class:!0});var a=N(e);
20n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","burn-status svelte-47ntu7")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1552&&t!==(t=(i[32].expiresAt===void 0?i[10]("clipboard.chat.burn_waiting"):i[10]("clipboard.chat.burn_countdown").replace("{count}",String(Math.max(0,Math.ceil((i[32].expiresAt-i[4])/1e3)))))+"")&&Z(n,t)},d(i){i&&C(e)}}}function Gi(r){let e,t,n=r[18](r[32])+"",i,a,o;function s(c,d){if(c[32].status==="sending")return qu;if(c[32].status==="delivered")return Ku}let f=s(r),u=f&&f(r),l=r[32].expiresAt===void 0&&(r[32].status==="unconfirmed"||r[32].status==="failed")&&Xi(r);return{c(){e=O("span"),u&&u.c(),t=k(),i=F(n),a=k(),l&&l.c(),o=vt(),this.h()},l(c){e=T(c,"SPAN",{class:!0});var d=N(e);u&&u.l(d),t=U(d),i=L(d,n),d.forEach(C),a=U(c),l&&l.l(c),o=vt(),this.h()},h(){E(e,"class","delivery-status svelte-47ntu7"),Te(e,"warning",r[32].status==="unconfirmed"),Te(e,"error",r[32].status==="failed")},m(c,d){j(c,e,d),u&&u.m(e,null),_(e,t),_(e,i),j(c,a,d),l&&l.m(c,d),j(c,o,d)},p(c,d){f!==(f=s(c))&&(u&&u.d(1),u=f&&f(c),u&&(u.c(),u.m(e,t))),d[0]&512&&n!==(n=c[18](c[32])+"")&&Z(i,n),d[0]&512&&Te(e,"warning",c[32].status==="unconfirmed"),d[0]&512&&Te(e,"error",c[32].status==="failed"),c[32].expiresAt===void 0&&(c[32].status==="unconfirmed"||c[32].status==="failed")?l?l.p(c,d):(l=Xi(c),l.c(),l.m(o.parentNode,o)):l&&(l.d(1),l=null)},d(c){c&&(C(e),C(a),C(o)),u&&u.d(),l&&l.d(c)}}}function Ku(r){let e,t="✓";return{c(){e=O("span"),e.textContent=t,this.h()},l(n){e=T(n,"SPAN",{"aria-hidden":!0,"data-svelte-h":!0}),Lt(e)!=="svelte-1fthx1o"&&(e.textContent=t),this.h()},h(){E(e,"aria-hidden","true")},m(n,i){j(n,e,i)},d(n){n&&C(e)}}}function qu(r){let e;return{c(){e=O("span"),this.h()},l(t){e=T(t,"SPAN",{class:!0,"aria-hidden":!0}),N(e).forEach(C),this.h()},h(){E(e,"class","status-spinner svelte-47ntu7"),E(e,"aria-hidden","true")},m(t,n){j(t,e,n)},d(t){t&&C(e)}}}function Xi(r){let e,t=r[10]("clipboard.chat.retry")+"",n,i,a,o;function s(){return r[24](r[32])}return{c(){e=O("button"),n=F(t),this.h()},l(f){e=T(f,"BUTTON",{type:!0,class:!0});var u=N(e);n=L(u,t),u.forEach(C),this.h()},h(){E(e,"type","button"),E(e,"class","retry-button svelte-47ntu7"),e.disabled=i=!r[2]},m(f,u){j(f,e,u),_(e,n),a||(o=Ie(e,"click",s),a=!0)},p(f,u){r=f,u[0]&1024&&t!==(t=r[10]("clipboard.chat.retry")+"")&&Z(n,t),u[0]&4&&i!==(i=!r[2])&&(e.disabled=i)},d(f){f&&C(e),a=!1,o()}}}function Wi(r,e){let t,n,i,a,o,s,f,u=Ki(e[32].createdAt)+"",l,c,d,h;function v(x,m){return x[32].ephemeral&&x[32].direction==="incoming"&&x[32].expiresAt===void 0?Zu:Yu}let p=v(e),y=p(e),g=!e[32].ephemeral&&Vi(e),w=e[32].ephemeral&&Hi(e),A=e[32].direction==="outgoing"&&Gi(e);return{key:r,first:null,c(){t=O("div"),n=O("div"),i=O("div"),y.c(),a=k(),o=O("div"),g&&g.c(),s=k(),f=O("span"),l=F(u),c=k(),w&&w.c(),d=k(),A&&A.c(),h=k(),this.h()},l(x){t=T(x,"DIV",{class:!0});var m=N(t);n=T(m,"DIV",{class:!0});var S=N(n);i=T(S,"DIV",{class:!0});var b=N(i);y.l(b),b.forEach(C),a=U(S),o=T(S,"DIV",{class:!0});var D=N(o);g&&g.l(D),s=U(D),f=T(D,"SPAN",{});var M=N(f);l=L(M,u),M.forEach(C),c=U(D),w&&w.l(D),d=U(D),A&&A.l(D),D.forEach(C),S.forEach(C),h=U(m),m.forEach(C),this.h()},h(){E(i,"class","message-bubble svelte-47ntu7"),E(o,"class","message-meta svelte-47ntu7"),E(n,"class","message-group svelte-47ntu7"),E(t,"class","message-row svelte-47ntu7"),Te(t,"outgoing",e[32].direction==="outgoing"),this.first=t},m(x,m){j(x,t,m),_(t,n),_(n,i),y.m(i,null),_(n,a),_(n,o),g&&g.m(o,null),_(o,s),_(o,f),_(f,l),_(o,c),w&&w.m(o,null),_(o,d),A&&A.m(o,null),_(t,h)},p(x,m){e=x,p===(p=v(e))&&y?y.p(e,m):(y.d(1),y=p(e),y&&(y.c(),y.m(i,null))),e[32].ephemeral?g&&(g.d(1),g=null):g?g.p(e,m):(g=Vi(e),g.c(),g.m(o,s)),m[0]&512&&u!==(u=Ki(e[32].createdAt)+"")&&Z(l,u),e[32].ephemeral?w?w.p(e,m):(w=Hi(e),w.c(),w.m(o,d)):w&&(w.d(1),w=null),e[32].direction==="outgoing"?A?A.p(e,m):(A=Gi(e),A.c(),A.m(o,null)):A&&(A.d(1),A=null),m[0]&512&&Te(t,"outgoing",e[32].direction==="outgoing")},d(x){x&&C(t),y.d(),g&&g.d(),w&&w.d(),A&&A.d()}}}function zi(r){let e,t,n=r[10]("clipboard.chat.new_messages")+"",i,a,o;return{c(){e=O("button"),t=F("↓ "),i=F(n),this.h()},l(s){e=T(s,"BUTTON",{type:!0,class:!0});var f=N(e);t=L(f,"↓ "),i=L(f,n),f.forEach(C),this.h()},h(){E(e,"type","button"),E(e,"class","new-message-button svelte-47ntu7")},m(s,f){j(s,e,f),_(e,t),_(e,i),a||(o=Ie(e,"click",r[26]),a=!0)},p(s,f){f[0]&1024&&n!==(n=s[10]("clipboard.chat.new_messages")+"")&&Z(i,n)},d(s){s&&C(e),a=!1,o()}}}
20function ji(r){let e,t=r[10]("clipboard.chat.peer_offline")+"",n;return{c(){e=O("div"),n=F(t),this.h()},l(i){e=T(i,"DIV",{class:!0,role:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","offline-notice svelte-47ntu7"),E(e,"role","status")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1024&&t!==(t=i[10]("clipboard.chat.peer_offline")+"")&&Z(n,t)},d(i){i&&C(e)}}}function Yi(r){let e,t=r[10]("clipboard.chat.burn_hint")+"",n,i,a,o=!r[3]&&Zi(r);return{c(){e=O("p"),n=F(t),i=k(),o&&o.c(),a=vt(),this.h()},l(s){e=T(s,"P",{class:!0});var f=N(e);n=L(f,t),f.forEach(C),i=U(s),o&&o.l(s),a=vt(),this.h()},h(){E(e,"class","burn-help svelte-47ntu7")},m(s,f){j(s,e,f),_(e,n),j(s,i,f),o&&o.m(s,f),j(s,a,f)},p(s,f){f[0]&1024&&t!==(t=s[10]("clipboard.chat.burn_hint")+"")&&Z(n,t),s[3]?o&&(o.d(1),o=null):o?o.p(s,f):(o=Zi(s),o.c(),o.m(a.parentNode,a))},d(s){s&&(C(e),C(i),C(a)),o&&o.d(s)}}}function Zi(r){let e,t=r[10]("clipboard.chat.burn_unavailable")+"",n;return{c(){e=O("p"),n=F(t),this.h()},l(i){e=T(i,"P",{class:!0,role:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","burn-help svelte-47ntu7"),E(e,"role","status")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&1024&&t!==(t=i[10]("clipboard.chat.burn_unavailable")+"")&&Z(n,t)},d(i){i&&C(e)}}}function Qu(r){let e,t,n,i,a,o,s=r[10]("clipboard.chat.storage_notice")+"",f,u,l,c,d,h,v,p,y,g,w,A,x,m=r[10]("clipboard.chat.burn_option")+"",S,b,D,M,G,W,V,z,Q,de=r[10]("clipboard.chat.send_hint")+"",re,Y,X,R,ee=r[10]("clipboard.chat.send_message")+"",pe,H,J,le,Ee,ce,ge;function be(ae,q){return ae[9].length===0?ju:zu}let _e=be(r),K=_e(r),Ae=r[7]&&zi(r),ne=!r[2]&&ji(r),ve=r[1]&&Yi(r);return{c(){e=O("div"),t=O("div"),n=rr("svg"),i=rr("path"),a=k(),o=O("span"),f=F(s),u=k(),l=O("div"),c=O("div"),K.c(),h=k(),Ae&&Ae.c(),v=k(),ne&&ne.c(),p=k(),y=O("div"),g=O("label"),w=O("input"),A=k(),x=O("span"),S=F(m),b=k(),ve&&ve.c(),D=k(),M=O("textarea"),V=k(),z=O("div"),Q=O("span"),re=F(de),Y=k(),X=O("button"),R=O("span"),pe=F(ee),H=k(),J=rr("svg"),le=rr("path"),this.h()},l(ae){e=T(ae,"DIV",{class:!0});var q=N(e);t=T(q,"DIV",{class:!0});var se=N(t);n=nr(se,"svg",{width:!0,height:!0,viewBox:!0,"aria-hidden":!0,class:!0});var Fe=N(n);i=nr(Fe,"path",{d:!0,fill:!0,stroke:!0,"stroke-width":!0,"stroke-linecap":!0,"stroke-linejoin":!0}),N(i).forEach(C),Fe.forEach(C),a=U(se),o=T(se,"SPAN",{});var je=N(o);f=L(je,s),je.forEach(C),se.forEach(C),u=U(q),l=T(q,"DIV",{class:!0});var et=N(l);c=T(et,"DIV",{class:!0,role:!0,"aria-label":!0,"aria-live":!0});var wt=N(c);K.l(wt),wt.forEach(C),h=U(et),Ae&&Ae.l(et),et.forEach(C),v=U(q),ne&&ne.l(q),p=U(q),y=T(q,"DIV",{class:!0});var Ye=N(y);g=T(Ye,"LABEL",{class:!0});var He=N(g);w=T(He,"INPUT",{type:!0}),A=U(He),x=T(He,"SPAN",{});var gt=N(x);S=L(gt,m),gt.forEach(C),He.forEach(C),b=U(Ye),ve&&ve.l(Ye),D=U(Ye),M=T(Ye,"TEXTAREA",{class:!0,placeholder:!0,rows:!0,maxlength:!0}),N(M).forEach(C),V=U(Ye),z=T(Ye,"DIV",{class:!0});var te=N(z);Q=T(te,"SPAN",{class:!0});var ct=N(Q);re=L(ct,de),ct.forEach(C),Y=U(te),X=T(te,"BUTTON",{type:!0,class:!0});var kt=N(X);R=T(kt,"SPAN",{});var Or=N(R);pe=L(Or,ee),Or.forEach(C),H=U(kt),J=nr(kt,"svg",{width:!0,height:!0,viewBox:!0,"aria-hidden":!0});var Tr=N(J);le=nr(Tr,"path",{d:!0,fill:!0,stroke:!0,"stroke-width":!0,"stroke-linecap":!0,"stroke-linejoin":!0}),N(le).forEach(C),Tr.forEach(C),kt.forEach(C),te.forEach(C),Ye.forEach(C),q.forEach(C),this.h()},h(){E(i,"d","M7 10V8a5 5 0 0 1 10 0v2m-11 0h12v10H6z"),E(i,"fill","none"),E(i,"stroke","currentColor"),E(i,"stroke-width","1.8"),E(i,"stroke-linecap","round"),E(i,"stroke-linejoin","round"),E(n,"width","15"),E(n,"height","15"),E(n,"viewBox","0 0 24 24"),E(n,"aria-hidden","true"),E(n,"class","svelte-47ntu7"),E(t,"class","privacy-note svelte-47ntu7"),E(c,"class","message-list svelte-47ntu7"),E(c,"role","log"),E(c,"aria-label",d=r[10]("clipboard.chat.conversation")),E(c,"aria-live","polite"),E(l,"class","message-area svelte-47ntu7"),E(w,"type","checkbox"),E(g,"class","burn-option svelte-47ntu7"),E(M,"class","text-input svelte-47ntu7"),E(M,"placeholder",G=r[10]("clipboard.chat.placeholder")),E(M,"rows","3"),E(M,"maxlength","100000"),M.disabled=W=!r[2],E(Q,"class","send-hint svelte-47ntu7"),E(le,"d","m4 4 17 8-17 8 3-8zm3 8h14"),E(le,"fill","none"),E(le,"stroke","currentColor"),E(le,"stroke-width","1.8"),E(le,"stroke-linecap","round"),E(le,"stroke-linejoin","round"),E(J,"width","17"),E(J,"height","17"),E(J,"viewBox","0 0 24 24"),E(J,"aria-hidden","true"),E(X,"type","button"),E(X,"class","send-button svelte-47ntu7"),X.disabled=Ee=!r[2]||!r[0].trim()||r[1]&&!r[3],E(z,"class","composer-footer svelte-47ntu7"),E(y,"class","composer svelte-47ntu7"),E(e,"class","chat-shell svelte-47ntu7")},m(ae,q){j(ae,e,q),_(e,t),_(t,n),_(n,i),_(t,a),_(t,o),_(o,f),_(e,u),_(e,l),_(l,c),K.m(c,null),r[25](c),_(l,h),Ae&&Ae.m(l,null),_(e,v),ne&&ne.m(e,null),_(e,p),_(e,y),_(y,g),_(g,w),w.checked=r[1],_(g,A),_(g,x),_(x,S),_(y,b),ve&&ve.m(y,null),_(y,D),_(y,M),kr(M,r[0]),_(y,V),_(y,z),_(z,Q),_(Q,re),_(z,Y),_(z,X),_(X,R),_(R,pe),_(X,H),_(X,J),_(J,le),ce||(ge=[Ie(c,"scroll",r[13]),Ie(w,"change",r[27]),Ie(M,"input",r[28]),Ie(M,"keydown",r[15]),Ie(X,"click",r[14])],ce=!0)},p(ae,q){q[0]&1024&&s!==(s=ae[10]("clipboard.chat.storage_notice")+"")&&Z(f,s),_e===(_e=be(ae))&&K?K.p(ae,q):(K.d(1),K=_e(ae),K&&(K.c(),K.m(c,null))),q[0]&1024&&d!==(d=ae[10]("clipboard.chat.conversation"))&&E(c,"aria-label",d),ae[7]?Ae?Ae.p(ae,q):(Ae=zi(ae),Ae.c(),Ae.m(l,null)):Ae&&(Ae.d(1),Ae=null),ae[2]?ne&&(ne.d(1),ne=null):ne?ne.p(ae,q):(ne=ji(ae),ne.c(),ne.m(e,p)),q[0]&2&&(w.checked=ae[1]),q[0]&1024&&m!==(m=ae[10]("clipboard.chat.burn_option")+"")&&Z(S,m),ae[1]?ve?ve.p(ae,q):(ve=Yi(ae),ve.c(),ve.m(y,D)):ve&&(ve.d(1),ve=null),q[0]&1024&&G!==(G=ae[10]("clipboard.chat.placeholder"))&&E(M,"placeholder",G),q[0]&4&&W!==(W=!ae[2])&&(M.disabled=W),q[0]&1&&kr(M,ae[0]),q[0]&1024&&de!==(de=ae[10]("clipboard.chat.send_hint")+"")&&Z(re,de),q[0]&1024&&ee!==(ee=ae[10]("clipboard.chat.send_message")+"")&&Z(pe,ee),q[0]&15&&Ee!==(Ee=!ae[2]||!ae[0].trim()||ae[1]&&!ae[3])&&(X.disabled=Ee)},d(ae){ae&&C(e),K.d(),r[25](null),Ae&&Ae.d(),ne&&ne.d(),ve&&ve.d(),ce=!1,cr(ge)}}}function $u(r){let e,t,n,i,a;return e=new En({props:{title:r[10]("clipboard.chat.conversation"),sectionId:"text-sharing",$$slots:{default:[Qu]},$$scope:{ctx:r}}}
20),{c(){it(e.$$.fragment),t=k(),n=O("span"),i=F(r[8]),this.h()},l(o){at(e.$$.fragment,o),t=U(o),n=T(o,"SPAN",{class:!0,"aria-live":!0});var s=N(n);i=L(s,r[8]),s.forEach(C),this.h()},h(){E(n,"class","sr-only svelte-47ntu7"),E(n,"aria-live","polite")},m(o,s){ot(e,o,s),j(o,t,s),j(o,n,s),_(n,i),a=!0},p(o,s){const f={};s[0]&1024&&(f.title=o[10]("clipboard.chat.conversation")),s[0]&1791|s[1]&16&&(f.$$scope={dirty:s,ctx:o}),e.$set(f),(!a||s[0]&256)&&Z(i,o[8])},i(o){a||(he(e.$$.fragment,o),a=!0)},o(o){xe(e.$$.fragment,o),a=!1},d(o){o&&(C(t),C(n)),st(e,o)}}}function Ki(r){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function Ju(r,e,t){let n,i,a,o;$t(r,ht,R=>t(10,o=R));const s=Ir();let{textContent:f}=e,{messages:u}=e,{peerConnected:l}=e,{peerSupportsEphemeral:c=!1}=e,{burnAfterRead:d=!1}=e,h=Date.now(),v=null,p=0,y="",g=!1,w=null;zr(()=>{const R=()=>{t(4,h=Date.now())},ee=setInterval(R,250);return document.addEventListener("visibilitychange",R),window.addEventListener("pageshow",R),t(20,p=u.length),m("auto"),()=>{clearInterval(ee),document.removeEventListener("visibilitychange",R),window.removeEventListener("pageshow",R),w&&clearTimeout(w)}});async function A(R){if(typeof window>"u"||u.length<=R)return;const ee=u[u.length-1],pe=R===0||(ee==null?void 0:ee.direction)==="outgoing"||x();await Cr(),pe?await m(R===0?"auto":"smooth"):(ee==null?void 0:ee.direction)==="incoming"&&t(7,g=!0)}function x(){return v?v.scrollHeight-v.scrollTop-v.clientHeight<72:!0}async function m(R="smooth"){await Cr(),v&&(v.scrollTo({top:v.scrollHeight,behavior:R}),t(7,g=!1))}function S(){x()&&t(7,g=!1)}function b(){const R=f.trim();!R||!l||d&&!c||(s("sendText",{text:R,ephemeral:d}),t(0,f=""))}function D(R){R.key!=="Enter"||R.shiftKey||R.isComposing||(R.preventDefault(),b())}function M(R){l&&s("retryText",{messageId:R})}async function G(R){if(!R.ephemeral)try{await navigator.clipboard.writeText(R.text),t(6,y=R.id),w&&clearTimeout(w),w=setTimeout(()=>{t(6,y="")},1800)}catch(ee){console.warn("Unable to copy clipboard message:",ee)}}function W(R){switch(R.status){case"sending":return ht.get("clipboard.chat.sending");case"delivered":return ht.get("clipboard.chat.delivered");case"unconfirmed":return ht.get("clipboard.chat.unconfirmed");case"failed":return ht.get("clipboard.chat.failed")}}const V=R=>s("revealText",{messageId:R.id}),z=R=>G(R),Q=R=>M(R.id);function de(R){Jt[R?"unshift":"push"](()=>{v=R,t(5,v)})}const re=()=>m();function Y(){d=this.checked,t(1,d)}function X(){f=this.value,t(0,f)}return r.$$set=R=>{"textContent"in R&&t(0,f=R.textContent),"messages"in R&&t(19,u=R.messages),"peerConnected"in R&&t(2,l=R.peerConnected),"peerSupportsEphemeral"in R&&t(3,c=R.peerSupportsEphemeral),"burnAfterRead"in R&&t(1,d=R.burnAfterRead)},r.$$.update=()=>{if(r.$$.dirty[0]&524304&&t(9,n=u.filter(R=>R.expiresAt===void 0||R.expiresAt>h)),r.$$.dirty[0]&524288&&t(21,i=[...u].reverse().find(R=>R.direction==="outgoing")),r.$$.dirty[0]&2097152&&t(8,a=i?W(i):""),r.$$.dirty[0]&1572864&&u.length!==p){const R=p;t(20,p=u.length),A(R)}},[f,d,l,c,h,v,y,g,a,n,o,s,m,S,b,D,M,G,W,u,p,i,V,z,Q,de,re,Y,X]}class el extends dr{constructor(e){super(),hr(this,e,Ju,$u,lr,{textContent:0,messages:19,peerConnected:2,peerSupportsEphemeral:3,burnAfterRead:1},null,[-1,-1])}}const{document:It}=oo;function qi(r,e,t){const n=r.slice();return n[89]=e[t],n}function Qi(r,e,t){const n=r.slice();return n[92]=e[t],n}function $i(r,e,t){const n=r.slice();return n[92]=e[t],n}function Ji(r){let e,t=`<script type="application/ld+json">${JSON.stringify(r[43]).replace(/</g,"\\u003c")}<\/script>`,n;return{c(){e=new da(!1),n=vt(),this.h()},l(i){e=ha(i,!1),n=vt(),this.h()},h(){e.a=n},m(i,a){e.m(t,i,a),j(i,n,a)},p(i,a){a[1]&4096&&t!==(t=`<script type="application/ld+json">${JSON.stringify(i[43]).replace(/</g,"\\u003c")}<\/script>`)&&e.p(t)},d(i){i&&(C(n),e.d())}}}function ea(r){let e,t,n=(r[42]?r[9]("clipboard.expand_header"):r[9]("clipboard.collapse_header"))+"",i,a,o,s,f,u,l,c;return{c(){e=O("button"),t=O("span"),i=F(n),a=k(),o=rr("svg"),s=rr("path"),this.h()},l(d){e=T(d,"BUTTON",{type:!0,class:!0,"aria-expanded":!0,"aria-controls":!0,"aria-label":!0});var h=N(e);t=T(h,"SPAN",{class:!0});var v=N(t);
20i=L(v,n),v.forEach(C),a=U(h),o=nr(h,"svg",{class:!0,width:!0,height:!0,viewBox:!0,"aria-hidden":!0});var p=N(o);s=nr(p,"path",{d:!0,fill:!0,stroke:!0,"stroke-width":!0,"stroke-linecap":!0,"stroke-linejoin":!0}),N(s).forEach(C),p.forEach(C),h.forEach(C),this.h()},h(){E(t,"class","toggle-label svelte-oym6lq"),E(s,"d","M6 9l6 6 6-6"),E(s,"fill","none"),E(s,"stroke","currentColor"),E(s,"stroke-width","2"),E(s,"stroke-linecap","round"),E(s,"stroke-linejoin","round"),E(o,"class","toggle-icon svelte-oym6lq"),E(o,"width","16"),E(o,"height","16"),E(o,"viewBox","0 0 24 24"),E(o,"aria-hidden","true"),E(e,"type","button"),E(e,"class","header-toggle svelte-oym6lq"),E(e,"aria-expanded",f=!r[42]),E(e,"aria-controls","clipboard-header-description"),E(e,"aria-label",u=r[42]?r[9]("clipboard.expand_header"):r[9]("clipboard.collapse_header"))},m(d,h){j(d,e,h),_(e,t),_(t,i),_(e,a),_(e,o),_(o,s),l||(c=Ie(e,"click",r[63]),l=!0)},p(d,h){h[0]&512|h[1]&2048&&n!==(n=(d[42]?d[9]("clipboard.expand_header"):d[9]("clipboard.collapse_header"))+"")&&Z(i,n),h[1]&2048&&f!==(f=!d[42])&&E(e,"aria-expanded",f),h[0]&512|h[1]&2048&&u!==(u=d[42]?d[9]("clipboard.expand_header"):d[9]("clipboard.collapse_header"))&&E(e,"aria-label",u)},d(d){d&&C(e),l=!1,c()}}}function ta(r){let e,t,n,i,a,o=r[9]("clipboard.peer_connected")+"",s,f,u=r[21]&&ra(r);return{c(){e=O("div"),t=O("div"),n=O("div"),i=k(),a=O("span"),s=F(o),f=k(),u&&u.c(),this.h()},l(l){e=T(l,"DIV",{class:!0});var c=N(e);t=T(c,"DIV",{class:!0});var d=N(t);n=T(d,"DIV",{class:!0}),N(n).forEach(C),i=U(d),a=T(d,"SPAN",{class:!0});var h=N(a);s=L(h,o),h.forEach(C),d.forEach(C),f=U(c),u&&u.l(c),c.forEach(C),this.h()},h(){E(n,"class","status-dot connected svelte-oym6lq"),E(a,"class","status-text svelte-oym6lq"),E(t,"class","status-badge svelte-oym6lq"),E(e,"class","session-status svelte-oym6lq")},m(l,c){j(l,e,c),_(e,t),_(t,n),_(t,i),_(t,a),_(a,s),_(e,f),u&&u.m(e,null)},p(l,c){c[0]&512&&o!==(o=l[9]("clipboard.peer_connected")+"")&&Z(s,o),l[21]?u?u.p(l,c):(u=ra(l),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},d(l){l&&C(e),u&&u.d()}}}function ra(r){let e,t,n="LAN",i,a,o=r[9]("clipboard.lan_direct")+"",s,f;return{c(){e=O("div"),t=O("span"),t.textContent=n,i=k(),a=O("span"),s=F(o),this.h()},l(u){e=T(u,"DIV",{class:!0,title:!0});var l=N(e);t=T(l,"SPAN",{class:!0,"data-svelte-h":!0}),Lt(t)!=="svelte-7q6gdo"&&(t.textContent=n),i=U(l),a=T(l,"SPAN",{class:!0});var c=N(a);s=L(c,o),c.forEach(C),l.forEach(C),this.h()},h(){E(t,"class","status-icon svelte-oym6lq"),E(a,"class","status-text svelte-oym6lq"),E(e,"class","status-badge lan svelte-oym6lq"),E(e,"title",f=r[9]("clipboard.lan_direct"))},m(u,l){j(u,e,l),_(e,t),_(e,i),_(e,a),_(a,s)},p(u,l){l[0]&512&&o!==(o=u[9]("clipboard.lan_direct")+"")&&Z(s,o),l[0]&512&&f!==(f=u[9]("clipboard.lan_direct"))&&E(e,"title",f)},d(u){u&&C(e)}}}function na(r){let e,t,n,i,a,o,s,f=r[34]?"等待中":r[28].includes("成功")?"成功":"提示",u,l,c,d,h,v,p,y="✕",g,w;function A(b,D){return D[0]&268435456&&(i=null),b[34]?nl:(i==null&&(i=!!b[28].includes("成功")),i?rl:tl)}let x=A(r,[-1,-1,-1,-1]),m=x(r),S=r[29]==="SESSION_FULL_ONLINE"&&r[30]&&ia(r);return{c(){e=O("div"),t=O("div"),n=O("div"),m.c(),a=k(),o=O("div"),s=O("strong"),u=F(f),l=k(),c=O("p"),d=F(r[28]),h=k(),S&&S.c(),v=k(),p=O("button"),p.textContent=y,this.h()},l(b){e=T(b,"DIV",{class:!0});var D=N(e);t=T(D,"DIV",{class:!0});var M=N(t);n=T(M,"DIV",{class:!0});var G=N(n);m.l(G),G.forEach(C),a=U(M),o=T(M,"DIV",{class:!0});var W=N(o);s=T(W,"STRONG",{class:!0});var V=N(s);u=L(V,f),V.forEach(C),l=U(W),c=T(W,"P",{class:!0});var z=N(c);d=L(z,r[28]),z.forEach(C),W.forEach(C),h=U(M),S&&S.l(M),v=U(M),p=T(M,"BUTTON",{class:!0,"aria-label":!0,"data-svelte-h":!0}),Lt(p)!=="svelte-1pizmc3"&&(p.textContent=y),M.forEach(C),D.forEach(C),this.h()},h(){E(n,"class","error-icon svelte-oym6lq"),E(s,"class","svelte-oym6lq"),E(c,"class","svelte-oym6lq"),E(o,"class","error-text svelte-oym6lq"),E(p,"class","error-close svelte-oym6lq"),E(p,"aria-label","关闭"),E(t,"class","error-content svelte-oym6lq"),E(e,"class","error-notification svelte-oym6lq"),Te(e,"waiting",r[34]),Te(e,"success",r[28].includes("成功"))},m(b,D){j(b,e,D),_(e,t),_(t,n),m.m(n,null),_(t,a),_(t,o),_(o,s),_(s,u),_(o,l),_(o,c),_(c,d),_(t,h),S&&S.m(t,null),_(t,v),_(t,p),g||(w=Ie(p,"click",r[60]),g=!0)},p(b,D){x!==(x=A(b,D))&&(m.d(1),m=x(b),m&&(m.c(),m.m(n,null))),D[0]&268435456|D[1]&8&&f!==(f=b[34]?"等待中":b[28].includes("成功")?"成功":"提示")&&Z(u,f),D[0]&268435456&&Z(d,b[28]),b[29]==="SESSION_FULL_ONLINE"&&b[30]?S?S.p(b,D):(S=ia(b),S.c(),S.m(t,v)):S&&(S.d(1),S=null),D[1]&8&&Te(e,"waiting",b[34]),D[0]&268435456&&Te(e,"success",b[28].includes("成功"))},d(b){b&&C(e),m.d(),S&&S.d(),g=!1,w()}}}function tl(r){let e;return{c(){e=F("⚠️")},l(t){e=L(t,"⚠️")},m(t,n){j(t,e,n)},d(t){t&&C(e)}}}function rl(r){let e;return{c(){e=F("✅")},l(t){e=L(t,"✅")},m(t,n){j(t,e,n)},d(t){t&&C(e)}}}function nl(r){let e;return{c(){e=O("div"),this.h()},l(t){e=T(t,"DIV",{class:!0}),N(e).forEach(C),this.h()},h(){E(e,"class","spinner svelte-oym6lq")},m(t,n){j(t,e,n)},d(t){t&&C(e)}}}function ia(r){let e,t=r[9]("clipboard.replace_old_device")+"",n,i,a;return{c(){e=O("button"),n=F(t),this.h()},l(o){e=T(o,"BUTTON",{class:!0,type:!0});var s=N(e);
20n=L(s,t),s.forEach(C),this.h()},h(){E(e,"class","error-action svelte-oym6lq"),E(e,"type","button")},m(o,s){j(o,e,s),_(e,n),i||(a=Ie(e,"click",r[49]),i=!0)},p(o,s){s[0]&512&&t!==(t=o[9]("clipboard.replace_old_device")+"")&&Z(n,t)},d(o){o&&C(e),i=!1,a()}}}function il(r){let e,t,n;function i(o){r[75](o)}let a={sessionId:r[10],isConnected:r[12],isCreating:r[13],isJoining:r[14],isCreator:r[15],peerConnected:r[16],sessionType:r[19],qrCodeUrl:r[20],hasSignedInSession:r[35],personalStatusLoading:r[36],personalRecommendedAction:r[37],personalOnlinePeers:r[38],personalMaxPeers:r[39],personalCurrentDeviceConnected:r[40],personalSessionState:r[41],isLeavingSession:r[32]};return r[11]!==void 0&&(a.joinCode=r[11]),e=new Hu({props:a}),Jt.push(()=>cn(e,"joinCode",i)),e.$on("createSession",r[45]),e.$on("joinSession",r[46]),e.$on("enterPersonalSession",r[47]),e.$on("leaveSession",r[48]),{c(){it(e.$$.fragment)},l(o){at(e.$$.fragment,o)},m(o,s){ot(e,o,s),n=!0},p(o,s){const f={};s[0]&1024&&(f.sessionId=o[10]),s[0]&4096&&(f.isConnected=o[12]),s[0]&8192&&(f.isCreating=o[13]),s[0]&16384&&(f.isJoining=o[14]),s[0]&32768&&(f.isCreator=o[15]),s[0]&65536&&(f.peerConnected=o[16]),s[0]&524288&&(f.sessionType=o[19]),s[0]&1048576&&(f.qrCodeUrl=o[20]),s[1]&16&&(f.hasSignedInSession=o[35]),s[1]&32&&(f.personalStatusLoading=o[36]),s[1]&64&&(f.personalRecommendedAction=o[37]),s[1]&128&&(f.personalOnlinePeers=o[38]),s[1]&256&&(f.personalMaxPeers=o[39]),s[1]&512&&(f.personalCurrentDeviceConnected=o[40]),s[1]&1024&&(f.personalSessionState=o[41]),s[1]&2&&(f.isLeavingSession=o[32]),!t&&s[0]&2048&&(t=!0,f.joinCode=o[11],ln(()=>t=!1)),e.$set(f)},i(o){n||(he(e.$$.fragment,o),n=!0)},o(o){xe(e.$$.fragment,o),n=!1},d(o){st(e,o)}}}function al(r){let e,t,n,i,a,o,s,f,u=r[9]("clipboard.session_management")+"",l,c,d,h,v,p=(r[32]?r[9]("clipboard.leaving_session"):r[15]?r[9]("clipboard.end_session"):r[9]("clipboard.leave_session"))+"",y,g,w,A;e=new Wu({props:{activeTab:r[22]}}),e.$on("tabChange",r[51]);let x=r[22]==="files"&&aa(r),m=r[22]==="text"&&oa(r),S=r[15]&&r[16]&&sa(r);return{c(){it(e.$$.fragment),t=k(),n=O("div"),x&&x.c(),i=k(),m&&m.c(),a=k(),o=O("div"),s=O("div"),f=O("h3"),l=F(u),c=k(),d=O("div"),S&&S.c(),h=k(),v=O("button"),y=F(p),this.h()},l(b){at(e.$$.fragment,b),t=U(b),n=T(b,"DIV",{class:!0});var D=N(n);x&&x.l(D),i=U(D),m&&m.l(D),D.forEach(C),a=U(b),o=T(b,"DIV",{class:!0});var M=N(o);s=T(M,"DIV",{class:!0});var G=N(s);f=T(G,"H3",{class:!0});var W=N(f);l=L(W,u),W.forEach(C),c=U(G),d=T(G,"DIV",{class:!0});var V=N(d);S&&S.l(V),h=U(V),v=T(V,"BUTTON",{class:!0});var z=N(v);y=L(z,p),z.forEach(C),V.forEach(C),G.forEach(C),M.forEach(C),this.h()},h(){E(n,"class","tab-content svelte-oym6lq"),E(f,"class","svelte-oym6lq"),E(v,"class","btn-secondary danger svelte-oym6lq"),v.disabled=r[32],E(d,"class","session-actions svelte-oym6lq"),E(s,"class","session-info svelte-oym6lq"),E(o,"class","session-management-section svelte-oym6lq")},m(b,D){ot(e,b,D),j(b,t,D),j(b,n,D),x&&x.m(n,null),_(n,i),m&&m.m(n,null),r[74](n),j(b,a,D),j(b,o,D),_(o,s),_(s,f),_(f,l),_(s,c),_(s,d),S&&S.m(d,null),_(d,h),_(d,v),_(v,y),g=!0,w||(A=Ie(v,"click",r[48]),w=!0)},p(b,D){const M={};D[0]&4194304&&(M.activeTab=b[22]),e.$set(M),b[22]==="files"?x?(x.p(b,D),D[0]&4194304&&he(x,1)):(x=aa(b),x.c(),he(x,1),x.m(n,i)):x&&(Rt(),xe(x,1,1,()=>{x=null}),Pt()),b[22]==="text"?m?(m.p(b,D),D[0]&4194304&&he(m,1)):(m=oa(b),m.c(),he(m,1),m.m(n,null)):m&&(Rt(),xe(m,1,1,()=>{m=null}),Pt()),(!g||D[0]&512)&&u!==(u=b[9]("clipboard.session_management")+"")&&Z(l,u),b[15]&&b[16]?S?S.p(b,D):(S=sa(b),S.c(),S.m(d,h)):S&&(S.d(1),S=null),(!g||D[0]&33280|D[1]&2)&&p!==(p=(b[32]?b[9]("clipboard.leaving_session"):b[15]?b[9]("clipboard.end_session"):b[9]("clipboard.leave_session"))+"")&&Z(y,p),(!g||D[1]&2)&&(v.disabled=b[32])},i(b){g||(he(e.$$.fragment,b),he(x),he(m),g=!0)},o(b){xe(e.$$.fragment,b),xe(x),xe(m),g=!1},d(b){b&&(C(t),C(n),C(a),C(o)),st(e,b),x&&x.d(),m&&m.d(),r[74](null),S&&S.d(),w=!1,A()}}}function aa(r){let e,t;return e=new Io({props:{files:r[23],receivedFiles:r[24],sendingFiles:r[0],receivingFiles:r[1],transferProgress:r[2],dragover:r[27],peerConnected:r[16],isTransferring:r[3]}}),e.$on("filesSelected",r[52]),e.$on("removeFile",r[53]),e.$on("sendFiles",r[54]),e.$on("cancelSending",r[55]),e.$on("cancelReceiving",r[56]),e.$on("downloadFile",ul),e.$on("removeReceivedFile",r[57]),e.$on("prepareFileSelection",r[61]),e.$on("fileSelectionComplete",r[62]),{c(){it(e.$$.fragment)},l(n){at(e.$$.fragment,n)},m(n,i){ot(e,n,i),t=!0},p(n,i){const a={};i[0]&8388608&&(a.files=n[23]),i[0]&16777216&&(a.receivedFiles=n[24]),i[0]&1&&(a.sendingFiles=n[0]),i[0]&2&&(a.receivingFiles=n[1]),i[0]&4&&(a.transferProgress=n[2]),i[0]&134217728&&(a.dragover=n[27]),i[0]&65536&&(a.peerConnected=n[16]),i[0]&8&&(a.isTransferring=n[3]),e.$set(a
20)},i(n){t||(he(e.$$.fragment,n),t=!0)},o(n){xe(e.$$.fragment,n),t=!1},d(n){st(e,n)}}}function oa(r){let e,t,n,i;function a(f){r[71](f)}function o(f){r[72](f)}let s={messages:r[26],peerConnected:r[16],peerSupportsEphemeral:r[17]};return r[18]!==void 0&&(s.burnAfterRead=r[18]),r[25]!==void 0&&(s.textContent=r[25]),e=new el({props:s}),Jt.push(()=>cn(e,"burnAfterRead",a)),Jt.push(()=>cn(e,"textContent",o)),e.$on("sendText",r[58]),e.$on("retryText",r[59]),e.$on("revealText",r[73]),{c(){it(e.$$.fragment)},l(f){at(e.$$.fragment,f)},m(f,u){ot(e,f,u),i=!0},p(f,u){const l={};u[0]&67108864&&(l.messages=f[26]),u[0]&65536&&(l.peerConnected=f[16]),u[0]&131072&&(l.peerSupportsEphemeral=f[17]),!t&&u[0]&262144&&(t=!0,l.burnAfterRead=f[18],ln(()=>t=!1)),!n&&u[0]&33554432&&(n=!0,l.textContent=f[25],ln(()=>n=!1)),e.$set(l)},i(f){i||(he(e.$$.fragment,f),i=!0)},o(f){xe(e.$$.fragment,f),i=!1},d(f){st(e,f)}}}function sa(r){let e,t=(r[31]?r[9]("clipboard.releasing_peer_slot"):r[9]("clipboard.release_peer_slot"))+"",n,i,a;return{c(){e=O("button"),n=F(t),this.h()},l(o){e=T(o,"BUTTON",{class:!0});var s=N(e);n=L(s,t),s.forEach(C),this.h()},h(){E(e,"class","btn-secondary release svelte-oym6lq"),e.disabled=r[31]},m(o,s){j(o,e,s),_(e,n),i||(a=Ie(e,"click",r[50]),i=!0)},p(o,s){s[0]&512|s[1]&1&&t!==(t=(o[31]?o[9]("clipboard.releasing_peer_slot"):o[9]("clipboard.release_peer_slot"))+"")&&Z(n,t),s[1]&1&&(e.disabled=o[31])},d(o){o&&C(e),i=!1,a()}}}function fa(r){let e,t,n=r[9]("clipboard.guide.title")+"",i,a,o,s=r[9]("clipboard.guide.summary")+"",f,u,l,c=r[9]("clipboard.guide.scenarios_title")+"",d,h,v,p,y,g=r[9]("clipboard.guide.steps_title")+"",w,A,x,m,S,b,D=r[9]("clipboard.guide.faq_title")+"",M,G,W=mt(["devices","sharing","conversation","discreet"]),V=[];for(let Y=0;Y<4;Y+=1)V[Y]=ua($i(r,W,Y));let z=mt(["create","invite","chat","finish"]),Q=[];for(let Y=0;Y<4;Y+=1)Q[Y]=la(Qi(r,z,Y));let de=mt(r[7]),re=[];for(let Y=0;Y<de.length;Y+=1)re[Y]=ca(qi(r,de,Y));return{c(){e=O("article"),t=O("h2"),i=F(n),a=k(),o=O("p"),f=F(s),u=k(),l=O("h3"),d=F(c),h=k(),v=O("ul");for(let Y=0;Y<4;Y+=1)V[Y].c();p=k(),y=O("h3"),w=F(g),A=k(),x=O("ol");for(let Y=0;Y<4;Y+=1)Q[Y].c();m=k(),S=O("section"),b=O("h2"),M=F(D),G=k();for(let Y=0;Y<re.length;Y+=1)re[Y].c();this.h()},l(Y){e=T(Y,"ARTICLE",{class:!0,"aria-labelledby":!0});var X=N(e);t=T(X,"H2",{id:!0,class:!0});var R=N(t);i=L(R,n),R.forEach(C),a=U(X),o=T(X,"P",{});var ee=N(o);f=L(ee,s),ee.forEach(C),u=U(X),l=T(X,"H3",{class:!0});var pe=N(l);d=L(pe,c),pe.forEach(C),h=U(X),v=T(X,"UL",{});var H=N(v);for(let ge=0;ge<4;ge+=1)V[ge].l(H);H.forEach(C),p=U(X),y=T(X,"H3",{class:!0});var J=N(y);w=L(J,g),J.forEach(C),A=U(X),x=T(X,"OL",{});var le=N(x);for(let ge=0;ge<4;ge+=1)Q[ge].l(le);le.forEach(C),m=U(X),S=T(X,"SECTION",{id:!0,"aria-labelledby":!0});var Ee=N(S);b=T(Ee,"H2",{id:!0,class:!0});var ce=N(b);M=L(ce,D),ce.forEach(C),G=U(Ee);for(let ge=0;ge<re.length;ge+=1)re[ge].l(Ee);Ee.forEach(C),X.forEach(C),this.h()},h(){E(t,"id","transfer-guide-title"),E(t,"class","svelte-oym6lq"),E(l,"class","svelte-oym6lq"),E(y,"class","svelte-oym6lq"),E(b,"id","transfer-faq-title"),E(b,"class","svelte-oym6lq"),E(S,"id","faq"),E(S,"aria-labelledby","transfer-faq-title"),E(e,"class","transfer-guide svelte-oym6lq"),E(e,"aria-labelledby","transfer-guide-title")},m(Y,X){j(Y,e,X),_(e,t),_(t,i),_(e,a),_(e,o),_(o,f),_(e,u),_(e,l),_(l,d),_(e,h),_(e,v);for(let R=0;R<4;R+=1)V[R]&&V[R].m(v,null);_(e,p),_(e,y),_(y,w),_(e,A),_(e,x);for(let R=0;R<4;R+=1)Q[R]&&Q[R].m(x,null);_(e,m),_(e,S),_(S,b),_(b,M),_(S,G);for(let R=0;R<re.length;R+=1)re[R]&&re[R].m(S,null)},p(Y,X){if(X[0]&512&&n!==(n=Y[9]("clipboard.guide.title")+"")&&Z(i,n),X[0]&512&&s!==(s=Y[9]("clipboard.guide.summary")+"")&&Z(f,s),X[0]&512&&c!==(c=Y[9]("clipboard.guide.scenarios_title")+"")&&Z(d,c),X[0]&512){W=mt(["devices","sharing","conversation","discreet"]);let R;for(R=0;R<4;R+=1){const ee=$i(Y,W,R);V[R]?V[R].p(ee,X):(V[R]=ua(ee),V[R].c(),V[R].m(v,null))}for(;R<4;R+=1)V[R].d(1)}if(X[0]&512&&g!==(g=Y[9]("clipboard.guide.steps_title")+"")&&Z(w,g),X[0]&512){z=mt(["create","invite","chat","finish"]);let R;for(R=0;R<4;R+=1){const ee=Qi(Y,z,R);Q[R]?Q[R].p(ee,X):(Q[R]=la(ee),Q[R].c(),Q[R].m(x,null))}for(;R<4;R+=1)Q[R].d(1)}if(X[0]&512&&D!==(D=Y[9]("clipboard.guide.faq_title")+"")&&Z(M,D),X[0]&128){de=mt(Y[7]);let R;for(R=0;R<de.length;R+=1){const ee=qi(Y,de,R);re[R]?re[R].p(ee,X):(re[R]=ca(ee),re[R].c(),re[R].m(S,null))}for(;R<re.length;R+=1)re[R].d(1);re.length=de.length}},d(Y){Y&&C(e),$r(V,Y),$r(Q,Y),$r(re,Y)}}}function ua(r){let e,t=r[9](`clipboard.guide.scenarios.${r[92]}`)+"",n;return{c(){e=O("li"),n=F(t),this.h()},l(i){e=T(i,"LI",{class:!0});var a=N(e);
20n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","svelte-oym6lq")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&512&&t!==(t=i[9](`clipboard.guide.scenarios.${i[92]}`)+"")&&Z(n,t)},d(i){i&&C(e)}}}function la(r){let e,t=r[9](`clipboard.guide.steps.${r[92]}`)+"",n;return{c(){e=O("li"),n=F(t),this.h()},l(i){e=T(i,"LI",{class:!0});var a=N(e);n=L(a,t),a.forEach(C),this.h()},h(){E(e,"class","svelte-oym6lq")},m(i,a){j(i,e,a),_(e,n)},p(i,a){a[0]&512&&t!==(t=i[9](`clipboard.guide.steps.${i[92]}`)+"")&&Z(n,t)},d(i){i&&C(e)}}}function ca(r){let e,t=r[89].question+"",n,i,a,o=r[89].answer+"",s;return{c(){e=O("h3"),n=F(t),i=k(),a=O("p"),s=F(o),this.h()},l(f){e=T(f,"H3",{class:!0});var u=N(e);n=L(u,t),u.forEach(C),i=U(f),a=T(f,"P",{});var l=N(a);s=L(l,o),l.forEach(C),this.h()},h(){E(e,"class","svelte-oym6lq")},m(f,u){j(f,e,u),_(e,n),j(f,i,u),j(f,a,u),_(a,s)},p(f,u){u[0]&128&&t!==(t=f[89].question+"")&&Z(n,t),u[0]&128&&o!==(o=f[89].answer+"")&&Z(s,o)},d(f){f&&(C(e),C(i),C(a))}}}function ol(r){let e,t,n,i,a,o,s,f,u,l,c,d,h,v,p=`<script type="application/ld+json">${JSON.stringify(r[44]).replace(/</g,"\\u003c")}<\/script>`,y,g,w,A,x,m,S,b=r[9]("clipboard.title")+"",D,M,G,W,V,z,Q=r[9]("clipboard.description")+"",de,re,Y,X=r[9]("clipboard.description_subtitle")+"",R,ee,pe,H,J,le,Ee,ce;It.title=e=r[9]("general.seo.transfer.title");let ge=r[8]&&Ji(r),be=r[4]&&ea(r),_e=r[12]&&r[16]&&ta(r),K=r[33]&&r[28]&&na(r);const Ae=[al,il],ne=[];function ve(q,se){return q[12]&&q[16]?0:1}J=ve(r),le=ne[J]=Ae[J](r);let ae=r[8]&&fa(r);return{c(){t=O("meta"),i=O("meta"),o=O("meta"),f=O("meta"),l=O("meta"),d=O("meta"),v=new da(!1),y=vt(),ge&&ge.c(),g=vt(),w=k(),A=O("div"),x=O("div"),m=O("div"),S=O("h1"),D=F(b),M=k(),be&&be.c(),G=k(),W=O("div"),V=O("div"),z=O("p"),de=F(Q),re=k(),Y=O("p"),R=F(X),ee=k(),_e&&_e.c(),pe=k(),K&&K.c(),H=k(),le.c(),Ee=k(),ae&&ae.c(),this.h()},l(q){const se=ao("svelte-1yif7ez",It.head);t=T(se,"META",{name:!0,content:!0}),i=T(se,"META",{name:!0,content:!0}),o=T(se,"META",{property:!0,content:!0}),f=T(se,"META",{property:!0,content:!0}),l=T(se,"META",{name:!0,content:!0}),d=T(se,"META",{name:!0,content:!0}),v=ha(se,!1),y=vt(),ge&&ge.l(se),g=vt(),se.forEach(C),w=U(q),A=T(q,"DIV",{class:!0});var Fe=N(A);x=T(Fe,"DIV",{class:!0});var je=N(x);m=T(je,"DIV",{class:!0});var et=N(m);S=T(et,"H1",{class:!0});var wt=N(S);D=L(wt,b),wt.forEach(C),M=U(et),be&&be.l(et),et.forEach(C),G=U(je),W=T(je,"DIV",{class:!0,id:!0,"aria-hidden":!0});var Ye=N(W);V=T(Ye,"DIV",{class:!0});var He=N(V);z=T(He,"P",{class:!0});var gt=N(z);de=L(gt,Q),gt.forEach(C),re=U(He),Y=T(He,"P",{class:!0});var te=N(Y);R=L(te,X),te.forEach(C),ee=U(He),_e&&_e.l(He),He.forEach(C),Ye.forEach(C),je.forEach(C),pe=U(Fe),K&&K.l(Fe),H=U(Fe),le.l(Fe),Ee=U(Fe),ae&&ae.l(Fe),Fe.forEach(C),this.h()},h(){E(t,"name","description"),E(t,"content",n=r[9]("general.seo.transfer.description")),E(i,"name","keywords"),E(i,"content",a=r[9]("general.seo.transfer.keywords")),E(o,"property","og:title"),E(o,"content",s=r[9]("general.seo.transfer.title")),E(f,"property","og:description"),E(f,"content",u=r[9]("general.seo.transfer.description")),E(l,"name","twitter:title"),E(l,"content",c=r[9]("general.seo.transfer.title")),E(d,"name","twitter:description"),E(d,"content",h=r[9]("general.seo.transfer.description")),v.a=y,E(S,"class","svelte-oym6lq"),E(m,"class","header-top svelte-oym6lq"),E(z,"class","description-main svelte-oym6lq"),E(Y,"class","description-subtitle svelte-oym6lq"),E(V,"class","description-container svelte-oym6lq"),E(W,"class","header-description svelte-oym6lq"),E(W,"id","clipboard-header-description"),E(W,"aria-hidden",r[42]),E(x,"class","clipboard-header svelte-oym6lq"),Te(x,"collapsed",r[42]),E(A,"class","clipboard-container svelte-oym6lq")},m(q,se){_(It.head,t),_(It.head,i),_(It.head,o),_(It.head,f),_(It.head,l),_(It.head,d),v.m(p,It.head),_(It.head,y),ge&&ge.m(It.head,null),_(It.head,g),j(q,w,se),j(q,A,se),_(A,x),_(x,m),_(m,S),_(S,D),_(m,M),be&&be.m(m,null),_(x,G),_(x,W),_(W,V),_(V,z),_(z,de),_(V,re),_(V,Y),_(Y,R),_(V,ee),_e&&_e.m(V,null),_(A,pe),K&&K.m(A,null),_(A,H),ne[J].m(A,null),_(A,Ee),ae&&ae.m(A,null),ce=!0},p(q,se){(!ce||se[0]&512)&&e!==(e=q[9]("general.seo.transfer.title"))&&(It.title=e),(!ce||se[0]&512&&n!==(n=q[9]("general.seo.transfer.description")))&&E(t,"content",n),(!ce||se[0]&512&&a!==(a=q[9]("general.seo.transfer.keywords")))&&E(i,"content",a),(!ce||se[0]&512&&s!==(s=q[9]("general.seo.transfer.title")))&&E(o,"content",s),(!ce||se[0]&512&&u!==(u=q[9]("general.seo.transfer.description")))&&E(f,"content",u),(!ce||se[0]&512&&c!==(c=q[9]("general.seo.transfer.title")))&&E(l,"content",c),(!ce||se[0]&512&&h!==(h=q[9]("general.seo.transfer.description")))&&E(d,"content",h),(!ce||se[1]&8192)&&p!==(p=`<script type="application/ld+json">${JSON.stringify(q[44]).replace(/</g,"\\u003c")}<\/script>`)&&v.p(p),q[8]?ge?ge.p(q,se):(ge=Ji(q),ge.c(),ge.m(g.parentNode,g)):ge&&(ge.d(1),ge=null),(!ce||se[0]&512)&&b!==(b=q[9]("clipboard.title")+"")&&Z(D,b),q[4]?be?be.p(q,se):(be=ea(q),be.c(),be.m(m,null)):be&&(be.d(1),be=null),(!ce||se[0]&512)&&Q!==(Q=q[9]("clipboard.description")+"")&&Z(de,Q),(!ce||se[0]&512)&&X!==(X=q[9]("clipboard.description_subtitle")+"")&&Z(R,X),q[12]&&q[16]?_e?_e.p(q,se):(_e=ta(q),_e.c(),_e.m(V,null)):_e&&(_e.d(1),_e=null),(!ce||se[1]&2048)&&E(W,"aria-hidden",q[42]),(!ce||se[1]&2048)&&Te(x,"collapsed",q[42]),q[33]&&q[28]?K?K.p(q,se):(K=na(q),K.c(),K.m(A,H)):K&&(K.d(1),K=null);let Fe=J;J=ve(q),J===Fe?ne[J].p(q,se):(Rt(),xe(ne[Fe],1,1,()=>{ne[Fe]=null}),Pt(),le=ne[J],le?le.p(q,se):(le=ne[J]=Ae[J](q),le.c()),he(le,1),le.m(A,Ee)),q[8]?ae?ae.p(q,se):(ae=fa(q),ae.c(),ae.m(A,null)):ae&&(ae.d(1),ae=null)},i(q){ce||(he(le),ce=!0)},o(q){xe(le),ce=!1},d(q){q&&(v.d(),C(w),C(A)),C(t),C(i),C(o),C(f),C(l),C(d),C(y),ge&&ge.d(q),C(g),be&&be.d(),_e&&_e.d(),K&&K.d(),ne[J].d(),ae&&ae.d()}}}const sl=768,fl=3e3;function ul(r){const e=r.detail.file,t=URL.createObjectURL(e.blob),n=document.createElement("a");n.href=t,n.download=e.name,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}function ll(r,e,t){let n,i,a,o,s,f,u,l;$t(r,ht,ye=>t(9,u=ye)),$t(r,so,ye=>t(70,l=ye));let c="",d="",h=!1,v=!1,p=!1,y=!1,g=!1,w=!1,A=!1,x="random",m="",S=!1,b="files",D=[],M=[],G="",W=[];
20const V=co.HOST||"freesavevideo.online",z=["wechat","install","history","disguise","privacy","files"];let Q=!1,de=!1,re=!1,Y=0,X=!1,R="",ee="",pe=!1,H=!1,J=!1,le=!1,Ee=!1,ce=!1,ge=!1,be="create",_e=0,K=2,Ae=!1,ne="empty",ve=null,ae=null,q=!1,se=null,Fe=!1,je=!1,et=!1,wt=null,Ye=!1,He=null,gt=null,te,ct=null;function kt(){te==null||te.createSession()}function Or(){d.trim()&&(te==null||te.joinSession(d.trim()))}function Tr(){te==null||te.enterPersonalSession()}function Ra(){const ye=y?"clipboard.end_session_confirm":"clipboard.leave_session_confirm";window.confirm(u(ye))&&(te==null||te.leaveSession())}function Pa(){window.confirm(u("clipboard.replace_device_confirm"))&&(te==null||te.replaceOccupiedPersonalSession())}function Ma(){window.confirm(u("clipboard.release_peer_confirm"))&&(te==null||te.removeConnectedPeer())}function Ba(ye){gr.update(oe=>({...oe,activeTab:ye.detail}))}function Fa(ye){gr.update(oe=>({...oe,files:[...oe.files,...ye.detail.files]}))}function La(ye){gr.update(oe=>({...oe,files:oe.files.filter((Ut,Ht)=>Ht!==ye.detail.index)}))}function ka(){te==null||te.sendFiles()}function Ua(){console.log("🚫 处理取消发送事件"),te==null||te.cancelSending()}function Va(){console.log("🚫 处理取消接收事件"),te==null||te.cancelReceiving()}function Ha(ye){gr.update(oe=>({...oe,receivedFiles:oe.receivedFiles.filter((Ut,Ht)=>Ht!==ye.detail.index)}))}function Ga(ye){var Ut;const oe=((Ut=ye==null?void 0:ye.detail)==null?void 0:Ut.text)||G;oe.trim()&&(te==null||te.sendText(oe,(ye==null?void 0:ye.detail.ephemeral)??!1))}function Xa(ye){te==null||te.retryText(ye.detail.messageId)}function Wa(){te==null||te.clearError()}function za(){console.log("📱 准备文件选择"),te==null||te.prepareForFileSelection()}async function ja(){console.log("📱 文件选择完成"),await(te==null?void 0:te.completeFileSelection())}function Ya(){t(42,q=!q),t(64,se=q?"collapsed":"expanded"),!q&&Fe&&(async()=>(await Cr(),He==null||He.scrollIntoView({behavior:"smooth",block:"start"})))()}function Qr(){wt&&(clearTimeout(wt),wt=null)}function Za(){!Fe||Ye||(Ye=!0,Qr(),wt=setTimeout(()=>{wt=null,Fe&&se===null&&(je||(t(42,q=!0),t(64,se="collapsed")))},fl))}zr(async()=>{if(t(28,R=""),t(33,le=!1),t(6,te=new lo),te.clearError(),typeof window<"u"){if(t(35,ce=!!await uo()),ce){await te.loadPersonalSessionStatus();const Vt=()=>{document.visibilityState==="visible"&&(!h||!g)&&(te==null||te.loadPersonalSessionStatus())},Rn=()=>Vt();window.addEventListener("focus",Vt),document.addEventListener("visibilitychange",Rn),ve=setInterval(Vt,15e3),ae=()=>{window.removeEventListener("focus",Vt),document.removeEventListener("visibilitychange",Rn)}}const ye=window.matchMedia(`(max-width: ${sl}px)`),oe=Vt=>{if(t(4,Fe=Vt),!Vt){Qr();return}Za()};oe(ye.matches);const Ut=Vt=>{oe(Vt.matches)};ye.addEventListener("change",Ut),gt=()=>ye.removeEventListener("change",Ut);const Ht=new URLSearchParams(window.location.search),Nn=Ht.get("session"),eo=(Ht.get("mode")||"").toLowerCase(),to=Ht.get("autostart")==="1",ro=Ht.get("autojoin")==="1";Nn?(t(11,d=Nn),await te.joinSession(d)):eo==="personal"&&ce&&(to||ro)&&await te.enterPersonalSession()}}),mn(()=>{Qr(),gt==null||gt(),ve&&clearInterval(ve),ve=null,ae==null||ae(),ae=null,ct==null||ct(),t(67,ct=null),te==null||te.dispose()});function Ka(ye){A=ye,t(18,A)}function qa(ye){G=ye,t(25,G)}const Qa=ye=>te==null?void 0:te.revealText(ye.detail.messageId);function $a(ye){Jt[ye?"unshift":"push"](()=>{He=ye,t(5,He)})}function Ja(ye){d=ye,t(11,d)}return r.$$.update=()=>{var ye;r.$$.dirty[2]&256&&t(68,n=((ye=l.url.pathname.match(/^\/([a-z]{2})/))==null?void 0:ye[1])||"en"),r.$$.dirty[2]&64&&t(8,i=n==="en"||n==="zh"),r.$$.dirty[0]&768&&t(7,a=i?z.map(oe=>({question:String(u(`clipboard.guide.faq.${oe}.question`)),answer:String(u(`clipboard.guide.faq.${oe}.answer`))})):[]),r.$$.dirty[2]&64&&t(69,o=`https://${V}/${n}/clipboard`),r.$$.dirty[0]&512|r.$$.dirty[2]&192&&t(44,s={"@context":"https://schema.org","@type":"WebApplication","@id":`${o}#app`,name:`FreeSaveVideo - ${u("clipboard.title")}`,inLanguage:n,url:o,applicationCategory:"UtilitiesApplication",applicationSubCategory:"File transfer and temporary one-to-one text chat",operatingSystem:"Any",isAccessibleForFree:!0,description:String(u("general.seo.transfer.description")),featureList:["cross-device file transfer","temporary one-to-one text chat","optional texts disappearing 30 seconds after opening","no-account random sessions","QR code and link join","encrypted WebRTC data channel"]}),r.$$.dirty[0]&128|r.$$.dirty[2]&192&&t(43,f={"@context":"https://schema.org","@type":"FAQPage","@id":`${o}#faq`,inLanguage:n,mainEntity:a.map(({question:oe,answer:Ut})=>
20({"@type":"Question",name:oe,acceptedAnswer:{"@type":"Answer",text:Ut}}))}),r.$$.dirty[0]&64|r.$$.dirty[2]&32&&te&&!ct&&t(67,ct=gr.subscribe(oe=>{t(10,c=oe.sessionId),t(12,h=oe.isConnected),t(13,v=oe.isCreating),t(14,p=oe.isJoining),t(15,y=oe.isCreator),t(16,g=oe.peerConnected),t(17,w=oe.peerSupportsEphemeral),t(19,x=oe.sessionType),t(20,m=oe.qrCodeUrl),t(21,S=oe.isLAN),t(22,b=oe.activeTab),t(23,D=oe.files),t(24,M=oe.receivedFiles),t(26,W=oe.messages),t(27,Q=oe.dragover),t(0,de=oe.sendingFiles),t(1,re=oe.receivingFiles),t(2,Y=oe.transferProgress),t(3,X=oe.isTransferring),oe.dataChannel,oe.peerConnection,t(28,R=oe.errorMessage),t(29,ee=oe.errorCode),t(30,pe=oe.canReplaceSession),t(31,H=oe.isReleasingPeer),t(32,J=oe.isLeavingSession),t(33,le=oe.showError),t(34,Ee=oe.waitingForCreator),t(36,ge=oe.personalStatusLoading),t(37,be=oe.personalRecommendedAction),t(38,_e=oe.personalOnlinePeers),t(39,K=oe.personalMaxPeers),t(40,Ae=oe.personalCurrentDeviceConnected),t(41,ne=oe.personalSessionState)})),r.$$.dirty[0]&31&&t(65,je=Fe&&(X||de||re||Y>0)),r.$$.dirty[2]&12&&(je?se===null&&t(42,q=!0):(se===null||se==="expanded"?t(42,q=!1):se==="collapsed"&&t(42,q=!0),se==="expanded"&&t(64,se=null))),r.$$.dirty[0]&48|r.$$.dirty[2]&24&&(je&&!et?(t(66,et=!0),Fe&&(async()=>(await Cr(),He==null||He.scrollIntoView({behavior:"smooth",block:"start"})))()):!je&&et&&t(66,et=!1))},[de,re,Y,X,Fe,He,te,a,i,u,c,d,h,v,p,y,g,w,A,x,m,S,b,D,M,G,W,Q,R,ee,pe,H,J,le,Ee,ce,ge,be,_e,K,Ae,ne,q,f,s,kt,Or,Tr,Ra,Pa,Ma,Ba,Fa,La,ka,Ua,Va,Ha,Ga,Xa,Wa,za,ja,Ya,se,je,et,ct,n,o,l,Ka,qa,Qa,$a,Ja]}class ml extends dr{constructor(e){super(),hr(this,e,ll,ol,lr,{},null,[-1,-1,-1,-1])}}export{ml as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.