You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3 lines
132 KiB
3 lines
132 KiB
10 months ago
|
!function(o,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(o||self).BarcodeDetectorPolyfill=e()}(this,function(){function o(o,e,r){var t=document.createElement("canvas"),s=t.getContext("2d");return t.width=e,t.height=r,s.drawImage(o,0,0,e,r),s.getImageData(0,0,e,r)}var e=function(e){try{if(e instanceof HTMLImageElement){try{e.decode()}catch(o){throw new DOMException("HTMLImageElement is not decodable","InvalidStateError")}return Promise.resolve(o(e,e.naturalWidth,e.naturalHeight))}if(e instanceof SVGImageElement)return Promise.resolve(o(e,640,480));if(e instanceof HTMLVideoElement){if(0===e.readyState||1===e.readyState)throw new DOMException("","InvalidStateError");return Promise.resolve(o(e,e.videoWidth,e.videoHeight))}if(e instanceof HTMLCanvasElement){var t=e.getContext("2d");return Promise.resolve(t.getImageData(0,0,e.width,e.height))}if(e instanceof ImageBitmap)return Promise.resolve(o(e,e.width,e.height));if(e instanceof OffscreenCanvas){var s=e.getContext("2d");return Promise.resolve(s.getImageData(0,0,e.width,e.height))}return e instanceof Blob?Promise.resolve(r(e)):e instanceof ImageData?Promise.resolve(e):Promise.resolve()}catch(o){return Promise.reject(o)}},r=function(o){try{var r=URL.createObjectURL(o),t=new Image;return t.src=r,Promise.resolve(new Promise(function(o,e){t.onload=o,t.onerror=e})).then(function(){return URL.revokeObjectURL(r),e(t)})}catch(o){return Promise.reject(o)}};function t(o){return(t=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function s(o,e){return(s=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o})(o,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function n(o,e,r){return(n=c()?Reflect.construct:function(o,e,r){var t=[null];t.push.apply(t,e);var c=new(Function.bind.apply(o,t));return r&&s(c,r.prototype),c}).apply(null,arguments)}function a(o){var e="function"==typeof Map?new Map:void 0;return(a=function(o){if(null===o||-1===Function.toString.call(o).indexOf("[native code]"))return o;if("function"!=typeof o)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(o))return e.get(o);e.set(o,r)}function r(){return n(o,arguments,t(this).constructor)}return r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,o)})(o)}var d=function(o){var e,r;function t(e){var r;return(r=o.call(this)||this).stringUrl=e,r}return r=o,(e=t).prototype=Object.create(r.prototype),e.prototype.constructor=e,s(e,r),t.prototype.postMessage=function(o,e){var r=this;void 0===this.worker?(this.worker=new Worker(this.stringUrl),this.worker.onmessage=function(o){r.dispatchEvent(new MessageEvent("message",{data:o.data}))}):self.clearTimeout(this.timeout),this.worker.postMessage(o,e),this.timeout=self.setTimeout(function(){r.worker.terminate(),r.worker=void 0},2500)},t}(a(EventTarget)),l=URL.createObjectURL(new Blob(['\n!function(o){"function"==typeof define&&define.amd?define(o):o()}(function(){function o(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e,r=o((function(o,e){var r;"undefined"!=typeof self&&self,r=function(){return function(o){var e={};function r(t){if(e[t])return e[t].exports;var c=e[t]={i:t,l:!1,exports:{}};return o[t].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=o,r.c=e,r.d=function(o,e,t){r.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},r.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(e,"a",e),e},r.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},r.p="",r(r.s=3)}([funct
|
||
|
//# sourceMappingURL=barcode-detector.umd.js.map
|