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.
qrcode-decoder/lib/index.min.js

3 lines
132 KiB
JavaScript

3 years ago
var QrcodeDecoder=function(){"use strict";var n=function(){return(n=Object.assign||function(e){for(var o,r=1,t=arguments.length;r<t;r++)for(var s in o=arguments[r])Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s]);return e}).apply(this,arguments)};function a(e,n,a,d){return new(a=a||Promise)(function(r,o){function t(e){try{c(d.next(e))}catch(e){o(e)}}function s(e){try{c(d.throw(e))}catch(e){o(e)}}function c(e){var o;e.done?r(e.value):((o=e.value)instanceof a?o:new a(function(e){e(o)})).then(t,s)}c((d=d.apply(e,n||[])).next())})}function d(t,s){var c,n,a,d={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:o(0),throw:o(1),return:o(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function o(r){return function(e){var o=[r,e];if(c)throw new TypeError("Generator is already executing.");for(;d;)try{if(c=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,(o=a?[2&o[0],a.value]:o)[0]){case 0:case 1:a=o;break;case 4:return d.label++,{value:o[1],done:!1};case 5:d.label++,n=o[1],o=[0];continue;case 7:o=d.ops.pop(),d.trys.pop();continue;default:if(!(a=0<(a=d.trys).length&&a[a.length-1])&&(6===o[0]||2===o[0])){d=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){d.label=o[1];break}if(6===o[0]&&d.label<a[1]){d.label=a[1],a=o;break}if(a&&d.label<a[2]){d.label=a[2],d.ops.push(o);break}a[2]&&d.ops.pop(),d.trys.pop();continue}o=s.call(t,d)}catch(e){o=[6,e],n=0}finally{c=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}}(function(e){var o;o=function(){return r=[function(e,o,r){function t(e,o){this.width=o,this.height=e.length/o,this.data=e}Object.defineProperty(o,"__esModule",{value:!0}),t.createEmpty=function(e,o){return new t(new Uint8ClampedArray(e*o),e)},t.prototype.get=function(e,o){return!(e<0||e>=this.width||o<0||o>=this.height)&&!!this.data[o*this.width+e]},t.prototype.set=function(e,o,r){this.data[o*this.width+e]=r?1:0},t.prototype.setRegion=function(e,o,r,t,s){for(var c=o;c<o+t;c++)for(var n=e;n<e+r;n++)this.set(n,c,!!s)},o.BitMatrix=t},function(e,o,r){Object.defineProperty(o,"__esModule",{value:!0});var c=r(2);function t(e,o,r){this.primitive=e,this.size=o,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var t=1,s=0;s<this.size;s++)this.expTable[s]=t,(t*=2)>=this.size&&(t=(t^this.primitive)&this.size-1);for(s=0;s<this.size-1;s++)this.logTable[this.expTable[s]]=s;this.zero=new c.default(this,Uint8ClampedArray.from([0])),this.one=new c.default(this,Uint8ClampedArray.from([1]))}o.addOrSubtractGF=function(e,o){return e^o},t.prototype.multiply=function(e,o){return 0===e||0===o?0:this.expTable[(this.logTable[e]+this.logTable[o])%(this.size-1)]},t.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},t.prototype.buildMonomial=function(e,o){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===o)return this.zero;e=new Uint8ClampedArray(e+1);return e[0]=o,new c.default(this,e)},t.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},t.prototype.exp=function(e){return this.expTable[e]},o.default=t},function(e,o,r){Object.defineProperty(o,"__esModule",{value:!0});var l=r(1);function i(e,o){if(0===o.length)throw new Error("No coefficients.");this.field=e;var r=o.length;if(1<r&&0===o[0]){for(var t=1;t<r&&0===o[t];)t++;if(t===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-t);for(var s=0;s<this.coefficients.length;s++)this.coefficients[s]=o[t+s]}}else this.coefficients=o}i.prototype.degree=function(){return this.coefficients.length-1},i.prototype.isZero=function(){return 0===this.coefficients[0]},i.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},i.prototype.addOrSubtract=function(e){if(this.isZero())return e;if(e.isZero())return this;for(var o=this.coefficients,r=e.coefficients,t=(o.length>r.length&&(o=(e=[r,o])[0],r=e[1]),new Uint8C
//# sourceMappingURL=index.min.js.map