@microblink/capture 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/capture.js +440 -440
- package/dist/capture.umd.cjs +26 -26
- package/dist/resources/advanced/capture-wasm.js +2 -2
- package/dist/resources/advanced/capture-wasm.wasm +0 -0
- package/dist/resources/advanced-threads/capture-wasm.js +2 -2
- package/dist/resources/advanced-threads/capture-wasm.wasm +0 -0
- package/dist/resources/basic/capture-wasm.wasm +0 -0
- package/dist/resources/capture-worker.js +2 -2
- package/package.json +7 -11
|
@@ -22,7 +22,7 @@ function ra(a){for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:
|
|
|
22
22
|
function Aa(){var a=h.preRun.shift();xa.unshift(a)}var Ba=0,Ca=null,Da=null;function Ea(){Ba++;h.monitorRunDependencies&&h.monitorRunDependencies(Ba)}function Fa(){Ba--;h.monitorRunDependencies&&h.monitorRunDependencies(Ba);if(0==Ba&&(null!==Ca&&(clearInterval(Ca),Ca=null),Da)){var a=Da;Da=null;a()}}function ma(a){if(h.onAbort)h.onAbort(a);a="Aborted("+a+")";u(a);oa=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}
|
|
23
23
|
function Ga(a){return a.startsWith("data:application/octet-stream;base64,")}var Ha;Ha="capture-wasm.wasm";if(!Ga(Ha)){var Ia=Ha;Ha=h.locateFile?h.locateFile(Ia,fa):fa+Ia}function Ja(a){try{if(a==Ha&&la)return new Uint8Array(la);if(ja)return ja(a);throw"both async and sync fetching of the wasm failed";}catch(b){ma(b)}}
|
|
24
24
|
function Ka(a){return la||"function"!=typeof fetch?Promise.resolve().then(function(){return Ja(a)}):fetch(a,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+a+"'";return b.arrayBuffer()}).catch(function(){return Ja(a)})}function La(a,b,c){return Ka(a).then(function(d){return WebAssembly.instantiate(d,b)}).then(function(d){return d}).then(c,function(d){u("failed to asynchronously prepare wasm: "+d);ma(d)})}
|
|
25
|
-
function Ma(a,b){var c=Ha;return la||"function"!=typeof WebAssembly.instantiateStreaming||Ga(c)||"function"!=typeof fetch?La(c,a,b):fetch(c,{credentials:"same-origin"}).then(function(d){return WebAssembly.instantiateStreaming(d,a).then(b,function(e){u("wasm streaming compile failed: "+e);u("falling back to ArrayBuffer instantiation");return La(c,a,b)})})}var J,K,Pa={
|
|
25
|
+
function Ma(a,b){var c=Ha;return la||"function"!=typeof WebAssembly.instantiateStreaming||Ga(c)||"function"!=typeof fetch?La(c,a,b):fetch(c,{credentials:"same-origin"}).then(function(d){return WebAssembly.instantiateStreaming(d,a).then(b,function(e){u("wasm streaming compile failed: "+e);u("falling back to ArrayBuffer instantiation");return La(c,a,b)})})}var J,K,Pa={60052:(a,b,c,d)=>{a=v(a);b=v(b);c=v(c);d=v(d);throw Error(a+b+c+d);},60268:(a,b)=>{a=v(a);b=v(b);throw Error(a+b);}};
|
|
26
26
|
function Qa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function Ra(a){for(;0<a.length;)a.shift()(h)}
|
|
27
27
|
var Sa=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},L=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Sa(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Ta=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},Ua=a=>{if("/"===
|
|
28
28
|
a)return"/";a=L(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function Va(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return()=>{crypto.getRandomValues(a);return a[0]}}return()=>ma("randomDevice")}
|
|
@@ -140,7 +140,7 @@ typeof f&&(f+=z)}F=b}I[d>>2]=F;return 0}catch(G){if("undefined"==typeof S||"Errn
|
|
|
140
140
|
"ErrnoError"!==g.name)throw g;return g.Fa}},r:function(a,b,c,d){try{a:{var e=Yb(a);a=b;for(var f,g=b=0;g<c;g++){var l=I[a>>2],m=I[a+4>>2];a+=8;var n=Mb(e,C,l,m,f);if(0>n){var r=-1;break a}b+=n;"undefined"!==typeof f&&(f+=n)}r=b}I[d>>2]=r;return 0}catch(p){if("undefined"==typeof S||"ErrnoError"!==p.name)throw p;return p.Fa}},_:function(){var a=stackTrace(),b=ra(a)+1,c=zd(b);A(a,w,c,b);return c},C:Kd,$:Nd,D:function(a,b,c,d){return Nd(a,b,c,d)}};
|
|
141
141
|
(function(){function a(c){c=c.exports;h.asm=c;na=h.asm.ea;va();wa=h.asm.ia;ya.unshift(h.asm.fa);Fa("wasm-instantiate");return c}var b={a:Qd};Ea("wasm-instantiate");if(h.instantiateWasm)try{return h.instantiateWasm(b,a)}catch(c){u("Module.instantiateWasm callback failed with error: "+c),ba(c)}Ma(b,function(c){a(c.instance)}).catch(ba);return{}})();function X(){return(X=h.asm.ga).apply(null,arguments)}function zd(){return(zd=h.asm.ha).apply(null,arguments)}
|
|
142
142
|
var Uc=h.___getTypeName=function(){return(Uc=h.___getTypeName=h.asm.ja).apply(null,arguments)};h.__embind_initialize_bindings=function(){return(h.__embind_initialize_bindings=h.asm.ka).apply(null,arguments)};function eb(){return(eb=h.asm.la).apply(null,arguments)}h.dynCall_ji=function(){return(h.dynCall_ji=h.asm.ma).apply(null,arguments)};h.dynCall_jiji=function(){return(h.dynCall_jiji=h.asm.na).apply(null,arguments)};h.dynCall_viijii=function(){return(h.dynCall_viijii=h.asm.oa).apply(null,arguments)};
|
|
143
|
-
h.dynCall_iiiiij=function(){return(h.dynCall_iiiiij=h.asm.pa).apply(null,arguments)};h.dynCall_iiiiijj=function(){return(h.dynCall_iiiiijj=h.asm.qa).apply(null,arguments)};h.dynCall_iiiiiijj=function(){return(h.dynCall_iiiiiijj=h.asm.ra).apply(null,arguments)};h.__ZN2MB2NN28LinearDefragmentingAllocator10Allocation4nullE=1024;h.___start_em_js=
|
|
143
|
+
h.dynCall_iiiiij=function(){return(h.dynCall_iiiiij=h.asm.pa).apply(null,arguments)};h.dynCall_iiiiijj=function(){return(h.dynCall_iiiiijj=h.asm.qa).apply(null,arguments)};h.dynCall_iiiiiijj=function(){return(h.dynCall_iiiiiijj=h.asm.ra).apply(null,arguments)};h.__ZN2MB2NN28LinearDefragmentingAllocator10Allocation4nullE=1024;h.___start_em_js=60378;h.___stop_em_js=61251;h.addRunDependency=Ea;h.removeRunDependency=Fa;h.FS_createPath=Qb;h.FS_createDataFile=Sb;h.FS_createPreloadedFile=Wb;
|
|
144
144
|
h.FS_createLazyFile=Ub;h.FS_createDevice=R;h.FS_unlink=Eb;var Rd;Da=function Sd(){Rd||Td();Rd||(Da=Sd)};
|
|
145
145
|
function Td(){function a(){if(!Rd&&(Rd=!0,h.calledRun=!0,!oa)){h.noFSInit||Ob||(Ob=!0,Nb(),h.stdin=h.stdin,h.stdout=h.stdout,h.stderr=h.stderr,h.stdin?R("/dev","stdin",h.stdin):Db("/dev/tty","/dev/stdin"),h.stdout?R("/dev","stdout",null,h.stdout):Db("/dev/tty","/dev/stdout"),h.stderr?R("/dev","stderr",null,h.stderr):Db("/dev/tty1","/dev/stderr"),Jb("/dev/stdin",0),Jb("/dev/stdout",1),Jb("/dev/stderr",1));pb=!1;Ra(ya);aa(h);if(h.onRuntimeInitialized)h.onRuntimeInitialized();if(h.postRun)for("function"==
|
|
146
146
|
typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;){var b=h.postRun.shift();za.unshift(b)}Ra(za)}}if(!(0<Ba)){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)Aa();Ra(xa);0<Ba||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1);a()},1)):a())}}if(h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0<h.preInit.length;)h.preInit.pop()();Td();
|
|
Binary file
|
|
@@ -26,7 +26,7 @@ function La(){F||(D.noFSInit||Ma||(Ma=!0,Na(),D.stdin=D.stdin,D.stdout=D.stdout,
|
|
|
26
26
|
function Ya(){Va++;D.monitorRunDependencies&&D.monitorRunDependencies(Va)}function Za(){Va--;D.monitorRunDependencies&&D.monitorRunDependencies(Va);if(0==Va&&(null!==Wa&&(clearInterval(Wa),Wa=null),Xa)){var a=Xa;Xa=null;a()}}function ya(a){if(D.onAbort)D.onAbort(a);a="Aborted("+a+")";E(a);Aa=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");na(a);throw a;}function $a(a){return a.startsWith("data:application/octet-stream;base64,")}var ab;ab="capture-wasm.wasm";
|
|
27
27
|
$a(ab)||(ab=sa(ab));function bb(a){try{if(a==ab&&xa)return new Uint8Array(xa);if(va)return va(a);throw"both async and sync fetching of the wasm failed";}catch(b){ya(b)}}function cb(a){return xa||"function"!=typeof fetch?Promise.resolve().then(function(){return bb(a)}):fetch(a,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+a+"'";return b.arrayBuffer()}).catch(function(){return bb(a)})}
|
|
28
28
|
function db(a,b,c){return cb(a).then(function(d){return WebAssembly.instantiate(d,b)}).then(function(d){return d}).then(c,function(d){E("failed to asynchronously prepare wasm: "+d);ya(d)})}
|
|
29
|
-
function eb(a,b){var c=ab;return xa||"function"!=typeof WebAssembly.instantiateStreaming||$a(c)||"function"!=typeof fetch?db(c,a,b):fetch(c,{credentials:"same-origin"}).then(function(d){return WebAssembly.instantiateStreaming(d,a).then(b,function(e){E("wasm streaming compile failed: "+e);E("falling back to ArrayBuffer instantiation");return db(c,a,b)})})}var L,M,fb={
|
|
29
|
+
function eb(a,b){var c=ab;return xa||"function"!=typeof WebAssembly.instantiateStreaming||$a(c)||"function"!=typeof fetch?db(c,a,b):fetch(c,{credentials:"same-origin"}).then(function(d){return WebAssembly.instantiateStreaming(d,a).then(b,function(e){E("wasm streaming compile failed: "+e);E("falling back to ArrayBuffer instantiation");return db(c,a,b)})})}var L,M,fb={61921:(a,b,c,d)=>{a=J(a);b=J(b);c=J(c);d=J(d);throw Error(a+b+c+d);},62137:(a,b)=>{a=J(a);b=J(b);throw Error(a+b);}};
|
|
30
30
|
function gb(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function hb(a){a.terminate();a.onmessage=()=>{}}function ib(a){(a=N.kb[a])||ya();N.md(a)}function jb(a){var b=N.Rc();if(!b)return 6;N.qb.push(b);N.kb[a.jb]=b;b.jb=a.jb;b.postMessage({cmd:"run",start_routine:a.td,arg:a.Ec,pthread_ptr:a.jb},a.zd);return 0}
|
|
31
31
|
var kb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},O=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=kb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},lb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},mb=a=>{if("/"===
|
|
32
32
|
a)return"/";a=O(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function nb(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return()=>{crypto.getRandomValues(a);return a[0]}}return()=>ya("randomDevice")}
|
|
@@ -159,7 +159,7 @@ b,c,d)}};(function(){function a(c,d){c=c.exports;D.asm=c;N.Ac.push(D.asm.ta);Ha=
|
|
|
159
159
|
var vc=D._pthread_self=function(){return(vc=D._pthread_self=D.asm.sa).apply(null,arguments)};D.__emscripten_tls_init=function(){return(D.__emscripten_tls_init=D.asm.ta).apply(null,arguments)};function xb(){return(xb=D.asm.ua).apply(null,arguments)}var Ad=D.___getTypeName=function(){return(Ad=D.___getTypeName=D.asm.va).apply(null,arguments)};D.__embind_initialize_bindings=function(){return(D.__embind_initialize_bindings=D.asm.wa).apply(null,arguments)};
|
|
160
160
|
var Ne=D.__emscripten_thread_init=function(){return(Ne=D.__emscripten_thread_init=D.asm.xa).apply(null,arguments)};D.__emscripten_thread_crashed=function(){return(D.__emscripten_thread_crashed=D.asm.ya).apply(null,arguments)};function ne(){return(ne=D.asm.Aa).apply(null,arguments)}var Rd=D.__emscripten_proxy_execute_task_queue=function(){return(Rd=D.__emscripten_proxy_execute_task_queue=D.asm.Ba).apply(null,arguments)};function uc(){return(uc=D.asm.Ca).apply(null,arguments)}
|
|
161
161
|
var Bc=D.__emscripten_thread_exit=function(){return(Bc=D.__emscripten_thread_exit=D.asm.Da).apply(null,arguments)};function xc(){return(xc=D.asm.Ea).apply(null,arguments)}function le(){return(le=D.asm.Fa).apply(null,arguments)}function yc(){return(yc=D.asm.Ga).apply(null,arguments)}function me(){return(me=D.asm.Ha).apply(null,arguments)}D.dynCall_ji=function(){return(D.dynCall_ji=D.asm.Ia).apply(null,arguments)};D.dynCall_jiji=function(){return(D.dynCall_jiji=D.asm.Ja).apply(null,arguments)};
|
|
162
|
-
D.dynCall_viijii=function(){return(D.dynCall_viijii=D.asm.Ka).apply(null,arguments)};D.dynCall_iiiiij=function(){return(D.dynCall_iiiiij=D.asm.La).apply(null,arguments)};D.dynCall_iiiiijj=function(){return(D.dynCall_iiiiijj=D.asm.Ma).apply(null,arguments)};D.dynCall_iiiiiijj=function(){return(D.dynCall_iiiiiijj=D.asm.Na).apply(null,arguments)};D.__ZN2MB2NN28LinearDefragmentingAllocator10Allocation4nullE=14816;D.___start_em_js=
|
|
162
|
+
D.dynCall_viijii=function(){return(D.dynCall_viijii=D.asm.Ka).apply(null,arguments)};D.dynCall_iiiiij=function(){return(D.dynCall_iiiiij=D.asm.La).apply(null,arguments)};D.dynCall_iiiiijj=function(){return(D.dynCall_iiiiijj=D.asm.Ma).apply(null,arguments)};D.dynCall_iiiiiijj=function(){return(D.dynCall_iiiiiijj=D.asm.Na).apply(null,arguments)};D.__ZN2MB2NN28LinearDefragmentingAllocator10Allocation4nullE=14816;D.___start_em_js=60928;D.___stop_em_js=61921;D.addRunDependency=Ya;
|
|
163
163
|
D.removeRunDependency=Za;D.FS_createPath=fc;D.FS_createDataFile=hc;D.FS_createPreloadedFile=lc;D.FS_createLazyFile=jc;D.FS_createDevice=Oa;D.FS_unlink=Wb;D.keepRuntimeAlive=function(){return noExitRuntime};D.wasmMemory=u;D.ExitStatus=gb;D.PThread=N;var Pe;Xa=function Qe(){Pe||Re();Pe||(Xa=Qe)};
|
|
164
164
|
function Re(){function a(){if(!Pe&&(Pe=!0,D.calledRun=!0,!Aa)){La();ma(D);if(D.onRuntimeInitialized)D.onRuntimeInitialized();if(!F){if(D.postRun)for("function"==typeof D.postRun&&(D.postRun=[D.postRun]);D.postRun.length;){var b=D.postRun.shift();Ka.unshift(b)}Sa(Ka)}}}if(!(0<Va))if(F)ma(D),La(),startWorker(D);else{if(D.preRun)for("function"==typeof D.preRun&&(D.preRun=[D.preRun]);D.preRun.length;)Ua();Sa(Ia);0<Va||(D.setStatus?(D.setStatus("Running..."),setTimeout(function(){setTimeout(function(){D.setStatus("")},
|
|
165
165
|
1);a()},1)):a())}}if(D.preInit)for("function"==typeof D.preInit&&(D.preInit=[D.preInit]);0<D.preInit.length;)D.preInit.pop()();Re();
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var captureWorker=function(
|
|
1
|
+
var captureWorker=function(P){"use strict";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/const x=Symbol("Comlink.proxy"),N=Symbol("Comlink.endpoint"),
|
|
5
|
+
*/const x=Symbol("Comlink.proxy"),N=Symbol("Comlink.endpoint"),I=Symbol("Comlink.releaseProxy"),m=Symbol("Comlink.finalizer"),h=Symbol("Comlink.thrown"),z=e=>typeof e=="object"&&e!==null||typeof e=="function",F={canHandle:e=>z(e)&&e[x],serialize(e){const{port1:t,port2:r}=new MessageChannel;return M(e,t),[r,[r]]},deserialize(e){return e.start(),_(e)}},H={canHandle:e=>z(e)&&h in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},C=new Map([["proxy",F],["throw",H]]);function V(e,t){for(const r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function M(e,t=globalThis,r=["*"]){t.addEventListener("message",function a(n){if(!n||!n.data)return;if(!V(r,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}const{id:f,type:s,path:c}=Object.assign({path:[]},n.data),u=(n.data.argumentList||[]).map(y);let o;try{const i=c.slice(0,-1).reduce((l,b)=>l[b],e),d=c.reduce((l,b)=>l[b],e);switch(s){case"GET":o=d;break;case"SET":i[c.slice(-1)[0]]=y(n.data.value),o=!0;break;case"APPLY":o=d.apply(i,u);break;case"CONSTRUCT":{const l=new d(...u);o=T(l)}break;case"ENDPOINT":{const{port1:l,port2:b}=new MessageChannel;M(e,b),o=G(l,[l])}break;case"RELEASE":o=void 0;break;default:return}}catch(i){o={value:i,[h]:0}}Promise.resolve(o).catch(i=>({value:i,[h]:0})).then(i=>{const[d,l]=k(i);t.postMessage(Object.assign(Object.assign({},d),{id:f}),l),s==="RELEASE"&&(t.removeEventListener("message",a),O(t),m in e&&typeof e[m]=="function"&&e[m]())}).catch(i=>{const[d,l]=k({value:new TypeError("Unserializable return value"),[h]:0});t.postMessage(Object.assign(Object.assign({},d),{id:f}),l)})}),t.start&&t.start()}function j(e){return e.constructor.name==="MessagePort"}function O(e){j(e)&&e.close()}function _(e,t){return W(e,[],t)}function A(e){if(e)throw new Error("Proxy has been released and is not useable")}function R(e){return g(e,{type:"RELEASE"}).then(()=>{O(e)})}const E=new WeakMap,S="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(E.get(e)||0)-1;E.set(e,t),t===0&&R(e)});function $(e,t){const r=(E.get(t)||0)+1;E.set(t,r),S&&S.register(e,t,e)}function B(e){S&&S.unregister(e)}function W(e,t=[],r=function(){}){let a=!1;const n=new Proxy(r,{get(f,s){if(A(a),s===I)return()=>{B(n),R(e),a=!0};if(s==="then"){if(t.length===0)return{then:()=>n};const c=g(e,{type:"GET",path:t.map(u=>u.toString())}).then(y);return c.then.bind(c)}return W(e,[...t,s])},set(f,s,c){A(a);const[u,o]=k(c);return g(e,{type:"SET",path:[...t,s].map(i=>i.toString()),value:u},o).then(y)},apply(f,s,c){A(a);const u=t[t.length-1];if(u===N)return g(e,{type:"ENDPOINT"}).then(y);if(u==="bind")return W(e,t.slice(0,-1));const[o,i]=v(c);return g(e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:o},i).then(y)},construct(f,s){A(a);const[c,u]=v(s);return g(e,{type:"CONSTRUCT",path:t.map(o=>o.toString()),argumentList:c},u).then(y)}});return $(n,e),n}function D(e){return Array.prototype.concat.apply([],e)}function v(e){const t=e.map(k);return[t.map(r=>r[0]),D(t.map(r=>r[1]))]}const L=new WeakMap;function G(e,t){return L.set(e,t),e}function T(e){return Object.assign(e,{[x]:!0})}function k(e){for(const[t,r]of C)if(r.canHandle(e)){const[a,n]=r.serialize(e);return[{type:"HANDLER",name:t,value:a},n]}return[{type:"RAW",value:e},L.get(e)||[]]}function y(e){switch(e.type){case"HANDLER":return C.get(e.name).deserialize(e.value);case"RAW":return e.value}}function g(e,t,r){return new Promise(a=>{const n=q();e.addEventListener("message",function f(s){!s.data||!s.data.id||s.data.id!==n||(e.removeEventListener("message",f),a(s.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:n},t),r)})}function q(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const Y=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),X=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),J=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),K=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),Q=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),Z=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),ee=()=>(async e=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function te(){return/iOS|iPhone|iPad|iPod/i.test(navigator.userAgent)}async function re(){if(!await ee())return!1;if(!("importScripts"in self))throw Error("Not implemented");return te()?!1:"Worker"in self}async function ne(){const e=[X(),J(),Y(),K(),Q()];if(!(await Promise.all(e)).every(Boolean))throw new Error("Browser doesn't meet minimum requirements!");return await Z()?await re()?"advanced-threads":"advanced":"basic"}let p,w;async function se(){const e=await ne();console.log(`Requesting ${e} Wasm build`);const t=self.location.href,r=t.substring(0,t.lastIndexOf("/")),a=`${r}/${e}/capture-wasm.js`;try{importScripts(a)}catch(n){console.error("loading scripts failed",n)}return p=await self.createModule({locateFile:n=>`${r}/${e}/${n}`,mainScriptUrlOrBlob:a.toString(),setStatus:n=>{}}),p[m]=()=>{console.log("finalizer wasmModule")},T(p)}function ae(){return p||console.warn("Wasm is not initialized yet. Call loadWasm() first."),w=new p.Analyzer,w[m]=()=>{console.log("Comlink.finalizer called on Analyzer instance. Deleting instance."),w.delete()},T(w)}function oe(e){const t=w.analyze(e);return self.postMessage({},[e.data.buffer]),e=null,t}const U={createAnalyzer:ae,loadWasm:se,analyze:oe,terminate:()=>self.close(),[m]:()=>{console.log("Comlink.finalizer called on proxyWorker")}};return M(U),P.proxyWorker=U,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),P}({});
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microblink/capture",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "",
|
|
4
4
|
"homepage": "https://microblink.com/",
|
|
5
|
-
"repository":
|
|
6
|
-
|
|
7
|
-
"url": "git+https://github.com/BlinkID/capture-browser.git"
|
|
8
|
-
},
|
|
9
|
-
"version": "1.0.0",
|
|
5
|
+
"repository": "github:BlinkID/capture-browser",
|
|
6
|
+
"version": "1.0.1",
|
|
10
7
|
"scripts": {
|
|
11
8
|
"rollup": "api-extractor run --local --verbose",
|
|
12
9
|
"build:js": "vite build",
|
|
@@ -54,9 +51,8 @@
|
|
|
54
51
|
"vite": "^4.4.6",
|
|
55
52
|
"zx": "^7.2.3"
|
|
56
53
|
},
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"license": "ISC"
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"capture-main": "workspace:^",
|
|
56
|
+
"capture-ui": "workspace:^"
|
|
57
|
+
}
|
|
62
58
|
}
|