@contentauth/c2pa-web 0.11.0 → 0.12.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.
@@ -1,6 +1,6 @@
1
- import { channel as j, transfer as O } from "highgain";
1
+ import { channel as M, transfer as N } from "highgain";
2
2
  import { merge as h } from "ts-deepmerge";
3
- const { createTx: U, rx: ee } = j(), { createTx: te, rx: L } = j("worker"), z = '(function(){"use strict";class p{static __wrap(e){const t=Object.create(p.prototype);return t.__wbg_ptr=e,x.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw d(t[0])}addIngredient(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,n);if(_[1])throw d(_[0])}addIngredientFromBlob(e,t,n){const _=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,i=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,i,s,n)}addRedaction(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addRedaction(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}addResourceFromBlob(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}static fromArchive(e,t){var n=g(t)?0:b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;const c=o.wasmbuilder_fromArchive(e,n,_);if(c[2])throw d(c[1]);return p.__wrap(c[0])}static fromJson(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;var c=g(t)?0:b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;const s=o.wasmbuilder_fromJson(n,_,c,i);if(s[2])throw d(s[1]);return p.__wrap(s[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}static new(e){var t=g(e)?0:b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;const _=o.wasmbuilder_new(t,n);if(_[2])throw d(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw d(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}setRemoteUrl(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,n)}setThumbnailFromBlob(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}sign(e,t,n){const _=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,n)}signAndGetManifestBytes(e,t,n){const _=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,n)}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class v{static __wrap(e){const t=Object.create(v.prototype);return t.__wbg_ptr=e,k.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=y(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}crJson(){let e,t;try{const n=o.wasmreader_crJson(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t,n){const _=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;var i=g(n)?0:b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmreader_fromBlob(_,c,t,i,s)}static fromBlobFragment(e,t,n,_){const c=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;var s=g(_)?0:b(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,i,t,n,s,a)}json(){let e,t;try{const n=o.wasmreader_json(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}resourceToBytes(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,n);if(_[2])throw d(_[1]);return d(_[0])}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);function C(r){const e=b(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw d(n[0])}function J(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_ef53bc310eb298a0:function(e,t){return Error(y(e,t))},__wbg_Number_6b506e6536831eaa:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d:function(e,t){const n=t,_=typeof n=="bigint"?n:void 0;m().setBigInt64(e+8,g(_)?BigInt(0):_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_boolean_get_1a45e2c38d4d41b9:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0accd80f45e5faa2:function(e,t){const n=j(t),_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg___wbindgen_in_70a403a56e771704:function(e,t){return e in t},__wbg___wbindgen_is_bigint_6ffd6468a9bc44b9:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_754e9f305ff6029e:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_56732c2bc353f41d:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_c236cabd84a4d769:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_67b456be8673d3d7:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_1068e624fa87f6ab:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_2c56564c75129511:function(e,t){return e==t},__wbg___wbindgen_number_get_9bb1761122181af2:function(e,t){const n=t,_=typeof n=="number"?n:void 0;m().setFloat64(e+8,g(_)?0:_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_string_get_72bdf95d3ae505b1:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:b(_,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;m().setInt32(e+4,i,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_1506f2235d1bdba0:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_61db23ac97f16c31:function(e){e._wbg_cb_unref()},__wbg_abort_2ec46222bf378517:function(e){e.abort()},__wbg_abort_b29d719932441c95:function(e,t){e.abort(t)},__wbg_append_e1746995edcb0170:function(){return f(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_05927079aabe6d46:function(){return f(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_2c6dc3b4b85d3547:function(e){return e.byteLength},__wbg_call_8a89609d89f6608a:function(){return f(function(e,t){return e.call(t)},arguments)},__wbg_call_9c758de292015997:function(){return f(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_60cf307fcc680536:function(e){return e.done},__wbg_entries_04b37a02507f1713:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,_;try{n=e,_=t,console.error(y(e,t))}finally{o.__wbindgen_free(n,_,1)}},__wbg_fetch_344c8d3849002659:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_d300fe49deab18f5:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return f(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_8aa3112c6615eef6:function(){return f(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return f(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getTime_00b3f7db575e4ef5:function(e){return e.getTime()},__wbg_get_1f8f054ddbaa7db2:function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_2b48c7d0d006a781:function(e,t){return e[t>>>0]},__wbg_get_de6a0f7d4d18a304:function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_33f6e5c9e2f2d6b2:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_73740b27f436fed3:function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_0feb63d2d374b44a:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_8f49811467741499:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_9fc06d9a951bcee6:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_d0db99486956c8e8:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_cb984bd66d7bd408:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_86f30649f63ef9c2:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_67c2c9c4313f4448:function(e){return Array.isArray(e)},__wbg_isSafeInteger_66acec27e09e99a7:function(e){return Number.isSafeInteger(e)},__wbg_iterator_8732428d309e270e:function(){return Symbol.iterator},__wbg_length_4a591ecaa01354d9:function(e){return e.length},__wbg_length_66f1a4b2e9026940:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_445c13a750296eb6:function(){return new Date},__wbg_new_0d09705104e164af:function(){return f(function(){return new AbortController},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_578aeef4b6b94378:function(e){return new Uint8Array(e)},__wbg_new_622fc80556be2e26:function(){return new Map},__wbg_new_a1b9f645bba64f0f:function(){return f(function(){return new FileReaderSync},arguments)},__wbg_new_ce1ab61c1c2b300d:function(){return new Object},__wbg_new_d90091b82fdf5b91:function(){return new Array},__wbg_new_e436d06bc8e77460:function(){return f(function(){return new Headers},arguments)},__wbg_new_from_slice_18fa1f71286d66b8:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_bf31d18f92484486:function(e,t){try{var n={a:e,b:t},_=(i,s)=>{const a=n.a;n.a=0;try{return P(a,n.b,i,s)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_36a4998e27b014c5:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_bcd02b79a793d27f:function(){return f(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_9e03acdf51c4960d:function(e){return e.next},__wbg_next_eb8ca7351fa27906:function(){return f(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_190933fa139cc119:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_3249fc62a0fafa30:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_queueMicrotask_35c611f4a14830b2:function(e){queueMicrotask(e)},__wbg_queueMicrotask_404ed0a58e0b63cc:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return f(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_f1b8da05559618d9:function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return f(function(){return module.require},arguments)},__wbg_resolve_25a7e548d5881dca:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_29c99a8aac1c01e5:function(e,t,n){e.set(A(t,n))},__wbg_set_52b1e1eb5bed906a:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_body_36614c7e61546809:function(e,t){e.body=t},__wbg_set_cache_488ea16c11cbf20d:function(e,t){e.cache=$[t]},__wbg_set_credentials_fa9c491a27c4bdf0:function(e,t){e.credentials=H[t]},__wbg_set_dca99999bba88a9a:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_7c1e39ece7826bec:function(e,t){e.headers=t},__wbg_set_method_7a6811dec7a4feff:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_c90e3667002857d4:function(e,t){e.mode=X[t]},__wbg_set_signal_d9da62b3f215c821:function(e,t){e.signal=t},__wbg_signal_e03304a84df9ed09:function(e){return e.signal},__wbg_size_9970092b88b1094c:function(e){return e.size},__wbg_slice_02bb778501725738:function(){return f(function(e,t,n){return e.slice(t,n)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(e,t){const n=t.stack,_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_static_accessor_GLOBAL_9d53f2689e622ca1:function(){const e=typeof global>"u"?null:global;return g(e)?0:S(e)},__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:S(e)},__wbg_static_accessor_SELF_4c59f6c7ea29a144:function(){const e=typeof self>"u"?null:self;return g(e)?0:S(e)},__wbg_static_accessor_WINDOW_e70ae9f2eb052253:function(){const e=typeof window>"u"?null:window;return g(e)?0:S(e)},__wbg_status_00549d55b78d949e:function(e){return e.status},__wbg_stringify_8286df6dcc591521:function(){return f(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_4aa221f6a4f5ab22:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_18f476d590e58992:function(e,t,n){return e.then(t,n)},__wbg_then_ac7b025999b52837:function(e,t){return e.then(t)},__wbg_url_6808f1c468f2d0cd:function(e,t){const n=t.url,_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_valueOf_41ae57308c1f031c:function(e){return e.valueOf()},__wbg_value_f3625092ee4b37f4:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return v.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,G)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,V)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return A(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return y(e,t)},__wbindgen_cast_0000000000000007:function(e){return BigInt.asUintN(64,e)},__wbindgen_cast_0000000000000008:function(e,t){var n=A(e,t).slice();return o.__wbindgen_free(e,t*1,1),n},__wbindgen_init_externref_table:function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function V(r,e){o.wasm_bindgen__convert__closures_____invoke__h9ad77c532ffa5b9e(r,e)}function G(r,e,t){const n=o.wasm_bindgen__convert__closures_____invoke__hf2acc361175a8d00(r,e,t);if(n[1])throw d(n[0])}function P(r,e,t,n){o.wasm_bindgen__convert__closures_____invoke__h53f6302d12a3bd57(r,e,t,n)}const $=["default","no-store","reload","no-cache","force-cache","only-if-cached"],H=["omit","same-origin","include"],X=["same-origin","no-cors","cors","navigate"],x=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmbuilder_free(r,1)),k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmreader_free(r,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>o.__wbg_wasmsigner_free(r,1));function S(r){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,r),e}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbindgen_destroy_closure(r.a,r.b));function j(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const _=r.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=r.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(r)){const _=r.length;let c="[";_>0&&(c+=j(r[0]));for(let i=1;i<_;i++)c+=", "+j(r[i]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(r));let n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}\n${r.stack}`:n}function A(r,e){return r=r>>>0,M().subarray(r/1,r/1+e)}let F=null;function m(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==o.memory.buffer)&&(F=new DataView(o.memory.buffer)),F}function y(r,e){return K(r>>>0,e)}let B=null;function M(){return(B===null||B.byteLength===0)&&(B=new Uint8Array(o.memory.buffer)),B}function f(r,e){try{return r.apply(this,e)}catch(t){const n=S(t);o.__wbindgen_exn_store(n)}}function g(r){return r==null}function z(r,e,t){const n={a:r,b:e,cnt:1},_=(...c)=>{n.cnt++;const i=n.a;n.a=0;try{return t(i,n.b,...c)}finally{n.a=i,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{--n.cnt===0&&(o.__wbindgen_destroy_closure(n.a,n.b),n.a=0,N.unregister(n))},N.register(_,n,n),_}function b(r,e,t){if(t===void 0){const s=T.encode(r),a=e(s.length,1)>>>0;return M().subarray(a,a+s.length).set(s),u=s.length,a}let n=r.length,_=e(n,1)>>>0;const c=M();let i=0;for(;i<n;i++){const s=r.charCodeAt(i);if(s>127)break;c[_+i]=s}if(i!==n){i!==0&&(r=r.slice(i)),_=t(_,n,n=i+r.length*3,1)>>>0;const s=M().subarray(_+i,_+n),a=T.encodeInto(r,s);i+=a.written,_=t(_,n,i,1)>>>0}return u=i,_}function d(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});E.decode();const Y=2146435072;let O=0;function K(r,e){return O+=e,O>=Y&&(E=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),E.decode(),O=e),E.decode(M().subarray(r,r+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(r,e){const t=T.encode(r);return e.set(t),{read:r.length,written:t.length}});let u=0,o;function Q(r,e){return o=r.exports,F=null,B=null,o.__wbindgen_start(),o}function Z(r){if(o!==void 0)return o;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function D(){let r=0;const e=new Map;return{add(t){const n=r++;return e.set(n,t),n},get(t){const n=e.get(t);if(!n)throw new Error("Attempted to use an object that has been freed");return n},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function I(r,e){return{type:L,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function U(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===L)}function q(r="default"){return{createTx(e){const t=new Map,n=e??self;return n.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==r)return;const{id:i,result:s,error:a}=c,w=t.get(i);w&&(a?w.reject(a):w.resolve(s),t.delete(i))}),new Proxy({},{get(_,c){return(...i)=>{const s=ee(),a=[],w=[];return i.forEach(R=>{U(R)?(a.push(R.value),w.push(...R.transfer)):a.push(R)}),n.postMessage({method:c,args:a,id:s,channelName:r},{transfer:w}),new Promise((R,_e)=>{t.set(s,{resolve:R,reject:_e})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:i,args:s,id:a}=c;try{const w=await e[i](...s);U(w)?n.postMessage({result:w.value,id:a,channelName:r},{transfer:w.transfer}):n.postMessage({result:w,id:a,channelName:r})}catch(w){n.postMessage({error:w,id:a,channelName:r})}})}}}function ee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const{rx:te}=q(),{createTx:ne}=q("worker"),h=D(),l=D(),W=ne();te(re({async initWorker(r,e){Z({module:r}),e&&C(e)},async reader_fromBlob(r,e,t){const n=await v.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await v.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){return h.get(r).manifestStore()},reader_activeManifest(r){return h.get(r).activeManifest()},reader_json(r){return h.get(r).json()},reader_crJson(r){return h.get(r).crJson()},reader_resourceToBytes(r,e){const n=h.get(r).resourceToBytes(e);return I(n,n.buffer)},reader_free(r){h.get(r).free(),h.remove(r)},builder_new(r){const e=p.new(r);return l.add(e)},builder_fromJson(r,e){const t=p.fromJson(r,e);return l.add(t)},builder_fromArchive(r,e){const t=p.fromArchive(r,e);return l.add(t)},builder_setIntent(r,e){l.get(r).setIntent(e)},builder_addAction(r,e){l.get(r).addAction(e)},builder_addRedaction(r,e,t){l.get(r).addRedaction(e,t)},builder_setRemoteUrl(r,e){l.get(r).setRemoteUrl(e)},builder_setNoEmbed(r,e){l.get(r).setNoEmbed(e)},builder_setThumbnailFromBlob(r,e,t){l.get(r).setThumbnailFromBlob(e,t)},builder_addIngredient(r,e){l.get(r).addIngredient(e)},async builder_addIngredientFromBlob(r,e,t,n){await l.get(r).addIngredientFromBlob(e,t,n)},builder_addResourceFromBlob(r,e,t){l.get(r).addResourceFromBlob(e,t)},builder_getDefinition(r){return l.get(r).getDefinition()},builder_toArchive(r){const t=l.get(r).toArchive();return I(t,t.buffer)},async builder_sign(r,e,t,n,_){const i=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async s=>await W.sign(e,I(s,s.buffer),t.reserveSize)},n,_);return I(i,i.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:i,asset:s}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await W.sign(e,I(a,a.buffer),t.reserveSize)},n,_);return I({manifest:i,asset:s},[i.buffer,s.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function re(r){const e={};for(const[t,n]of Object.entries(r))e[t]=async(..._)=>{try{return await n(..._)}catch(c){throw typeof c=="string"?new Error(c):c}};return e}})();\n', p = typeof self < "u" && self.Blob && new Blob([z], { type: "text/javascript;charset=utf-8" });
3
+ const { createTx: U, rx: ee } = M(), { createTx: te, rx: L } = M("worker"), O = '(function(){"use strict";class p{static __wrap(e){const t=Object.create(p.prototype);return t.__wbg_ptr=e,x.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,x.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmbuilder_free(e,0)}addAction(e){const t=o.wasmbuilder_addAction(this.__wbg_ptr,e);if(t[1])throw d(t[0])}addIngredient(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmbuilder_addIngredient(this.__wbg_ptr,t,n);if(_[1])throw d(_[0])}addIngredientFromBlob(e,t,n){const _=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u,i=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmbuilder_addIngredientFromBlob(this.__wbg_ptr,_,c,i,s,n)}addRedaction(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addRedaction(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}addResourceFromBlob(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_addResourceFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}static fromArchive(e,t){var n=g(t)?0:b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;const c=o.wasmbuilder_fromArchive(e,n,_);if(c[2])throw d(c[1]);return p.__wrap(c[0])}static fromJson(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u;var c=g(t)?0:b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;const s=o.wasmbuilder_fromJson(n,_,c,i);if(s[2])throw d(s[1]);return p.__wrap(s[0])}getDefinition(){const e=o.wasmbuilder_getDefinition(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}static new(e){var t=g(e)?0:b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;const _=o.wasmbuilder_new(t,n);if(_[2])throw d(_[1]);return p.__wrap(_[0])}setIntent(e){const t=o.wasmbuilder_setIntent(this.__wbg_ptr,e);if(t[1])throw d(t[0])}setNoEmbed(e){o.wasmbuilder_setNoEmbed(this.__wbg_ptr,e)}setRemoteUrl(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u;o.wasmbuilder_setRemoteUrl(this.__wbg_ptr,t,n)}setThumbnailFromBlob(e,t){const n=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,c=o.wasmbuilder_setThumbnailFromBlob(this.__wbg_ptr,n,_,t);if(c[1])throw d(c[0])}sign(e,t,n){const _=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_sign(this.__wbg_ptr,e,_,c,n)}signAndGetManifestBytes(e,t,n){const _=b(t,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;return o.wasmbuilder_signAndGetManifestBytes(this.__wbg_ptr,e,_,c,n)}toArchive(){const e=o.wasmbuilder_toArchive(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}}Symbol.dispose&&(p.prototype[Symbol.dispose]=p.prototype.free);class v{static __wrap(e){const t=Object.create(v.prototype);return t.__wbg_ptr=e,k.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){const e=this.__destroy_into_raw();o.__wbg_wasmreader_free(e,0)}activeLabel(){const e=o.wasmreader_activeLabel(this.__wbg_ptr);let t;return e[0]!==0&&(t=y(e[0],e[1]).slice(),o.__wbindgen_free(e[0],e[1]*1,1)),t}activeManifest(){const e=o.wasmreader_activeManifest(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}crJson(){let e,t;try{const n=o.wasmreader_crJson(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}static fromBlob(e,t,n){const _=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;var i=g(n)?0:b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;return o.wasmreader_fromBlob(_,c,t,i,s)}static fromBlobFragment(e,t,n,_){const c=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;var s=g(_)?0:b(_,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u;return o.wasmreader_fromBlobFragment(c,i,t,n,s,a)}json(){let e,t;try{const n=o.wasmreader_json(this.__wbg_ptr);return e=n[0],t=n[1],y(n[0],n[1])}finally{o.__wbindgen_free(e,t,1)}}manifestStore(){const e=o.wasmreader_manifestStore(this.__wbg_ptr);if(e[2])throw d(e[1]);return d(e[0])}resourceToBytes(e){const t=b(e,o.__wbindgen_malloc,o.__wbindgen_realloc),n=u,_=o.wasmreader_resourceToBytes(this.__wbg_ptr,t,n);if(_[2])throw d(_[1]);return d(_[0])}}Symbol.dispose&&(v.prototype[Symbol.dispose]=v.prototype.free);function C(r){const e=b(r,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,n=o.loadSettings(e,t);if(n[1])throw d(n[0])}function J(){return{__proto__:null,"./c2pa_bg.js":{__proto__:null,__wbg_Error_ef53bc310eb298a0:function(e,t){return Error(y(e,t))},__wbg_Number_6b506e6536831eaa:function(e){return Number(e)},__wbg___wbindgen_bigint_get_as_i64_38130e98eecd467d:function(e,t){const n=t,_=typeof n=="bigint"?n:void 0;m().setBigInt64(e+8,g(_)?BigInt(0):_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_boolean_get_1a45e2c38d4d41b9:function(e){const t=e,n=typeof t=="boolean"?t:void 0;return g(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0accd80f45e5faa2:function(e,t){const n=O(t),_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg___wbindgen_in_70a403a56e771704:function(e,t){return e in t},__wbg___wbindgen_is_bigint_6ffd6468a9bc44b9:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_754e9f305ff6029e:function(e){return typeof e=="function"},__wbg___wbindgen_is_object_56732c2bc353f41d:function(e){const t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_c236cabd84a4d769:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_67b456be8673d3d7:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_1068e624fa87f6ab:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_2c56564c75129511:function(e,t){return e==t},__wbg___wbindgen_number_get_9bb1761122181af2:function(e,t){const n=t,_=typeof n=="number"?n:void 0;m().setFloat64(e+8,g(_)?0:_,!0),m().setInt32(e+0,!g(_),!0)},__wbg___wbindgen_string_get_72bdf95d3ae505b1:function(e,t){const n=t,_=typeof n=="string"?n:void 0;var c=g(_)?0:b(_,o.__wbindgen_malloc,o.__wbindgen_realloc),i=u;m().setInt32(e+4,i,!0),m().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_1506f2235d1bdba0:function(e,t){throw new Error(y(e,t))},__wbg__wbg_cb_unref_61db23ac97f16c31:function(e){e._wbg_cb_unref()},__wbg_abort_2ec46222bf378517:function(e){e.abort()},__wbg_abort_b29d719932441c95:function(e,t){e.abort(t)},__wbg_append_e1746995edcb0170:function(){return f(function(e,t,n,_,c){e.append(y(t,n),y(_,c))},arguments)},__wbg_arrayBuffer_05927079aabe6d46:function(){return f(function(e){return e.arrayBuffer()},arguments)},__wbg_byteLength_2c6dc3b4b85d3547:function(e){return e.byteLength},__wbg_call_8a89609d89f6608a:function(){return f(function(e,t){return e.call(t)},arguments)},__wbg_call_9c758de292015997:function(){return f(function(e,t,n){return e.call(t,n)},arguments)},__wbg_clearTimeout_6b8d9a38b9263d65:function(e){return clearTimeout(e)},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_done_60cf307fcc680536:function(e){return e.done},__wbg_entries_04b37a02507f1713:function(e){return Object.entries(e)},__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,_;try{n=e,_=t,console.error(y(e,t))}finally{o.__wbindgen_free(n,_,1)}},__wbg_fetch_344c8d3849002659:function(e,t){return e.fetch(t)},__wbg_fetch_9dad4fe911207b37:function(e){return fetch(e)},__wbg_from_d300fe49deab18f5:function(e){return Array.from(e)},__wbg_getRandomValues_3f44b700395062e5:function(){return f(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_8aa3112c6615eef6:function(){return f(function(e,t){globalThis.crypto.getRandomValues(A(e,t))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return f(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getTime_00b3f7db575e4ef5:function(e){return e.getTime()},__wbg_get_1f8f054ddbaa7db2:function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_2b48c7d0d006a781:function(e,t){return e[t>>>0]},__wbg_get_de6a0f7d4d18a304:function(){return f(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_unchecked_33f6e5c9e2f2d6b2:function(e,t){return e[t>>>0]},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_has_73740b27f436fed3:function(){return f(function(e,t){return Reflect.has(e,t)},arguments)},__wbg_headers_0feb63d2d374b44a:function(e){return e.headers},__wbg_instanceof_ArrayBuffer_8f49811467741499:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Map_9fc06d9a951bcee6:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_Promise_d0db99486956c8e8:function(e){let t;try{t=e instanceof Promise}catch{t=!1}return t},__wbg_instanceof_Response_cb984bd66d7bd408:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_86f30649f63ef9c2:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_67c2c9c4313f4448:function(e){return Array.isArray(e)},__wbg_isSafeInteger_66acec27e09e99a7:function(e){return Number.isSafeInteger(e)},__wbg_iterator_8732428d309e270e:function(){return Symbol.iterator},__wbg_length_4a591ecaa01354d9:function(e){return e.length},__wbg_length_66f1a4b2e9026940:function(e){return e.length},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_new_0_445c13a750296eb6:function(){return new Date},__wbg_new_0d09705104e164af:function(){return f(function(){return new AbortController},arguments)},__wbg_new_227d7c05414eb861:function(){return new Error},__wbg_new_578aeef4b6b94378:function(e){return new Uint8Array(e)},__wbg_new_622fc80556be2e26:function(){return new Map},__wbg_new_a1b9f645bba64f0f:function(){return f(function(){return new FileReaderSync},arguments)},__wbg_new_ce1ab61c1c2b300d:function(){return new Object},__wbg_new_d90091b82fdf5b91:function(){return new Array},__wbg_new_e436d06bc8e77460:function(){return f(function(){return new Headers},arguments)},__wbg_new_from_slice_18fa1f71286d66b8:function(e,t){return new Uint8Array(A(e,t))},__wbg_new_typed_bf31d18f92484486:function(e,t){try{var n={a:e,b:t},_=(i,s)=>{const a=n.a;n.a=0;try{return G(a,n.b,i,s)}finally{n.a=a}};return new Promise(_)}finally{n.a=0}},__wbg_new_with_length_36a4998e27b014c5:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_str_and_init_bcd02b79a793d27f:function(){return f(function(e,t,n){return new Request(y(e,t),n)},arguments)},__wbg_next_9e03acdf51c4960d:function(e){return e.next},__wbg_next_eb8ca7351fa27906:function(){return f(function(e){return e.next()},arguments)},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_190933fa139cc119:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_3249fc62a0fafa30:function(e,t,n){Uint8Array.prototype.set.call(A(e,t),n)},__wbg_queueMicrotask_35c611f4a14830b2:function(e){queueMicrotask(e)},__wbg_queueMicrotask_404ed0a58e0b63cc:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return f(function(e,t){e.randomFillSync(t)},arguments)},__wbg_readAsArrayBuffer_f1b8da05559618d9:function(){return f(function(e,t){return e.readAsArrayBuffer(t)},arguments)},__wbg_require_b4edbdcf3e2a1ef0:function(){return f(function(){return module.require},arguments)},__wbg_resolve_25a7e548d5881dca:function(e){return Promise.resolve(e)},__wbg_setTimeout_f757f00851f76c42:function(e,t){return setTimeout(e,t)},__wbg_set_29c99a8aac1c01e5:function(e,t,n){e.set(A(t,n))},__wbg_set_52b1e1eb5bed906a:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_body_36614c7e61546809:function(e,t){e.body=t},__wbg_set_cache_488ea16c11cbf20d:function(e,t){e.cache=$[t]},__wbg_set_credentials_fa9c491a27c4bdf0:function(e,t){e.credentials=H[t]},__wbg_set_dca99999bba88a9a:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_7c1e39ece7826bec:function(e,t){e.headers=t},__wbg_set_method_7a6811dec7a4feff:function(e,t,n){e.method=y(t,n)},__wbg_set_mode_c90e3667002857d4:function(e,t){e.mode=X[t]},__wbg_set_signal_d9da62b3f215c821:function(e,t){e.signal=t},__wbg_signal_e03304a84df9ed09:function(e){return e.signal},__wbg_size_9970092b88b1094c:function(e){return e.size},__wbg_slice_02bb778501725738:function(){return f(function(e,t,n){return e.slice(t,n)},arguments)},__wbg_stack_3b0d974bbf31e44f:function(e,t){const n=t.stack,_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_static_accessor_GLOBAL_9d53f2689e622ca1:function(){const e=typeof global>"u"?null:global;return g(e)?0:S(e)},__wbg_static_accessor_GLOBAL_THIS_a1a35cec07001a8a:function(){const e=typeof globalThis>"u"?null:globalThis;return g(e)?0:S(e)},__wbg_static_accessor_SELF_4c59f6c7ea29a144:function(){const e=typeof self>"u"?null:self;return g(e)?0:S(e)},__wbg_static_accessor_WINDOW_e70ae9f2eb052253:function(){const e=typeof window>"u"?null:window;return g(e)?0:S(e)},__wbg_status_00549d55b78d949e:function(e){return e.status},__wbg_stringify_8286df6dcc591521:function(){return f(function(e){return JSON.stringify(e)},arguments)},__wbg_subarray_4aa221f6a4f5ab22:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_18f476d590e58992:function(e,t,n){return e.then(t,n)},__wbg_then_ac7b025999b52837:function(e,t){return e.then(t)},__wbg_url_6808f1c468f2d0cd:function(e,t){const n=t.url,_=b(n,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;m().setInt32(e+4,c,!0),m().setInt32(e+0,_,!0)},__wbg_valueOf_41ae57308c1f031c:function(e){return e.valueOf()},__wbg_value_f3625092ee4b37f4:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_wasmreader_new:function(e){return v.__wrap(e)},__wbindgen_cast_0000000000000001:function(e,t){return z(e,t,P)},__wbindgen_cast_0000000000000002:function(e,t){return z(e,t,V)},__wbindgen_cast_0000000000000003:function(e){return e},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e,t){return A(e,t)},__wbindgen_cast_0000000000000006:function(e,t){return y(e,t)},__wbindgen_cast_0000000000000007:function(e){return BigInt.asUintN(64,e)},__wbindgen_cast_0000000000000008:function(e,t){var n=A(e,t).slice();return o.__wbindgen_free(e,t*1,1),n},__wbindgen_init_externref_table:function(){const e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function V(r,e){o.wasm_bindgen__convert__closures_____invoke__h8da1d8dbbd4ddc9b(r,e)}function P(r,e,t){const n=o.wasm_bindgen__convert__closures_____invoke__h2e10f36d601ef68f(r,e,t);if(n[1])throw d(n[0])}function G(r,e,t,n){o.wasm_bindgen__convert__closures_____invoke__h19a27e34ad664b98(r,e,t,n)}const $=["default","no-store","reload","no-cache","force-cache","only-if-cached"],H=["omit","same-origin","include"],X=["same-origin","no-cors","cors","navigate"],x=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmbuilder_free(r,1)),k=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbg_wasmreader_free(r,1));typeof FinalizationRegistry>"u"||new FinalizationRegistry(r=>o.__wbg_wasmsigner_free(r,1));function S(r){const e=o.__externref_table_alloc();return o.__wbindgen_externrefs.set(e,r),e}const N=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>o.__wbindgen_destroy_closure(r.a,r.b));function O(r){const e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){const _=r.description;return _==null?"Symbol":`Symbol(${_})`}if(e=="function"){const _=r.name;return typeof _=="string"&&_.length>0?`Function(${_})`:"Function"}if(Array.isArray(r)){const _=r.length;let c="[";_>0&&(c+=O(r[0]));for(let i=1;i<_;i++)c+=", "+O(r[i]);return c+="]",c}const t=/\\[object ([^\\]]+)\\]/.exec(toString.call(r));let n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}\n${r.stack}`:n}function A(r,e){return r=r>>>0,B().subarray(r/1,r/1+e)}let F=null;function m(){return(F===null||F.buffer.detached===!0||F.buffer.detached===void 0&&F.buffer!==o.memory.buffer)&&(F=new DataView(o.memory.buffer)),F}function y(r,e){return K(r>>>0,e)}let R=null;function B(){return(R===null||R.byteLength===0)&&(R=new Uint8Array(o.memory.buffer)),R}function f(r,e){try{return r.apply(this,e)}catch(t){const n=S(t);o.__wbindgen_exn_store(n)}}function g(r){return r==null}function z(r,e,t){const n={a:r,b:e,cnt:1},_=(...c)=>{n.cnt++;const i=n.a;n.a=0;try{return t(i,n.b,...c)}finally{n.a=i,_._wbg_cb_unref()}};return _._wbg_cb_unref=()=>{--n.cnt===0&&(o.__wbindgen_destroy_closure(n.a,n.b),n.a=0,N.unregister(n))},N.register(_,n,n),_}function b(r,e,t){if(t===void 0){const s=T.encode(r),a=e(s.length,1)>>>0;return B().subarray(a,a+s.length).set(s),u=s.length,a}let n=r.length,_=e(n,1)>>>0;const c=B();let i=0;for(;i<n;i++){const s=r.charCodeAt(i);if(s>127)break;c[_+i]=s}if(i!==n){i!==0&&(r=r.slice(i)),_=t(_,n,n=i+r.length*3,1)>>>0;const s=B().subarray(_+i,_+n),a=T.encodeInto(r,s);i+=a.written,_=t(_,n,i,1)>>>0}return u=i,_}function d(r){const e=o.__wbindgen_externrefs.get(r);return o.__externref_table_dealloc(r),e}let j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();const Y=2146435072;let E=0;function K(r,e){return E+=e,E>=Y&&(j=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),j.decode(),E=e),j.decode(B().subarray(r,r+e))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(r,e){const t=T.encode(r);return e.set(t),{read:r.length,written:t.length}});let u=0,o;function Q(r,e){return o=r.exports,F=null,R=null,o.__wbindgen_start(),o}function Z(r){if(o!==void 0)return o;r!==void 0&&(Object.getPrototypeOf(r)===Object.prototype?{module:r}=r:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=J();r instanceof WebAssembly.Module||(r=new WebAssembly.Module(r));const t=new WebAssembly.Instance(r,e);return Q(t)}function D(){let r=0;const e=new Map;return{add(t){const n=r++;return e.set(n,t),n},get(t){const n=e.get(t);if(!n)throw new Error("Attempted to use an object that has been freed");return n},remove(t){return e.delete(t)}}}const L=Symbol("transfer");function I(r,e){return{type:L,value:r,transfer:e?Array.isArray(e)?e:[e]:[r]}}function U(r){return!!(r&&typeof r=="object"&&Reflect.get(r,"type")===L)}function q(r="default"){return{createTx(e){const t=new Map,n=e??self;return n.addEventListener("message",_=>{const{data:c}=_;if(c.channelName!==r)return;const{id:i,result:s,error:a}=c,w=t.get(i);w&&(a?w.reject(a):w.resolve(s),t.delete(i))}),new Proxy({},{get(_,c){return(...i)=>{const s=ee(),a=[],w=[];return i.forEach(M=>{U(M)?(a.push(M.value),w.push(...M.transfer)):a.push(M)}),n.postMessage({method:c,args:a,id:s,channelName:r},{transfer:w}),new Promise((M,oe)=>{t.set(s,{resolve:M,reject:oe})})}}})},rx(e,t){const n=t??self;n.addEventListener("message",async _=>{const{data:c}=_;if(c.channelName!==r)return;const{method:i,args:s,id:a}=c;try{const w=await e[i](...s);U(w)?n.postMessage({result:w.value,id:a,channelName:r},{transfer:w.transfer}):n.postMessage({result:w,id:a,channelName:r})}catch(w){n.postMessage({error:w,id:a,channelName:r})}})}}}function ee(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const{rx:te}=q(),{createTx:ne}=q("worker");function re(r){if(!(r!=null&&r.manifests))return r;const e=r.manifests,t=Object.assign(Object.create(null),e),n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&r.active_manifest&&(t[r.active_manifest]=n),r.manifests=t,r}const h=D(),l=D(),W=ne();te(_e({async initWorker(r,e){Z({module:r}),e&&C(e)},async reader_fromBlob(r,e,t){const n=await v.fromBlob(r,e,t);return h.add(n)},async reader_fromBlobFragment(r,e,t,n){const _=await v.fromBlobFragment(r,e,t,n);return h.add(_)},reader_activeLabel(r){return h.get(r).activeLabel()??null},reader_manifestStore(r){const e=h.get(r);return re(e.manifestStore())},reader_activeManifest(r){return h.get(r).activeManifest()},reader_json(r){return h.get(r).json()},reader_crJson(r){return h.get(r).crJson()},reader_resourceToBytes(r,e){const n=h.get(r).resourceToBytes(e);return I(n,n.buffer)},reader_free(r){h.get(r).free(),h.remove(r)},builder_new(r){const e=p.new(r);return l.add(e)},builder_fromJson(r,e){const t=p.fromJson(r,e);return l.add(t)},builder_fromArchive(r,e){const t=p.fromArchive(r,e);return l.add(t)},builder_setIntent(r,e){l.get(r).setIntent(e)},builder_addAction(r,e){l.get(r).addAction(e)},builder_addRedaction(r,e,t){l.get(r).addRedaction(e,t)},builder_setRemoteUrl(r,e){l.get(r).setRemoteUrl(e)},builder_setNoEmbed(r,e){l.get(r).setNoEmbed(e)},builder_setThumbnailFromBlob(r,e,t){l.get(r).setThumbnailFromBlob(e,t)},builder_addIngredient(r,e){l.get(r).addIngredient(e)},async builder_addIngredientFromBlob(r,e,t,n){await l.get(r).addIngredientFromBlob(e,t,n)},builder_addResourceFromBlob(r,e,t){l.get(r).addResourceFromBlob(e,t)},builder_getDefinition(r){return l.get(r).getDefinition()},builder_toArchive(r){const t=l.get(r).toArchive();return I(t,t.buffer)},async builder_sign(r,e,t,n,_){const i=await l.get(r).sign({reserveSize:t.reserveSize,alg:t.alg,sign:async s=>await W.sign(e,I(s,s.buffer),t.reserveSize)},n,_);return I(i,i.buffer)},async builder_signAndGetManifestBytes(r,e,t,n,_){const c=l.get(r),{manifest:i,asset:s}=await c.signAndGetManifestBytes({reserveSize:t.reserveSize,alg:t.alg,sign:async a=>await W.sign(e,I(a,a.buffer),t.reserveSize)},n,_);return I({manifest:i,asset:s},[i.buffer,s.buffer])},builder_free(r){l.get(r).free(),l.remove(r)}}));function _e(r){const e={};for(const[t,n]of Object.entries(r))e[t]=async(..._)=>{try{return await n(..._)}catch(c){throw typeof c=="string"?new Error(c):c}};return e}})();\n', p = typeof self < "u" && self.Blob && new Blob([O], { type: "text/javascript;charset=utf-8" });
4
4
  function k(e) {
5
5
  let t;
6
6
  try {
@@ -13,7 +13,7 @@ function k(e) {
13
13
  }), o;
14
14
  } catch {
15
15
  return new Worker(
16
- "data:text/javascript;charset=utf-8," + encodeURIComponent(z),
16
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(O),
17
17
  {
18
18
  name: e == null ? void 0 : e.name
19
19
  }
@@ -29,7 +29,7 @@ function J(e) {
29
29
  );
30
30
  return e.toString();
31
31
  }
32
- async function $(e) {
32
+ async function D(e) {
33
33
  const { wasm: t, settingsString: o, workerSrc: r } = e;
34
34
  let n = 0;
35
35
  const _ = r ? new Worker(J(r), { type: "module" }) : new k(), i = U(_), a = /* @__PURE__ */ new Map();
@@ -40,7 +40,7 @@ async function $(e) {
40
40
  if (a.delete(c), !m)
41
41
  throw new Error("No signer registered for request");
42
42
  const y = await m(u, f);
43
- return O(y, y.buffer);
43
+ return N(y, y.buffer);
44
44
  }
45
45
  },
46
46
  _
@@ -67,7 +67,7 @@ class R extends Error {
67
67
  super(`Unsupported format: ${t}.`), this.name = "UnsupportedFormatError";
68
68
  }
69
69
  }
70
- const P = [
70
+ const W = [
71
71
  "jpg",
72
72
  "video/mp4",
73
73
  "image/heif",
@@ -124,17 +124,19 @@ const P = [
124
124
  "avif",
125
125
  "image/webp",
126
126
  "nef",
127
- "heif"
127
+ "heif",
128
+ "jxl",
129
+ "image/jxl"
128
130
  ];
129
131
  function S(e) {
130
- return P.includes(e);
132
+ return W.includes(e);
131
133
  }
132
- const W = {
134
+ const $ = {
133
135
  userAnchors: !0,
134
136
  trustAnchors: !0,
135
137
  trustConfig: !0,
136
138
  allowedList: !0
137
- }, D = Object.keys(W), C = {
139
+ }, P = Object.keys($), C = {
138
140
  builder: {
139
141
  generateC2paArchive: !0
140
142
  }
@@ -144,33 +146,33 @@ async function b(e, t) {
144
146
  if (!o)
145
147
  return;
146
148
  const r = h(C, o), n = [];
147
- return r.trust && n.push(F(r.trust)), r.cawgTrust && n.push(F(r.cawgTrust)), await Promise.all(n), JSON.stringify(N(r));
149
+ return r.trust && n.push(x(r.trust)), r.cawgTrust && n.push(x(r.cawgTrust)), await Promise.all(n), JSON.stringify(z(r));
148
150
  }
149
- function N(e) {
151
+ function z(e) {
150
152
  return Object.entries(e).reduce(
151
- (o, [r, n]) => (o[q(r)] = typeof n == "object" && n !== null ? N(n) : n, o),
153
+ (o, [r, n]) => (o[q(r)] = typeof n == "object" && n !== null ? z(n) : n, o),
152
154
  {}
153
155
  );
154
156
  }
155
157
  function q(e) {
156
158
  return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
157
159
  }
158
- async function F(e) {
160
+ async function x(e) {
159
161
  try {
160
- const t = Object.entries(e).filter(([o]) => D.includes(o)).map(async ([o, r]) => {
162
+ const t = Object.entries(e).filter(([o]) => P.includes(o)).map(async ([o, r]) => {
161
163
  if (r && typeof r == "object" && Array.isArray(r)) {
162
164
  const n = r.map(async (a) => {
163
165
  if (typeof a != "string")
164
166
  throw new Error("Expected a string value for array item");
165
- const s = await E(a);
166
- if (x(o) && !B(s))
167
+ const s = await I(a);
168
+ if (F(o) && !B(s))
167
169
  throw new Error(`Error parsing PEM file at: ${a}`);
168
170
  return s;
169
171
  }), i = (await Promise.all(n)).join("");
170
172
  e[o] = i;
171
173
  } else if (r && typeof r == "string" && G(r)) {
172
- const n = await E(r);
173
- if (x(o) && !B(n))
174
+ const n = await I(r);
175
+ if (F(o) && !B(n))
174
176
  throw new Error(`Error parsing PEM file at: ${r}`);
175
177
  e[o] = n;
176
178
  } else
@@ -182,8 +184,8 @@ async function F(e) {
182
184
  throw new Error(`Failed to resolve trust settings. ${o}`, { cause: t });
183
185
  }
184
186
  }
185
- const x = (e) => ["userAnchors", "trustAnchors"].includes(e), B = (e) => e.includes("-----BEGIN CERTIFICATE-----"), G = (e) => e.startsWith("http");
186
- async function E(e) {
187
+ const F = (e) => ["userAnchors", "trustAnchors"].includes(e), B = (e) => e.includes("-----BEGIN CERTIFICATE-----"), G = (e) => e.startsWith("http");
188
+ async function I(e) {
187
189
  let t;
188
190
  try {
189
191
  t = await fetch(e);
@@ -215,7 +217,7 @@ function V(e, t) {
215
217
  });
216
218
  return n.register(u, c, u), u;
217
219
  } catch (s) {
218
- return I(s);
220
+ return E(s);
219
221
  }
220
222
  },
221
223
  async fromBlobFragment(_, i, a, s) {
@@ -234,12 +236,12 @@ function V(e, t) {
234
236
  });
235
237
  return n.register(f, u, f), f;
236
238
  } catch (c) {
237
- return I(c);
239
+ return E(c);
238
240
  }
239
241
  }
240
242
  };
241
243
  }
242
- function I(e) {
244
+ function E(e) {
243
245
  if (e instanceof Error && e.message === "C2pa(JumbfNotFound)")
244
246
  return null;
245
247
  throw e;
@@ -276,8 +278,8 @@ typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_was
276
278
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_wasmreader_free(e, 1));
277
279
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbg_wasmsigner_free(e, 1));
278
280
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((e) => d.__wbindgen_destroy_closure(e.a, e.b));
279
- let X = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
280
- X.decode();
281
+ let Z = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
282
+ Z.decode();
281
283
  const g = new TextEncoder();
282
284
  "encodeInto" in g || (g.encodeInto = function(e, t) {
283
285
  const o = g.encode(e);
@@ -287,15 +289,15 @@ const g = new TextEncoder();
287
289
  };
288
290
  });
289
291
  let d;
290
- const Y = "sha512-2nvIDEdLBQHSJJqGx1M7hxP8Pyg5rhmPX/Ag0CsgzbeTUrh8zdR0YpwhN8S9ifoqN+ia3BkETxLcmUFmF0ptwA==";
291
- async function M(e) {
292
+ const K = "sha512-S6dXg9jOKhTeGjD/drZj5FlsBWaDID6+K4mDRHASyxXqZ55AhbJvoZbfax+QU17YfIkiCBVvEziGPegiDuR/Ww==";
293
+ async function j(e) {
292
294
  const { alg: t } = e;
293
295
  return {
294
296
  reserveSize: await e.reserveSize(),
295
297
  alg: t
296
298
  };
297
299
  }
298
- function H(e, t) {
300
+ function X(e, t) {
299
301
  const o = t, { tx: r } = e, n = new FinalizationRegistry((_) => {
300
302
  r.builder_free(_);
301
303
  });
@@ -359,7 +361,7 @@ function l(e, t, o) {
359
361
  return await r.builder_toArchive(t);
360
362
  },
361
363
  async sign(n, _, i) {
362
- const a = await M(n), s = e.registerSignReceiver(n.sign);
364
+ const a = await j(n), s = e.registerSignReceiver(n.sign);
363
365
  return await r.builder_sign(
364
366
  t,
365
367
  s,
@@ -369,7 +371,7 @@ function l(e, t, o) {
369
371
  );
370
372
  },
371
373
  async signAndGetManifestBytes(n, _, i) {
372
- const a = await M(n), s = e.registerSignReceiver(n.sign);
374
+ const a = await j(n), s = e.registerSignReceiver(n.sign);
373
375
  return await r.builder_signAndGetManifestBytes(
374
376
  t,
375
377
  s,
@@ -384,19 +386,19 @@ function l(e, t, o) {
384
386
  };
385
387
  }
386
388
  async function ne(e) {
387
- const { wasmSrc: t, workerSrc: o, settings: r } = e, n = typeof t == "string" ? await K(t) : t, _ = await b(r, void 0), i = await $({ wasm: n, workerSrc: o, settingsString: _ });
389
+ const { wasmSrc: t, workerSrc: o, settings: r } = e, n = typeof t == "string" ? await Y(t) : t, _ = await b(r, void 0), i = await D({ wasm: n, workerSrc: o, settingsString: _ });
388
390
  return {
389
391
  reader: V(i, r),
390
- builder: H(i, r),
392
+ builder: X(i, r),
391
393
  dispose: i.terminate
392
394
  };
393
395
  }
394
- async function K(e) {
395
- const t = await fetch(e, { integrity: Y });
396
+ async function Y(e) {
397
+ const t = await fetch(e, { integrity: K });
396
398
  return await WebAssembly.compileStreaming(t);
397
399
  }
398
400
  export {
399
- P as R,
401
+ W as R,
400
402
  ne as c,
401
403
  S as i
402
404
  };
@@ -1,5 +1,5 @@
1
1
  var V = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
2
- var ie = V((ae, C) => {
2
+ var se = V((ue, C) => {
3
3
  class h {
4
4
  static __wrap(e) {
5
5
  const t = Object.create(h.prototype);
@@ -305,12 +305,12 @@ var ie = V((ae, C) => {
305
305
  }
306
306
  }
307
307
  Symbol.dispose && (F.prototype[Symbol.dispose] = F.prototype.free);
308
- function G(r) {
308
+ function P(r) {
309
309
  const e = b(r, o.__wbindgen_malloc, o.__wbindgen_realloc), t = u, n = o.loadSettings(e, t);
310
310
  if (n[1])
311
311
  throw d(n[0]);
312
312
  }
313
- function P() {
313
+ function G() {
314
314
  return {
315
315
  __proto__: null,
316
316
  "./c2pa_bg.js": {
@@ -330,7 +330,7 @@ var ie = V((ae, C) => {
330
330
  return w(n) ? 16777215 : n ? 1 : 0;
331
331
  },
332
332
  __wbg___wbindgen_debug_string_0accd80f45e5faa2: function(e, t) {
333
- const n = O(t), _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = u;
333
+ const n = E(t), _ = b(n, o.__wbindgen_malloc, o.__wbindgen_realloc), c = u;
334
334
  m().setInt32(e + 4, c, !0), m().setInt32(e + 0, _, !0);
335
335
  },
336
336
  __wbg___wbindgen_in_70a403a56e771704: function(e, t) {
@@ -776,15 +776,15 @@ var ie = V((ae, C) => {
776
776
  };
777
777
  }
778
778
  function $(r, e) {
779
- o.wasm_bindgen__convert__closures_____invoke__h9ad77c532ffa5b9e(r, e);
779
+ o.wasm_bindgen__convert__closures_____invoke__h8da1d8dbbd4ddc9b(r, e);
780
780
  }
781
781
  function H(r, e, t) {
782
- const n = o.wasm_bindgen__convert__closures_____invoke__hf2acc361175a8d00(r, e, t);
782
+ const n = o.wasm_bindgen__convert__closures_____invoke__h2e10f36d601ef68f(r, e, t);
783
783
  if (n[1])
784
784
  throw d(n[0]);
785
785
  }
786
786
  function X(r, e, t, n) {
787
- o.wasm_bindgen__convert__closures_____invoke__h53f6302d12a3bd57(r, e, t, n);
787
+ o.wasm_bindgen__convert__closures_____invoke__h19a27e34ad664b98(r, e, t, n);
788
788
  }
789
789
  const Y = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"], K = ["omit", "same-origin", "include"], Q = ["same-origin", "no-cors", "cors", "navigate"], x = typeof FinalizationRegistry > "u" ? { register: () => {
790
790
  }, unregister: () => {
@@ -799,7 +799,7 @@ var ie = V((ae, C) => {
799
799
  const N = typeof FinalizationRegistry > "u" ? { register: () => {
800
800
  }, unregister: () => {
801
801
  } } : new FinalizationRegistry((r) => o.__wbindgen_destroy_closure(r.a, r.b));
802
- function O(r) {
802
+ function E(r) {
803
803
  const e = typeof r;
804
804
  if (e == "number" || e == "boolean" || r == null)
805
805
  return `${r}`;
@@ -816,9 +816,9 @@ var ie = V((ae, C) => {
816
816
  if (Array.isArray(r)) {
817
817
  const _ = r.length;
818
818
  let c = "[";
819
- _ > 0 && (c += O(r[0]));
819
+ _ > 0 && (c += E(r[0]));
820
820
  for (let i = 1; i < _; i++)
821
- c += ", " + O(r[i]);
821
+ c += ", " + E(r[i]);
822
822
  return c += "]", c;
823
823
  }
824
824
  const t = /\[object ([^\]]+)\]/.exec(toString.call(r));
@@ -837,7 +837,7 @@ var ie = V((ae, C) => {
837
837
  ${r.stack}` : n;
838
838
  }
839
839
  function v(r, e) {
840
- return r = r >>> 0, M().subarray(r / 1, r / 1 + e);
840
+ return r = r >>> 0, B().subarray(r / 1, r / 1 + e);
841
841
  }
842
842
  let A = null;
843
843
  function m() {
@@ -846,9 +846,9 @@ ${r.stack}` : n;
846
846
  function y(r, e) {
847
847
  return ee(r >>> 0, e);
848
848
  }
849
- let B = null;
850
- function M() {
851
- return (B === null || B.byteLength === 0) && (B = new Uint8Array(o.memory.buffer)), B;
849
+ let R = null;
850
+ function B() {
851
+ return (R === null || R.byteLength === 0) && (R = new Uint8Array(o.memory.buffer)), R;
852
852
  }
853
853
  function f(r, e) {
854
854
  try {
@@ -879,10 +879,10 @@ ${r.stack}` : n;
879
879
  function b(r, e, t) {
880
880
  if (t === void 0) {
881
881
  const s = T.encode(r), a = e(s.length, 1) >>> 0;
882
- return M().subarray(a, a + s.length).set(s), u = s.length, a;
882
+ return B().subarray(a, a + s.length).set(s), u = s.length, a;
883
883
  }
884
884
  let n = r.length, _ = e(n, 1) >>> 0;
885
- const c = M();
885
+ const c = B();
886
886
  let i = 0;
887
887
  for (; i < n; i++) {
888
888
  const s = r.charCodeAt(i);
@@ -891,7 +891,7 @@ ${r.stack}` : n;
891
891
  }
892
892
  if (i !== n) {
893
893
  i !== 0 && (r = r.slice(i)), _ = t(_, n, n = i + r.length * 3, 1) >>> 0;
894
- const s = M().subarray(_ + i, _ + n), a = T.encodeInto(r, s);
894
+ const s = B().subarray(_ + i, _ + n), a = T.encodeInto(r, s);
895
895
  i += a.written, _ = t(_, n, i, 1) >>> 0;
896
896
  }
897
897
  return u = i, _;
@@ -900,12 +900,12 @@ ${r.stack}` : n;
900
900
  const e = o.__wbindgen_externrefs.get(r);
901
901
  return o.__externref_table_dealloc(r), e;
902
902
  }
903
- let E = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
904
- E.decode();
903
+ let j = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
904
+ j.decode();
905
905
  const Z = 2146435072;
906
- let j = 0;
906
+ let O = 0;
907
907
  function ee(r, e) {
908
- return j += e, j >= Z && (E = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), E.decode(), j = e), E.decode(M().subarray(r, r + e));
908
+ return O += e, O >= Z && (j = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), j.decode(), O = e), j.decode(B().subarray(r, r + e));
909
909
  }
910
910
  const T = new TextEncoder();
911
911
  "encodeInto" in T || (T.encodeInto = function(r, e) {
@@ -917,12 +917,12 @@ ${r.stack}` : n;
917
917
  });
918
918
  let u = 0, o;
919
919
  function te(r, e) {
920
- return o = r.exports, A = null, B = null, o.__wbindgen_start(), o;
920
+ return o = r.exports, A = null, R = null, o.__wbindgen_start(), o;
921
921
  }
922
922
  function ne(r) {
923
923
  if (o !== void 0) return o;
924
924
  r !== void 0 && (Object.getPrototypeOf(r) === Object.prototype ? { module: r } = r : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
925
- const e = P();
925
+ const e = G();
926
926
  r instanceof WebAssembly.Module || (r = new WebAssembly.Module(r));
927
927
  const t = new WebAssembly.Instance(r, e);
928
928
  return te(t);
@@ -947,7 +947,7 @@ ${r.stack}` : n;
947
947
  };
948
948
  }
949
949
  const q = Symbol("transfer");
950
- function R(r, e) {
950
+ function M(r, e) {
951
951
  return {
952
952
  type: q,
953
953
  value: r,
@@ -1009,11 +1009,18 @@ ${r.stack}` : n;
1009
1009
  function re() {
1010
1010
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
1011
1011
  }
1012
- const { rx: _e } = W(), { createTx: oe } = W("worker"), p = U(), l = U(), L = oe();
1012
+ const { rx: _e } = W(), { createTx: oe } = W("worker");
1013
+ function ce(r) {
1014
+ if (!(r != null && r.manifests))
1015
+ return r;
1016
+ const e = r.manifests, t = Object.assign(/* @__PURE__ */ Object.create(null), e), n = Object.getPrototypeOf(e);
1017
+ return n !== null && n !== Object.prototype && r.active_manifest && (t[r.active_manifest] = n), r.manifests = t, r;
1018
+ }
1019
+ const p = U(), l = U(), L = oe();
1013
1020
  _e(
1014
- ce({
1021
+ ie({
1015
1022
  async initWorker(r, e) {
1016
- ne({ module: r }), e && G(e);
1023
+ ne({ module: r }), e && P(e);
1017
1024
  },
1018
1025
  async reader_fromBlob(r, e, t) {
1019
1026
  const n = await F.fromBlob(r, e, t);
@@ -1032,7 +1039,8 @@ ${r.stack}` : n;
1032
1039
  return p.get(r).activeLabel() ?? null;
1033
1040
  },
1034
1041
  reader_manifestStore(r) {
1035
- return p.get(r).manifestStore();
1042
+ const e = p.get(r);
1043
+ return ce(e.manifestStore());
1036
1044
  },
1037
1045
  reader_activeManifest(r) {
1038
1046
  return p.get(r).activeManifest();
@@ -1045,7 +1053,7 @@ ${r.stack}` : n;
1045
1053
  },
1046
1054
  reader_resourceToBytes(r, e) {
1047
1055
  const n = p.get(r).resourceToBytes(e);
1048
- return R(n, n.buffer);
1056
+ return M(n, n.buffer);
1049
1057
  },
1050
1058
  reader_free(r) {
1051
1059
  p.get(r).free(), p.remove(r);
@@ -1094,7 +1102,7 @@ ${r.stack}` : n;
1094
1102
  },
1095
1103
  builder_toArchive(r) {
1096
1104
  const t = l.get(r).toArchive();
1097
- return R(t, t.buffer);
1105
+ return M(t, t.buffer);
1098
1106
  },
1099
1107
  async builder_sign(r, e, t, n, _) {
1100
1108
  const i = await l.get(r).sign(
@@ -1103,14 +1111,14 @@ ${r.stack}` : n;
1103
1111
  alg: t.alg,
1104
1112
  sign: async (s) => await L.sign(
1105
1113
  e,
1106
- R(s, s.buffer),
1114
+ M(s, s.buffer),
1107
1115
  t.reserveSize
1108
1116
  )
1109
1117
  },
1110
1118
  n,
1111
1119
  _
1112
1120
  );
1113
- return R(i, i.buffer);
1121
+ return M(i, i.buffer);
1114
1122
  },
1115
1123
  async builder_signAndGetManifestBytes(r, e, t, n, _) {
1116
1124
  const c = l.get(r), { manifest: i, asset: s } = await c.signAndGetManifestBytes(
@@ -1119,14 +1127,14 @@ ${r.stack}` : n;
1119
1127
  alg: t.alg,
1120
1128
  sign: async (a) => await L.sign(
1121
1129
  e,
1122
- R(a, a.buffer),
1130
+ M(a, a.buffer),
1123
1131
  t.reserveSize
1124
1132
  )
1125
1133
  },
1126
1134
  n,
1127
1135
  _
1128
1136
  );
1129
- return R(
1137
+ return M(
1130
1138
  {
1131
1139
  manifest: i,
1132
1140
  asset: s
@@ -1139,7 +1147,7 @@ ${r.stack}` : n;
1139
1147
  }
1140
1148
  })
1141
1149
  );
1142
- function ce(r) {
1150
+ function ie(r) {
1143
1151
  const e = {};
1144
1152
  for (const [t, n] of Object.entries(r))
1145
1153
  e[t] = async (..._) => {
@@ -1152,4 +1160,4 @@ ${r.stack}` : n;
1152
1160
  return e;
1153
1161
  }
1154
1162
  });
1155
- export default ie();
1163
+ export default se();
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as r, c as R, i as o } from "./c2pa-BhHHemvP.js";
1
+ import { R as r, c as R, i as o } from "./c2pa-Sp6ssDto.js";
2
2
  export {
3
3
  r as READER_SUPPORTED_FORMATS,
4
4
  R as createC2pa,