@learncard/didkit-plugin 1.10.10 → 1.10.11
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/dist/didWebDocumentCache.d.ts +80 -0
- package/dist/didWebDocumentCache.d.ts.map +1 -0
- package/dist/didWebDocumentCache.test.d.ts +2 -0
- package/dist/didWebDocumentCache.test.d.ts.map +1 -0
- package/dist/didkit-plugin.cjs.development.cjs +369 -9
- package/dist/didkit-plugin.cjs.development.cjs.map +4 -4
- package/dist/didkit-plugin.cjs.production.min.cjs +2 -2
- package/dist/didkit-plugin.cjs.production.min.cjs.map +4 -4
- package/dist/didkit-plugin.esm.js +369 -9
- package/dist/didkit-plugin.esm.js.map +4 -4
- package/dist/helpers.d.ts +10 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/didWebDocumentCache.test.ts +732 -0
- package/src/didWebDocumentCache.ts +573 -0
- package/src/helpers.ts +16 -8
- package/src/index.ts +12 -0
- package/src/plugin.ts +22 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
${t.stack}`:r}s(P,"debugString");var W=typeof FinalizationRegistry>"u"?{register:s(()=>{},"register"),unregister:s(()=>{},"unregister")}:new FinalizationRegistry(t=>{o.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function K(t,e,n,r){let _={a:t,b:e,cnt:1,dtor:n},c=s((...a)=>{_.cnt++;let g=_.a;_.a=0;try{return r(g,_.b,...a)}finally{--_.cnt===0?(o.__wbindgen_export_3.get(_.dtor)(g,_.b),W.unregister(_)):_.a=g}},"real");return c.original=_,W.register(c,_,_),c}s(K,"makeMutClosure");function L(t,e,n){let r=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),_=u,c=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),a=u,g=f(n,o.__wbindgen_export_0,o.__wbindgen_export_1),d=u,w=o.verifyPresentation(r,_,c,a,g,d);return l(w)}s(L,"verifyPresentation");function B(t){let e=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),n=u,r=o.contextLoader(e,n);return l(r)}s(B,"contextLoader");function U(){let t=o.clearCache();return l(t)}s(U,"clearCache");function V(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u,a=o.didResolver(n,r,_,c);return l(a)}s(V,"didResolver");function j(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u,a=o.resolveDID(n,r,_,c);return l(a)}s(j,"resolveDID");function q(t,e){let n,r;try{let y=o.__wbindgen_add_to_stack_pointer(-16),I=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),J=u,ae=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),be=u;o.keyToDID(y,I,J,ae,be);var _=p().getInt32(y+0,!0),c=p().getInt32(y+4,!0),a=p().getInt32(y+8,!0),g=p().getInt32(y+12,!0),d=_,w=c;if(g)throw d=0,w=0,l(a);return n=d,r=w,m(d,w)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_4(n,r,1)}}s(q,"keyToDID");function z(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u,a=o.keyToVerificationMethod(n,r,_,c);return l(a)}s(z,"keyToVerificationMethod");function $(t){let e=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),n=u,r=o.didToVerificationMethod(e,n);return l(r)}s($,"didToVerificationMethod");function H(t,e,n,r){let _=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u,a=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),g=u,d=f(n,o.__wbindgen_export_0,o.__wbindgen_export_1),w=u,y=f(r,o.__wbindgen_export_0,o.__wbindgen_export_1),I=u,J=o.issueCredential(_,c,a,g,d,w,y,I);return l(J)}s(H,"issueCredential");function G(t,e,n){let r=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),_=u,c=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),a=u,g=f(n,o.__wbindgen_export_0,o.__wbindgen_export_1),d=u,w=o.verifyCredential(r,_,c,a,g,d);return l(w)}s(G,"verifyCredential");function X(t,e,n,r){let _=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u,a=f(e,o.__wbindgen_export_0,o.__wbindgen_export_1),g=u,d=f(n,o.__wbindgen_export_0,o.__wbindgen_export_1),w=u,y=f(r,o.__wbindgen_export_0,o.__wbindgen_export_1),I=u,J=o.issuePresentation(_,c,a,g,d,w,y,I);return l(J)}s(X,"issuePresentation");function Y(t,e){let n=e(t.length*1,1)>>>0;return D().set(t,n/1),u=t.length,n}s(Y,"passArray8ToWasm0");function Q(t){let e,n;try{let w=o.__wbindgen_add_to_stack_pointer(-16),y=Y(t,o.__wbindgen_export_0),I=u;o.generateEd25519KeyFromBytes(w,y,I);var r=p().getInt32(w+0,!0),_=p().getInt32(w+4,!0),c=p().getInt32(w+8,!0),a=p().getInt32(w+12,!0),g=r,d=_;if(a)throw g=0,d=0,l(c);return e=g,n=d,m(g,d)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_4(e,n,1)}}s(Q,"generateEd25519KeyFromBytes");function Z(t){let e,n;try{let w=o.__wbindgen_add_to_stack_pointer(-16),y=Y(t,o.__wbindgen_export_0),I=u;o.generateSecp256k1KeyFromBytes(w,y,I);var r=p().getInt32(w+0,!0),_=p().getInt32(w+4,!0),c=p().getInt32(w+8,!0),a=p().getInt32(w+12,!0),g=r,d=_;if(a)throw g=0,d=0,l(c);return e=g,n=d,m(g,d)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_4(e,n,1)}}s(Z,"generateSecp256k1KeyFromBytes");function M(t,e){let n=e(t.length*4,4)>>>0,r=p();for(let _=0;_<t.length;_++)r.setUint32(n+4*_,b(t[_]),!0);return u=t.length,n}s(M,"passArrayJsValueToWasm0");function ee(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=M(e,o.__wbindgen_export_0),c=u,a=o.createJwe(n,r,_,c);return l(a)}s(ee,"createJwe");function te(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=M(e,o.__wbindgen_export_0),c=u,a=o.decryptJwe(n,r,_,c);return l(a)}s(te,"decryptJwe");function ne(t,e){let n=M(e,o.__wbindgen_export_0),r=u,_=o.createDagJwe(b(t),n,r);return l(_)}s(ne,"createDagJwe");function re(t,e){let n=f(t,o.__wbindgen_export_0,o.__wbindgen_export_1),r=u,_=M(e,o.__wbindgen_export_0),c=u,a=o.decryptDagJwe(n,r,_,c);return l(a)}s(re,"decryptDagJwe");function me(t,e,n){o.__wbindgen_export_5(t,e,b(n))}s(me,"__wbg_adapter_6");function he(t,e){o.__wbindgen_export_6(t,e)}s(he,"__wbg_adapter_19");function Ie(t,e,n,r){o.__wbindgen_export_7(t,e,b(n),b(r))}s(Ie,"__wbg_adapter_107");var Se=["default","no-store","reload","no-cache","force-cache","only-if-cached"],ve=["omit","same-origin","include"],De=["same-origin","no-cors","cors","navigate"],Oe=new Set(["basic","cors","default"]);async function Je(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.ok&&Oe.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}s(Je,"__wbg_load");function ke(){let t={};return t.wbg={},t.wbg.__wbg_Error_e17e777aac105295=function(e,n){let r=Error(m(e,n));return b(r)},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(i(n)),_=f(r,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u;p().setInt32(e+4,c,!0),p().setInt32(e+0,_,!0)},t.wbg.__wbg_abort_67e1b49bf6614565=function(e){i(e).abort()},t.wbg.__wbg_abort_d830bf2e9aa6ec5b=function(e,n){i(e).abort(i(n))},t.wbg.__wbg_append_72a3c0addd2bce38=function(){return x(function(e,n,r,_,c){i(e).append(m(n,r),m(_,c))},arguments)},t.wbg.__wbg_arrayBuffer_9c99b8e2809e8cbb=function(){return x(function(e){let n=i(e).arrayBuffer();return b(n)},arguments)},t.wbg.__wbg_call_13410aac570ffff7=function(){return x(function(e,n){let r=i(e).call(i(n));return b(r)},arguments)},t.wbg.__wbg_call_a5400b25a865cfd8=function(){return x(function(e,n,r){let _=i(e).call(i(n),i(r));return b(_)},arguments)},t.wbg.__wbg_clearTimeout_42d9ccd50822fd3a=function(e){let n=clearTimeout(l(e));return b(n)},t.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){let n=i(e).crypto;return b(n)},t.wbg.__wbg_done_75ed0ee6dd243d9d=function(e){return i(e).done},t.wbg.__wbg_entries_2be2f15bd5554996=function(e){let n=Object.entries(i(e));return b(n)},t.wbg.__wbg_fetch_6bbc32f991730587=function(e){let n=fetch(i(e));return b(n)},t.wbg.__wbg_fetch_87aed7f306ec6d63=function(e,n){let r=i(e).fetch(i(n));return b(r)},t.wbg.__wbg_from_88bc52ce20ba6318=function(e){let n=Array.from(i(e));return b(n)},t.wbg.__wbg_getRandomValues_1c61fac11405ffdc=function(){return x(function(e,n){globalThis.crypto.getRandomValues(k(e,n))},arguments)},t.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return x(function(e,n){i(e).getRandomValues(i(n))},arguments)},t.wbg.__wbg_getTime_6bb3f64e0f18f817=function(e){return i(e).getTime()},t.wbg.__wbg_get_0da715ceaecea5c8=function(e,n){let r=i(e)[n>>>0];return b(r)},t.wbg.__wbg_get_458e874b43b18b25=function(){return x(function(e,n){let r=Reflect.get(i(e),i(n));return b(r)},arguments)},t.wbg.__wbg_has_b89e451f638123e3=function(){return x(function(e,n){return Reflect.has(i(e),i(n))},arguments)},t.wbg.__wbg_headers_29fec3c72865cd75=function(e){let n=i(e).headers;return b(n)},t.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd=function(e){let n;try{n=i(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b=function(e){let n;try{n=i(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_instanceof_Response_50fde2cd696850bf=function(e){let n;try{n=i(e)instanceof Response}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7=function(e){let n;try{n=i(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_isArray_030cce220591fb41=function(e){return Array.isArray(i(e))},t.wbg.__wbg_isSafeInteger_1c0d1af5542e102a=function(e){return Number.isSafeInteger(i(e))},t.wbg.__wbg_iterator_f370b34483c71a1c=function(){return b(Symbol.iterator)},t.wbg.__wbg_keys_ef52390b2ae0e714=function(e){let n=Object.keys(i(e));return b(n)},t.wbg.__wbg_length_186546c51cd61acd=function(e){return i(e).length},t.wbg.__wbg_length_6bb7e81f9d7713e4=function(e){return i(e).length},t.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){let n=i(e).msCrypto;return b(n)},t.wbg.__wbg_new0_b0a0a38c201e6df5=function(){return b(new Date)},t.wbg.__wbg_new_19c25a3f2fa63a02=function(){let e=new Object;return b(e)},t.wbg.__wbg_new_1f3a344cf3123716=function(){let e=new Array;return b(e)},t.wbg.__wbg_new_2e3c58a15f39f5f9=function(e,n){try{var r={a:e,b:n},_=s((a,g)=>{let d=r.a;r.a=0;try{return Ie(d,r.b,a,g)}finally{r.a=d}},"cb0");let c=new Promise(_);return b(c)}finally{r.a=r.b=0}},t.wbg.__wbg_new_2ff1f68f3676ea53=function(){return b(new Map)},t.wbg.__wbg_new_638ebfaedbf32a5e=function(e){let n=new Uint8Array(i(e));return b(n)},t.wbg.__wbg_new_66b9434b4e59b63e=function(){return x(function(){let e=new AbortController;return b(e)},arguments)},t.wbg.__wbg_new_f6e53210afea8e45=function(){return x(function(){let e=new Headers;return b(e)},arguments)},t.wbg.__wbg_newfromslice_074c56947bd43469=function(e,n){let r=new Uint8Array(k(e,n));return b(r)},t.wbg.__wbg_newnoargs_254190557c45b4ec=function(e,n){let r=new Function(m(e,n));return b(r)},t.wbg.__wbg_newwithlength_a167dcc7aaa3ba77=function(e){let n=new Uint8Array(e>>>0);return b(n)},t.wbg.__wbg_newwithstrandinit_b5d168a29a3fd85f=function(){return x(function(e,n,r){let _=new Request(m(e,n),i(r));return b(_)},arguments)},t.wbg.__wbg_next_5b3530e612fde77d=function(e){let n=i(e).next;return b(n)},t.wbg.__wbg_next_692e82279131b03c=function(){return x(function(e){let n=i(e).next();return b(n)},arguments)},t.wbg.__wbg_node_905d3e251edff8a2=function(e){let n=i(e).node;return b(n)},t.wbg.__wbg_now_886b39d7ec380719=function(e){return i(e).now()},t.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){let n=i(e).process;return b(n)},t.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(e,n,r){Uint8Array.prototype.set.call(k(e,n),i(r))},t.wbg.__wbg_push_330b2eb93e4e1212=function(e,n){return i(e).push(i(n))},t.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(e){queueMicrotask(i(e))},t.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(e){let n=i(e).queueMicrotask;return b(n)},t.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return x(function(e,n){i(e).randomFillSync(l(n))},arguments)},t.wbg.__wbg_require_60cc747a6bc5215a=function(){return x(function(){let e=module.require;return b(e)},arguments)},t.wbg.__wbg_resolve_4055c623acdd6a1b=function(e){let n=Promise.resolve(i(e));return b(n)},t.wbg.__wbg_setTimeout_4ec014681668a581=function(e,n){let r=setTimeout(i(e),n);return b(r)},t.wbg.__wbg_set_1353b2a5e96bc48c=function(e,n,r){i(e).set(k(n,r))},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){i(e)[l(n)]=l(r)},t.wbg.__wbg_set_453345bcda80b89a=function(){return x(function(e,n,r){return Reflect.set(i(e),i(n),i(r))},arguments)},t.wbg.__wbg_set_90f6c0f7bd8c0415=function(e,n,r){i(e)[n>>>0]=l(r)},t.wbg.__wbg_set_b7f1cf4fae26fe2a=function(e,n,r){let _=i(e).set(i(n),i(r));return b(_)},t.wbg.__wbg_setbody_c8460bdf44147df8=function(e,n){i(e).body=i(n)},t.wbg.__wbg_setcache_90ca4ad8a8ad40d3=function(e,n){i(e).cache=Se[n]},t.wbg.__wbg_setcredentials_9cd60d632c9d5dfc=function(e,n){i(e).credentials=ve[n]},t.wbg.__wbg_setheaders_0052283e2f3503d1=function(e,n){i(e).headers=i(n)},t.wbg.__wbg_setmethod_9b504d5b855b329c=function(e,n,r){i(e).method=m(n,r)},t.wbg.__wbg_setmode_a23e1a2ad8b512f8=function(e,n){i(e).mode=De[n]},t.wbg.__wbg_setsignal_8c45ad1247a74809=function(e,n){i(e).signal=i(n)},t.wbg.__wbg_signal_da4d466ce86118b5=function(e){let n=i(e).signal;return b(n)},t.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){let e=typeof global>"u"?null:global;return h(e)?0:b(e)},t.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){let e=typeof globalThis>"u"?null:globalThis;return h(e)?0:b(e)},t.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){let e=typeof self>"u"?null:self;return h(e)?0:b(e)},t.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){let e=typeof window>"u"?null:window;return h(e)?0:b(e)},t.wbg.__wbg_status_3fea3036088621d6=function(e){return i(e).status},t.wbg.__wbg_stringify_b98c93d0a190446a=function(){return x(function(e){let n=JSON.stringify(i(e));return b(n)},arguments)},t.wbg.__wbg_subarray_70fd07feefe14294=function(e,n,r){let _=i(e).subarray(n>>>0,r>>>0);return b(_)},t.wbg.__wbg_then_b33a773d723afa3e=function(e,n,r){let _=i(e).then(i(n),i(r));return b(_)},t.wbg.__wbg_then_e22500defe16819f=function(e,n){let r=i(e).then(i(n));return b(r)},t.wbg.__wbg_url_e5720dfacf77b05e=function(e,n){let r=i(n).url,_=f(r,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u;p().setInt32(e+4,c,!0),p().setInt32(e+0,_,!0)},t.wbg.__wbg_value_dd9372230531eade=function(e){let n=i(e).value;return b(n)},t.wbg.__wbg_versions_c01dfd4722a88165=function(e){let n=i(e).versions;return b(n)},t.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(e,n){let r=i(n),_=typeof r=="bigint"?r:void 0;p().setBigInt64(e+8,h(_)?BigInt(0):_,!0),p().setInt32(e+0,!h(_),!0)},t.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746=function(e){let n=i(e),r=typeof n=="boolean"?n:void 0;return h(r)?16777215:r?1:0},t.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(e){let n=i(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(e,n){let r=P(i(n)),_=f(r,o.__wbindgen_export_0,o.__wbindgen_export_1),c=u;p().setInt32(e+4,c,!0),p().setInt32(e+0,_,!0)},t.wbg.__wbg_wbindgenin_d7a1ee10933d2d55=function(e,n){return i(e)in i(n)},t.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154=function(e){return typeof i(e)=="bigint"},t.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(e){return typeof i(e)=="function"},t.wbg.__wbg_wbindgenisnull_f3037694abe4d97a=function(e){return i(e)===null},t.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(e){let n=i(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(e){return typeof i(e)=="string"},t.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(e){return i(e)===void 0},t.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(e,n){return i(e)===i(n)},t.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1=function(e,n){return i(e)==i(n)},t.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(e,n){let r=i(n),_=typeof r=="number"?r:void 0;p().setFloat64(e+8,h(_)?0:_,!0),p().setInt32(e+0,!h(_),!0)},t.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(e,n){let r=i(n),_=typeof r=="string"?r:void 0;var c=h(_)?0:f(_,o.__wbindgen_export_0,o.__wbindgen_export_1),a=u;p().setInt32(e+4,a,!0),p().setInt32(e+0,c,!0)},t.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(e,n){throw new Error(m(e,n))},t.wbg.__wbindgen_cast_1eaafab1968e741d=function(e,n){let r=K(e,n,639,he);return b(r)},t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,n){let r=m(e,n);return b(r)},t.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,n){let r=BigInt.asUintN(64,e)|n<<BigInt(64);return b(r)},t.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){let n=BigInt.asUintN(64,e);return b(n)},t.wbg.__wbindgen_cast_67d14185bb436b4e=function(e,n){let r=K(e,n,726,me);return b(r)},t.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return b(e)},t.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,n){let r=k(e,n);return b(r)},t.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return b(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=i(e);return b(n)},t.wbg.__wbindgen_object_drop_ref=function(e){l(e)},t}s(ke,"__wbg_get_imports");function Ce(t,e){return o=t.exports,_e.__wbindgen_wasm_module=e,v=null,C=null,o}s(Ce,"__wbg_finalize_init");async function _e(t){if(o!==void 0)return o;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("didkit_wasm_bg.wasm",Ne.url));let e=ke();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await Je(await t,e);return Ce(n,r)}s(_e,"__wbg_init");var oe=_e;var Ae="https://assets.learncard.ai/didkit/sha256-ba3e2ec2208f6da57d94e47c332b3226f048e11d7a23093d50b184d849b6bc0b/didkit_wasm_bg.wasm",ie=!1,F=!1,Te=s(async(t=Ae)=>{for(;F;)await new Promise(e=>setTimeout(e,250));if(!ie)try{F=!0,await oe({module_or_path:t}),F=!1,ie=!0}catch(e){throw F=!1,e}},"init"),ce=Te;var se=s(t=>{let e=[],n=s(r=>{typeof r!="object"||r===null||(r["@context"]&&(Array.isArray(r["@context"])?e.push(...r["@context"]):e.push(r["@context"])),Object.keys(r).forEach(_=>{n(r[_])}))},"traverse");return n(t),e},"getContextURIs"),O=s(async(t,e,n=!1)=>{let r=se(e),_=await Promise.all(r.map(async c=>t.context.resolveDocument(c,n)));return r.reduce((c,a,g)=>{let d=_[g];return d&&(c[a]=JSON.stringify(d)),c},{})},"getDocumentMap");var Re=s(async(t,e=!1)=>{await ce(t);let n={};return{name:"DIDKit",displayName:"DIDKit",description:"Provides an interface to DIDKit, which allows for the generation of key material, as well as signing and verifying credentials and presentations",context:{resolveStaticDocument:s(async(r,_)=>{try{return JSON.parse(await B(_)??"")||void 0}catch(c){r.debug?.(c);return}},"resolveStaticDocument")},methods:{generateEd25519KeyFromBytes:s((r,_)=>JSON.parse(Q(_)),"generateEd25519KeyFromBytes"),generateSecp256k1KeyFromBytes:s((r,_)=>JSON.parse(Z(_)),"generateSecp256k1KeyFromBytes"),keyToDid:s((r,_,c)=>q(_,JSON.stringify(c)),"keyToDid"),keyToVerificationMethod:s(async(r,_,c)=>z(_,JSON.stringify(c)),"keyToVerificationMethod"),didToVerificationMethod:s(async(r,_)=>$(_),"didToVerificationMethod"),issueCredential:s(async(r,_,c,a)=>JSON.parse(await H(JSON.stringify(_),JSON.stringify(c),JSON.stringify(a),JSON.stringify(await O(r,_,e)))),"issueCredential"),verifyCredential:s(async(r,_,c={})=>JSON.parse(await G(JSON.stringify(_),JSON.stringify(c),JSON.stringify(await O(r,_,e)))),"verifyCredential"),issuePresentation:s(async(r,_,c,a)=>{let g=c.proofFormat==="jwt",d=await X(JSON.stringify(_),JSON.stringify(c),JSON.stringify(a),JSON.stringify(await O(r,_,e)));return g?d:JSON.parse(d)},"issuePresentation"),verifyPresentation:s(async(r,_,c={})=>{let a=typeof _=="string";return JSON.parse(await L(a?_:JSON.stringify(_),JSON.stringify(c),a?"{}":JSON.stringify(await O(r,_,e))))},"verifyPresentation"),contextLoader:s(async(r,_)=>{try{return JSON.parse(await B(_)??"")||void 0}catch(c){r.debug?.(c);return}},"contextLoader"),resolveDid:s(async(r,_,c={})=>JSON.parse(await j(_,JSON.stringify(c))),"resolveDid"),didResolver:s(async(r,_,c={})=>JSON.parse(await V(_,JSON.stringify(c))),"didResolver"),createJwe:s(async(r,_,c)=>JSON.parse(await ee(_,c)),"createJwe"),decryptJwe:s(async(r,_,c)=>te(JSON.stringify(_),c.map(a=>JSON.stringify(a))),"decryptJwe"),createDagJwe:s(async(r,_,c)=>JSON.parse(await ne(_,c)),"createDagJwe"),decryptDagJwe:s(async(r,_,c)=>{let a=s(g=>{if(g==null)return g;if(typeof g=="bigint")return Number(g);if(Array.isArray(g))return g.map(a);if(typeof g!="object"||!Object.values(g).some(y=>typeof y=="bigint"||typeof y=="object"&&y!==null))return g;let w={};for(let y in g)w[y]=a(g[y]);return w},"convertBigIntsToNumbers");return a(await re(JSON.stringify(_),c.map(g=>JSON.stringify(g))))},"decryptDagJwe"),clearDidWebCache:s(async()=>{await U()},"clearDidWebCache")}}},"getDidKitPlugin");
|
|
1
|
+
"use strict";var U=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var i=(t,e)=>U(t,"name",{value:e,configurable:!0});var Ve=(t,e)=>{for(var n in e)U(t,n,{get:e[n],enumerable:!0})},ze=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of je(e))!Ke.call(t,o)&&o!==n&&U(t,o,{get:()=>e[o],enumerable:!(r=Be(e,o))||r.enumerable});return t};var Ge=t=>ze(U({},"__esModule",{value:!0}),t);var At={};Ve(At,{DEFAULT_DID_WEB_DOCUMENT_CACHE_MAX_ENTRIES:()=>We,DEFAULT_DID_WEB_DOCUMENT_TTL_MS:()=>Ne,WALLET_DID_WEB_DOCUMENT_TTL_MS:()=>ke,clearDidWebDocumentFetchCache:()=>H,didWebToDocumentUrl:()=>oe,getContextURIs:()=>Ae,getDidKitPlugin:()=>Rt,getDidWebDocumentFetchCacheStats:()=>qe,getDocumentMap:()=>R,installDidWebDocumentFetchCache:()=>F,installWalletDidWebDocumentFetchCache:()=>Ue,invalidateDidWebDocument:()=>J,isDidWebDocumentUrl:()=>G});module.exports=Ge(At);var ct={};var _,M=null;function v(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(_.memory.buffer)),M}i(v,"getUint8ArrayMemory0");var q=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});q.decode();var He=2146435072,Q=0;function $e(t,e){return Q+=e,Q>=He&&(q=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),q.decode(),Q=e),q.decode(v().subarray(t,t+e))}i($e,"decodeText");function D(t,e){return t=t>>>0,$e(t,e)}i(D,"getStringFromWasm0");var S=new Array(128).fill(void 0);S.push(void 0,null,!0,!1);var N=S.length;function u(t){N===S.length&&S.push(S.length+1);let e=N;return N=S[e],S[e]=t,e}i(u,"addHeapObject");function c(t){return S[t]}i(c,"getObject");var b=0,k=new TextEncoder;"encodeInto"in k||(k.encodeInto=function(t,e){let n=k.encode(t);return e.set(n),{read:t.length,written:n.length}});function f(t,e,n){if(n===void 0){let d=k.encode(t),g=e(d.length,1)>>>0;return v().subarray(g,g+d.length).set(d),b=d.length,g}let r=t.length,o=e(r,1)>>>0,s=v(),a=0;for(;a<r;a++){let d=t.charCodeAt(a);if(d>127)break;s[o+a]=d}if(a!==r){a!==0&&(t=t.slice(a)),o=n(o,r,r=a+t.length*3,1)>>>0;let d=v().subarray(o+a,o+r),g=k.encodeInto(t,d);a+=g.written,o=n(o,r,a,1)>>>0}return b=a,o}i(f,"passStringToWasm0");var C=null;function l(){return(C===null||C.buffer.detached===!0||C.buffer.detached===void 0&&C.buffer!==_.memory.buffer)&&(C=new DataView(_.memory.buffer)),C}i(l,"getDataViewMemory0");function x(t,e){try{return t.apply(this,e)}catch(n){_.__wbindgen_export_2(u(n))}}i(x,"handleError");function Xe(t){t<132||(S[t]=N,N=t)}i(Xe,"dropObject");function y(t){let e=c(t);return Xe(t),e}i(y,"takeObject");function O(t,e){return t=t>>>0,v().subarray(t/1,t/1+e)}i(O,"getArrayU8FromWasm0");function I(t){return t==null}i(I,"isLikeNone");function Z(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let o=t.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){let o=t.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(t)){let o=t.length,s="[";o>0&&(s+=Z(t[0]));for(let a=1;a<o;a++)s+=", "+Z(t[a]);return s+="]",s}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
|
|
2
|
+
${t.stack}`:r}i(Z,"debugString");var ce=typeof FinalizationRegistry>"u"?{register:i(()=>{},"register"),unregister:i(()=>{},"unregister")}:new FinalizationRegistry(t=>{_.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function se(t,e,n,r){let o={a:t,b:e,cnt:1,dtor:n},s=i((...a)=>{o.cnt++;let d=o.a;o.a=0;try{return r(d,o.b,...a)}finally{--o.cnt===0?(_.__wbindgen_export_3.get(o.dtor)(d,o.b),ce.unregister(o)):o.a=d}},"real");return s.original=o,ce.register(s,o,o),s}i(se,"makeMutClosure");function ae(t,e,n){let r=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),o=b,s=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b,d=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),g=b,w=_.verifyPresentation(r,o,s,a,d,g);return y(w)}i(ae,"verifyPresentation");function ee(t){let e=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),n=b,r=_.contextLoader(e,n);return y(r)}i(ee,"contextLoader");function ue(){let t=_.clearCache();return y(t)}i(ue,"clearCache");function de(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.didResolver(n,r,o,s);return y(a)}i(de,"didResolver");function be(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.resolveDID(n,r,o,s);return y(a)}i(be,"resolveDID");function ge(t,e){let n,r;try{let p=_.__wbindgen_add_to_stack_pointer(-16),m=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),E=b,$=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),L=b;_.keyToDID(p,m,E,$,L);var o=l().getInt32(p+0,!0),s=l().getInt32(p+4,!0),a=l().getInt32(p+8,!0),d=l().getInt32(p+12,!0),g=o,w=s;if(d)throw g=0,w=0,y(a);return n=g,r=w,D(g,w)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(n,r,1)}}i(ge,"keyToDID");function fe(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.keyToVerificationMethod(n,r,o,s);return y(a)}i(fe,"keyToVerificationMethod");function we(t){let e=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),n=b,r=_.didToVerificationMethod(e,n);return y(r)}i(we,"didToVerificationMethod");function le(t,e,n,r){let o=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=b,g=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=b,p=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=b,E=_.issueCredential(o,s,a,d,g,w,p,m);return y(E)}i(le,"issueCredential");function pe(t,e,n){let r=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),o=b,s=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b,d=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),g=b,w=_.verifyCredential(r,o,s,a,d,g);return y(w)}i(pe,"verifyCredential");function ye(t,e,n,r){let o=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=b,g=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=b,p=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=b,E=_.issuePresentation(o,s,a,d,g,w,p,m);return y(E)}i(ye,"issuePresentation");function xe(t,e){let n=e(t.length*1,1)>>>0;return v().set(t,n/1),b=t.length,n}i(xe,"passArray8ToWasm0");function he(t){let e,n;try{let w=_.__wbindgen_add_to_stack_pointer(-16),p=xe(t,_.__wbindgen_export_0),m=b;_.generateEd25519KeyFromBytes(w,p,m);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),s=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(s);return e=d,n=g,D(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(e,n,1)}}i(he,"generateEd25519KeyFromBytes");function me(t){let e,n;try{let w=_.__wbindgen_add_to_stack_pointer(-16),p=xe(t,_.__wbindgen_export_0),m=b;_.generateSecp256k1KeyFromBytes(w,p,m);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),s=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(s);return e=d,n=g,D(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(e,n,1)}}i(me,"generateSecp256k1KeyFromBytes");function P(t,e){let n=e(t.length*4,4)>>>0,r=l();for(let o=0;o<t.length;o++)r.setUint32(n+4*o,u(t[o]),!0);return b=t.length,n}i(P,"passArrayJsValueToWasm0");function De(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.createJwe(n,r,o,s);return y(a)}i(De,"createJwe");function Ie(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.decryptJwe(n,r,o,s);return y(a)}i(Ie,"decryptJwe");function Se(t,e){let n=P(e,_.__wbindgen_export_0),r=b,o=_.createDagJwe(u(t),n,r);return y(o)}i(Se,"createDagJwe");function Te(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.decryptDagJwe(n,r,o,s);return y(a)}i(Te,"decryptDagJwe");function Ye(t,e,n){_.__wbindgen_export_5(t,e,u(n))}i(Ye,"__wbg_adapter_6");function Qe(t,e){_.__wbindgen_export_6(t,e)}i(Qe,"__wbg_adapter_19");function Ze(t,e,n,r){_.__wbindgen_export_7(t,e,u(n),u(r))}i(Ze,"__wbg_adapter_107");var et=["default","no-store","reload","no-cache","force-cache","only-if-cached"],tt=["omit","same-origin","include"],nt=["same-origin","no-cors","cors","navigate"],rt=new Set(["basic","cors","default"]);async function ot(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.ok&&rt.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}i(ot,"__wbg_load");function _t(){let t={};return t.wbg={},t.wbg.__wbg_Error_e17e777aac105295=function(e,n){let r=Error(D(e,n));return u(r)},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(c(n)),o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_abort_67e1b49bf6614565=function(e){c(e).abort()},t.wbg.__wbg_abort_d830bf2e9aa6ec5b=function(e,n){c(e).abort(c(n))},t.wbg.__wbg_append_72a3c0addd2bce38=function(){return x(function(e,n,r,o,s){c(e).append(D(n,r),D(o,s))},arguments)},t.wbg.__wbg_arrayBuffer_9c99b8e2809e8cbb=function(){return x(function(e){let n=c(e).arrayBuffer();return u(n)},arguments)},t.wbg.__wbg_call_13410aac570ffff7=function(){return x(function(e,n){let r=c(e).call(c(n));return u(r)},arguments)},t.wbg.__wbg_call_a5400b25a865cfd8=function(){return x(function(e,n,r){let o=c(e).call(c(n),c(r));return u(o)},arguments)},t.wbg.__wbg_clearTimeout_42d9ccd50822fd3a=function(e){let n=clearTimeout(y(e));return u(n)},t.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){let n=c(e).crypto;return u(n)},t.wbg.__wbg_done_75ed0ee6dd243d9d=function(e){return c(e).done},t.wbg.__wbg_entries_2be2f15bd5554996=function(e){let n=Object.entries(c(e));return u(n)},t.wbg.__wbg_fetch_6bbc32f991730587=function(e){let n=fetch(c(e));return u(n)},t.wbg.__wbg_fetch_87aed7f306ec6d63=function(e,n){let r=c(e).fetch(c(n));return u(r)},t.wbg.__wbg_from_88bc52ce20ba6318=function(e){let n=Array.from(c(e));return u(n)},t.wbg.__wbg_getRandomValues_1c61fac11405ffdc=function(){return x(function(e,n){globalThis.crypto.getRandomValues(O(e,n))},arguments)},t.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return x(function(e,n){c(e).getRandomValues(c(n))},arguments)},t.wbg.__wbg_getTime_6bb3f64e0f18f817=function(e){return c(e).getTime()},t.wbg.__wbg_get_0da715ceaecea5c8=function(e,n){let r=c(e)[n>>>0];return u(r)},t.wbg.__wbg_get_458e874b43b18b25=function(){return x(function(e,n){let r=Reflect.get(c(e),c(n));return u(r)},arguments)},t.wbg.__wbg_has_b89e451f638123e3=function(){return x(function(e,n){return Reflect.has(c(e),c(n))},arguments)},t.wbg.__wbg_headers_29fec3c72865cd75=function(e){let n=c(e).headers;return u(n)},t.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd=function(e){let n;try{n=c(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b=function(e){let n;try{n=c(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_instanceof_Response_50fde2cd696850bf=function(e){let n;try{n=c(e)instanceof Response}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7=function(e){let n;try{n=c(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_isArray_030cce220591fb41=function(e){return Array.isArray(c(e))},t.wbg.__wbg_isSafeInteger_1c0d1af5542e102a=function(e){return Number.isSafeInteger(c(e))},t.wbg.__wbg_iterator_f370b34483c71a1c=function(){return u(Symbol.iterator)},t.wbg.__wbg_keys_ef52390b2ae0e714=function(e){let n=Object.keys(c(e));return u(n)},t.wbg.__wbg_length_186546c51cd61acd=function(e){return c(e).length},t.wbg.__wbg_length_6bb7e81f9d7713e4=function(e){return c(e).length},t.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){let n=c(e).msCrypto;return u(n)},t.wbg.__wbg_new0_b0a0a38c201e6df5=function(){return u(new Date)},t.wbg.__wbg_new_19c25a3f2fa63a02=function(){let e=new Object;return u(e)},t.wbg.__wbg_new_1f3a344cf3123716=function(){let e=new Array;return u(e)},t.wbg.__wbg_new_2e3c58a15f39f5f9=function(e,n){try{var r={a:e,b:n},o=i((a,d)=>{let g=r.a;r.a=0;try{return Ze(g,r.b,a,d)}finally{r.a=g}},"cb0");let s=new Promise(o);return u(s)}finally{r.a=r.b=0}},t.wbg.__wbg_new_2ff1f68f3676ea53=function(){return u(new Map)},t.wbg.__wbg_new_638ebfaedbf32a5e=function(e){let n=new Uint8Array(c(e));return u(n)},t.wbg.__wbg_new_66b9434b4e59b63e=function(){return x(function(){let e=new AbortController;return u(e)},arguments)},t.wbg.__wbg_new_f6e53210afea8e45=function(){return x(function(){let e=new Headers;return u(e)},arguments)},t.wbg.__wbg_newfromslice_074c56947bd43469=function(e,n){let r=new Uint8Array(O(e,n));return u(r)},t.wbg.__wbg_newnoargs_254190557c45b4ec=function(e,n){let r=new Function(D(e,n));return u(r)},t.wbg.__wbg_newwithlength_a167dcc7aaa3ba77=function(e){let n=new Uint8Array(e>>>0);return u(n)},t.wbg.__wbg_newwithstrandinit_b5d168a29a3fd85f=function(){return x(function(e,n,r){let o=new Request(D(e,n),c(r));return u(o)},arguments)},t.wbg.__wbg_next_5b3530e612fde77d=function(e){let n=c(e).next;return u(n)},t.wbg.__wbg_next_692e82279131b03c=function(){return x(function(e){let n=c(e).next();return u(n)},arguments)},t.wbg.__wbg_node_905d3e251edff8a2=function(e){let n=c(e).node;return u(n)},t.wbg.__wbg_now_886b39d7ec380719=function(e){return c(e).now()},t.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){let n=c(e).process;return u(n)},t.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(e,n,r){Uint8Array.prototype.set.call(O(e,n),c(r))},t.wbg.__wbg_push_330b2eb93e4e1212=function(e,n){return c(e).push(c(n))},t.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(e){queueMicrotask(c(e))},t.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(e){let n=c(e).queueMicrotask;return u(n)},t.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return x(function(e,n){c(e).randomFillSync(y(n))},arguments)},t.wbg.__wbg_require_60cc747a6bc5215a=function(){return x(function(){let e=module.require;return u(e)},arguments)},t.wbg.__wbg_resolve_4055c623acdd6a1b=function(e){let n=Promise.resolve(c(e));return u(n)},t.wbg.__wbg_setTimeout_4ec014681668a581=function(e,n){let r=setTimeout(c(e),n);return u(r)},t.wbg.__wbg_set_1353b2a5e96bc48c=function(e,n,r){c(e).set(O(n,r))},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){c(e)[y(n)]=y(r)},t.wbg.__wbg_set_453345bcda80b89a=function(){return x(function(e,n,r){return Reflect.set(c(e),c(n),c(r))},arguments)},t.wbg.__wbg_set_90f6c0f7bd8c0415=function(e,n,r){c(e)[n>>>0]=y(r)},t.wbg.__wbg_set_b7f1cf4fae26fe2a=function(e,n,r){let o=c(e).set(c(n),c(r));return u(o)},t.wbg.__wbg_setbody_c8460bdf44147df8=function(e,n){c(e).body=c(n)},t.wbg.__wbg_setcache_90ca4ad8a8ad40d3=function(e,n){c(e).cache=et[n]},t.wbg.__wbg_setcredentials_9cd60d632c9d5dfc=function(e,n){c(e).credentials=tt[n]},t.wbg.__wbg_setheaders_0052283e2f3503d1=function(e,n){c(e).headers=c(n)},t.wbg.__wbg_setmethod_9b504d5b855b329c=function(e,n,r){c(e).method=D(n,r)},t.wbg.__wbg_setmode_a23e1a2ad8b512f8=function(e,n){c(e).mode=nt[n]},t.wbg.__wbg_setsignal_8c45ad1247a74809=function(e,n){c(e).signal=c(n)},t.wbg.__wbg_signal_da4d466ce86118b5=function(e){let n=c(e).signal;return u(n)},t.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){let e=typeof global>"u"?null:global;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){let e=typeof globalThis>"u"?null:globalThis;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){let e=typeof self>"u"?null:self;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){let e=typeof window>"u"?null:window;return I(e)?0:u(e)},t.wbg.__wbg_status_3fea3036088621d6=function(e){return c(e).status},t.wbg.__wbg_stringify_b98c93d0a190446a=function(){return x(function(e){let n=JSON.stringify(c(e));return u(n)},arguments)},t.wbg.__wbg_subarray_70fd07feefe14294=function(e,n,r){let o=c(e).subarray(n>>>0,r>>>0);return u(o)},t.wbg.__wbg_then_b33a773d723afa3e=function(e,n,r){let o=c(e).then(c(n),c(r));return u(o)},t.wbg.__wbg_then_e22500defe16819f=function(e,n){let r=c(e).then(c(n));return u(r)},t.wbg.__wbg_url_e5720dfacf77b05e=function(e,n){let r=c(n).url,o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_value_dd9372230531eade=function(e){let n=c(e).value;return u(n)},t.wbg.__wbg_versions_c01dfd4722a88165=function(e){let n=c(e).versions;return u(n)},t.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(e,n){let r=c(n),o=typeof r=="bigint"?r:void 0;l().setBigInt64(e+8,I(o)?BigInt(0):o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746=function(e){let n=c(e),r=typeof n=="boolean"?n:void 0;return I(r)?16777215:r?1:0},t.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(e){let n=c(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(e,n){let r=Z(c(n)),o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_wbindgenin_d7a1ee10933d2d55=function(e,n){return c(e)in c(n)},t.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154=function(e){return typeof c(e)=="bigint"},t.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(e){return typeof c(e)=="function"},t.wbg.__wbg_wbindgenisnull_f3037694abe4d97a=function(e){return c(e)===null},t.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(e){let n=c(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(e){return typeof c(e)=="string"},t.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(e){return c(e)===void 0},t.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(e,n){return c(e)===c(n)},t.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1=function(e,n){return c(e)==c(n)},t.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(e,n){let r=c(n),o=typeof r=="number"?r:void 0;l().setFloat64(e+8,I(o)?0:o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(e,n){let r=c(n),o=typeof r=="string"?r:void 0;var s=I(o)?0:f(o,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b;l().setInt32(e+4,a,!0),l().setInt32(e+0,s,!0)},t.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(e,n){throw new Error(D(e,n))},t.wbg.__wbindgen_cast_1eaafab1968e741d=function(e,n){let r=se(e,n,639,Qe);return u(r)},t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,n){let r=D(e,n);return u(r)},t.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,n){let r=BigInt.asUintN(64,e)|n<<BigInt(64);return u(r)},t.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){let n=BigInt.asUintN(64,e);return u(n)},t.wbg.__wbindgen_cast_67d14185bb436b4e=function(e,n){let r=se(e,n,726,Ye);return u(r)},t.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return u(e)},t.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,n){let r=O(e,n);return u(r)},t.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return u(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=c(e);return u(n)},t.wbg.__wbindgen_object_drop_ref=function(e){y(e)},t}i(_t,"__wbg_get_imports");function it(t,e){return _=t.exports,Ee.__wbindgen_wasm_module=e,C=null,M=null,_}i(it,"__wbg_finalize_init");async function Ee(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("didkit_wasm_bg.wasm",ct.url));let e=_t();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await ot(await t,e);return it(n,r)}i(Ee,"__wbg_init");var Ce=Ee;var st="https://assets.learncard.ai/didkit/sha256-ba3e2ec2208f6da57d94e47c332b3226f048e11d7a23093d50b184d849b6bc0b/didkit_wasm_bg.wasm",ve=!1,B=!1,at=i(async(t=st)=>{for(;B;)await new Promise(e=>setTimeout(e,250));if(!ve)try{B=!0,await Ce({module_or_path:t}),B=!1,ve=!0}catch(e){throw B=!1,e}},"init"),Re=at;var Ae=i(t=>{let e=[],n=i(r=>{if(typeof r!="object"||r===null)return;let o="@context"in r?r["@context"]:void 0;for(let s of Array.isArray(o)?o:[o])typeof s=="string"&&e.push(s);Object.values(r).forEach(n)},"traverse");return n(t),e},"getContextURIs"),R=i(async(t,e,n=!1)=>{let r=Ae(e),o=await Promise.all(r.map(async s=>t.context.resolveDocument(s,n)));return r.reduce((s,a,d)=>{let g=o[d];return g&&(s[a]=JSON.stringify(g)),s},{})},"getDocumentMap");var Ne=1e4,ke=6e4,We=64,Fe=new Set([101,204,205,304]),j=!1,K,W=1e4,te=64,A=0,h=new Map,T=new Map,ne=new Map,re=i(t=>new URL(t).href,"normalizeAbsoluteUrl"),ut=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r.toLowerCase(),n])}),e.sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:n[1]<r[1]?-1:n[1]>r[1]?1:0),e},"headersToSortedTuples"),dt=i((t,e)=>new Request(t,e),"normalizeRequest"),bt=i(t=>({method:t.method.toUpperCase(),url:re(t.url),headers:ut(t.headers),credentials:t.credentials,mode:t.mode,cache:t.cache,redirect:t.redirect,referrerPolicy:t.referrerPolicy}),"describeSemanticsFromRequest"),gt=i(t=>JSON.stringify([t.method,t.url,t.headers,t.credentials,t.mode,t.cache,t.redirect,t.referrerPolicy]),"semanticsKey"),ft=i((t,e)=>new Request(t,{signal:e}),"sharedNetworkRequest"),wt=i(t=>typeof t=="string"?t:t instanceof URL?t.href:t.url,"peekRequestUrl"),lt=i((t,e)=>e?.method?e.method.toUpperCase():t instanceof Request?t.method.toUpperCase():"GET","peekMethod"),pt=i((t,e)=>typeof e?.integrity=="string"&&e.integrity.length>0||t instanceof Request&&t.integrity.length>0,"peekHasIntegrity"),yt=i((t,e)=>e?.cache?e.cache:t instanceof Request?t.cache:"default","peekCacheMode"),xt=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{let e=t.split(/[?#]/,1)[0]??t;return e==="did.json"||e.endsWith("/did.json")}},"peekIsDidWebDocumentUrl"),G=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{return!1}},"isDidWebDocumentUrl"),oe=i(t=>{if(!t.startsWith("did:web:"))return;let e=t.slice(8).split(":"),n=e[0];if(!n)return;let r=n.replace(/%3A/gi,":"),o=e.length>1?e.slice(1).join("/"):".well-known",s=r.startsWith("localhost")?"http":"https";try{return re(`${s}://${r}/${o}/did.json`)}catch{return}},"didWebToDocumentUrl"),V=i(t=>ne.get(t)??0,"getUrlGeneration"),ht=i(t=>{ne.set(t,V(t)+1);for(let e of[...T.keys()])try{JSON.parse(e)[1]===t&&T.delete(e)}catch{}},"bumpUrlGeneration"),mt=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},"headersToTuples"),Dt=i(t=>{let e=t.get("cache-control");if(!e)return;let n=e.toLowerCase().split(",").map(r=>r.trim());if(n.some(r=>r==="no-store"||r==="no-cache"))return 0;for(let r of n){let o=/^max-age=(\d+)$/.exec(r);if(o)return Number(o[1])*1e3}},"parseCacheControlMaxAgeMs"),Je=i(t=>{let e=t.body===null||Fe.has(t.status)?null:t.body.slice(0),n=new Response(e,{status:t.status,statusText:t.statusText,headers:t.headers});try{Object.defineProperty(n,"url",{value:t.url,writable:!1,enumerable:!0,configurable:!0})}catch{}return n},"storedToResponse"),It=i(async(t,e,n)=>{let r=Fe.has(t.status)?null:await t.arrayBuffer();return{expiresAt:Date.now()+e,status:t.status,statusText:t.statusText,headers:mt(t.headers),body:r,url:t.url||n}},"readResponse"),St=i((t=Date.now())=>{for(let[e,n]of h)n.expiresAt<=t&&h.delete(e)},"sweepExpired"),Le=i((t,e)=>{for(h.delete(t),h.set(t,e);h.size>te;){let n=h.keys().next().value;if(n===void 0)break;h.delete(n)}},"touchLru"),Tt=i((t,e=Date.now())=>{St(e);let n=h.get(t);if(n){if(n.expiresAt<=e){h.delete(t);return}return Le(t,n),n}},"getFreshSuccess"),z=i(()=>{if(typeof DOMException=="function")return new DOMException("The operation was aborted.","AbortError");let t=new Error("The operation was aborted.");return t.name="AbortError",t},"abortError"),Et=i(t=>new Promise((e,n)=>{if(t.aborted){n(z());return}t.addEventListener("abort",()=>n(z()),{once:!0})}),"waitForAbort"),Ct=i((t,e)=>{e.waiters-=1,!(e.waiters>0)&&(T.get(t)===e&&T.delete(t),e.controller.signal.aborted||e.controller.abort())},"releaseInflightWaiter");async function Oe(t,e,n){e.waiters+=1;try{if(n?.aborted)throw z();let r=n?await Promise.race([e.promise,Et(n)]):await e.promise;return Je(r)}finally{Ct(t,e)}}i(Oe,"joinInflight");var Me=i(t=>t==="no-store"||t==="reload"||t==="no-cache","shouldBypassRequestCacheMode");async function vt(t,e){let n=K;if(!n){if(typeof globalThis.fetch!="function")throw new TypeError("globalThis.fetch is not available");return globalThis.fetch(t,e)}if(pt(t,e)||lt(t,e)!=="GET"||!xt(wt(t))||Me(yt(t,e)))return n(t,e);let r;try{r=dt(t,e)}catch{return n(t,e)}let o=bt(r);if(o.method!=="GET"||!G(o.url)||Me(o.cache))return n(t,e);let s=r.signal;if(s.aborted)throw z();let a=gt(o),d=Tt(a);if(d)return Je(d);let g=T.get(a);if(g&&g.generation===A)return Oe(a,g,s);let w=A,p=V(o.url),m=new AbortController,E=ft(r,m.signal),$=(async()=>{let X=await n(E),Y=Dt(X.headers),_e=Y===void 0?W:Math.max(0,Math.min(W,Y)),ie=await It(X,_e||W,o.url),Pe=w===A&&p===V(o.url);return X.ok&&Y!==0&&_e>0&&Pe&&w===A&&p===V(o.url)&&Le(a,ie),ie})(),L={generation:w,controller:m,promise:$,waiters:0,semanticsKey:a};return T.set(a,L),Oe(a,L,s)}i(vt,"cachedFetch");var F=i((t={})=>{if(typeof globalThis.fetch!="function")throw new TypeError("installDidWebDocumentFetchCache requires globalThis.fetch; none is available");typeof t.ttlMs=="number"&&t.ttlMs>0&&(W=t.ttlMs),typeof t.maxEntries=="number"&&t.maxEntries>0&&(te=t.maxEntries),!(j&&!t.force)&&(j&&t.force&&K&&(globalThis.fetch=K),K=globalThis.fetch.bind(globalThis),globalThis.fetch=vt,j=!0)},"installDidWebDocumentFetchCache"),Ue=i(()=>{F({ttlMs:6e4})},"installWalletDidWebDocumentFetchCache"),H=i(()=>{A+=1,h.clear(),T.clear(),ne.clear()},"clearDidWebDocumentFetchCache"),J=i(t=>{let e=t.startsWith("did:")?oe(t):G(t)?t:void 0;if(!e)return;let n;try{n=re(e)}catch{return}for(let r of[...h.keys()])try{JSON.parse(r)[1]===n&&h.delete(r)}catch{}ht(n)},"invalidateDidWebDocument"),qe=i(()=>({installed:j,ttlMs:W,maxEntries:te,successEntries:h.size,inflightEntries:T.size,cacheGeneration:A}),"getDidWebDocumentFetchCacheStats");var Rt=i(async(t,e=!1)=>{F(),await Re(t);let n={};return{name:"DIDKit",displayName:"DIDKit",description:"Provides an interface to DIDKit, which allows for the generation of key material, as well as signing and verifying credentials and presentations",context:{resolveStaticDocument:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await ee(o)??"")||void 0}catch(s){r.debug?.(s);return}},"resolveStaticDocument")},methods:{generateEd25519KeyFromBytes:i((r,o)=>JSON.parse(he(o)),"generateEd25519KeyFromBytes"),generateSecp256k1KeyFromBytes:i((r,o)=>JSON.parse(me(o)),"generateSecp256k1KeyFromBytes"),keyToDid:i((r,o,s)=>ge(o,JSON.stringify(s)),"keyToDid"),keyToVerificationMethod:i(async(r,o,s)=>fe(o,JSON.stringify(s)),"keyToVerificationMethod"),didToVerificationMethod:i(async(r,o)=>we(o),"didToVerificationMethod"),issueCredential:i(async(r,o,s,a)=>JSON.parse(await le(JSON.stringify(o),JSON.stringify(s),JSON.stringify(a),JSON.stringify(await R(r,o,e)))),"issueCredential"),verifyCredential:i(async(r,o,s={})=>JSON.parse(await pe(JSON.stringify(o),JSON.stringify(s),JSON.stringify(await R(r,o,e)))),"verifyCredential"),issuePresentation:i(async(r,o,s,a)=>{let d=s.proofFormat==="jwt",g=await ye(JSON.stringify(o),JSON.stringify(s),JSON.stringify(a),JSON.stringify(await R(r,o,e)));return d?g:JSON.parse(g)},"issuePresentation"),verifyPresentation:i(async(r,o,s={})=>{let a=typeof o=="string";return JSON.parse(await ae(a?o:JSON.stringify(o),JSON.stringify(s),a?"{}":JSON.stringify(await R(r,o,e))))},"verifyPresentation"),contextLoader:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await ee(o)??"")||void 0}catch(s){r.debug?.(s);return}},"contextLoader"),resolveDid:i(async(r,o,s={})=>(s.noCache&&J(o),JSON.parse(await be(o,JSON.stringify(s)))),"resolveDid"),didResolver:i(async(r,o,s={})=>(s.noCache&&J(o),JSON.parse(await de(o,JSON.stringify(s)))),"didResolver"),createJwe:i(async(r,o,s)=>JSON.parse(await De(o,s)),"createJwe"),decryptJwe:i(async(r,o,s)=>Ie(JSON.stringify(o),s.map(a=>JSON.stringify(a))),"decryptJwe"),createDagJwe:i(async(r,o,s)=>JSON.parse(await Se(o,s)),"createDagJwe"),decryptDagJwe:i(async(r,o,s)=>{let a=i(d=>{if(d==null)return d;if(typeof d=="bigint")return Number(d);if(Array.isArray(d))return d.map(a);if(typeof d!="object"||!Object.values(d).some(p=>typeof p=="bigint"||typeof p=="object"&&p!==null))return d;let w={};for(let p in d)w[p]=a(d[p]);return w},"convertBigIntsToNumbers");return a(await Te(JSON.stringify(o),s.map(d=>JSON.stringify(d))))},"decryptDagJwe"),clearDidWebCache:i(async()=>{H(),await ue()},"clearDidWebCache")}}},"getDidKitPlugin");
|
|
3
3
|
//# sourceMappingURL=didkit-plugin.cjs.production.min.cjs.map
|