UNPKG

vue3-barcode-qrcode-reader

Version:

Vue 3 barcodes and QR codes scanner

5 lines 406 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".scanner__container[data-v-c4f5ee33]{position:relative}.scanner__container .content[data-v-c4f5ee33]{display:flex;min-height:100vh;width:100%;align-items:center;justify-content:center}.scanner__container .content video[data-v-c4f5ee33]{height:100%;width:100%}.scanner__container .container-btn-stop[data-v-c4f5ee33]{position:absolute;top:90%;left:50%;margin:auto;transform:translate(-50%,-50%)}.scanner__container .container-btn-stop button.btn-stop[data-v-c4f5ee33]{height:2.5rem;width:2.5rem;border-radius:9999px;border-width:4px;--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-delay:75ms;animation:blink-c4f5ee33 1s infinite}@keyframes blink-c4f5ee33{0%{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}50%{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}to{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}}.scanner__container .container-btn-stop button.btn-stop[data-v-c4f5ee33]:hover{border-width:4px;--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity));animation:none}.scanner__container .container-btn-facemode[data-v-c4f5ee33]{position:absolute;top:90%;left:15%;margin:auto;transform:translate(-50%,-50%)}.scanner__container .container-btn-facemode button.btn-facemode[data-v-c4f5ee33]{display:inline-flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity));padding:.375rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-delay:75ms}.scanner__container .container-btn-facemode button.btn-facemode[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity)) }.scanner__container .btn-stream[data-v-c4f5ee33]{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity));padding:.625rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.scanner__container .btn-stream[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.scanner__container .btn-stream[data-v-c4f5ee33]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)) }.scanner__container .btn-reset[data-v-c4f5ee33]{margin-inline-start:.5rem;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity));padding:.625rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.scanner__container .btn-reset[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.scanner__container .btn-reset[data-v-c4f5ee33]:focus{outline:2px solid transparent;outline-offset:2px}")),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})(); (function(Nt,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],O):(Nt=typeof globalThis<"u"?globalThis:Nt||self,O(Nt.Vue3BarcodeQRcodeReader={},Nt.Vue))})(this,function(Nt,O){"use strict";function Ke(r){return O.getCurrentScope()?(O.onScopeDispose(r),!0):!1}function ve(r){return typeof r=="function"?r():O.unref(r)}const Zr=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $r=Object.prototype.toString,Kr=r=>$r.call(r)==="[object Object]",qr=()=>{};function Qr(r,t=!0){O.getCurrentInstance()?O.onMounted(r):t?r():O.nextTick(r)}function Jr(r){var t;const e=ve(r);return(t=e==null?void 0:e.$el)!=null?t:e}const pe=Zr?window:void 0;function tn(...r){let t,e,n,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([e,n,i]=r,t=pe):[t,e,n,i]=r,!t)return qr;Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(c=>c()),a.length=0},f=(c,l,h,d)=>(c.addEventListener(l,h,d),()=>c.removeEventListener(l,h,d)),s=O.watch(()=>[Jr(t),ve(i)],([c,l])=>{if(o(),!c)return;const h=Kr(l)?{...l}:l;a.push(...e.flatMap(d=>n.map(v=>f(c,d,v,h))))},{immediate:!0,flush:"post"}),u=()=>{s(),o()};return Ke(u),u}function en(){const r=O.ref(!1);return O.getCurrentInstance()&&O.onMounted(()=>{r.value=!0}),r}function rn(r){const t=en();return O.computed(()=>(t.value,!!r()))}function nn(r,t={}){const{window:e=pe}=t,n=rn(()=>e&&"matchMedia"in e&&typeof e.matchMedia=="function");let i;const a=O.ref(!1),o=u=>{a.value=u.matches},f=()=>{i&&("removeEventListener"in i?i.removeEventListener("change",o):i.removeListener(o))},s=O.watchEffect(()=>{n.value&&(f(),i=e.matchMedia(ve(r)),"addEventListener"in i?i.addEventListener("change",o):i.addListener(o),a.value=i.matches)});return Ke(()=>{s(),f(),i=void 0}),a}function an(r={}){const{window:t=pe,initialWidth:e=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:a=!0}=r,o=O.ref(e),f=O.ref(n),s=()=>{t&&(a?(o.value=t.innerWidth,f.value=t.innerHeight):(o.value=t.document.documentElement.clientWidth,f.value=t.document.documentElement.clientHeight))};if(s(),Qr(s),tn("resize",s,{passive:!0}),i){const u=nn("(orientation: portrait)");O.watch(u,()=>s())}return{width:o,height:f}}const qe=(r,t)=>{const e=r.__vccOpts||r;for(const[n,i]of t)e[n]=i;return e},on={},fn={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},sn=[O.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[O.createElementVNode("path",{d:"M22.003 3v4.497A.503.503 0 0 1 21.5 8v0c-.2 0-.38-.119-.466-.3A10.001 10.001 0 0 0 12.003 2c-5.186 0-9.45 3.947-9.95 9"}),O.createElementVNode("path",{d:"M6 16.4V9.394a.6.6 0 0 1 .6-.6h1.173a.6.6 0 0 0 .504-.275l1.446-2.244A.6.6 0 0 1 10.227 6h3.546a.6.6 0 0 1 .504.275l1.446 2.244a.6.6 0 0 0 .504.275H17.4a.6.6 0 0 1 .6.6V16.4a.6.6 0 0 1-.6.6H6.6a.6.6 0 0 1-.6-.6Z"}),O.createElementVNode("path",{d:"M12 14a2 2 0 1 0 0-4a2 2 0 0 0 0 4Zm-9.95 7v-4.497c0-.278.226-.503.504-.503v0c.2 0 .38.119.466.3a10.001 10.001 0 0 0 9.03 5.7c5.186 0 9.45-3.947 9.951-9"})],-1)];function un(r,t){return O.openBlock(),O.createElementBlock("svg",fn,sn)}const Qe=qe(on,[["render",un]]);function cn(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function ln(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var hn=function(){var r=function(e,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(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),dn=function(r){hn(t,r);function t(e,n){var i=this.constructor,a=r.call(this,e,n)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),cn(a,i.prototype),ln(a),a}return t}(Error),vn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vt=function(r){vn(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t}(dn),pn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),It=function(r){pn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t}(vt),gn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),M=function(r){gn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t}(vt),xn=function(){function r(t){if(this.binarizer=t,t===null)throw new M("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(t,e){return this.binarizer.getBlackRow(t,e)},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(t,e,n,i){var a=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(a))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(t))},r.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(t))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),yn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),at=function(r){yn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(vt),_n=function(){function r(t){this.source=t}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}(),j=function(){function r(){}return r.arraycopy=function(t,e,n,i,a){for(;a--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),wn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ge=function(r){wn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t}(vt),An=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Je=function(r){An(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=e,i.message=n,i}return t.kind="ArrayIndexOutOfBoundsException",t}(ge),En=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.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(t?"Object is not iterable.":"Symbol.iterator is not defined.")},J=function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n]=e},r.fillWithin=function(t,e,n,i){r.rangeCheck(t.length,e,n);for(var a=e;a<n;a++)t[a]=i},r.rangeCheck=function(t,e,n){if(e>n)throw new M("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Je(e);if(n>t)throw new Je(n)},r.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},r.create=function(t,e,n){var i=Array.from({length:t});return i.map(function(a){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var i=Array.from({length:t});return i.map(function(a){return Int32Array.from({length:e}).fill(n)})},r.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var i=1;try{for(var a=En(t),o=a.next();!o.done;o=a.next()){var f=o.value;i=31*i+f}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},r.fillUint8Array=function(t,e){for(var n=0;n!==t.length;n++)t[n]=e},r.copyOf=function(t,e){return t.slice(0,e)},r.copyOfUint8Array=function(t,e){if(t.length<=e){var n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)},r.copyOfRange=function(t,e,n){var i=n-e,a=new Int32Array(i);return j.arraycopy(t,e,a,0,i),a},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var i=0,a=t.length-1;i<=a;){var o=a+i>>1,f=n(e,t[o]);if(f>0)i=o+1;else if(f<0)a=o-1;else return o}return-i-1},r.numberComparator=function(t,e){return t-e},r}(),F=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return t>>>16||(e+=16,t<<=16),t>>>24||(e+=8,t<<=8),t>>>28||(e+=4,t<<=4),t>>>30||(e+=2,t<<=2),e-=t>>>31,e},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),ot=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var e=r.makeArray(t);j.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),a=n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=n[i]}var f=i*32+F.numberOfTrailingZeros(a);return f>e?e:f},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),a=~n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=~n[i]}var f=i*32+F.numberOfTrailingZeros(a);return f>e?e:f},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new M;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,o=n;o<=i;o++){var f=o>n?0:t&31,s=o<i?31:e&31,u=(2<<s)-(1<<f);a[o]|=u}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;n<t;n++)e[n]=0},r.prototype.isRange=function(t,e,n){if(e<t||t<0||e>this.size)throw new M;if(e===t)return!0;e--;for(var i=Math.floor(t/32),a=Math.floor(e/32),o=this.bits,f=i;f<=a;f++){var s=f>i?0:t&31,u=f<a?31:e&31,c=(2<<u)-(1<<s)&4294967295;if((o[f]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new M("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)===1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n<e;n++)this.appendBit(t.get(n))},r.prototype.xor=function(t){if(this.size!==t.size)throw new M("Sizes don't match");for(var e=this.bits,n=0,i=e.length;n<i;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,i){for(var a=0;a<i;a++){for(var o=0,f=0;f<8;f++)this.get(t)&&(o|=1<<7-f),t++;e[n+a]=o}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+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,t[e-a]=o}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,a=1;a<n;a++){var u=t[a];s|=u<<32-f,t[a-1]=s,s=u>>>f}t[n-1]=s}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&J.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+J.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)e&7||(t+=" "),t+=this.get(e)?"X":".";return t},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var t=[],e=0,n=this.size;e<n;e++)t.push(this.get(e));return t},r}(),xe;(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.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(xe||(xe={}));const Q=xe;var Cn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),T=function(r){Cn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(vt),In=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.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(t?"Object is not iterable.":"Symbol.iterator is not defined.")},W;(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"})(W||(W={}));var tt=function(){function r(t,e,n){for(var i,a,o=[],f=3;f<arguments.length;f++)o[f-3]=arguments[f];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=o,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var s=this.values,u=0,c=s.length;u!==c;u++){var l=s[u];r.VALUES_TO_ECI.set(l,this)}try{for(var h=In(o),d=h.next();!d.done;d=h.next()){var v=d.value;r.NAME_TO_ECI.set(v,this)}}catch(g){i={error:g}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}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(t){if(t<0||t>=900)throw new T("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(W.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(W.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(W.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(W.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(W.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(W.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(W.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(W.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(W.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(W.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(W.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(W.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(W.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(W.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(W.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(W.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(W.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(W.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(W.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(W.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(W.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(W.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(W.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(W.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(W.Big5,28,"Big5"),r.GB18030=new r(W.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(W.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),mn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ee=function(r){mn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}(vt),At=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof tt?t:tt.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=t.length;a<o;a++){var f=t[a].toString(16);f.length<2&&(f="0"+f),i+="%"+f}return decodeURIComponent(i)}if(n.equals(tt.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ee("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(tt.UTF8)||t.equals(tt.ISO8859_1)||t.equals(tt.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),i=[],a=0;a<n.length;a++)i.push(n[a].charCodeAt(0));return new Uint8Array(i)},r}(),k=function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return At.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(Q.CHARACTER_SET)!==void 0)return e.get(Q.CHARACTER_SET).toString();for(var n=t.length,i=!0,a=!0,o=!0,f=0,s=0,u=0,c=0,l=0,h=0,d=0,v=0,g=0,x=0,_=0,y=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,A=0;A<n&&(i||a||o);A++){var E=t[A]&255;o&&(f>0?E&128?f--:o=!1:E&128&&(E&64?(f++,E&32?(f++,E&16?(f++,E&8?o=!1:c++):u++):s++):o=!1)),i&&(E>127&&E<160?i=!1:E>159&&(E<192||E===215||E===247)&&_++),a&&(l>0?E<64||E===127||E>252?a=!1:l--:E===128||E===160||E>239?a=!1:E>160&&E<224?(h++,v=0,d++,d>g&&(g=d)):E>127?(l++,d=0,v++,v>x&&(x=v)):(d=0,v=0))}return o&&f>0&&(o=!1),a&&l>0&&(a=!1),o&&(y||s+u+c>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||g>=3||x>=3)?r.SHIFT_JIS:i&&a?g===2&&h===2||_*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=-1;function a(f,s,u,c,l,h){if(f==="%%")return"%";if(e[++i]!==void 0){f=c?parseInt(c.substr(1)):void 0;var d=l?parseInt(l.substr(1)):void 0,v;switch(h){case"s":v=e[i];break;case"c":v=e[i][0];break;case"f":v=parseFloat(e[i]).toFixed(f);break;case"p":v=parseFloat(e[i]).toPrecision(f);break;case"e":v=parseFloat(e[i]).toExponential(f);break;case"x":v=parseInt(e[i]).toString(d||16);break;case"d":v=parseFloat(parseInt(e[i],d||10).toPrecision(f)).toFixed(0);break}v=typeof v=="object"?JSON.stringify(v):(+v).toString(d);for(var g=parseInt(u),x=u&&u[0]+""=="0"?"0":" ";v.length<g;)v=s!==void 0?v+x:x+v;return v}}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,a)},r.getBytes=function(t,e){return At.encode(t,e)},r.getCharCode=function(t,e){return e===void 0&&(e=0),t.charCodeAt(e)},r.getCharAt=function(t){return String.fromCharCode(t)},r.SHIFT_JIS=tt.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=tt.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=tt.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),B=function(){function r(t){t===void 0&&(t=""),this.value=t}return r.prototype.enableDecoding=function(t){return this.encoding=t,this},r.prototype.append=function(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=k.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},r.prototype.appendChars=function(t,e,n){for(var i=e;e<e+n;i++)this.append(t[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(t){return this.value.charAt(t)},r.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},r.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},r.prototype.substring=function(t,e){return this.value.substring(t,e)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(t,e){this.value=this.value.substring(0,t)+e+this.value.substring(t)},r}(),Ot=function(){function r(t,e,n,i){if(this.width=t,this.height=e,this.rowSize=n,this.bits=i,e==null&&(e=t),this.height=e,t<1||e<1)throw new M("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,i=new r(n,e),a=0;a<e;a++)for(var o=t[a],f=0;f<n;f++)o[f]&&i.set(f,a);return i},r.parseFromString=function(t,e,n){if(t===null)throw new M("stringRepresentation cannot be null");for(var i=new Array(t.length),a=0,o=0,f=-1,s=0,u=0;u<t.length;)if(t.charAt(u)===` `||t.charAt(u)==="\r"){if(a>o){if(f===-1)f=a-o;else if(a-o!==f)throw new M("row lengths do not match");o=a,s++}u++}else if(t.substring(u,u+e.length)===e)u+=e.length,i[a]=!0,a++;else if(t.substring(u,u+n.length)===n)u+=n.length,i[a]=!1,a++;else throw new M("illegal character encountered: "+t.substring(u));if(a>o){if(f===-1)f=a-o;else if(a-o!==f)throw new M("row lengths do not match");s++}for(var c=new r(f,s),l=0;l<a;l++)i[l]&&c.set(Math.floor(l%f),Math.floor(l/f));return c},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new M("input matrix dimensions do not match");for(var e=new ot(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,a=0,o=this.height;a<o;a++)for(var f=a*n,s=t.getRow(a,e).getBitArray(),u=0;u<n;u++)i[f+u]^=s[u]},r.prototype.clear=function(){for(var t=this.bits,e=t.length,n=0;n<e;n++)t[n]=0},r.prototype.setRegion=function(t,e,n,i){if(e<0||t<0)throw new M("Left and top must be nonnegative");if(i<1||n<1)throw new M("Height and width must be at least 1");var a=t+n,o=e+i;if(o>this.height||a>this.width)throw new M("The region must fit inside the matrix");for(var f=this.rowSize,s=this.bits,u=e;u<o;u++)for(var c=u*f,l=t;l<a;l++)s[c+Math.floor(l/32)]|=1<<(l&31)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new ot(this.width):e.clear();for(var n=this.rowSize,i=this.bits,a=t*n,o=0;o<n;o++)e.setBulk(o*32,i[a+o]);return e},r.prototype.setRow=function(t,e){j.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),n=new ot(t),i=new ot(t),a=0,o=Math.floor((e+1)/2);a<o;a++)n=this.getRow(a,n),i=this.getRow(e-1-a,i),n.reverse(),i.reverse(),this.setRow(a,i),this.setRow(e-1-a,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,i=this.bits,a=t,o=e,f=-1,s=-1,u=0;u<e;u++)for(var c=0;c<n;c++){var l=i[u*n+c];if(l!==0){if(u<o&&(o=u),u>s&&(s=u),c*32<a){for(var h=0;!(l<<31-h&4294967295);)h++;c*32+h<a&&(a=c*32+h)}if(c*32+31>f){for(var h=31;!(l>>>h);)h--;c*32+h>f&&(f=c*32+h)}}}return f<a||s<o?null:Int32Array.from([a,o,f-a+1,s-o+1])},r.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,n=0;n<e.length&&e[n]===0;)n++;if(n===e.length)return null;for(var i=n/t,a=n%t*32,o=e[n],f=0;!(o<<31-f&4294967295);)f++;return a+=f,Int32Array.from([a,i])},r.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,n=e.length-1;n>=0&&e[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/t),a=Math.floor(n%t)*32,o=e[n],f=31;!(o>>>f);)f--;return a+=f,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(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&J.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+J.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=` `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new B,a=0,o=this.height;a<o;a++){for(var f=0,s=this.width;f<s;f++)i.append(this.get(f,a)?t:e);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),Sn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),C=function(r){Sn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(vt),Tn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),bn=function(r){Tn(t,r);function t(e){var n=r.call(this,e)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return t.prototype.getBlackRow=function(e,n){var i=this.getLuminanceSource(),a=i.getWidth();n==null||n.getSize()<a?n=new ot(a):n.clear(),this.initArrays(a);for(var o=i.getRow(e,this.luminances),f=this.buckets,s=0;s<a;s++)f[(o[s]&255)>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(f);if(a<3)for(var s=0;s<a;s++)(o[s]&255)<u&&n.set(s);else for(var c=o[0]&255,l=o[1]&255,s=1;s<a-1;s++){var h=o[s+1]&255;(l*4-c-h)/2<u&&n.set(s),c=l,l=h}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight(),a=new Ot(n,i);this.initArrays(n);for(var o=this.buckets,f=1;f<5;f++)for(var s=Math.floor(i*f/5),u=e.getRow(s,this.luminances),c=Math.floor(n*4/5),l=Math.floor(n/5);l<c;l++){var h=u[l]&255;o[h>>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(o),v=e.getMatrix(),f=0;f<i;f++)for(var g=f*n,l=0;l<n;l++){var h=v[g+l]&255;h<d&&a.set(l,f)}return a},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var n=this.buckets,i=0;i<t.LUMINANCE_BUCKETS;i++)n[i]=0},t.estimateBlackPoint=function(e){for(var n=e.length,i=0,a=0,o=0,f=0;f<n;f++)e[f]>o&&(a=f,o=e[f]),e[f]>i&&(i=e[f]);for(var s=0,u=0,f=0;f<n;f++){var c=f-a,l=e[f]*c*c;l>u&&(s=f,u=l)}if(a>s){var h=a;a=s,s=h}if(s-a<=n/16)throw new C;for(var d=s-1,v=-1,f=s-1;f>a;f--){var g=f-a,l=g*g*(s-f)*(i-e[f]);l>v&&(d=f,v=l)}return d<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(_n),On=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Dn=function(r){On(t,r);function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=e.getMatrix(),o=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&o++;var f=i>>t.BLOCK_SIZE_POWER;i&t.BLOCK_SIZE_MASK&&f++;var s=t.calculateBlackPoints(a,o,f,n,i),u=new Ot(n,i);t.calculateThresholdForBlock(a,o,f,n,i,s,u),this.matrix=u}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,i,a,o,f,s){for(var u=o-t.BLOCK_SIZE,c=a-t.BLOCK_SIZE,l=0;l<i;l++){var h=l<<t.BLOCK_SIZE_POWER;h>u&&(h=u);for(var d=t.cap(l,2,i-3),v=0;v<n;v++){var g=v<<t.BLOCK_SIZE_POWER;g>c&&(g=c);for(var x=t.cap(v,2,n-3),_=0,y=-2;y<=2;y++){var A=f[d+y];_+=A[x-2]+A[x-1]+A[x]+A[x+1]+A[x+2]}var E=_/25;t.thresholdBlock(e,g,h,E,a,s)}}},t.cap=function(e,n,i){return e<n?n:e>i?i:e},t.thresholdBlock=function(e,n,i,a,o,f){for(var s=0,u=i*o+n;s<t.BLOCK_SIZE;s++,u+=o)for(var c=0;c<t.BLOCK_SIZE;c++)(e[u+c]&255)<=a&&f.set(n+c,i+s)},t.calculateBlackPoints=function(e,n,i,a,o){for(var f=o-t.BLOCK_SIZE,s=a-t.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(n);var l=c<<t.BLOCK_SIZE_POWER;l>f&&(l=f);for(var h=0;h<n;h++){var d=h<<t.BLOCK_SIZE_POWER;d>s&&(d=s);for(var v=0,g=255,x=0,_=0,y=l*a+d;_<t.BLOCK_SIZE;_++,y+=a){for(var A=0;A<t.BLOCK_SIZE;A++){var E=e[y+A]&255;v+=E,E<g&&(g=E),E>x&&(x=E)}if(x-g>t.MIN_DYNAMIC_RANGE)for(_++,y+=a;_<t.BLOCK_SIZE;_++,y+=a)for(var A=0;A<t.BLOCK_SIZE;A++)v+=e[y+A]&255}var I=v>>t.BLOCK_SIZE_POWER*2;if(x-g<=t.MIN_DYNAMIC_RANGE&&(I=g/2,c>0&&h>0)){var S=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;g<S&&(I=S)}u[c][h]=I}}return u},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t}(bn),re=function(){function r(t,e){this.width=t,this.height=e}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(t,e,n,i){throw new ee("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new ee("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new ee("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new B,n=0;n<this.height;n++){for(var i=this.getRow(n,t),a=0;a<this.width;a++){var o=i[a]&255,f=void 0;o<64?f="#":o<128?f="+":o<192?f=".":f=" ",e.append(f)}e.append(` `)}return e.toString()},r}(),Nn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye=function(r){Nn(t,r);function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return t.prototype.getRow=function(e,n){for(var i=this.delegate.getRow(e,n),a=this.getWidth(),o=0;o<a;o++)i[o]=255-(i[o]&255);return i},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),a=0;a<n;a++)i[a]=255-(e[a]&255);return i},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,i,a){return new t(this.delegate.crop(e,n,i,a))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(re),Rn=globalThis&&globalThis.__extends||function(){var r=function(t,e){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(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Pn=function(r){Rn(t,r);function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return t.makeBufferFromCanvasImageData=function(e){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,i){var a=new Uint8ClampedArray(n*i);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX)for(var o=0,f=0,s=e.length;o<s;o+=4,f++){var u=void 0,c=e[o+3];if(c===0)u=255;else{var l=e[o],h=e[o+1],d=e[o+2];u=306*l+601*h+117*d+512>>10}a[f]=u}else for(var o=0,f=0,v=e.length;o<v;o+=4,f++){var u=void 0,c=e[o+3];if(c===0)u=255;else{var l=e[o],h=e[o+1],d=e[o+2];u=306*l+601*h+117*d+512>>10}a[f]=255-u}return a},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);var i=this.getWidth(),a=e*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},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,a){return r.prototype.crop.call(this,e,n,i,a),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),i=n.getContext("2d"),a=e*t.DEGREE_TO_RADIANS,o=this.canvas.width,f=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(a))*o+Math.abs(Math.sin(a))*f),u=Math.ceil(Math.abs(Math.sin(a))*o+Math.abs(Math.cos(a))*f);return n.width=s,n.height=u,i.translate(s/2,u/2),i.rotate(a),i.drawImage(this.canvas,o/-2,f/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new ye(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(re),Mn=function(){function r(t,e,n){this.deviceId=t,this.label=e,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}(),pt=globalThis&&globalThis.__awaiter||function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function f(c){try{u(n.next(c))}catch(l){o(l)}}function s(c){try{u(n.throw(c))}catch(l){o(l)}}function u(c){c.done?a(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},gt=globalThis&&globalThis.__generator||function(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)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 e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1],a=u;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(u);break}a[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Bn=globalThis&&globalThis.__values||function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.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(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gt=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},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(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return pt(this,void 0,void 0,function(){var t,e,n,i,a,o,f,s,u,c,l,h;return gt(this,function(d){switch(d.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:t=d.sent(),e=[];try{for(n=Bn(t),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(f=a.deviceId||a.id,s=a.label||"Video device "+(e.length+1),u=a.groupId,c={deviceId:f,label:s,kind:o,groupId:u},e.push(c))}catch(v){l={error:v}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return pt(this,void 0,void 0,function(){var t;return gt(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new Mn(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return pt(this,void 0,void 0,function(){var e;return gt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return pt(this,void 0,void 0,function(){return gt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return pt(this,void 0,void 0,function(){var n,i;return gt(this,function(a){switch(a.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,a.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return pt(this,void 0,void 0,function(){var n;return gt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return pt(this,void 0,void 0,function(){var n,i;return gt(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.