You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
quaggaJS/dist/quagga.min.js

1 line
88 KiB
JavaScript

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(e.toString()).default:"object"==typeof exports?exports.Quagga=e(e.toString()).default:t.Quagga=e(e.toString()).default}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=165)}([function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";function r(t,e){return this._row=[],this.config=t||{},this.supplements=e,this}r.prototype._nextUnset=function(t,e){var n;for(void 0===e&&(e=0),n=e;n<t.length;n++)if(!t[n])return n;return t.length},r.prototype._matchPattern=function(t,e,n){var r,o,i,a,u=0,c=0,s=0,f=0;for(n=n||this.SINGLE_CODE_ERROR||1,r=0;r<t.length;r++)s+=t[r],f+=e[r];if(s<f)return Number.MAX_VALUE;for(o=s/f,n*=o,r=0;r<t.length;r++){if(i=t[r],a=e[r]*o,(c=Math.abs(i-a)/a)>n)return Number.MAX_VALUE;u+=c}return u/f},r.prototype._nextSet=function(t,e){var n;for(e=e||0,n=e;n<t.length;n++)if(t[n])return n;return t.length},r.prototype._correctBars=function(t,e,n){for(var r=n.length,o=0;r--;)(o=t[n[r]]*(1-(1-e)/2))>1&&(t[n[r]]=o)},r.prototype._matchTrace=function(t,e){var n,r,o=[],i=this,a=i._nextSet(i._row),u=!i._row[a],c=0,s={error:Number.MAX_VALUE,code:-1,start:0};if(t){for(n=0;n<t.length;n++)o.push(0);for(n=a;n<i._row.length;n++)if(i._row[n]^u)o[c]++;else{if(c===o.length-1)return r=i._matchPattern(o,t),r<e?(s.start=n-a,s.end=n,s.counter=o,s):null;c++,o[c]=1,u=!u}}else for(o.push(0),n=a;n<i._row.length;n++)i._row[n]^u?o[c]++:(c++,o.push(0),o[c]=1,u=!u);return s.start=a,s.end=i._row.length-1,s.counter=o,s},r.prototype.decodePattern=function(t){var e,n=this;return n._row=t,e=n._decode(),null===e?(n._row.reverse(),(e=n._decode())&&(e.direction=r.DIRECTION.REVERSE,e.start=n._row.length-e.start,e.end=n._row.length-e.end)):e.direction=r.DIRECTION.FORWARD,e&&(e.format=n.FORMAT),e},r.prototype._matchRange=function(t,e,n){var r;for(t=t<0?0:t,r=t;r<e;r++)if(this._row[r]!==n)return!1;return!0},r.prototype._fillCounters=function(t,e,n){var r,o=this,i=0,a=[];for(n=void 0===n||n,t=void 0!==t?t:o._nextUnset(o._row),e=e||o._row.length,a[i]=0,r=t;r<e;r++)o._row[r]^n?a[i]++:(i++,a[i]=1,n=!n);return a},Object.defineProperty(r.prototype,"FORMAT",{value:"unknown",writeable:!1}),r.DIRECTION={FORWARD:1,REVERSE:-1},r.Exception={StartNotFoundException:"Start-Info was not found!",CodeNotFoundException:"Code could not be found!",PatternNotFoundException:"Pattern could not be found!"},r.CONFIG_KEYS={},e.a=r},function(t,e,n){"use strict";function r(t,e){t=a()(o(),t),u.a.call(this,t,e)}function o(){var t={};return Object.keys(r.CONFIG_KEYS).forEach(function(e){t[e]=r.CONFIG_KEYS[e].default}),t}var i=n(28),a=n.n(i),u=n(2),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s={CODE_L_START:{value:0},CODE_G_START:{value:10},START_PATTERN:{value:[1,1,1]},STOP_PATTERN:{value:[1,1,1]},MIDDLE_PATTERN:{value:[1,1,1,1,1]},EXTENSION_START_PATTERN:{value:[1,1,2]},CODE_PATTERN:{value:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2],[1,1,2,3],[1,2,2,2],[2,2,1,2],[1,1,4,1],[2,3,1,1],[1,3,2,1],[4,1,1,1],[2,1,3,1],[3,1,2,1],[2,1,1,3]]},CODE_FREQUENCY:{value:[0,11,13,14,19,25,28,21,22,26]},SINGLE_CODE_ERROR:{value:.7},AVG_CODE_ERROR:{value:.48},FORMAT:{value:"ean_13",writeable:!1}};r.prototype=Object.create(u.a.prototype,s),r.prototype.constructor=r,r.prototype._decodeCode=function(t,e){var n,r,o,i=[0,0,0,0],a=this,u=t,c=!a._row[u],s=0,f={error:Number.MAX_VALUE,