scandit-web-datacapture-core
Advanced tools
| import { a } from './chunk-MBGHEFWH.js'; | ||
| import { a as a$4 } from './chunk-AIRWHLJH.js'; | ||
| import { a as a$3 } from './chunk-FGO2SSRS.js'; | ||
| import { a as a$1 } from './chunk-QCRFVRSS.js'; | ||
| import { b } from './chunk-FTD535WI.js'; | ||
| import { a as a$2 } from './chunk-SP3HSP4K.js'; | ||
| var u=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,l){let r=null,t;try{t=l(),t instanceof Promise&&(t=await t);}catch(h){t=void 0,r=a$4(h);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,preloadEngine:e.preloadEngine,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}default:return b(a.data),!1}return !0}}; | ||
| export { u as a }; |
| import { d } from './chunk-ZAOFG2OQ.js'; | ||
| import { a as a$4 } from './chunk-EYIDRFHC.js'; | ||
| import { a as a$5 } from './chunk-MZFVLSKK.js'; | ||
| import { c as c$1, a as a$6 } from './chunk-7AWOP7WL.js'; | ||
| import { c } from './chunk-RR3PHYWZ.js'; | ||
| import { a as a$2 } from './chunk-ZKXWQPFR.js'; | ||
| import { a as a$1 } from './chunk-O7TZTIHO.js'; | ||
| import { a } from './chunk-SP3HSP4K.js'; | ||
| import { a as a$3 } from './chunk-QCZSSQAQ.js'; | ||
| import { c as c$2, e } from './chunk-HIOHGPUS.js'; | ||
| var b=class b{constructor(e,t){this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathPreload="/scandit_sync_folder_preload";this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var m,h;let t=this.getModeDeserializers(),r=c$1(location);(r==="localhost"||r==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(r+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,r,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let i=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(i==null)throw new Error("Could not create the context");let a=i.getView();this.context=i.getContext(),i.delete();let s=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(n,l)=>{this.contextDidChangeStatus(JSON.parse(l.toJson()));},didStartObservingContext:()=>{this.didStartObservingContext();}}),p=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:n=>{},onObservationStopped:n=>{},onFrameProcessingStarted:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"});},onFrameProcessingFinished:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"});},onFrameSkipped:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"});}}),f=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(n,l)=>{var g;(g=this.gestureListener)==null||g.delete(),this.gestureListener=n.clone();}});(m=this.gestureRecognizer)==null||m.delete(),this.gestureRecognizer=new f;let u=new s;this.context.addListener(u),u.delete();let c=new p;this.context.addFrameListener(c),c.delete(),this.setView(a),(h=this.view)==null||h.setGestureRecognizer(this.gestureRecognizer);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[b.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var a;if(this.context==null)return {payload:e,transferables:[e.data.buffer]};let t=e.data,r=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,i),(a=this.imageFrameSource)==null||a.outputFrame(i,e.width,e.height,r),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=a=>this.redrawRequests.length>0&&this.redrawRequests[0]<=a,r=a=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=a;)this.redrawRequests.shift();},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let a=performance.now();if(t(a)){r(a),e.draw();let s=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(s));}i();},this.redrawInterval);};i();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null)throw new Error("Could not update the context");this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.gestureRecognizer!=null&&(r==null||r.setGestureRecognizer(this.gestureRecognizer)),this.setView(r),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let a=JSON.parse(i),s=[];for(let p of a){let f=new TextDecoder(p.ianaName,{fatal:!0});s.push(f.decode(r.slice(p.startIndex,p.endIndex)));}return s.join("")}catch(a){return ""}}});e.setDataDecoding(new t);}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),typeof this.moduleHandler.get().PThread=="object"||r());}getWritableDataPath(e,t){return e?this.writableDataPathPreload:t!=null?(a.log(a.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${t}`),t):this.writableDataPathStandard}async setup({libraryLocation:e$1,locationPath:t,preloadEngine:r,writableDataPathOverride:i,overrideThreadsSupport:a$7,overrideSimdSupport:s,verifyResponseHash:p,referredOrigin:f}){var R;let u=!1,c=!1;this.writableDataPath=this.getWritableDataPath(r,i),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:m,reject:h,promise:n}=new a$1,l=a$2.sdkVersion();if(l==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[g,D]=await Promise.all([c$2(),e()]);a$7!=="auto"&&(D=a$7==="on"),s!=="auto"&&(g=s==="on");let k=d(l,e$1,this.getWasmCoreFileName(g,D)),{jsURI:M,wasmURI:w}=k,W={instantiateWasm:(d,T)=>(a$6({importObject:d,wasmURI:w,expectedHash:this.getWasmCoreExpectedHash(g,D),verifyResponseHash:p,successCallback:T,progressCallback:this._loadProgressCallback,referredOrigin:f}),{})};return this.moduleHandler.set({mainScriptUrlOrBlob:M,canvas:(R=this.workerFunctions.getOffscreenCanvas())!=null?R:{getContext:()=>null},...W,dynamicLibraries:this.getWasmDynamicLibraries(w),locateFile:d=>e$1+d,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPathPreload:this.writableDataPathPreload,writableDataPath:this.writableDataPath,preloading:r});}catch(d){if(d.name==="BlockedIndexedDB"){h(d.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",d);}c=!0,this.start(c,u,m);}],onMainComplete:()=>{if([u,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:u,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),h("onMainComplete has been called but runtime or file system was not ready.");return}m();},onRuntimeInitialized:()=>{u=!0,this.start(c,u,m);},print:d=>{a.log(a.Level.Info,d);}}),await a$5(M,l)||h(`Couldn't retrieve Scandit Data Capture library at ${M}, did you configure the path for it correctly?`),n}};b.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var I=b; | ||
| export { I as a }; |
| import { a } from './chunk-4B27JKMG.js'; | ||
| var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){} | ||
| export { t as a, l as b }; |
| var e;(o=>{function i(){let r="6.27.1";return r}o.sdkVersion=i;})(e||(e={})); | ||
| export { e as a }; |
@@ -1,1 +0,1 @@ | ||
| "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty;module.exports=(e={},((e,c,n,l)=>{if(c&&"object"==typeof c||"function"==typeof c)for(let u of o(c))p.call(e,u)||u===n||t(e,u,{get:()=>c[u],enumerable:!(l=r(c,u))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e)); | ||
| var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty;module.exports=(e={},((e,n,c,l)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let a of o(n))p.call(e,a)||a===c||t(e,a,{get:()=>n[a],enumerable:!(l=r(n,a))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e)); |
@@ -1,1 +0,1 @@ | ||
| "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,p={};((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(p,{CHN:()=>y,Id:()=>i,K:()=>l}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of o(p))n.call(e,i)||i===a||t(e,i,{get:()=>p[i],enumerable:!(l=r(p,i))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a=String.fromCodePoint,l=a.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=a.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),y=a.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]); | ||
| var e,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,p={};((e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})})(p,{CHN:()=>y,Id:()=>i,K:()=>l}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of o(p))n.call(e,i)||i===a||r(e,i,{get:()=>p[i],enumerable:!(l=t(p,i))||l.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=String.fromCodePoint,l=a.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=a.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),y=a.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]); |
@@ -1,1 +0,1 @@ | ||
| "use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})})(p,{register:()=>u,unregister:()=>f}),module.exports=(e=p,((e,p,s,o)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of a(p))r.call(e,i)||i===s||t(e,i,{get:()=>p[i],enumerable:!(o=n(p,i))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s=String.fromCodePoint,o=(s.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),s.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57])),i=s.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function c(e,t){return async function(n,a){if(function(e,t){const n=new URL(e.url);return t.senderId===o&&"localhost"===n.hostname||""===n.hostname}(n.senderFrame,a))switch(a.type){case"get-license-key":if(null!=a.payload)try{const r=await async function(e,t){const{fs:n,crypto:a,path:r,app:p}=e,[s,o]=t.publicKey.split(":"),i=r.join(p.getAppPath(),t.licenseDataPath);return function(e,t,n){const r=a.createDecipheriv("aes-256-cbc",t,n);let p=r.update(e,"hex","utf8");return p+=r.final("utf8"),p}((await n.readFile(i)).toString("utf8"),Buffer.from(s,"base64"),Buffer.from(o,"base64"))}(e,{licenseDataPath:a.payload.licenseDataPath,publicKey:t});n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{licenseKey:r??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}break;case"get-app-info":try{const t=await async function(e){const{fs:t,path:n,app:a}=e;let r=process.cwd();a.isPackaged&&(r=a.getAppPath());const p=await t.readFile(n.join(r,"package.json"),"utf8"),s=JSON.parse(p);return{appId:s.build?.appId??s.appId,name:s.name,version:s.version}}(e);n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{isPackaged:e.app.isPackaged,version:t.version??e.app.getVersion(),appName:t.name??e.app.getName(),appId:t.appId??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}}}}var d=null,l=null;function u(e,t){l=e,d=c(e,t),l.ipcMain.on(i,d)}function f(){null!=d&&null!=l&&l.ipcMain.off(i,d)} | ||
| var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})})(p,{register:()=>u,unregister:()=>f}),module.exports=(e=p,((e,p,s,o)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of a(p))r.call(e,i)||i===s||t(e,i,{get:()=>p[i],enumerable:!(o=n(p,i))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s=String.fromCodePoint,o=(s.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),s.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57])),i=s.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function c(e,t){return async function(n,a){if(function(e,t){const n=new URL(e.url);return t.senderId===o&&"localhost"===n.hostname||""===n.hostname}(n.senderFrame,a))switch(a.type){case"get-license-key":if(null!=a.payload)try{const r=await async function(e,t){const{fs:n,crypto:a,path:r,app:p}=e,[s,o]=t.publicKey.split(":"),i=r.join(p.getAppPath(),t.licenseDataPath);return function(e,t,n){const r=a.createDecipheriv("aes-256-cbc",t,n);let p=r.update(e,"hex","utf8");return p+=r.final("utf8"),p}((await n.readFile(i)).toString("utf8"),Buffer.from(s,"base64"),Buffer.from(o,"base64"))}(e,{licenseDataPath:a.payload.licenseDataPath,publicKey:t});n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{licenseKey:r??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}break;case"get-app-info":try{const t=await async function(e){const{fs:t,path:n,app:a}=e;let r=process.cwd();a.isPackaged&&(r=a.getAppPath());const p=await t.readFile(n.join(r,"package.json"),"utf8"),s=JSON.parse(p);return{appId:s.build?.appId??s.appId,name:s.name,version:s.version}}(e);n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{isPackaged:e.app.isPackaged,version:t.version??e.app.getVersion(),appName:t.name??e.app.getName(),appId:t.appId??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}}}}var d=null,l=null;function u(e,t){l=e,d=c(e,t),l.ipcMain.on(i,d)}function f(){null!=d&&null!=l&&l.ipcMain.off(i,d)} |
@@ -1,1 +0,1 @@ | ||
| "use strict";var e,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,p={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(p,{preloadBindings:()=>s}),module.exports=(e=p,((e,p,a,i)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let l of n(p))o.call(e,l)||l===a||r(e,l,{get:()=>p[l],enumerable:!(i=t(p,l))||i.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=require("electron"),i=String.fromCodePoint,l=i.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),y=i.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),c=i.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function d(e){return null!=e.payload.error}function s(e){a.contextBridge.exposeInMainWorld(l,Object.freeze(function(e){return{getAppInfo:async()=>new Promise(((r,t)=>{e.once(c,((e,n)=>{d(n)&&t(n.payload.error),"get-app-info"===n.type&&r(n.payload)})),e.send(c,{type:"get-app-info",senderId:y})})),getKey:async r=>new Promise(((t,n)=>{e.once(c,((e,r)=>{d(r)&&n(r.payload.error),"get-license-key"===r.type&&t(r.payload)})),e.send(c,{type:"get-license-key",senderId:y,payload:r})}))}}(e)))} | ||
| var e,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})})(p,{preloadBindings:()=>s}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let y of t(p))o.call(e,y)||y===a||r(e,y,{get:()=>p[y],enumerable:!(l=n(p,y))||l.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=require("electron"),l=String.fromCodePoint,y=l.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=l.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),c=l.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function d(e){return null!=e.payload.error}function s(e){a.contextBridge.exposeInMainWorld(y,Object.freeze(function(e){return{getAppInfo:async()=>new Promise(((r,n)=>{e.once(c,((e,t)=>{d(t)&&n(t.payload.error),"get-app-info"===t.type&&r(t.payload)})),e.send(c,{type:"get-app-info",senderId:i})})),getKey:async r=>new Promise(((n,t)=>{e.once(c,((e,r)=>{d(r)&&t(r.payload.error),"get-license-key"===r.type&&n(r.payload)})),e.send(c,{type:"get-license-key",senderId:i,payload:r})}))}}(e)))} |
@@ -1,1 +0,1 @@ | ||
| export { a as DataCaptureVersion } from './chunks/chunk-XMUOIWV7.js'; | ||
| export { a as DataCaptureVersion } from './chunks/chunk-ZKXWQPFR.js'; |
| export { b as DataCaptureLoader, a as OverrideState } from './chunks/chunk-MFFBJAZS.js'; | ||
| import { a as a$1 } from './chunks/chunk-UH7EP55Y.js'; | ||
| export { a as WorkerMain } from './chunks/chunk-5DB2IMBI.js'; | ||
| export { a as WorkerMain } from './chunks/chunk-4B27JKMG.js'; | ||
| import { a as a$3 } from './chunks/chunk-ZAOFG2OQ.js'; | ||
@@ -14,3 +14,3 @@ export { c as CameraFOVSwitchControl, b as CameraSwitchControl, a as TorchSwitchControl } from './chunks/chunk-T5EUB6UG.js'; | ||
| export { a as SingleImageUploaderSettings } from './chunks/chunk-BTXDPF7O.js'; | ||
| export { a as DataCaptureVersion } from './chunks/chunk-XMUOIWV7.js'; | ||
| export { a as DataCaptureVersion } from './chunks/chunk-ZKXWQPFR.js'; | ||
| export { a as DataCaptureView } from './chunks/chunk-6OZMW537.js'; | ||
@@ -17,0 +17,0 @@ export { a as Timeout } from './chunks/chunk-Q7JWDX4U.js'; |
@@ -1,1 +0,1 @@ | ||
| export { b as InlineWorker, a as workerInstance } from '../chunks/chunk-E2NXIQ2Y.js'; | ||
| export { b as InlineWorker, a as workerInstance } from '../chunks/chunk-SVVKZX2L.js'; |
@@ -1,1 +0,1 @@ | ||
| export { a as DataCaptureEngine } from '../chunks/chunk-VQ5DYTPM.js'; | ||
| export { a as DataCaptureEngine } from '../chunks/chunk-MBGHEFWH.js'; |
| export { b as DataCaptureLoader, a as OverrideState } from '../chunks/chunk-MFFBJAZS.js'; | ||
| export { a as WorkerMain } from '../chunks/chunk-5DB2IMBI.js'; | ||
| export { a as DataCaptureEngine } from '../chunks/chunk-VQ5DYTPM.js'; | ||
| export { a as WorkerMain } from '../chunks/chunk-4B27JKMG.js'; | ||
| export { a as DataCaptureEngine } from '../chunks/chunk-MBGHEFWH.js'; | ||
| export { e as HintCornerStyle, a as HintFont, d as HintHeight, f as HintIcon, b as HintTextAlignment, c as HintWidth, g as LicensedFeature } from '../chunks/chunk-Q5P56NBF.js'; |
@@ -1,1 +0,1 @@ | ||
| export { a as WorkerMain } from '../chunks/chunk-5DB2IMBI.js'; | ||
| export { a as WorkerMain } from '../chunks/chunk-4B27JKMG.js'; |
+1
-1
| { | ||
| "name": "scandit-web-datacapture-core", | ||
| "version": "6.27.0", | ||
| "version": "6.27.1", | ||
| "description": "Scandit Data Capture SDK for the Web", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE", |
| import { a } from './chunk-VQ5DYTPM.js'; | ||
| import { a as a$4 } from './chunk-AIRWHLJH.js'; | ||
| import { a as a$3 } from './chunk-FGO2SSRS.js'; | ||
| import { a as a$1 } from './chunk-QCRFVRSS.js'; | ||
| import { b } from './chunk-FTD535WI.js'; | ||
| import { a as a$2 } from './chunk-SP3HSP4K.js'; | ||
| var u=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,l){let r=null,t;try{t=l(),t instanceof Promise&&(t=await t);}catch(h){t=void 0,r=a$4(h);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,preloadEngine:e.preloadEngine,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}default:return b(a.data),!1}return !0}}; | ||
| export { u as a }; |
| import { a } from './chunk-5DB2IMBI.js'; | ||
| var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){} | ||
| export { t as a, l as b }; |
| import { d } from './chunk-ZAOFG2OQ.js'; | ||
| import { a as a$4 } from './chunk-EYIDRFHC.js'; | ||
| import { a as a$5 } from './chunk-MZFVLSKK.js'; | ||
| import { c as c$1, a as a$6 } from './chunk-7AWOP7WL.js'; | ||
| import { c } from './chunk-RR3PHYWZ.js'; | ||
| import { a as a$2 } from './chunk-XMUOIWV7.js'; | ||
| import { a as a$1 } from './chunk-O7TZTIHO.js'; | ||
| import { a } from './chunk-SP3HSP4K.js'; | ||
| import { a as a$3 } from './chunk-QCZSSQAQ.js'; | ||
| import { c as c$2, e } from './chunk-HIOHGPUS.js'; | ||
| var b=class b{constructor(e,t){this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathPreload="/scandit_sync_folder_preload";this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(this.getWasmMetadata());}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0);}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var m,h;let t=this.getModeDeserializers(),r=c$1(location);(r==="localhost"||r==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(r+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,r,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let i=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(i==null)throw new Error("Could not create the context");let a=i.getView();this.context=i.getContext(),i.delete();let s=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(n,l)=>{this.contextDidChangeStatus(JSON.parse(l.toJson()));},didStartObservingContext:()=>{this.didStartObservingContext();}}),p=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:n=>{},onObservationStopped:n=>{},onFrameProcessingStarted:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"});},onFrameProcessingFinished:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"});},onFrameSkipped:(n,l)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"});}}),f=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(n,l)=>{var g;(g=this.gestureListener)==null||g.delete(),this.gestureListener=n.clone();}});(m=this.gestureRecognizer)==null||m.delete(),this.gestureRecognizer=new f;let u=new s;this.context.addListener(u),u.delete();let c=new p;this.context.addFrameListener(c),c.delete(),this.setView(a),(h=this.view)==null||h.setGestureRecognizer(this.gestureRecognizer);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[b.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var a;if(this.context==null)return {payload:e,transferables:[e.data.buffer]};let t=e.data,r=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,i),(a=this.imageFrameSource)==null||a.outputFrame(i,e.width,e.height,r),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=a=>this.redrawRequests.length>0&&this.redrawRequests[0]<=a,r=a=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=a;)this.redrawRequests.shift();},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let a=performance.now();if(t(a)){r(a),e.draw();let s=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(s));}i();},this.redrawInterval);};i();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null)throw new Error("Could not update the context");this.context.delete(),this.context=t.getContext();let r=t.getView();t.delete(),r!=null&&e.view!=null&&r.setViewSize(e.view.width,e.view.height,e.view.orientation),this.gestureRecognizer!=null&&(r==null||r.setGestureRecognizer(this.gestureRecognizer)),this.setView(r),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e});}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"});}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let a=JSON.parse(i),s=[];for(let p of a){let f=new TextDecoder(p.ianaName,{fatal:!0});s.push(f.decode(r.slice(p.startIndex,p.endIndex)));}return s.join("")}catch(a){return ""}}});e.setDataDecoding(new t);}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),typeof this.moduleHandler.get().PThread=="object"||r());}getWritableDataPath(e,t){return e?this.writableDataPathPreload:t!=null?(a.log(a.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${t}`),t):this.writableDataPathStandard}async setup({libraryLocation:e$1,locationPath:t,preloadEngine:r,writableDataPathOverride:i,overrideThreadsSupport:a$7,overrideSimdSupport:s,verifyResponseHash:p,referredOrigin:f}){var R;let u=!1,c=!1;this.writableDataPath=this.getWritableDataPath(r,i),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:m,reject:h,promise:n}=new a$1,l=a$2.sdkVersion();if(l==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[g,D]=await Promise.all([c$2(),e()]);a$7!=="auto"&&(D=a$7==="on"),s!=="auto"&&(g=s==="on");let k=d(l,e$1,this.getWasmCoreFileName(g,D)),{jsURI:M,wasmURI:w}=k,W={instantiateWasm:(d,T)=>(a$6({importObject:d,wasmURI:w,expectedHash:this.getWasmCoreExpectedHash(g,D),verifyResponseHash:p,successCallback:T,progressCallback:this._loadProgressCallback,referredOrigin:f}),{})};return this.moduleHandler.set({mainScriptUrlOrBlob:M,canvas:(R=this.workerFunctions.getOffscreenCanvas())!=null?R:{getContext:()=>null},...W,dynamicLibraries:this.getWasmDynamicLibraries(w),locateFile:d=>e$1+d,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPathPreload:this.writableDataPathPreload,writableDataPath:this.writableDataPath,preloading:r});}catch(d){if(d.name==="BlockedIndexedDB"){h(d.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",d);}c=!0,this.start(c,u,m);}],onMainComplete:()=>{if([u,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:u,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),h("onMainComplete has been called but runtime or file system was not ready.");return}m();},onRuntimeInitialized:()=>{u=!0,this.start(c,u,m);},print:d=>{a.log(a.Level.Info,d);}}),await a$5(M,l)||h(`Couldn't retrieve Scandit Data Capture library at ${M}, did you configure the path for it correctly?`),n}};b.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var I=b; | ||
| export { I as a }; |
| var e;(o=>{function i(){let r="6.27.0";return r}o.sdkVersion=i;})(e||(e={})); | ||
| export { e as a }; |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
573650
-0.01%24
4.35%