space-data-module-sdk 0.13.1 → 0.14.0

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.
Files changed (72) hide show
  1. package/bin/space-data-module.js +2 -1
  2. package/docs/_shell/consumer-assets.html +1 -1
  3. package/docs/assets/sdn-chrome/sdn-chrome.js +7 -3
  4. package/docs/assets/vendor/sdn-stack-nav/{1.2.0/sdn-stack-nav.ba268c55a1551bcacc390ac01347c319335a1660787b55b4b239df00fc3c1a4c.js → 1.3.0/sdn-stack-nav.2e5d4efc654388c85b79e53b1b148268e4083d9252f2a367ea257ccb50d270cd.js} +5 -0
  5. package/docs/browser-wasmedge-isomorphic.html +1 -1
  6. package/docs/byo-wasm-quickstart.html +1 -1
  7. package/docs/conformance.html +1 -1
  8. package/docs/events-abi.html +1 -1
  9. package/docs/families/analytics.html +1 -1
  10. package/docs/families/attitude.html +1 -1
  11. package/docs/families/behavior.html +1 -1
  12. package/docs/families/breakup.html +1 -1
  13. package/docs/families/conjunction.html +1 -1
  14. package/docs/families/data-source.html +2 -2
  15. package/docs/families/effects.html +1 -1
  16. package/docs/families/environment.html +1 -1
  17. package/docs/families/estimation.html +1 -1
  18. package/docs/families/gnc.html +1 -1
  19. package/docs/families/maneuver.html +1 -1
  20. package/docs/families/obstruction.html +1 -1
  21. package/docs/families/propagator.html +1 -1
  22. package/docs/families/propulsion.html +1 -1
  23. package/docs/families/reentry.html +1 -1
  24. package/docs/families/rf.html +1 -1
  25. package/docs/families/scheduler.html +1 -1
  26. package/docs/families/sensor.html +1 -1
  27. package/docs/families/signature.html +1 -1
  28. package/docs/flatsql-host-contract.html +1 -1
  29. package/docs/flatsql-streaming-standard.html +1 -1
  30. package/docs/gpu-module-abi.html +1 -1
  31. package/docs/index.html +1 -1
  32. package/docs/isomorphic-pthreads.html +1 -1
  33. package/docs/isomorphic-sdn-runtime-plan.html +1 -1
  34. package/docs/language-runtime-matrix.html +1 -1
  35. package/docs/module-bundle-runtime-plan.html +1 -1
  36. package/docs/module-publication-standard.html +10 -7
  37. package/docs/module-publication-standard.md +25 -11
  38. package/docs/node-red-default-node-parity.html +1 -1
  39. package/docs/protect-and-sign.html +9 -7
  40. package/docs/protect-and-sign.md +39 -9
  41. package/docs/protocol-installation.html +1 -1
  42. package/docs/provider-access-abi.md +7 -1
  43. package/docs/publication-submission.html +1 -1
  44. package/docs/secrets-capability.html +1 -1
  45. package/docs/testing-harness.html +1 -1
  46. package/docs/tri-runtime-parity-gate.html +1 -1
  47. package/docs/tri-runtime-parity.html +1 -1
  48. package/package.json +4 -4
  49. package/src/bundle/sdkTestSigner.js +41 -0
  50. package/src/bundle/sigdomain.js +2 -2
  51. package/src/bundle/signing.js +214 -36
  52. package/src/compiler/compileModule.js +4 -2
  53. package/src/flow/flowCompiler.js +7 -4
  54. package/src/generated/spacedatastandards/plg/PLG.d.ts +15 -3
  55. package/src/generated/spacedatastandards/plg/PLG.d.ts.map +1 -1
  56. package/src/generated/spacedatastandards/plg/PLG.js +18 -6
  57. package/src/generated/spacedatastandards/plg/PLG.ts +31 -6
  58. package/src/host/browserHost.js +56 -6
  59. package/src/host/hostWorkerBundleSources.js +3 -3
  60. package/src/host/nodeHost.js +60 -3
  61. package/src/host/providerAccessAbi.js +17 -3
  62. package/src/host/providerAccessFixtureAdapter.js +14 -4
  63. package/src/host/providerAccessTileStoreAdapter.js +5 -1
  64. package/src/index.d.ts +61 -12
  65. package/src/licensing/records.js +18 -0
  66. package/src/manifest/plgCodec.js +22 -0
  67. package/src/transport/index.js +7 -0
  68. package/src/transport/pki.js +331 -172
  69. package/src/transport/records.js +98 -24
  70. package/src/utils/encoding.js +57 -2
  71. package/src/utils/wasmCrypto.js +187 -0
  72. /package/docs/assets/vendor/sdn-stack-nav/{1.2.0 → 1.3.0}/sdn-stack-nav.36a36359ce18322185e9ff179f88175bab67d5ad84a14d9c08a54f2ff27267e7.css +0 -0
@@ -2,9 +2,9 @@
2
2
  // Self-contained classic-script worker bundles, spawned from blob: URLs
3
3
  // (design A39). Rebuild after changing any file they bundle.
4
4
 
5
- /** src/host/wasiThreadBrowserWorker.mjs, sha256 517c4666d450e9f7cc71fb8f5386c09f55773c453b73ec5b67c92b5ed4ea4eea. */
6
- export const WASI_THREAD_POOL_WORKER_BUNDLE = "(()=>{var oa=Object.defineProperty;var aa=(e,t)=>{for(var s in t)oa(e,s,{get:t[s],enumerable:!0})};var fa=new TextDecoder;function Ht(e){return fa.decode(e.slice())}var ha=new TextEncoder,Ye=\"$bin\";function ca(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function ua(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function pe(e,t){if(e==null)return e??null;if(ca(e)){let s=t.length;return t.push(ua(e)),{[Ye]:s}}return e instanceof Date?e.toISOString():typeof e==\"bigint\"?e.toString():Array.isArray(e)?e.map(s=>pe(s,t)):typeof e==\"object\"?Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0).map(([s,i])=>[s,pe(i,t)])):e}function vt(e,t){if(e==null)return e;if(Array.isArray(e))return e.map(s=>vt(s,t));if(typeof e==\"object\"){let s=Object.keys(e);if(s.length===1&&s[0]===Ye){let i=e[Ye];if(!Number.isInteger(i)||i<0||i>=t.length)throw new RangeError(`Hostcall envelope references missing binary segment ${i}.`);return t[i]}return Object.fromEntries(s.map(i=>[i,vt(e[i],t)]))}return e}function qe(e,t=[]){let s=ha.encode(JSON.stringify(e??null)),i=4+s.length+4;for(let l of t)i+=4+l.length;let r=new Uint8Array(i),o=new DataView(r.buffer),a=0;o.setUint32(a,s.length,!0),a+=4,r.set(s,a),a+=s.length,o.setUint32(a,t.length,!0),a+=4;for(let l of t)o.setUint32(a,l.length,!0),a+=4,r.set(l,a),a+=l.length;return r}function Ie(e){if(!(e instanceof Uint8Array))throw new TypeError(\"Hostcall envelope must be a Uint8Array.\");if(e.length<8)throw new RangeError(\"Hostcall envelope is truncated.\");let t=new DataView(e.buffer,e.byteOffset,e.byteLength),s=0,i=t.getUint32(s,!0);if(s+=4,s+i+4>e.length)throw new RangeError(\"Hostcall envelope meta exceeds envelope bounds.\");let r=JSON.parse(Ht(e.subarray(s,s+i)));s+=i;let o=t.getUint32(s,!0);s+=4;let a=[];for(let l=0;l<o;l+=1){if(s+4>e.length)throw new RangeError(\"Hostcall envelope segment table is truncated.\");let E=t.getUint32(s,!0);if(s+=4,s+E>e.length)throw new RangeError(\"Hostcall envelope segment exceeds envelope bounds.\");a.push(e.subarray(s,s+E)),s+=E}return{meta:r,segments:a}}function Qi(e){let{meta:t,segments:s}=Ie(e);return vt(t,s)}var lt=new Int32Array(2),Se=new Float32Array(lt.buffer),Ae=new Float64Array(lt.buffer),Mt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var $t;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})($t||($t={}));var yt=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return lt[0]=this.readInt32(t),Se[0]}readFloat64(t){return lt[Mt?0:1]=this.readInt32(t),lt[Mt?1:0]=this.readInt32(t+4),Ae[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){Se[0]=s,this.writeInt32(t,lt[0])}writeFloat64(t,s){Ae[0]=s,this.writeInt32(t,lt[Mt?0:1]),this.writeInt32(t+4,lt[Mt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===$t.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var Zt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=yt.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=yt.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,l=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(l+_)!=this.bb.readInt16(E+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var la=Object.defineProperty,Ea=(e,t,s)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t,s)=>Ea(e,typeof t!=\"symbol\"?t+\"\":t,s),Bt=class e{constructor(){je(this,\"bb\",null),je(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigTable(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigTable(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigTable(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endConfigTable(t){return t.endObject()}static createConfigTable(t,s){return e.startConfigTable(t),e.addEntries(t,s),e.endConfigTable(t)}unpack(){return new Ft(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Ft=class{constructor(t=[]){je(this,\"ENTRIES\",t)}pack(t){let s=Bt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Bt.createConfigTable(t,s)}};var $=(e=>(e[e.String=0]=\"String\",e[e.Number=1]=\"Number\",e[e.Bool=2]=\"Bool\",e[e.StringList=3]=\"StringList\",e[e.NumberList=4]=\"NumberList\",e[e.TableList=5]=\"TableList\",e))($||{});var _a=Object.defineProperty,da=(e,t,s)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_t=(e,t,s)=>da(e,typeof t!=\"symbol\"?t+\"\":t,s),Et=class e{constructor(){_t(this,\"bb\",null),_t(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigEntry(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigEntry(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}KEY(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}KIND(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):$.String}STRING_VALUE(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}NUMBER_VALUE(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb_pos+t):0}BOOL_VALUE(){let t=this.bb.__offset(this.bb_pos,12);return t?!!this.bb.readInt8(this.bb_pos+t):!1}STRINGS(t,s){let i=this.bb.__offset(this.bb_pos,14);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+t*4,s):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}NUMBERS(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.readFloat64(this.bb.__vector(this.bb_pos+s)+t*8):0}numbersLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}numbersArray(){let t=this.bb.__offset(this.bb_pos,16);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TABLES(t,s){let i=this.bb.__offset(this.bb_pos,18);return i?(s||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}tablesLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigEntry(t){t.startObject(8)}static addKey(t,s){t.addFieldOffset(0,s,0)}static addKind(t,s){t.addFieldInt8(1,s,$.String)}static addStringValue(t,s){t.addFieldOffset(2,s,0)}static addNumberValue(t,s){t.addFieldFloat64(3,s,0)}static addBoolValue(t,s){t.addFieldInt8(4,+s,0)}static addStrings(t,s){t.addFieldOffset(5,s,0)}static createStringsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startStringsVector(t,s){t.startVector(4,s,4)}static addNumbers(t,s){t.addFieldOffset(6,s,0)}static createNumbersVector(t,s){t.startVector(8,s.length,8);for(let i=s.length-1;i>=0;i--)t.addFloat64(s[i]);return t.endVector()}static startNumbersVector(t,s){t.startVector(8,s,8)}static addTables(t,s){t.addFieldOffset(7,s,0)}static createTablesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startTablesVector(t,s){t.startVector(4,s,4)}static endConfigEntry(t){let s=t.endObject();return t.requiredField(s,4),s}static createConfigEntry(t,s,i,r,o,a,l,E,_){return e.startConfigEntry(t),e.addKey(t,s),e.addKind(t,i),e.addStringValue(t,r),e.addNumberValue(t,o),e.addBoolValue(t,a),e.addStrings(t,l),e.addNumbers(t,E),e.addTables(t,_),e.endConfigEntry(t)}unpack(){return new Qt(this.KEY(),this.KIND(),this.STRING_VALUE(),this.NUMBER_VALUE(),this.BOOL_VALUE(),this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),this.bb.createObjList(this.TABLES.bind(this),this.tablesLength()))}unpackTo(t){t.KEY=this.KEY(),t.KIND=this.KIND(),t.STRING_VALUE=this.STRING_VALUE(),t.NUMBER_VALUE=this.NUMBER_VALUE(),t.BOOL_VALUE=this.BOOL_VALUE(),t.STRINGS=this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),t.NUMBERS=this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),t.TABLES=this.bb.createObjList(this.TABLES.bind(this),this.tablesLength())}},Qt=class{constructor(t=null,s=$.String,i=null,r=0,o=!1,a=[],l=[],E=[]){_t(this,\"KEY\",t),_t(this,\"KIND\",s),_t(this,\"STRING_VALUE\",i),_t(this,\"NUMBER_VALUE\",r),_t(this,\"BOOL_VALUE\",o),_t(this,\"STRINGS\",a),_t(this,\"NUMBERS\",l),_t(this,\"TABLES\",E)}pack(t){let s=this.KEY!==null?t.createString(this.KEY):0,i=this.STRING_VALUE!==null?t.createString(this.STRING_VALUE):0,r=Et.createStringsVector(t,t.createObjectOffsetList(this.STRINGS)),o=Et.createNumbersVector(t,this.NUMBERS),a=Et.createTablesVector(t,t.createObjectOffsetList(this.TABLES));return Et.createConfigEntry(t,s,this.KIND,i,this.NUMBER_VALUE,this.BOOL_VALUE,r,o,a)}};var wt=(e=>(e[e.Unchanged=0]=\"Unchanged\",e[e.Skipped=1]=\"Skipped\",e[e.Missing=2]=\"Missing\",e[e.Expired=3]=\"Expired\",e[e.Info=4]=\"Info\",e))(wt||{});var Vt=(e=>(e[e.Duplicates=0]=\"Duplicates\",e[e.None=1]=\"None\",e[e.Current=2]=\"Current\",e))(Vt||{});var pa=Object.defineProperty,Ia=(e,t,s)=>t in e?pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ke=(e,t,s)=>Ia(e,typeof t!=\"symbol\"?t+\"\":t,s),xt=class e{constructor(){Ke(this,\"bb\",null),Ke(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsModuleConfig(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModuleConfig(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"MCFG\")}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new Et).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startModuleConfig(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endModuleConfig(t){return t.endObject()}static finishModuleConfigBuffer(t,s){t.finish(s,\"MCFG\")}static finishSizePrefixedModuleConfigBuffer(t,s){t.finish(s,\"MCFG\",!0)}static createModuleConfig(t,s){return e.startModuleConfig(t),e.addEntries(t,s),e.endModuleConfig(t)}unpack(){return new zt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},zt=class{constructor(t=[]){Ke(this,\"ENTRIES\",t)}pack(t){let s=xt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return xt.createModuleConfig(t,s)}};var Gt={};aa(Gt,{BodyRef:()=>Re,BoolValue:()=>ba,CacheKeyParams:()=>$a,ContextParams:()=>Uf,CountValue:()=>Ta,CronField:()=>bf,CryptoParams:()=>Za,EnvVar:()=>Cf,EpochStreamParams:()=>ka,ExecParams:()=>Lf,ExecResult:()=>Pf,FsEntry:()=>Nf,FsParams:()=>yf,FsStat:()=>Df,HasCapabilityParams:()=>ma,HttpParams:()=>ya,HttpResult:()=>Na,IpfsLink:()=>ef,IpfsParams:()=>Ja,IpfsPin:()=>sf,IpfsResult:()=>tf,IpfsSwarmPeer:()=>rf,KeyslotParams:()=>Qa,MqttParams:()=>Tf,MqttResult:()=>Of,NodeActivityEvent:()=>If,NodeActivityParams:()=>pf,NodeBandwidthSample:()=>df,NodeStatusReport:()=>_f,NumberValue:()=>Ra,P2pLatestDataset:()=>Ef,P2pParams:()=>ff,P2pPeer:()=>cf,P2pPeerValue:()=>uf,P2pPnmEntry:()=>lf,P2pSummary:()=>hf,ProtocolParams:()=>af,Provenance:()=>Ba,ProvenanceAttribute:()=>Fa,PubsubParams:()=>nf,PubsubSubscribed:()=>of,QuerySurfaceLimits:()=>Wa,RandomBytesParams:()=>ga,SandboxQueryParams:()=>Ya,SandboxQueryResult:()=>qa,ScheduleParams:()=>Af,SecretParams:()=>za,SecretResult:()=>Xa,SocketParams:()=>mf,SocketResult:()=>gf,SqlStreamParams:()=>xa,StorageDeleteParams:()=>Ua,StorageExpireParams:()=>Ha,StorageExpireResult:()=>va,StorageIngestParams:()=>Ma,StorageIngestResult:()=>Va,StorageQueryParams:()=>Da,StorageWriteParams:()=>Ca,StorageWriteResult:()=>Pa,StoredRecordMeta:()=>La,StreamResult:()=>Ga,SurfaceColumn:()=>Ka,SurfaceTable:()=>ja,TextValue:()=>Oa,TimeValue:()=>wa,TimersDelayParams:()=>Sf,WebsocketParams:()=>Rf,WebsocketResult:()=>wf});var Sa=Object.defineProperty,Aa=(e,t,s)=>t in e?Sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t,s)=>Aa(e,typeof t!=\"symbol\"?t+\"\":t,s);function f(e,t,s){let i=Math.floor(s/8),r=1<<s%8;return(e.getUint8(t+i)&r)!==0}function h(e,t,s,i){let r=Math.floor(s/8),o=1<<s%8,a=e.getUint8(t+r);e.setUint8(t+r,i?a|o:a&~o)}function c(e,t,s){let i=Math.min(e.getUint8(t),s),r=new Uint8Array(e.buffer,e.byteOffset+t+1,i);return new TextDecoder().decode(r)}function u(e,t,s,i){let o=new TextEncoder().encode(i),a=Math.min(o.length,s);e.setUint8(t,a);let l=new Uint8Array(e.buffer,e.byteOffset+t+1,s);l.fill(0),l.set(o.subarray(0,a))}var We=class Xi{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xi(t,s)}vALUE(){return this.view.getUint8(this.offset+0)!==0}setVALUE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(We,\"SIZE\",1);n(We,\"ALIGN\",1);var ba=We,$e=class Ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ji(t,s)}vALUE(){return this.view.getFloat64(this.offset+0,!0)}setVALUE(t){this.view.setFloat64(this.offset+0,t,!0)}};n($e,\"SIZE\",8);n($e,\"ALIGN\",8);var Ra=$e,Ze=class tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tr(t,s)}uNIX_MS(){return this.view.getBigUint64(this.offset+0,!0)}setUNIX_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(Ze,\"SIZE\",8);n(Ze,\"ALIGN\",8);var wa=Ze,Qe=class er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new er(t,s)}vALUE(){return this.view.getBigUint64(this.offset+0,!0)}setVALUE(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(Qe,\"SIZE\",8);n(Qe,\"ALIGN\",8);var Ta=Qe,ze=class sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sr(t,s)}hasVALUE(){return f(this.view,this.offset,0)}setHasVALUE(t){h(this.view,this.offset,0,t)}vALUE(){return c(this.view,this.offset+1,255)}setVALUE(t){u(this.view,this.offset+1,255,t),this.setHasVALUE(!0)}};n(ze,\"SIZE\",257);n(ze,\"ALIGN\",1);var Oa=ze,Xe=class ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ir(t,s)}tOKEN(){return this.view.getBigUint64(this.offset+8,!0)}setTOKEN(t){this.view.setBigUint64(this.offset+8,t,!0)}sIZE(){return this.view.getBigUint64(this.offset+16,!0)}setSIZE(t){this.view.setBigUint64(this.offset+16,t,!0)}fRAMES(){return this.view.getBigInt64(this.offset+24,!0)}setFRAMES(t){this.view.setBigInt64(this.offset+24,t,!0)}hasFNV1A64(){return f(this.view,this.offset,0)}setHasFNV1A64(t){h(this.view,this.offset,0,t)}fNV1A64(){return c(this.view,this.offset+32,16)}setFNV1A64(t){u(this.view,this.offset+32,16,t),this.setHasFNV1A64(!0)}};n(Xe,\"SIZE\",56);n(Xe,\"ALIGN\",8);var Re=Xe,Je=class rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rr(t,s)}hasCAPABILITY(){return f(this.view,this.offset,0)}setHasCAPABILITY(t){h(this.view,this.offset,0,t)}cAPABILITY(){return c(this.view,this.offset+1,64)}setCAPABILITY(t){u(this.view,this.offset+1,64,t),this.setHasCAPABILITY(!0)}};n(Je,\"SIZE\",66);n(Je,\"ALIGN\",1);var ma=Je,ts=class nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nr(t,s)}lENGTH(){return this.view.getUint32(this.offset+0,!0)}setLENGTH(t){this.view.setUint32(this.offset+0,t,!0)}};n(ts,\"SIZE\",4);n(ts,\"ALIGN\",4);var ga=ts,es=class or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new or(t,s)}hasMETHOD(){return f(this.view,this.offset,0)}setHasMETHOD(t){h(this.view,this.offset,0,t)}mETHOD(){return c(this.view,this.offset+1,16)}setMETHOD(t){u(this.view,this.offset+1,16,t),this.setHasMETHOD(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+20,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+20,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}nO_REDIRECTS(){return this.view.getUint8(this.offset+32)!==0}setNO_REDIRECTS(t){this.view.setUint8(this.offset+32,t?1:0)}};n(es,\"SIZE\",40);n(es,\"ALIGN\",8);var ya=es,ss=class ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ar(t,s)}sTATUS(){return this.view.getInt32(this.offset+0,!0)}setSTATUS(t){this.view.setInt32(this.offset+0,t,!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+8,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}};n(ss,\"SIZE\",16);n(ss,\"ALIGN\",8);var Na=ss,is=class fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasDAY(){return f(this.view,this.offset,1)}setHasDAY(t){h(this.view,this.offset,1,t)}dAY(){return c(this.view,this.offset+66,16)}setDAY(t){u(this.view,this.offset+66,16,t),this.setHasDAY(!0)}hasENTITY_ID(){return f(this.view,this.offset,2)}setHasENTITY_ID(t){h(this.view,this.offset,2,t)}eNTITY_ID(){return c(this.view,this.offset+83,255)}setENTITY_ID(t){u(this.view,this.offset+83,255,t),this.setHasENTITY_ID(!0)}nORAD_CAT_ID(){return this.view.getUint32(this.offset+340,!0)}setNORAD_CAT_ID(t){this.view.setUint32(this.offset+340,t,!0)}lIMIT(){return this.view.getUint32(this.offset+344,!0)}setLIMIT(t){this.view.setUint32(this.offset+344,t,!0)}};n(is,\"SIZE\",348);n(is,\"ALIGN\",4);var Da=is,rs=class hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}rOW_ID(){return this.view.getBigInt64(this.offset+136,!0)}setROW_ID(t){this.view.setBigInt64(this.offset+136,t,!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+144,128)}setPEER_ID(t){u(this.view,this.offset+144,128,t),this.setHasPEER_ID(!0)}tIMESTAMP_MS(){return this.view.getBigInt64(this.offset+280,!0)}setTIMESTAMP_MS(t){this.view.setBigInt64(this.offset+280,t,!0)}mATERIALIZED_MS(){return this.view.getBigInt64(this.offset+288,!0)}setMATERIALIZED_MS(t){this.view.setBigInt64(this.offset+288,t,!0)}lENGTH(){return this.view.getUint32(this.offset+296,!0)}setLENGTH(t){this.view.setUint32(this.offset+296,t,!0)}hasPROVIDER_ID(){return f(this.view,this.offset,2)}setHasPROVIDER_ID(t){h(this.view,this.offset,2,t)}pROVIDER_ID(){return c(this.view,this.offset+300,128)}setPROVIDER_ID(t){u(this.view,this.offset+300,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,3)}setHasSOURCE_NAME(t){h(this.view,this.offset,3,t)}sOURCE_NAME(){return c(this.view,this.offset+429,128)}setSOURCE_NAME(t){u(this.view,this.offset+429,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,4)}setHasBATCH_ID(t){h(this.view,this.offset,4,t)}bATCH_ID(){return c(this.view,this.offset+558,128)}setBATCH_ID(t){u(this.view,this.offset+558,128,t),this.setHasBATCH_ID(!0)}hasPRODUCER_PEER_ID(){return f(this.view,this.offset,5)}setHasPRODUCER_PEER_ID(t){h(this.view,this.offset,5,t)}pRODUCER_PEER_ID(){return c(this.view,this.offset+687,128)}setPRODUCER_PEER_ID(t){u(this.view,this.offset+687,128,t),this.setHasPRODUCER_PEER_ID(!0)}hasLICENSE(){return f(this.view,this.offset,6)}setHasLICENSE(t){h(this.view,this.offset,6,t)}lICENSE(){return c(this.view,this.offset+816,128)}setLICENSE(t){u(this.view,this.offset+816,128,t),this.setHasLICENSE(!0)}};n(rs,\"SIZE\",952);n(rs,\"ALIGN\",8);var La=rs,ns=class cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}};n(ns,\"SIZE\",66);n(ns,\"ALIGN\",1);var Ca=ns,os=class ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ur(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}};n(os,\"SIZE\",130);n(os,\"ALIGN\",1);var Pa=os,as=class lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new lr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+66,128)}setCID(t){u(this.view,this.offset+66,128,t),this.setHasCID(!0)}};n(as,\"SIZE\",195);n(as,\"ALIGN\",1);var Ua=as,fs=class Er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Er(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+66,128)}setPROVIDER_ID(t){u(this.view,this.offset+66,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+195,128)}setSOURCE_NAME(t){u(this.view,this.offset+195,128,t),this.setHasSOURCE_NAME(!0)}bEFORE_MS(){return this.view.getBigUint64(this.offset+328,!0)}setBEFORE_MS(t){this.view.setBigUint64(this.offset+328,t,!0)}bATCH(){return this.view.getUint32(this.offset+336,!0)}setBATCH(t){this.view.setUint32(this.offset+336,t,!0)}mAX_DELETES(){return this.view.getUint32(this.offset+340,!0)}setMAX_DELETES(t){this.view.setUint32(this.offset+340,t,!0)}};n(fs,\"SIZE\",344);n(fs,\"ALIGN\",8);var Ha=fs,hs=class _r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new _r(t,s)}dELETED(){return this.view.getBigUint64(this.offset+0,!0)}setDELETED(t){this.view.setBigUint64(this.offset+0,t,!0)}mISSING(){return this.view.getBigUint64(this.offset+8,!0)}setMISSING(t){this.view.setBigUint64(this.offset+8,t,!0)}cAPPED(){return this.view.getUint8(this.offset+16)!==0}setCAPPED(t){this.view.setUint8(this.offset+16,t?1:0)}};n(hs,\"SIZE\",24);n(hs,\"ALIGN\",8);var va=hs,cs=class dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new dr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+2,64)}setSCHEMA(t){u(this.view,this.offset+2,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return c(this.view,this.offset+67,128)}setPROVIDER_ID(t){u(this.view,this.offset+67,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return c(this.view,this.offset+196,128)}setSOURCE_NAME(t){u(this.view,this.offset+196,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,3)}setHasBATCH_ID(t){h(this.view,this.offset,3,t)}bATCH_ID(){return c(this.view,this.offset+325,128)}setBATCH_ID(t){u(this.view,this.offset+325,128,t),this.setHasBATCH_ID(!0)}hasSOURCE_URL(){return f(this.view,this.offset,4)}setHasSOURCE_URL(t){h(this.view,this.offset,4,t)}sOURCE_URL(){return c(this.view,this.offset+454,255)}setSOURCE_URL(t){u(this.view,this.offset+454,255,t),this.setHasSOURCE_URL(!0)}hasCONTENT_KEY_ID(){return f(this.view,this.offset,5)}setHasCONTENT_KEY_ID(t){h(this.view,this.offset,5,t)}cONTENT_KEY_ID(){return c(this.view,this.offset+710,128)}setCONTENT_KEY_ID(t){u(this.view,this.offset+710,128,t),this.setHasCONTENT_KEY_ID(!0)}hasSOURCE_PEER(){return f(this.view,this.offset,6)}setHasSOURCE_PEER(t){h(this.view,this.offset,6,t)}sOURCE_PEER(){return c(this.view,this.offset+839,128)}setSOURCE_PEER(t){u(this.view,this.offset+839,128,t),this.setHasSOURCE_PEER(!0)}hasLICENSE(){return f(this.view,this.offset,7)}setHasLICENSE(t){h(this.view,this.offset,7,t)}lICENSE(){return c(this.view,this.offset+968,128)}setLICENSE(t){u(this.view,this.offset+968,128,t),this.setHasLICENSE(!0)}hasLICENSE_URL(){return f(this.view,this.offset,8)}setHasLICENSE_URL(t){h(this.view,this.offset,8,t)}lICENSE_URL(){return c(this.view,this.offset+1097,255)}setLICENSE_URL(t){u(this.view,this.offset+1097,255,t),this.setHasLICENSE_URL(!0)}hasCITATION(){return f(this.view,this.offset,9)}setHasCITATION(t){h(this.view,this.offset,9,t)}cITATION(){return c(this.view,this.offset+1353,255)}setCITATION(t){u(this.view,this.offset+1353,255,t),this.setHasCITATION(!0)}sHARE_ALIKE(){return this.view.getUint8(this.offset+1609)!==0}setSHARE_ALIKE(t){this.view.setUint8(this.offset+1609,t?1:0)}rECONCILE(){return this.view.getUint8(this.offset+1610)}setRECONCILE(t){this.view.setUint8(this.offset+1610,t)}hasARCHIVE_SOURCE(){return f(this.view,this.offset,10)}setHasARCHIVE_SOURCE(t){h(this.view,this.offset,10,t)}aRCHIVE_SOURCE(){return c(this.view,this.offset+1611,128)}setARCHIVE_SOURCE(t){u(this.view,this.offset+1611,128,t),this.setHasARCHIVE_SOURCE(!0)}hasARCHIVE_NAME(){return f(this.view,this.offset,11)}setHasARCHIVE_NAME(t){h(this.view,this.offset,11,t)}aRCHIVE_NAME(){return c(this.view,this.offset+1740,255)}setARCHIVE_NAME(t){u(this.view,this.offset+1740,255,t),this.setHasARCHIVE_NAME(!0)}};n(cs,\"SIZE\",1996);n(cs,\"ALIGN\",1);var Ma=cs,us=class pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new pr(t,s)}hasSOURCE_URL(){return f(this.view,this.offset,0)}setHasSOURCE_URL(t){h(this.view,this.offset,0,t)}sOURCE_URL(){return c(this.view,this.offset+1,255)}setSOURCE_URL(t){u(this.view,this.offset+1,255,t),this.setHasSOURCE_URL(!0)}hTTP_STATUS(){return this.view.getInt32(this.offset+260,!0)}setHTTP_STATUS(t){this.view.setInt32(this.offset+260,t,!0)}hasETAG(){return f(this.view,this.offset,1)}setHasETAG(t){h(this.view,this.offset,1,t)}eTAG(){return c(this.view,this.offset+264,255)}setETAG(t){u(this.view,this.offset+264,255,t),this.setHasETAG(!0)}hasLAST_MODIFIED(){return f(this.view,this.offset,2)}setHasLAST_MODIFIED(t){h(this.view,this.offset,2,t)}lAST_MODIFIED(){return c(this.view,this.offset+520,64)}setLAST_MODIFIED(t){u(this.view,this.offset+520,64,t),this.setHasLAST_MODIFIED(!0)}hasCONTENT_TYPE(){return f(this.view,this.offset,3)}setHasCONTENT_TYPE(t){h(this.view,this.offset,3,t)}cONTENT_TYPE(){return c(this.view,this.offset+585,128)}setCONTENT_TYPE(t){u(this.view,this.offset+585,128,t),this.setHasCONTENT_TYPE(!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+720,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+720,t,!0)}hasPARSER(){return f(this.view,this.offset,4)}setHasPARSER(t){h(this.view,this.offset,4,t)}pARSER(){return c(this.view,this.offset+728,128)}setPARSER(t){u(this.view,this.offset+728,128,t),this.setHasPARSER(!0)}hasPARSER_VERSION(){return f(this.view,this.offset,5)}setHasPARSER_VERSION(t){h(this.view,this.offset,5,t)}pARSER_VERSION(){return c(this.view,this.offset+857,64)}setPARSER_VERSION(t){u(this.view,this.offset+857,64,t),this.setHasPARSER_VERSION(!0)}hasSOURCE_SHA256(){return f(this.view,this.offset,6)}setHasSOURCE_SHA256(t){h(this.view,this.offset,6,t)}sOURCE_SHA256(){return c(this.view,this.offset+922,64)}setSOURCE_SHA256(t){u(this.view,this.offset+922,64,t),this.setHasSOURCE_SHA256(!0)}hasNORMALIZED_SHA256(){return f(this.view,this.offset,7)}setHasNORMALIZED_SHA256(t){h(this.view,this.offset,7,t)}nORMALIZED_SHA256(){return c(this.view,this.offset+987,64)}setNORMALIZED_SHA256(t){u(this.view,this.offset+987,64,t),this.setHasNORMALIZED_SHA256(!0)}nORMALIZED_COUNT(){return this.view.getBigUint64(this.offset+1056,!0)}setNORMALIZED_COUNT(t){this.view.setBigUint64(this.offset+1056,t,!0)}fROM_CACHE(){return this.view.getUint8(this.offset+1064)!==0}setFROM_CACHE(t){this.view.setUint8(this.offset+1064,t?1:0)}};n(us,\"SIZE\",1072);n(us,\"ALIGN\",8);var Ba=us,ls=class Ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ir(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(ls,\"SIZE\",386);n(ls,\"ALIGN\",1);var Fa=ls,Es=class Sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Sr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasBATCH_ID(){return f(this.view,this.offset,1)}setHasBATCH_ID(t){h(this.view,this.offset,1,t)}bATCH_ID(){return c(this.view,this.offset+66,128)}setBATCH_ID(t){u(this.view,this.offset+66,128,t),this.setHasBATCH_ID(!0)}iNSERTED(){return this.view.getBigUint64(this.offset+200,!0)}setINSERTED(t){this.view.setBigUint64(this.offset+200,t,!0)}rECONCILED_DUPLICATES(){return this.view.getBigUint64(this.offset+208,!0)}setRECONCILED_DUPLICATES(t){this.view.setBigUint64(this.offset+208,t,!0)}rECONCILED_OLD_BATCHES(){return this.view.getBigUint64(this.offset+216,!0)}setRECONCILED_OLD_BATCHES(t){this.view.setBigUint64(this.offset+216,t,!0)}hasARCHIVED(){return f(this.view,this.offset,2)}setHasARCHIVED(t){h(this.view,this.offset,2,t)}aRCHIVED(){return c(this.view,this.offset+224,255)}setARCHIVED(t){u(this.view,this.offset+224,255,t),this.setHasARCHIVED(!0)}hasPROVENANCE_FILE(){return f(this.view,this.offset,3)}setHasPROVENANCE_FILE(t){h(this.view,this.offset,3,t)}pROVENANCE_FILE(){return c(this.view,this.offset+480,255)}setPROVENANCE_FILE(t){u(this.view,this.offset+480,255,t),this.setHasPROVENANCE_FILE(!0)}};n(Es,\"SIZE\",736);n(Es,\"ALIGN\",8);var Va=Es,_s=class Ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ar(t,s)}dELIVER(){return this.view.getUint8(this.offset+0)}setDELIVER(t){this.view.setUint8(this.offset+0,t)}};n(_s,\"SIZE\",1);n(_s,\"ALIGN\",1);var xa=_s,ds=class br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new br(t,s)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new Re(this.buffer,this.offset+24)}};n(ds,\"SIZE\",80);n(ds,\"ALIGN\",8);var Ga=ds,ps=class Rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Rr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return c(this.view,this.offset+1,64)}setSCHEMA(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+66,128)}setSOURCE(t){u(this.view,this.offset+66,128,t),this.setHasSOURCE(!0)}hasPROFILE(){return f(this.view,this.offset,2)}setHasPROFILE(t){h(this.view,this.offset,2,t)}pROFILE(){return c(this.view,this.offset+195,32)}setPROFILE(t){u(this.view,this.offset+195,32,t),this.setHasPROFILE(!0)}ePOCH(){return this.view.getFloat64(this.offset+232,!0)}setEPOCH(t){this.view.setFloat64(this.offset+232,t,!0)}lIMIT(){return this.view.getUint32(this.offset+240,!0)}setLIMIT(t){this.view.setUint32(this.offset+240,t,!0)}dELIVER(){return this.view.getUint8(this.offset+244)}setDELIVER(t){this.view.setUint8(this.offset+244,t)}};n(ps,\"SIZE\",248);n(ps,\"ALIGN\",8);var ka=ps,Is=class wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new wr(t,s)}wANT(){return this.view.getUint8(this.offset+0)}setWANT(t){this.view.setUint8(this.offset+0,t)}dELIVER(){return this.view.getUint8(this.offset+1)}setDELIVER(t){this.view.setUint8(this.offset+1,t)}};n(Is,\"SIZE\",2);n(Is,\"ALIGN\",1);var Ya=Is,Ss=class Tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Tr(t,s)}kIND(){return this.view.getUint8(this.offset+1)}setKIND(t){this.view.setUint8(this.offset+1,t)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new Re(this.buffer,this.offset+24)}};n(Ss,\"SIZE\",80);n(Ss,\"ALIGN\",8);var qa=Ss,As=class Or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Or(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasKIND(){return f(this.view,this.offset,1)}setHasKIND(t){h(this.view,this.offset,1,t)}kIND(){return c(this.view,this.offset+130,16)}setKIND(t){u(this.view,this.offset+130,16,t),this.setHasKIND(!0)}hasSOURCE(){return f(this.view,this.offset,2)}setHasSOURCE(t){h(this.view,this.offset,2,t)}sOURCE(){return c(this.view,this.offset+147,128)}setSOURCE(t){u(this.view,this.offset+147,128,t),this.setHasSOURCE(!0)}rECORDS(){return this.view.getBigInt64(this.offset+280,!0)}setRECORDS(t){this.view.setBigInt64(this.offset+280,t,!0)}};n(As,\"SIZE\",288);n(As,\"ALIGN\",8);var ja=As,bs=class mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new mr(t,s)}hasTABLE(){return f(this.view,this.offset,0)}setHasTABLE(t){h(this.view,this.offset,0,t)}tABLE(){return c(this.view,this.offset+1,128)}setTABLE(t){u(this.view,this.offset+1,128,t),this.setHasTABLE(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,128)}setNAME(t){u(this.view,this.offset+130,128,t),this.setHasNAME(!0)}pLACEHOLDER(){return this.view.getUint8(this.offset+259)!==0}setPLACEHOLDER(t){this.view.setUint8(this.offset+259,t?1:0)}};n(bs,\"SIZE\",260);n(bs,\"ALIGN\",1);var Ka=bs,Rs=class gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new gr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}mAX_ROWS(){return this.view.getBigUint64(this.offset+8,!0)}setMAX_ROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}};n(Rs,\"SIZE\",24);n(Rs,\"ALIGN\",8);var Wa=Rs,ws=class yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new yr(t,s)}hasSCHEMA_NAME(){return f(this.view,this.offset,0)}setHasSCHEMA_NAME(t){h(this.view,this.offset,0,t)}sCHEMA_NAME(){return c(this.view,this.offset+1,64)}setSCHEMA_NAME(t){u(this.view,this.offset+1,64,t),this.setHasSCHEMA_NAME(!0)}hasSCHEMA_VERSION(){return f(this.view,this.offset,1)}setHasSCHEMA_VERSION(t){h(this.view,this.offset,1,t)}sCHEMA_VERSION(){return c(this.view,this.offset+66,32)}setSCHEMA_VERSION(t){u(this.view,this.offset+66,32,t),this.setHasSCHEMA_VERSION(!0)}hasFORMAT(){return f(this.view,this.offset,2)}setHasFORMAT(t){h(this.view,this.offset,2,t)}fORMAT(){return c(this.view,this.offset+99,32)}setFORMAT(t){u(this.view,this.offset+99,32,t),this.setHasFORMAT(!0)}hasPUBLISH_EVENT_KEY(){return f(this.view,this.offset,3)}setHasPUBLISH_EVENT_KEY(t){h(this.view,this.offset,3,t)}pUBLISH_EVENT_KEY(){return c(this.view,this.offset+132,128)}setPUBLISH_EVENT_KEY(t){u(this.view,this.offset+132,128,t),this.setHasPUBLISH_EVENT_KEY(!0)}};n(ws,\"SIZE\",261);n(ws,\"ALIGN\",1);var $a=ws,Ts=class Nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Nr(t,s)}aLGORITHM(){return this.view.getUint8(this.offset+0)}setALGORITHM(t){this.view.setUint8(this.offset+0,t)}lENGTH(){return this.view.getUint32(this.offset+4,!0)}setLENGTH(t){this.view.setUint32(this.offset+4,t,!0)}};n(Ts,\"SIZE\",8);n(Ts,\"ALIGN\",4);var Za=Ts,Os=class Dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Dr(t,s)}hasSLOT_ID(){return f(this.view,this.offset,0)}setHasSLOT_ID(t){h(this.view,this.offset,0,t)}sLOT_ID(){return c(this.view,this.offset+1,128)}setSLOT_ID(t){u(this.view,this.offset+1,128,t),this.setHasSLOT_ID(!0)}aLGORITHM(){return this.view.getUint8(this.offset+130)}setALGORITHM(t){this.view.setUint8(this.offset+130,t)}};n(Os,\"SIZE\",131);n(Os,\"ALIGN\",1);var Qa=Os,ms=class Lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Lr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}};n(ms,\"SIZE\",386);n(ms,\"ALIGN\",1);var za=ms,gs=class Cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Cr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return c(this.view,this.offset+1,128)}setID(t){u(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return c(this.view,this.offset+130,255)}setUSERNAME(t){u(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}cONFIGURED(){return this.view.getUint8(this.offset+386)!==0}setCONFIGURED(t){this.view.setUint8(this.offset+386,t?1:0)}hasUSERNAME_MASKED(){return f(this.view,this.offset,2)}setHasUSERNAME_MASKED(t){h(this.view,this.offset,2,t)}uSERNAME_MASKED(){return c(this.view,this.offset+387,255)}setUSERNAME_MASKED(t){u(this.view,this.offset+387,255,t),this.setHasUSERNAME_MASKED(!0)}uPDATED_MS(){return this.view.getBigUint64(this.offset+648,!0)}setUPDATED_MS(t){this.view.setBigUint64(this.offset+648,t,!0)}vERIFIED_MS(){return this.view.getBigUint64(this.offset+656,!0)}setVERIFIED_MS(t){this.view.setBigUint64(this.offset+656,t,!0)}};n(gs,\"SIZE\",664);n(gs,\"ALIGN\",8);var Xa=gs,ys=class Pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Pr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasTYPE(){return f(this.view,this.offset,2)}setHasTYPE(t){h(this.view,this.offset,2,t)}tYPE(){return c(this.view,this.offset+386,32)}setTYPE(t){u(this.view,this.offset+386,32,t),this.setHasTYPE(!0)}hasLIFETIME(){return f(this.view,this.offset,3)}setHasLIFETIME(t){h(this.view,this.offset,3,t)}lIFETIME(){return c(this.view,this.offset+419,32)}setLIFETIME(t){u(this.view,this.offset+419,32,t),this.setHasLIFETIME(!0)}hasTTL(){return f(this.view,this.offset,4)}setHasTTL(t){h(this.view,this.offset,4,t)}tTL(){return c(this.view,this.offset+452,32)}setTTL(t){u(this.view,this.offset+452,32,t),this.setHasTTL(!0)}nO_PIN(){return this.view.getUint8(this.offset+485)!==0}setNO_PIN(t){this.view.setUint8(this.offset+485,t?1:0)}};n(ys,\"SIZE\",486);n(ys,\"ALIGN\",1);var Ja=ys,Ns=class Ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ur(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return c(this.view,this.offset+130,255)}setNAME(t){u(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,2)}setHasVALUE(t){h(this.view,this.offset,2,t)}vALUE(){return c(this.view,this.offset+386,255)}setVALUE(t){u(this.view,this.offset+386,255,t),this.setHasVALUE(!0)}sIZE(){return this.view.getBigUint64(this.offset+648,!0)}setSIZE(t){this.view.setBigUint64(this.offset+648,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,3)}setHasAGENT_VERSION(t){h(this.view,this.offset,3,t)}aGENT_VERSION(){return c(this.view,this.offset+656,128)}setAGENT_VERSION(t){u(this.view,this.offset+656,128,t),this.setHasAGENT_VERSION(!0)}hasPROTOCOL_VERSION(){return f(this.view,this.offset,4)}setHasPROTOCOL_VERSION(t){h(this.view,this.offset,4,t)}pROTOCOL_VERSION(){return c(this.view,this.offset+785,64)}setPROTOCOL_VERSION(t){u(this.view,this.offset+785,64,t),this.setHasPROTOCOL_VERSION(!0)}};n(Ns,\"SIZE\",856);n(Ns,\"ALIGN\",8);var tf=Ns,Ds=class Hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Hr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return c(this.view,this.offset+257,128)}setCID(t){u(this.view,this.offset+257,128,t),this.setHasCID(!0)}sIZE(){return this.view.getBigUint64(this.offset+392,!0)}setSIZE(t){this.view.setBigUint64(this.offset+392,t,!0)}tYPE(){return this.view.getInt32(this.offset+400,!0)}setTYPE(t){this.view.setInt32(this.offset+400,t,!0)}};n(Ds,\"SIZE\",408);n(Ds,\"ALIGN\",8);var ef=Ds,Ls=class vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new vr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return c(this.view,this.offset+1,128)}setCID(t){u(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasTYPE(){return f(this.view,this.offset,1)}setHasTYPE(t){h(this.view,this.offset,1,t)}tYPE(){return c(this.view,this.offset+130,32)}setTYPE(t){u(this.view,this.offset+130,32,t),this.setHasTYPE(!0)}};n(Ls,\"SIZE\",163);n(Ls,\"ALIGN\",1);var sf=Ls,Cs=class Mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Mr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasADDRESS(){return f(this.view,this.offset,1)}setHasADDRESS(t){h(this.view,this.offset,1,t)}aDDRESS(){return c(this.view,this.offset+130,255)}setADDRESS(t){u(this.view,this.offset+130,255,t),this.setHasADDRESS(!0)}lATENCY_MS(){return this.view.getFloat64(this.offset+392,!0)}setLATENCY_MS(t){this.view.setFloat64(this.offset+392,t,!0)}};n(Cs,\"SIZE\",400);n(Cs,\"ALIGN\",8);var rf=Cs,Ps=class Br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Br(t,s)}hasTOPIC(){return f(this.view,this.offset,0)}setHasTOPIC(t){h(this.view,this.offset,0,t)}tOPIC(){return c(this.view,this.offset+1,255)}setTOPIC(t){u(this.view,this.offset+1,255,t),this.setHasTOPIC(!0)}};n(Ps,\"SIZE\",257);n(Ps,\"ALIGN\",1);var nf=Ps,Us=class Fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Fr(t,s)}aLREADY(){return this.view.getUint8(this.offset+0)!==0}setALREADY(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Us,\"SIZE\",1);n(Us,\"ALIGN\",1);var of=Us,Hs=class Vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Vr(t,s)}hasTARGET(){return f(this.view,this.offset,0)}setHasTARGET(t){h(this.view,this.offset,0,t)}tARGET(){return c(this.view,this.offset+1,255)}setTARGET(t){u(this.view,this.offset+1,255,t),this.setHasTARGET(!0)}hasPROTOCOL_ID(){return f(this.view,this.offset,1)}setHasPROTOCOL_ID(t){h(this.view,this.offset,1,t)}pROTOCOL_ID(){return c(this.view,this.offset+257,128)}setPROTOCOL_ID(t){u(this.view,this.offset+257,128,t),this.setHasPROTOCOL_ID(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+386,128)}setPEER_ID(t){u(this.view,this.offset+386,128,t),this.setHasPEER_ID(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+516,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+516,t,!0)}};n(Hs,\"SIZE\",520);n(Hs,\"ALIGN\",4);var af=Hs,vs=class xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new xr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}lIMIT(){return this.view.getUint32(this.offset+132,!0)}setLIMIT(t){this.view.setUint32(this.offset+132,t,!0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+136,16)}setSTANDARD(t){u(this.view,this.offset+136,16,t),this.setHasSTANDARD(!0)}dELIVER(){return this.view.getUint8(this.offset+153)}setDELIVER(t){this.view.setUint8(this.offset+153,t)}};n(vs,\"SIZE\",156);n(vs,\"ALIGN\",4);var ff=vs,Ms=class Gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Gr(t,s)}hasSELF(){return f(this.view,this.offset,0)}setHasSELF(t){h(this.view,this.offset,0,t)}sELF(){return c(this.view,this.offset+1,128)}setSELF(t){u(this.view,this.offset+1,128,t),this.setHasSELF(!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return c(this.view,this.offset+130,128)}setPEER_ID(t){u(this.view,this.offset+130,128,t),this.setHasPEER_ID(!0)}pUBLISHER_KEY_AVAILABLE(){return this.view.getUint8(this.offset+259)!==0}setPUBLISHER_KEY_AVAILABLE(t){this.view.setUint8(this.offset+259,t?1:0)}gOSSIP_ONLY_EXCLUDED(){return this.view.getUint32(this.offset+260,!0)}setGOSSIP_ONLY_EXCLUDED(t){this.view.setUint32(this.offset+260,t,!0)}};n(Ms,\"SIZE\",264);n(Ms,\"ALIGN\",4);var hf=Ms,Bs=class kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new kr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}cONNECTED(){return this.view.getUint8(this.offset+130)!==0}setCONNECTED(t){this.view.setUint8(this.offset+130,t?1:0)}sELF(){return this.view.getUint8(this.offset+131)!==0}setSELF(t){this.view.setUint8(this.offset+131,t?1:0)}ePM_INDEX(){return this.view.getInt32(this.offset+132,!0)}setEPM_INDEX(t){this.view.setInt32(this.offset+132,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,1)}setHasAGENT_VERSION(t){h(this.view,this.offset,1,t)}aGENT_VERSION(){return c(this.view,this.offset+136,128)}setAGENT_VERSION(t){u(this.view,this.offset+136,128,t),this.setHasAGENT_VERSION(!0)}};n(Bs,\"SIZE\",268);n(Bs,\"ALIGN\",4);var cf=Bs,Fs=class Yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Yr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+1,128)}setPEER_ID(t){u(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Fs,\"SIZE\",386);n(Fs,\"ALIGN\",1);var uf=Fs,Vs=class qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return c(this.view,this.offset+2,128)}setPEER_ID(t){u(this.view,this.offset+2,128,t),this.setHasPEER_ID(!0)}hasPUBLISHER_PEER_ID(){return f(this.view,this.offset,1)}setHasPUBLISHER_PEER_ID(t){h(this.view,this.offset,1,t)}pUBLISHER_PEER_ID(){return c(this.view,this.offset+131,128)}setPUBLISHER_PEER_ID(t){u(this.view,this.offset+131,128,t),this.setHasPUBLISHER_PEER_ID(!0)}hasGOSSIP_PEER_ID(){return f(this.view,this.offset,2)}setHasGOSSIP_PEER_ID(t){h(this.view,this.offset,2,t)}gOSSIP_PEER_ID(){return c(this.view,this.offset+260,128)}setGOSSIP_PEER_ID(t){u(this.view,this.offset+260,128,t),this.setHasGOSSIP_PEER_ID(!0)}hasSTANDARD(){return f(this.view,this.offset,3)}setHasSTANDARD(t){h(this.view,this.offset,3,t)}sTANDARD(){return c(this.view,this.offset+389,16)}setSTANDARD(t){u(this.view,this.offset+389,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,4)}setHasSCHEMA(t){h(this.view,this.offset,4,t)}sCHEMA(){return c(this.view,this.offset+406,64)}setSCHEMA(t){u(this.view,this.offset+406,64,t),this.setHasSCHEMA(!0)}hasFILE_ID(){return f(this.view,this.offset,5)}setHasFILE_ID(t){h(this.view,this.offset,5,t)}fILE_ID(){return c(this.view,this.offset+471,255)}setFILE_ID(t){u(this.view,this.offset+471,255,t),this.setHasFILE_ID(!0)}hasFILE_NAME(){return f(this.view,this.offset,6)}setHasFILE_NAME(t){h(this.view,this.offset,6,t)}fILE_NAME(){return c(this.view,this.offset+727,255)}setFILE_NAME(t){u(this.view,this.offset+727,255,t),this.setHasFILE_NAME(!0)}hasCID(){return f(this.view,this.offset,7)}setHasCID(t){h(this.view,this.offset,7,t)}cID(){return c(this.view,this.offset+983,128)}setCID(t){u(this.view,this.offset+983,128,t),this.setHasCID(!0)}pUBLISH_MS(){return this.view.getBigUint64(this.offset+1112,!0)}setPUBLISH_MS(t){this.view.setBigUint64(this.offset+1112,t,!0)}hasSIGNATURE_TYPE(){return f(this.view,this.offset,8)}setHasSIGNATURE_TYPE(t){h(this.view,this.offset,8,t)}sIGNATURE_TYPE(){return c(this.view,this.offset+1120,32)}setSIGNATURE_TYPE(t){u(this.view,this.offset+1120,32,t),this.setHasSIGNATURE_TYPE(!0)}hasSIGNATURE_HEX(){return f(this.view,this.offset,9)}setHasSIGNATURE_HEX(t){h(this.view,this.offset,9,t)}sIGNATURE_HEX(){return c(this.view,this.offset+1153,255)}setSIGNATURE_HEX(t){u(this.view,this.offset+1153,255,t),this.setHasSIGNATURE_HEX(!0)}sIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+1409)!==0}setSIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+1409,t?1:0)}hasATTRIBUTION(){return f(this.view,this.offset,10)}setHasATTRIBUTION(t){h(this.view,this.offset,10,t)}aTTRIBUTION(){return c(this.view,this.offset+1410,16)}setATTRIBUTION(t){u(this.view,this.offset+1410,16,t),this.setHasATTRIBUTION(!0)}pNM_INDEX(){return this.view.getInt32(this.offset+1428,!0)}setPNM_INDEX(t){this.view.setInt32(this.offset+1428,t,!0)}hasPUBLISHER_KEY_HEX(){return f(this.view,this.offset,11)}setHasPUBLISHER_KEY_HEX(t){h(this.view,this.offset,11,t)}pUBLISHER_KEY_HEX(){return c(this.view,this.offset+1432,128)}setPUBLISHER_KEY_HEX(t){u(this.view,this.offset+1432,128,t),this.setHasPUBLISHER_KEY_HEX(!0)}hasPUBLISHER_KEY_SOURCE(){return f(this.view,this.offset,12)}setHasPUBLISHER_KEY_SOURCE(t){h(this.view,this.offset,12,t)}pUBLISHER_KEY_SOURCE(){return c(this.view,this.offset+1561,64)}setPUBLISHER_KEY_SOURCE(t){u(this.view,this.offset+1561,64,t),this.setHasPUBLISHER_KEY_SOURCE(!0)}};n(Vs,\"SIZE\",1632);n(Vs,\"ALIGN\",8);var lf=Vs,xs=class jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new jr(t,s)}kNOWN(){return this.view.getUint8(this.offset+2)!==0}setKNOWN(t){this.view.setUint8(this.offset+2,t?1:0)}hasREASON(){return f(this.view,this.offset,0)}setHasREASON(t){h(this.view,this.offset,0,t)}rEASON(){return c(this.view,this.offset+3,64)}setREASON(t){u(this.view,this.offset+3,64,t),this.setHasREASON(!0)}pINNED(){return this.view.getUint8(this.offset+68)!==0}setPINNED(t){this.view.setUint8(this.offset+68,t?1:0)}sELF(){return this.view.getUint8(this.offset+69)!==0}setSELF(t){this.view.setUint8(this.offset+69,t?1:0)}fRESH(){return this.view.getUint8(this.offset+70)!==0}setFRESH(t){this.view.setUint8(this.offset+70,t?1:0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return c(this.view,this.offset+71,16)}setSTANDARD(t){u(this.view,this.offset+71,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,2)}setHasSCHEMA(t){h(this.view,this.offset,2,t)}sCHEMA(){return c(this.view,this.offset+88,64)}setSCHEMA(t){u(this.view,this.offset+88,64,t),this.setHasSCHEMA(!0)}hasPNM_CID(){return f(this.view,this.offset,3)}setHasPNM_CID(t){h(this.view,this.offset,3,t)}pNM_CID(){return c(this.view,this.offset+153,128)}setPNM_CID(t){u(this.view,this.offset+153,128,t),this.setHasPNM_CID(!0)}hasPNM_FILE_ID(){return f(this.view,this.offset,4)}setHasPNM_FILE_ID(t){h(this.view,this.offset,4,t)}pNM_FILE_ID(){return c(this.view,this.offset+282,255)}setPNM_FILE_ID(t){u(this.view,this.offset+282,255,t),this.setHasPNM_FILE_ID(!0)}pNM_PUBLISH_MS(){return this.view.getBigUint64(this.offset+544,!0)}setPNM_PUBLISH_MS(t){this.view.setBigUint64(this.offset+544,t,!0)}pNM_SIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+552)!==0}setPNM_SIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+552,t?1:0)}hasPNM_ATTRIBUTION(){return f(this.view,this.offset,5)}setHasPNM_ATTRIBUTION(t){h(this.view,this.offset,5,t)}pNM_ATTRIBUTION(){return c(this.view,this.offset+553,16)}setPNM_ATTRIBUTION(t){u(this.view,this.offset+553,16,t),this.setHasPNM_ATTRIBUTION(!0)}hasBATCH_ID(){return f(this.view,this.offset,6)}setHasBATCH_ID(t){h(this.view,this.offset,6,t)}bATCH_ID(){return c(this.view,this.offset+570,128)}setBATCH_ID(t){u(this.view,this.offset+570,128,t),this.setHasBATCH_ID(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,7)}setHasPROVIDER_ID(t){h(this.view,this.offset,7,t)}pROVIDER_ID(){return c(this.view,this.offset+699,128)}setPROVIDER_ID(t){u(this.view,this.offset+699,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,8)}setHasSOURCE_NAME(t){h(this.view,this.offset,8,t)}sOURCE_NAME(){return c(this.view,this.offset+828,128)}setSOURCE_NAME(t){u(this.view,this.offset+828,128,t),this.setHasSOURCE_NAME(!0)}rECORD_COUNT(){return this.view.getBigUint64(this.offset+960,!0)}setRECORD_COUNT(t){this.view.setBigUint64(this.offset+960,t,!0)}bYTE_COUNT(){return this.view.getBigUint64(this.offset+968,!0)}setBYTE_COUNT(t){this.view.setBigUint64(this.offset+968,t,!0)}pARTS(){return this.view.getUint32(this.offset+976,!0)}setPARTS(t){this.view.setUint32(this.offset+976,t,!0)}pUBLISHED_MS(){return this.view.getBigUint64(this.offset+984,!0)}setPUBLISHED_MS(t){this.view.setBigUint64(this.offset+984,t,!0)}hasETAG_FNV1A64(){return f(this.view,this.offset,9)}setHasETAG_FNV1A64(t){h(this.view,this.offset,9,t)}eTAG_FNV1A64(){return c(this.view,this.offset+992,16)}setETAG_FNV1A64(t){u(this.view,this.offset+992,16,t),this.setHasETAG_FNV1A64(!0)}hasREF(){return f(this.view,this.offset,10)}setHasREF(t){h(this.view,this.offset,10,t)}rEF(){return new Re(this.buffer,this.offset+1016)}};n(xs,\"SIZE\",1072);n(xs,\"ALIGN\",8);var Ef=xs,Gs=class Kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Kr(t,s)}uPTIME_S(){return this.view.getBigUint64(this.offset+8,!0)}setUPTIME_S(t){this.view.setBigUint64(this.offset+8,t,!0)}sTARTED_MS(){return this.view.getBigUint64(this.offset+16,!0)}setSTARTED_MS(t){this.view.setBigUint64(this.offset+16,t,!0)}sTORE_TOTAL_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setSTORE_TOTAL_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}sTORE_TOTAL_RECORDS(){return this.view.getBigUint64(this.offset+32,!0)}setSTORE_TOTAL_RECORDS(t){this.view.setBigUint64(this.offset+32,t,!0)}hasSTORAGE_PATH(){return f(this.view,this.offset,0)}setHasSTORAGE_PATH(t){h(this.view,this.offset,0,t)}sTORAGE_PATH(){return c(this.view,this.offset+40,255)}setSTORAGE_PATH(t){u(this.view,this.offset+40,255,t),this.setHasSTORAGE_PATH(!0)}hAS_DISK(){return this.view.getUint8(this.offset+296)!==0}setHAS_DISK(t){this.view.setUint8(this.offset+296,t?1:0)}dISK_CAPACITY_BYTES(){return this.view.getBigUint64(this.offset+304,!0)}setDISK_CAPACITY_BYTES(t){this.view.setBigUint64(this.offset+304,t,!0)}dISK_FREE_BYTES(){return this.view.getBigUint64(this.offset+312,!0)}setDISK_FREE_BYTES(t){this.view.setBigUint64(this.offset+312,t,!0)}dISK_AVAILABLE_BYTES(){return this.view.getBigUint64(this.offset+320,!0)}setDISK_AVAILABLE_BYTES(t){this.view.setBigUint64(this.offset+320,t,!0)}hasSERVICE_STATE(){return f(this.view,this.offset,1)}setHasSERVICE_STATE(t){h(this.view,this.offset,1,t)}sERVICE_STATE(){return c(this.view,this.offset+328,32)}setSERVICE_STATE(t){u(this.view,this.offset+328,32,t),this.setHasSERVICE_STATE(!0)}hasSERVICE_MODE(){return f(this.view,this.offset,2)}setHasSERVICE_MODE(t){h(this.view,this.offset,2,t)}sERVICE_MODE(){return c(this.view,this.offset+361,32)}setSERVICE_MODE(t){u(this.view,this.offset+361,32,t),this.setHasSERVICE_MODE(!0)}hAS_BANDWIDTH(){return this.view.getUint8(this.offset+394)!==0}setHAS_BANDWIDTH(t){this.view.setUint8(this.offset+394,t?1:0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+400,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+400,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+408,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+408,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+416,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+416,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+424,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+424,t,!0)}};n(Gs,\"SIZE\",432);n(Gs,\"ALIGN\",8);var _f=Gs,ks=class Wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Wr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+0,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+8,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+8,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+24,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+24,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+32,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+32,t,!0)}};n(ks,\"SIZE\",40);n(ks,\"ALIGN\",8);var df=ks,Ys=class $r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new $r(t,s)}lIMIT(){return this.view.getUint32(this.offset+0,!0)}setLIMIT(t){this.view.setUint32(this.offset+0,t,!0)}};n(Ys,\"SIZE\",4);n(Ys,\"ALIGN\",4);var pf=Ys,qs=class Zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Zr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+8,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}hasKIND(){return f(this.view,this.offset,0)}setHasKIND(t){h(this.view,this.offset,0,t)}kIND(){return c(this.view,this.offset+16,32)}setKIND(t){u(this.view,this.offset+16,32,t),this.setHasKIND(!0)}hasDETAIL(){return f(this.view,this.offset,1)}setHasDETAIL(t){h(this.view,this.offset,1,t)}dETAIL(){return c(this.view,this.offset+49,255)}setDETAIL(t){u(this.view,this.offset+49,255,t),this.setHasDETAIL(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return c(this.view,this.offset+305,128)}setPEER_ID(t){u(this.view,this.offset+305,128,t),this.setHasPEER_ID(!0)}};n(qs,\"SIZE\",440);n(qs,\"ALIGN\",8);var If=qs,js=class Qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Qr(t,s)}mS(){return this.view.getUint32(this.offset+0,!0)}setMS(t){this.view.setUint32(this.offset+0,t,!0)}};n(js,\"SIZE\",4);n(js,\"ALIGN\",4);var Sf=js,Ks=class zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new zr(t,s)}hasEXPRESSION(){return f(this.view,this.offset,0)}setHasEXPRESSION(t){h(this.view,this.offset,0,t)}eXPRESSION(){return c(this.view,this.offset+1,128)}setEXPRESSION(t){u(this.view,this.offset+1,128,t),this.setHasEXPRESSION(!0)}aT_MS(){return this.view.getBigUint64(this.offset+136,!0)}setAT_MS(t){this.view.setBigUint64(this.offset+136,t,!0)}};n(Ks,\"SIZE\",144);n(Ks,\"ALIGN\",8);var Af=Ks,Ws=class Xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,16)}setNAME(t){u(this.view,this.offset+1,16,t),this.setHasNAME(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return c(this.view,this.offset+18,64)}setSOURCE(t){u(this.view,this.offset+18,64,t),this.setHasSOURCE(!0)}hAS_WILDCARD(){return this.view.getUint8(this.offset+83)!==0}setHAS_WILDCARD(t){this.view.setUint8(this.offset+83,t?1:0)}hasVALUES(){return f(this.view,this.offset,2)}setHasVALUES(t){h(this.view,this.offset,2,t)}vALUESLength(){return this.hasVALUES()?Math.min(this.view.getUint32(this.offset+84,!0),60):0}setVALUESLength(t){let s=Math.max(0,Math.min(t,60));this.view.setUint32(this.offset+84,s,!0),this.setHasVALUES(!0)}vALUESAt(t){return this.view.getInt32(this.offset+84+4+t*4,!0)}setVALUESAt(t,s){this.view.setInt32(this.offset+84+4+t*4,s,!0),this.setHasVALUES(!0)}};n(Ws,\"SIZE\",328);n(Ws,\"ALIGN\",4);var bf=Ws,$s=class Jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Jr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+4)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+4,t?1:0)}mESSAGE_IS_TEXT(){return this.view.getUint8(this.offset+5)!==0}setMESSAGE_IS_TEXT(t){this.view.setUint8(this.offset+5,t?1:0)}};n($s,\"SIZE\",8);n($s,\"ALIGN\",4);var Rf=$s,Zs=class tn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tn(t,s)}hasPROTOCOL(){return f(this.view,this.offset,0)}setHasPROTOCOL(t){h(this.view,this.offset,0,t)}pROTOCOL(){return c(this.view,this.offset+1,64)}setPROTOCOL(t){u(this.view,this.offset+1,64,t),this.setHasPROTOCOL(!0)}hasEXTENSIONS(){return f(this.view,this.offset,1)}setHasEXTENSIONS(t){h(this.view,this.offset,1,t)}eXTENSIONS(){return c(this.view,this.offset+66,255)}setEXTENSIONS(t){u(this.view,this.offset+66,255,t),this.setHasEXTENSIONS(!0)}cLOSE_CODE(){return this.view.getInt32(this.offset+324,!0)}setCLOSE_CODE(t){this.view.setInt32(this.offset+324,t,!0)}hasCLOSE_REASON(){return f(this.view,this.offset,2)}setHasCLOSE_REASON(t){h(this.view,this.offset,2,t)}cLOSE_REASON(){return c(this.view,this.offset+328,255)}setCLOSE_REASON(t){u(this.view,this.offset+328,255,t),this.setHasCLOSE_REASON(!0)}bODY_IS_TEXT(){return this.view.getUint8(this.offset+584)!==0}setBODY_IS_TEXT(t){this.view.setUint8(this.offset+584,t?1:0)}};n(Zs,\"SIZE\",588);n(Zs,\"ALIGN\",4);var wf=Zs,Qs=class en{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new en(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}hasUSERNAME(){return f(this.view,this.offset,3)}setHasUSERNAME(t){h(this.view,this.offset,3,t)}uSERNAME(){return c(this.view,this.offset+645,128)}setUSERNAME(t){u(this.view,this.offset+645,128,t),this.setHasUSERNAME(!0)}kEEP_ALIVE_S(){return this.view.getUint16(this.offset+774,!0)}setKEEP_ALIVE_S(t){this.view.setUint16(this.offset+774,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+776,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+776,t,!0)}pACKET_ID(){return this.view.getUint16(this.offset+780,!0)}setPACKET_ID(t){this.view.setUint16(this.offset+780,t,!0)}};n(Qs,\"SIZE\",784);n(Qs,\"ALIGN\",4);var Tf=Qs,zs=class sn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return c(this.view,this.offset+260,128)}setCLIENT_ID(t){u(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return c(this.view,this.offset+389,255)}setTOPIC(t){u(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}pAYLOAD_BYTES(){return this.view.getBigUint64(this.offset+648,!0)}setPAYLOAD_BYTES(t){this.view.setBigUint64(this.offset+648,t,!0)}};n(zs,\"SIZE\",656);n(zs,\"ALIGN\",8);var Of=zs,Xs=class rn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+260,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+260,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+264)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+264,t?1:0)}hasBIND_ADDRESS(){return f(this.view,this.offset,1)}setHasBIND_ADDRESS(t){h(this.view,this.offset,1,t)}bIND_ADDRESS(){return c(this.view,this.offset+265,64)}setBIND_ADDRESS(t){u(this.view,this.offset+265,64,t),this.setHasBIND_ADDRESS(!0)}bIND_PORT(){return this.view.getUint16(this.offset+330,!0)}setBIND_PORT(t){this.view.setUint16(this.offset+330,t,!0)}hasUDP_TYPE(){return f(this.view,this.offset,2)}setHasUDP_TYPE(t){h(this.view,this.offset,2,t)}uDP_TYPE(){return c(this.view,this.offset+332,8)}setUDP_TYPE(t){u(this.view,this.offset+332,8,t),this.setHasUDP_TYPE(!0)}aLLOW_UNAUTHORIZED(){return this.view.getUint8(this.offset+341)!==0}setALLOW_UNAUTHORIZED(t){this.view.setUint8(this.offset+341,t?1:0)}hasSERVER_NAME(){return f(this.view,this.offset,3)}setHasSERVER_NAME(t){h(this.view,this.offset,3,t)}sERVER_NAME(){return c(this.view,this.offset+342,255)}setSERVER_NAME(t){u(this.view,this.offset+342,255,t),this.setHasSERVER_NAME(!0)}};n(Xs,\"SIZE\",600);n(Xs,\"ALIGN\",4);var mf=Xs,Js=class nn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return c(this.view,this.offset+1,255)}setHOST(t){u(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasLOCAL_ADDRESS(){return f(this.view,this.offset,1)}setHasLOCAL_ADDRESS(t){h(this.view,this.offset,1,t)}lOCAL_ADDRESS(){return c(this.view,this.offset+260,64)}setLOCAL_ADDRESS(t){u(this.view,this.offset+260,64,t),this.setHasLOCAL_ADDRESS(!0)}lOCAL_PORT(){return this.view.getUint16(this.offset+326,!0)}setLOCAL_PORT(t){this.view.setUint16(this.offset+326,t,!0)}hasREMOTE_ADDRESS(){return f(this.view,this.offset,2)}setHasREMOTE_ADDRESS(t){h(this.view,this.offset,2,t)}rEMOTE_ADDRESS(){return c(this.view,this.offset+328,64)}setREMOTE_ADDRESS(t){u(this.view,this.offset+328,64,t),this.setHasREMOTE_ADDRESS(!0)}rEMOTE_PORT(){return this.view.getUint16(this.offset+394,!0)}setREMOTE_PORT(t){this.view.setUint16(this.offset+394,t,!0)}aUTHORIZED(){return this.view.getUint8(this.offset+396)!==0}setAUTHORIZED(t){this.view.setUint8(this.offset+396,t?1:0)}hasAUTHORIZATION_ERROR(){return f(this.view,this.offset,3)}setHasAUTHORIZATION_ERROR(t){h(this.view,this.offset,3,t)}aUTHORIZATION_ERROR(){return c(this.view,this.offset+397,255)}setAUTHORIZATION_ERROR(t){u(this.view,this.offset+397,255,t),this.setHasAUTHORIZATION_ERROR(!0)}};n(Js,\"SIZE\",654);n(Js,\"ALIGN\",2);var gf=Js,ti=class on{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new on(t,s)}nOT_RECURSIVE(){return this.view.getUint8(this.offset+0)!==0}setNOT_RECURSIVE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(ti,\"SIZE\",1);n(ti,\"ALIGN\",1);var yf=ti,ei=class an{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new an(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,255)}setNAME(t){u(this.view,this.offset+1,255,t),this.setHasNAME(!0)}iS_FILE(){return this.view.getUint8(this.offset+257)!==0}setIS_FILE(t){this.view.setUint8(this.offset+257,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+258)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+258,t?1:0)}};n(ei,\"SIZE\",259);n(ei,\"ALIGN\",1);var Nf=ei,si=class fn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fn(t,s)}sIZE(){return this.view.getBigUint64(this.offset+0,!0)}setSIZE(t){this.view.setBigUint64(this.offset+0,t,!0)}iS_FILE(){return this.view.getUint8(this.offset+8)!==0}setIS_FILE(t){this.view.setUint8(this.offset+8,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+9)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+9,t?1:0)}cTIME_MS(){return this.view.getFloat64(this.offset+16,!0)}setCTIME_MS(t){this.view.setFloat64(this.offset+16,t,!0)}mTIME_MS(){return this.view.getFloat64(this.offset+24,!0)}setMTIME_MS(t){this.view.setFloat64(this.offset+24,t,!0)}};n(si,\"SIZE\",32);n(si,\"ALIGN\",8);var Df=si,ii=class hn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hn(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}};n(ii,\"SIZE\",4);n(ii,\"ALIGN\",4);var Lf=ii,ri=class cn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cn(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return c(this.view,this.offset+1,128)}setNAME(t){u(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return c(this.view,this.offset+130,255)}setVALUE(t){u(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(ri,\"SIZE\",386);n(ri,\"ALIGN\",1);var Cf=ri,ni=class un{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new un(t,s)}eXIT_CODE(){return this.view.getInt32(this.offset+4,!0)}setEXIT_CODE(t){this.view.setInt32(this.offset+4,t,!0)}hasSIGNAL(){return f(this.view,this.offset,0)}setHasSIGNAL(t){h(this.view,this.offset,0,t)}sIGNAL(){return c(this.view,this.offset+8,16)}setSIGNAL(t){u(this.view,this.offset+8,16,t),this.setHasSIGNAL(!0)}};n(ni,\"SIZE\",28);n(ni,\"ALIGN\",4);var Pf=ni,oi=class ln{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ln(t,s)}hasSCOPE(){return f(this.view,this.offset,0)}setHasSCOPE(t){h(this.view,this.offset,0,t)}sCOPE(){return c(this.view,this.offset+1,128)}setSCOPE(t){u(this.view,this.offset+1,128,t),this.setHasSCOPE(!0)}hasKEY(){return f(this.view,this.offset,1)}setHasKEY(t){h(this.view,this.offset,1,t)}kEY(){return c(this.view,this.offset+130,255)}setKEY(t){u(this.view,this.offset+130,255,t),this.setHasKEY(!0)}};n(oi,\"SIZE\",386);n(oi,\"ALIGN\",1);var Uf=oi;var dt=new Int32Array(2),we=new Float32Array(dt.buffer),Te=new Float64Array(dt.buffer),kt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Xt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Xt||(Xt={}));var pt=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return dt[0]=this.readInt32(t),we[0]}readFloat64(t){return dt[kt?0:1]=this.readInt32(t),dt[kt?1:0]=this.readInt32(t+4),Te[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){we[0]=s,this.writeInt32(t,dt[0])}writeFloat64(t,s){Te[0]=s,this.writeInt32(t,dt[kt?0:1]),this.writeInt32(t+4,dt[kt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Xt.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var Jt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=pt.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=pt.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,l=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(l+_)!=this.bb.readInt16(E+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var ai;(function(e){e[e.DIRECT=0]=\"DIRECT\",e[e.COMMAND=1]=\"COMMAND\"})(ai||(ai={}));var It;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.APPEND_ONLY=1]=\"APPEND_ONLY\",e[e.MUTABLE=2]=\"MUTABLE\"})(It||(It={}));var Z;(function(e){e[e.BORROWED=0]=\"BORROWED\",e[e.PRODUCER_OWNED=1]=\"PRODUCER_OWNED\",e[e.HOST_OWNED=2]=\"HOST_OWNED\",e[e.SHARED=3]=\"SHARED\"})(Z||(Z={}));function _n(e){if(e==null)return{valid:!0,present:!1,bytes:[]};if(typeof e==\"string\"){let s=e.startsWith(\"0x\")?e.slice(2):e;if(s.length===0)return{valid:!0,present:!1,bytes:[]};if(s.length%2!==0||!/^[0-9a-fA-F]+$/.test(s))return{valid:!1,present:!0,bytes:[]};let i=[];for(let r=0;r<s.length;r+=2)i.push(Number.parseInt(s.slice(r,r+2),16));return{valid:!0,present:!0,bytes:i}}if(!Array.isArray(e)&&!(e instanceof Uint8Array))return{valid:!1,present:!0,bytes:[]};let t=Array.from(e);return t.length===0?{valid:!0,present:!1,bytes:[]}:t.some(s=>!Number.isInteger(s)||s<0||s>255)?{valid:!1,present:!0,bytes:[]}:{valid:!0,present:!0,bytes:t}}function dn(e){let t=_n(e);return t.valid&&t.present?t.bytes:void 0}function pn(e){return _n(e).valid}function vf(e){return Object.prototype.toString.call(e)}function Mf(e){if(!e||typeof e!=\"object\")return!1;let t=vf(e);return t===\"[object ArrayBuffer]\"||t===\"[object SharedArrayBuffer]\"}function st(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Mf(e)?new Uint8Array(e):null}var j;(function(e){e[e.FLATBUFFER=0]=\"FLATBUFFER\",e[e.ALIGNED_BINARY=1]=\"ALIGNED_BINARY\"})(j||(j={}));var Yt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsFlatBufferTypeRef(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFlatBufferTypeRef(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}SCHEMA_NAME(t){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,t):null}FILE_IDENTIFIER(t){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_VERSION(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}ROOT_TYPE(t){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_HASH(t){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}schemaHashLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}schemaHashArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ACCEPTS_ANY_FLATBUFFER(){let t=this.bb.__offset(this.bb_pos,14);return t?!!this.bb.readInt8(this.bb_pos+t):!1}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):j.FLATBUFFER}FIXED_STRING_LENGTH(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint16(this.bb_pos+t):0}BYTE_LENGTH(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint32(this.bb_pos+t):0}REQUIRED_ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):0}static startFlatBufferTypeRef(t){t.startObject(10)}static addSchemaName(t,s){t.addFieldOffset(0,s,0)}static addFileIdentifier(t,s){t.addFieldOffset(1,s,0)}static addSchemaVersion(t,s){t.addFieldOffset(2,s,0)}static addRootType(t,s){t.addFieldOffset(3,s,0)}static addSchemaHash(t,s){t.addFieldOffset(4,s,0)}static createSchemaHashVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startSchemaHashVector(t,s){t.startVector(1,s,1)}static addAcceptsAnyFlatbuffer(t,s){t.addFieldInt8(5,+s,0)}static addWireFormat(t,s){t.addFieldInt8(6,s,j.FLATBUFFER)}static addFixedStringLength(t,s){t.addFieldInt16(7,s,0)}static addByteLength(t,s){t.addFieldInt32(8,s,0)}static addRequiredAlignment(t,s){t.addFieldInt16(9,s,0)}static endFlatBufferTypeRef(t){return t.endObject()}static createFlatBufferTypeRef(t,s,i,r,o,a,l,E,_,I,m){return e.startFlatBufferTypeRef(t),e.addSchemaName(t,s),e.addFileIdentifier(t,i),e.addSchemaVersion(t,r),e.addRootType(t,o),e.addSchemaHash(t,a),e.addAcceptsAnyFlatbuffer(t,l),e.addWireFormat(t,E),e.addFixedStringLength(t,_),e.addByteLength(t,I),e.addRequiredAlignment(t,m),e.endFlatBufferTypeRef(t)}unpack(){return new te(this.SCHEMA_NAME(),this.FILE_IDENTIFIER(),this.SCHEMA_VERSION(),this.ROOT_TYPE(),this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),this.ACCEPTS_ANY_FLATBUFFER(),this.WIRE_FORMAT(),this.FIXED_STRING_LENGTH(),this.BYTE_LENGTH(),this.REQUIRED_ALIGNMENT())}unpackTo(t){t.SCHEMA_NAME=this.SCHEMA_NAME(),t.FILE_IDENTIFIER=this.FILE_IDENTIFIER(),t.SCHEMA_VERSION=this.SCHEMA_VERSION(),t.ROOT_TYPE=this.ROOT_TYPE(),t.SCHEMA_HASH=this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),t.ACCEPTS_ANY_FLATBUFFER=this.ACCEPTS_ANY_FLATBUFFER(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.FIXED_STRING_LENGTH=this.FIXED_STRING_LENGTH(),t.BYTE_LENGTH=this.BYTE_LENGTH(),t.REQUIRED_ALIGNMENT=this.REQUIRED_ALIGNMENT()}},te=class{constructor(t=null,s=null,i=null,r=null,o=[],a=!1,l=j.FLATBUFFER,E=0,_=0,I=0){this.SCHEMA_NAME=t,this.FILE_IDENTIFIER=s,this.SCHEMA_VERSION=i,this.ROOT_TYPE=r,this.SCHEMA_HASH=o,this.ACCEPTS_ANY_FLATBUFFER=a,this.WIRE_FORMAT=l,this.FIXED_STRING_LENGTH=E,this.BYTE_LENGTH=_,this.REQUIRED_ALIGNMENT=I}pack(t){let s=this.SCHEMA_NAME!==null?t.createString(this.SCHEMA_NAME):0,i=this.FILE_IDENTIFIER!==null?t.createString(this.FILE_IDENTIFIER):0,r=this.SCHEMA_VERSION!==null?t.createString(this.SCHEMA_VERSION):0,o=this.ROOT_TYPE!==null?t.createString(this.ROOT_TYPE):0,a=Yt.createSchemaHashVector(t,this.SCHEMA_HASH);return Yt.createFlatBufferTypeRef(t,s,i,r,o,a,this.ACCEPTS_ANY_FLATBUFFER,this.WIRE_FORMAT,this.FIXED_STRING_LENGTH,this.BYTE_LENGTH,this.REQUIRED_ALIGNMENT)}};var Q;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.SINGLE_WRITER_MUTABLE=1]=\"SINGLE_WRITER_MUTABLE\",e[e.APPEND_ONLY=2]=\"APPEND_ONLY\"})(Q||(Q={}));var z;(function(e){e[e.HOST_OWNED=0]=\"HOST_OWNED\",e[e.PLUGIN_OWNED=1]=\"PLUGIN_OWNED\",e[e.TRANSFERRED=2]=\"TRANSFERRED\"})(z||(z={}));var x=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsTAB(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTAB(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$TAB\")}OFFSET(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}SIZE(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0}ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint8(this.bb_pos+t):j.FLATBUFFER}TYPE_REF(t){let s=this.bb.__offset(this.bb_pos,12);return s?(t||new Yt).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}MUTABILITY(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint8(this.bb_pos+t):Q.IMMUTABLE}OWNERSHIP(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):z.HOST_OWNED}FRAME_ID(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}PORT_ID(t){let s=this.bb.__offset(this.bb_pos,20);return s?this.bb.__string(this.bb_pos+s,t):null}static startTAB(t){t.startObject(9)}static addOffset(t,s){t.addFieldInt32(0,s,0)}static addSize(t,s){t.addFieldInt32(1,s,0)}static addAlignment(t,s){t.addFieldInt32(2,s,0)}static addWireFormat(t,s){t.addFieldInt8(3,s,j.FLATBUFFER)}static addTypeRef(t,s){t.addFieldOffset(4,s,0)}static addMutability(t,s){t.addFieldInt8(5,s,Q.IMMUTABLE)}static addOwnership(t,s){t.addFieldInt8(6,s,z.HOST_OWNED)}static addFrameId(t,s){t.addFieldInt64(7,s,BigInt(\"0\"))}static addPortId(t,s){t.addFieldOffset(8,s,0)}static endTAB(t){return t.endObject()}static finishTABBuffer(t,s){t.finish(s,\"$TAB\")}static finishSizePrefixedTABBuffer(t,s){t.finish(s,\"$TAB\",!0)}unpack(){return new qt(this.OFFSET(),this.SIZE(),this.ALIGNMENT(),this.WIRE_FORMAT(),this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,this.MUTABILITY(),this.OWNERSHIP(),this.FRAME_ID(),this.PORT_ID())}unpackTo(t){t.OFFSET=this.OFFSET(),t.SIZE=this.SIZE(),t.ALIGNMENT=this.ALIGNMENT(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.TYPE_REF=this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,t.MUTABILITY=this.MUTABILITY(),t.OWNERSHIP=this.OWNERSHIP(),t.FRAME_ID=this.FRAME_ID(),t.PORT_ID=this.PORT_ID()}},qt=class{constructor(t=0,s=0,i=0,r=j.FLATBUFFER,o=null,a=Q.IMMUTABLE,l=z.HOST_OWNED,E=BigInt(\"0\"),_=null){this.OFFSET=t,this.SIZE=s,this.ALIGNMENT=i,this.WIRE_FORMAT=r,this.TYPE_REF=o,this.MUTABILITY=a,this.OWNERSHIP=l,this.FRAME_ID=E,this.PORT_ID=_}pack(t){let s=this.TYPE_REF!==null?this.TYPE_REF.pack(t):0,i=this.PORT_ID!==null?t.createString(this.PORT_ID):0;return x.startTAB(t),x.addOffset(t,this.OFFSET),x.addSize(t,this.SIZE),x.addAlignment(t,this.ALIGNMENT),x.addWireFormat(t,this.WIRE_FORMAT),x.addTypeRef(t,s),x.addMutability(t,this.MUTABILITY),x.addOwnership(t,this.OWNERSHIP),x.addFrameId(t,this.FRAME_ID),x.addPortId(t,i),x.endTAB(t)}};var Tt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVRequest(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVRequest(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}METHOD_ID(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}INPUTS(t,s){let i=this.bb.__offset(this.bb_pos,6);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,8);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}OUTPUT_STREAM_CAP(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}static startPIVRequest(t){t.startObject(5)}static addMethodId(t,s){t.addFieldOffset(0,s,0)}static addInputs(t,s){t.addFieldOffset(1,s,0)}static createInputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startInputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(2,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addTraceId(t,s){t.addFieldInt64(3,s,BigInt(\"0\"))}static addOutputStreamCap(t,s){t.addFieldInt32(4,s,0)}static endPIVRequest(t){let s=t.endObject();return t.requiredField(s,4),s}static createPIVRequest(t,s,i,r,o,a){return e.startPIVRequest(t),e.addMethodId(t,s),e.addInputs(t,i),e.addPayloadArena(t,r),e.addTraceId(t,o),e.addOutputStreamCap(t,a),e.endPIVRequest(t)}unpack(){return new fi(this.METHOD_ID(),this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.TRACE_ID(),this.OUTPUT_STREAM_CAP())}unpackTo(t){t.METHOD_ID=this.METHOD_ID(),t.INPUTS=this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.TRACE_ID=this.TRACE_ID(),t.OUTPUT_STREAM_CAP=this.OUTPUT_STREAM_CAP()}},fi=class{constructor(t=null,s=[],i=[],r=BigInt(\"0\"),o=0){this.METHOD_ID=t,this.INPUTS=s,this.PAYLOAD_ARENA=i,this.TRACE_ID=r,this.OUTPUT_STREAM_CAP=o}pack(t){let s=this.METHOD_ID!==null?t.createString(this.METHOD_ID):0,i=Tt.createInputsVector(t,t.createObjectOffsetList(this.INPUTS)),r=Tt.createPayloadArenaVector(t,this.PAYLOAD_ARENA);return Tt.createPIVRequest(t,s,i,r,this.TRACE_ID,this.OUTPUT_STREAM_CAP)}};var St;(function(e){e[e.OK=0]=\"OK\",e[e.NOT_FOUND=1]=\"NOT_FOUND\",e[e.YIELDED=2]=\"YIELDED\",e[e.FAILED=3]=\"FAILED\"})(St||(St={}));var B=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVResponse(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVResponse(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}STATUS_CODE(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}STATUS(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):St.OK}YIELDED(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}BACKLOG_REMAINING(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}OUTPUTS(t,s){let i=this.bb.__offset(this.bb_pos,12);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,14);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ERROR_CODE(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__string(this.bb_pos+s,t):null}ERROR_MESSAGE(t){let s=this.bb.__offset(this.bb_pos,18);return s?this.bb.__string(this.bb_pos+s,t):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}static startPIVResponse(t){t.startObject(9)}static addStatusCode(t,s){t.addFieldInt32(0,s,0)}static addStatus(t,s){t.addFieldInt32(1,s,St.OK)}static addYielded(t,s){t.addFieldInt8(2,+s,0)}static addBacklogRemaining(t,s){t.addFieldInt32(3,s,0)}static addOutputs(t,s){t.addFieldOffset(4,s,0)}static createOutputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startOutputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(5,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addErrorCode(t,s){t.addFieldOffset(6,s,0)}static addErrorMessage(t,s){t.addFieldOffset(7,s,0)}static addTraceId(t,s){t.addFieldInt64(8,s,BigInt(\"0\"))}static endPIVResponse(t){return t.endObject()}static createPIVResponse(t,s,i,r,o,a,l,E,_,I){return e.startPIVResponse(t),e.addStatusCode(t,s),e.addStatus(t,i),e.addYielded(t,r),e.addBacklogRemaining(t,o),e.addOutputs(t,a),e.addPayloadArena(t,l),e.addErrorCode(t,E),e.addErrorMessage(t,_),e.addTraceId(t,I),e.endPIVResponse(t)}unpack(){return new hi(this.STATUS_CODE(),this.STATUS(),this.YIELDED(),this.BACKLOG_REMAINING(),this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.ERROR_CODE(),this.ERROR_MESSAGE(),this.TRACE_ID())}unpackTo(t){t.STATUS_CODE=this.STATUS_CODE(),t.STATUS=this.STATUS(),t.YIELDED=this.YIELDED(),t.BACKLOG_REMAINING=this.BACKLOG_REMAINING(),t.OUTPUTS=this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.ERROR_CODE=this.ERROR_CODE(),t.ERROR_MESSAGE=this.ERROR_MESSAGE(),t.TRACE_ID=this.TRACE_ID()}},hi=class{constructor(t=0,s=St.OK,i=!1,r=0,o=[],a=[],l=null,E=null,_=BigInt(\"0\")){this.STATUS_CODE=t,this.STATUS=s,this.YIELDED=i,this.BACKLOG_REMAINING=r,this.OUTPUTS=o,this.PAYLOAD_ARENA=a,this.ERROR_CODE=l,this.ERROR_MESSAGE=E,this.TRACE_ID=_}pack(t){let s=B.createOutputsVector(t,t.createObjectOffsetList(this.OUTPUTS)),i=B.createPayloadArenaVector(t,this.PAYLOAD_ARENA),r=this.ERROR_CODE!==null?t.createString(this.ERROR_CODE):0,o=this.ERROR_MESSAGE!==null?t.createString(this.ERROR_MESSAGE):0;return B.createPIVResponse(t,this.STATUS_CODE,this.STATUS,this.YIELDED,this.BACKLOG_REMAINING,s,i,r,o,this.TRACE_ID)}};var W=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIV(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIV(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$PIV\")}REQUEST(t){let s=this.bb.__offset(this.bb_pos,4);return s?(t||new Tt).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}RESPONSE(t){let s=this.bb.__offset(this.bb_pos,6);return s?(t||new B).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}static startPIV(t){t.startObject(2)}static addRequest(t,s){t.addFieldOffset(0,s,0)}static addResponse(t,s){t.addFieldOffset(1,s,0)}static endPIV(t){return t.endObject()}static finishPIVBuffer(t,s){t.finish(s,\"$PIV\")}static finishSizePrefixedPIVBuffer(t,s){t.finish(s,\"$PIV\",!0)}unpack(){return new ci(this.REQUEST()!==null?this.REQUEST().unpack():null,this.RESPONSE()!==null?this.RESPONSE().unpack():null)}unpackTo(t){t.REQUEST=this.REQUEST()!==null?this.REQUEST().unpack():null,t.RESPONSE=this.RESPONSE()!==null?this.RESPONSE().unpack():null}},ci=class{constructor(t=null,s=null){this.REQUEST=t,this.RESPONSE=s}pack(t){let s=this.REQUEST!==null?this.REQUEST.pack(t):0,i=this.RESPONSE!==null?this.RESPONSE.pack(t):0;return W.startPIV(t),W.addRequest(t,s),W.addResponse(t,i),W.endPIV(t)}};var se=65535,ht=4294967295,Sn=new WeakMap,Bf=new WeakMap,Ff=new WeakMap;function Y(...e){return e.find(t=>t!=null)}function X(e,t,s={}){let{defaultValue:i,minimum:r=0,maximum:o=Number.MAX_SAFE_INTEGER}=s;if(e==null||e===\"\"){if(i!==void 0)return i;throw new TypeError(`${t} is required.`)}let a;if(typeof e==\"bigint\"){if(e<BigInt(r)||e>BigInt(o))throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);a=Number(e)}else a=typeof e==\"number\"?e:Number(e);if(!Number.isSafeInteger(a)||a<r||a>o)throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);return a}function me(e){return e>0&&Number.isInteger(Math.log2(e))}function Ei(e,t,s={}){let i=X(e,t,{defaultValue:s.defaultValue,minimum:0,maximum:s.maximum??ht});if(!me(i))throw new RangeError(`${t} must be a positive power of two.`);return i}function _i(e,t,s){if(e>ht-t)throw new RangeError(`${s} offset + size exceeds the uint32 address range.`)}function di(e,t,s){if(e.buffer!==t.buffer||e.byteOffset<t.byteOffset||e.byteOffset+e.byteLength>t.byteOffset+t.byteLength)throw new Error(`${s} is outside its arena lease.`)}function pi(e){let t=Sn.get(e);if(!t)throw new TypeError(\"SDS PIV/TAB arena lease is invalid.\");return t}function Vf(e,t,s,i){let r=pi(e);if(r.closed)throw new Error(`${i} arena lease is closed.`);if(t!==r.generation)throw new Error(`${i} has stale arena lease generation ${String(t)}; active generation is ${r.generation}.`);return s&&di(s,r.arena,i),r}function An(e,t,s={}){let i=e?.arenaLease;if(!i){if(s.required===!0)throw new Error(`${t} requires a live arena lease.`);return null}let r=st(e.payload),o=Y(e.generation,e.arenaGeneration);return Vf(i,o,r,t)}function bn(e,t){let s=An(e,t);if(!s)return null;let i=mn(e.ownership),r=On(e.mutability);if(i===Z.PRODUCER_OWNED||r!==It.IMMUTABLE){let o=st(e.payload),a=Y(e.generation,e.arenaGeneration),l=Ff.get(e);if(l&&i===Z.SHARED&&l.lease===e.arenaLease&&l.generation===a&&l.payloadBuffer===o?.buffer&&l.payloadByteOffset===o?.byteOffset&&l.payloadByteLength===o?.byteLength&&l.frameId===ge(e)&&l.ownership===i&&l.mutability===r)return s;throw new Error(`${t} producer-owned or mutable cross-invocation alias requires explicit compatible transfer forwarding.`)}return s}function xf(e){if(e instanceof pt)return e;let t=st(e);if(t)return new pt(t);throw new TypeError(\"Expected ByteBuffer, Uint8Array, ArrayBufferView, or ArrayBuffer.\")}function ui(e,t=0){let s=Number(e??t);return Number.isFinite(s)?Math.max(0,Math.trunc(s)):t}function jt(e,t=BigInt(0)){if(typeof e==\"bigint\")return e;if(typeof e==\"number\"&&Number.isFinite(e))return BigInt(Math.trunc(e));if(typeof e==\"string\"&&e.trim())try{return BigInt(e.trim())}catch{return t}return t}function ee(e){let t=typeof e==\"string\"?e.trim().toLowerCase():\"\";if(e===1||t===\"aligned-binary\"||t===\"aligned_binary\"||t===\"alignedbinary\")return\"aligned-binary\";if(e==null||e===0||t===\"\"||t===\"flatbuffer\")return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format: ${String(e)}.`)}function Ii(e){return ee(e)===\"aligned-binary\"?j.ALIGNED_BINARY:j.FLATBUFFER}function Rn(e){if(e===j.ALIGNED_BINARY)return\"aligned-binary\";if(e===j.FLATBUFFER)return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format value: ${e}.`)}function Si(e){if(e==null||e===It.IMMUTABLE||e===\"immutable\"||e===\"IMMUTABLE\")return Q.IMMUTABLE;if(e===It.APPEND_ONLY||e===\"append-only\"||e===\"APPEND_ONLY\")return Q.APPEND_ONLY;if(e===It.MUTABLE||e===\"mutable\"||e===\"single-writer-mutable\"||e===\"SINGLE_WRITER_MUTABLE\")return Q.SINGLE_WRITER_MUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability: ${String(e)}.`)}function wn(e){if(e===Q.APPEND_ONLY)return It.APPEND_ONLY;if(e===Q.SINGLE_WRITER_MUTABLE)return It.MUTABLE;if(e===Q.IMMUTABLE)return It.IMMUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability value: ${e}.`)}function Ai(e){if(e==null||e===Z.BORROWED||e===Z.HOST_OWNED||e===\"borrowed\"||e===\"BORROWED\"||e===\"host-owned\"||e===\"host_owned\"||e===\"HOST_OWNED\")return z.HOST_OWNED;if(e===Z.PRODUCER_OWNED||e===\"producer-owned\"||e===\"producer_owned\"||e===\"PRODUCER_OWNED\"||e===\"plugin-owned\"||e===\"plugin_owned\"||e===\"PLUGIN_OWNED\")return z.PLUGIN_OWNED;if(e===Z.SHARED||e===\"shared\"||e===\"SHARED\"||e===\"transferred\"||e===\"TRANSFERRED\")return z.TRANSFERRED;throw new TypeError(`Unsupported SDS PIV/TAB ownership: ${String(e)}.`)}function Tn(e){if(e===z.PLUGIN_OWNED)return Z.PRODUCER_OWNED;if(e===z.TRANSFERRED)return Z.SHARED;if(e===z.HOST_OWNED)return Z.HOST_OWNED;throw new TypeError(`Unsupported SDS PIV/TAB ownership value: ${e}.`)}function On(e){return wn(Si(e))}function mn(e){return Tn(Ai(e))}function Gf(e={},t=void 0){let s=Y(e.schemaHash,e.SCHEMA_HASH);if(!pn(s))throw new TypeError(\"SDS PIV/TAB schemaHash must contain valid bytes or hex.\");let i=ee(Y(e.wireFormat,e.WIRE_FORMAT,t));return new te(e.schemaName??e.SCHEMA_NAME??null,e.fileIdentifier??e.FILE_IDENTIFIER??null,e.schemaVersion??e.SCHEMA_VERSION??null,e.rootTypeName??e.rootType??e.ROOT_TYPE??null,dn(s)??[],!!(e.acceptsAnyFlatbuffer??e.ACCEPTS_ANY_FLATBUFFER??!1),Ii(i),X(Y(e.fixedStringLength,e.FIXED_STRING_LENGTH),\"SDS PIV/TAB fixedStringLength\",{defaultValue:0,maximum:se}),X(Y(e.byteLength,e.BYTE_LENGTH),\"SDS PIV/TAB byteLength\",{defaultValue:0,maximum:ht}),X(Y(e.requiredAlignment,e.REQUIRED_ALIGNMENT),\"SDS PIV/TAB requiredAlignment\",{defaultValue:0,maximum:se}))}function gn(e={}){let t=e.typeRef??e.allowedType??{},s=Y(e.wireFormat,e.WIRE_FORMAT),i=Y(t.wireFormat,t.WIRE_FORMAT),r=ee(Y(i,s));if(i!==void 0&&s!==void 0&&ee(i)!==ee(s))throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let o=Gf(t,r);if(r===\"aligned-binary\")o.REQUIRED_ALIGNMENT=Ei(o.REQUIRED_ALIGNMENT,\"SDS PIV/TAB aligned type requiredAlignment\",{maximum:se}),o.BYTE_LENGTH=X(o.BYTE_LENGTH,\"SDS PIV/TAB aligned type byteLength\",{minimum:0,maximum:ht});else if(o.REQUIRED_ALIGNMENT>0&&!me(o.REQUIRED_ALIGNMENT))throw new RangeError(\"SDS PIV/TAB type requiredAlignment must be a positive power of two when declared.\");return{typeRef:o,wireFormat:r}}function yn(e,t){let s=Y(e?.alignment,e?.ALIGNMENT),i=Ei(s,\"SDS PIV/TAB frame alignment\",{defaultValue:Math.max(Nt,t||1)});if(i<t)throw new RangeError(`SDS PIV/TAB frame alignment ${i} is below required alignment ${t}.`);return i}function Nn(e,t,s){if(e===\"aligned-binary\"&&t.BYTE_LENGTH>0&&s!==t.BYTE_LENGTH)throw new RangeError(`SDS PIV/TAB aligned payload size ${s} does not match declared byteLength ${t.BYTE_LENGTH}.`)}function ge(e={}){return e.frameId!==void 0&&e.frameId!==null?jt(e.frameId):e.sequence!==void 0||e.endOfStream!==void 0||e.endOfStream===!0?jt(e.sequence)<<BigInt(1)|(e.endOfStream===!0?BigInt(1):BigInt(0)):jt(e.traceId)}function kf(e){let t=jt(e);return{sequence:t>>BigInt(1),endOfStream:(t&BigInt(1))===BigInt(1)}}function Yf(e,t){if(t<=1)return e;let s=e%t;return s===0?e:e+t-s}function li(e){return X(Y(e?.offset,e?.OFFSET),\"SDS PIV/TAB frame offset\",{defaultValue:0,maximum:ht})}function Dn(e){return X(Y(e?.size,e?.SIZE),\"SDS PIV/TAB frame size\",{defaultValue:0,maximum:ht})}function ye(e){return Ei(Y(e?.alignment,e?.ALIGNMENT),\"SDS PIV/TAB frame alignment\",{defaultValue:Nt})}function qf(e={},t){let s=st(e.payload??new Uint8Array)??new Uint8Array;bn(e,\"SDS PIV/TAB frame forwarding\");let{typeRef:i,wireFormat:r}=gn(e),o=i.REQUIRED_ALIGNMENT,a=yn(e,o);Nn(r,i,s.length);let l=Yf(t,a);return _i(l,s.length,\"SDS PIV/TAB frame\"),{payload:s,padding:l-t,buffer:new qt(l,s.length,a,Ii(r),i,Si(e.mutability),Ai(e.ownership),ge(e),e.portId??null)}}var Nt=8;function jf(e,t={}){let s=st(e);if(!s)throw new TypeError(\"createInvokeArenaLease requires Uint8Array-compatible arena bytes.\");let i={arena:s,generation:X(t.generation,\"SDS PIV/TAB arena lease generation\",{defaultValue:1,maximum:ht}),closed:!1},r={get arena(){return i.arena},get generation(){return i.generation},get closed(){return i.closed},advance(o=void 0){if(i.closed)throw new Error(\"SDS PIV/TAB arena lease is closed.\");if(i.generation>=ht)throw new RangeError(\"SDS PIV/TAB arena lease generation exceeds the uint32 range.\");if(o!==void 0){let a=st(o);if(!a)throw new TypeError(\"SDS PIV/TAB arena lease advance requires Uint8Array-compatible bytes.\");i.arena=a}return i.generation+=1,i.generation},close(){i.closed=!0},createTransferToken(o,a={}){if(An(o,\"SDS PIV/TAB arena transfer\",{required:!0})!==i||o.arenaLease!==r)throw new Error(\"SDS PIV/TAB arena transfer frame belongs to a different lease.\");let E=mn(a.ownership??\"transferred\");if(E!==Z.SHARED)throw new Error(\"SDS PIV/TAB arena transfer ownership must be transferred/shared.\");let _=On(a.mutability??o.mutability),I=st(o.payload),m=Object.freeze({});return Bf.set(m,{lease:r,generation:i.generation,payloadBuffer:I.buffer,payloadByteOffset:I.byteOffset,payloadByteLength:I.byteLength,frameId:ge(o),ownership:E,mutability:_,consumed:!1}),m}};return Sn.set(r,i),Object.freeze(r)}function Kf(e,t,s){return e.startVector(1,t.length,s),e.bb.setPosition(e.space-=t.length),e.bb.bytes().set(t,e.space),e.endVector()}function In(e){return e===\"request\"?\"PIV request\":\"PIV response\"}function Wf(e,t,s,i=Nt){if(e.byteOffset%Nt!==0)throw new Error(`${In(s)} buffer base is not ${Nt}-byte aligned (byteOffset ${e.byteOffset}).`);if(t&&t.length>0&&t.byteOffset%i!==0)throw new Error(`${In(s)} payload arena base is not ${i}-byte aligned (byteOffset ${t.byteOffset}).`)}function $f(e=[],t=qf){let s=[],i=[],r=0,o=Nt;for(let l of e){let E=t(l,r);r=li(E.buffer)+Dn(E.buffer),o=Math.max(o,ye(E.buffer)),s.push(E.buffer),i.push(E)}let a=new Uint8Array(r);for(let l of i)a.set(l.payload,li(l.buffer));return{frames:s,arena:a,arenaAlignment:o}}function Zf(e={}){return e.offset!==void 0||e.OFFSET!==void 0}function Qf(e={},t){let s=st(e.payload),i=bn(e,\"SDS PIV/TAB external frame forwarding\");i&&t&&di(t,i.arena,\"SDS PIV/TAB external arena\");let{typeRef:r,wireFormat:o}=gn(e),a=yn(e,r.REQUIRED_ALIGNMENT),l=X(Y(e.offset,e.OFFSET),\"SDS PIV/TAB external arena frame offset\",{defaultValue:0,maximum:ht});!Zf(e)&&s&&t&&s.buffer===t.buffer&&(l=s.byteOffset-t.byteOffset);let E=X(Y(e.size,e.SIZE,e.byteLength,s?.byteLength),\"SDS PIV/TAB external arena frame size\",{defaultValue:0,maximum:ht});if(_i(l,E,\"SDS PIV/TAB external arena frame\"),Nn(o,r,E),E>0&&t){if(l>t.length||E>t.length-l)throw new Error(\"SDS PIV external arena frame range exceeds externalArena.\");let _=t.byteOffset+l;if(a>1&&_%a!==0)throw new Error(`SDS PIV external arena frame \"${e.portId??\"\"}\" is misaligned: absolute offset ${_} violates alignment ${a}.`)}return new qt(l,E,a,Ii(o),r,Si(e.mutability),Ai(e.ownership),ge(e),e.portId??null)}function zf(e=[],t){let s=st(t);if(!s)throw new TypeError(\"SDS PIV external arena encoding requires externalArena bytes.\");let i=Nt;return{frames:e.map(o=>{let a=Qf(o,s);return i=Math.max(i,ye(a)),a}),arena:new Uint8Array,arenaAlignment:i,externalArena:s}}function Xf(e){if(!e)return null;let t=e.schemaHashArray?.()??new Uint8Array;return{schemaName:e.SCHEMA_NAME()??null,fileIdentifier:e.FILE_IDENTIFIER()??null,schemaVersion:e.SCHEMA_VERSION()??null,schemaHash:t.byteLength>0?new Uint8Array(t):void 0,acceptsAnyFlatbuffer:e.ACCEPTS_ANY_FLATBUFFER?.()===!0,wireFormat:Rn(e.WIRE_FORMAT()),rootTypeName:e.ROOT_TYPE()??null,fixedStringLength:X(e.FIXED_STRING_LENGTH(),\"SDS PIV/TAB decoded fixedStringLength\",{defaultValue:0,maximum:se}),byteLength:X(e.BYTE_LENGTH(),\"SDS PIV/TAB decoded byteLength\",{defaultValue:0,maximum:ht}),requiredAlignment:X(e.REQUIRED_ALIGNMENT(),\"SDS PIV/TAB decoded requiredAlignment\",{defaultValue:0,maximum:se})}}function Jf(e){let t=e.typeRef;if(t&&t.wireFormat!==e.wireFormat)throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let s=t?.requiredAlignment??0;if(s>0&&!me(s))throw new RangeError(\"SDS PIV/TAB decoded requiredAlignment must be a positive power of two.\");if(e.alignment<s)throw new RangeError(`SDS PIV/TAB frame alignment ${e.alignment} is below required alignment ${s}.`);if(e.wireFormat===\"aligned-binary\"){if(!t)throw new Error(\"SDS PIV/TAB aligned frame requires a typeRef.\");if(!me(s))throw new RangeError(\"SDS PIV/TAB aligned type requiredAlignment must be a positive power of two.\");let i=Number(t.byteLength??0);if(i>0&&e.size!==i)throw new RangeError(`SDS PIV/TAB aligned payload size ${e.size} does not match declared byteLength ${i}.`)}}function th(e){if(!e)return null;let t=ui(e.OFFSET()),s=ui(e.SIZE()),i=ye({ALIGNMENT:e.ALIGNMENT()}),r=Rn(e.WIRE_FORMAT()),o=jt(e.FRAME_ID()),a=kf(o),l={typeRef:Xf(e.TYPE_REF()),portId:e.PORT_ID()??null,alignment:i,offset:t,size:s,ownership:Tn(e.OWNERSHIP()),generation:0,mutability:wn(e.MUTABILITY()),frameId:o,traceId:o,streamId:0,sequence:a.sequence,endOfStream:a.endOfStream,wireFormat:r};return Jf(l),l}function eh(e,t){let s=[];for(let i=0;i<e;i++){let r=th(t(i));r&&s.push(r)}return s}function sh(e,t={}){let s=st(t.externalArena),i=e.length>0?e:s??e;if(!t.arenaLease)return jf(i);let r=pi(t.arenaLease);if(r.closed)throw new Error(\"SDS PIV/TAB decoded arena lease is closed.\");return di(i,r.arena,\"SDS PIV/TAB decoded arena\"),t.arenaLease}function ih(e=[],t,s={}){let i=st(s.externalArena),r=s.arenaLease,o=r?pi(r).generation:void 0;return e.map(a=>{let l=li(a),E=Dn(a),_=t.length>0?t:i,I=t.length>0?\"PAYLOAD_ARENA\":\"external arena\";if(_i(l,E,\"SDS PIV/TAB decoded frame\"),E>0&&!_)throw new Error(\"SDS PIV external arena bytes are required when PAYLOAD_ARENA is empty.\");if(_&&(l>_.length||E>_.length-l))throw new Error(`SDS PIV TAB payload range exceeds ${I}.`);let m=ye(a);if(_&&m>1&&E>0){let T=_.byteOffset+l;if(T%m!==0)throw new Error(`SDS PIV TAB \"${a.portId??\"\"}\" payload is misaligned: absolute offset ${T} violates alignment ${m}.`)}let A=_?_.subarray(l,l+E):new Uint8Array;return{...a,payload:A,typeRef:a.typeRef??null,arenaLease:r,arenaGeneration:o,generation:o}})}function rh(e,t){return t.map(s=>s.pack(e))}function Ln(e,t={}){let s=xf(e);if(!W.bufferHasIdentifier(s))throw new Error(\"SDS PIV invoke request buffer identifier mismatch.\");let r=W.getRootAsPIV(s).REQUEST();if(!r)throw new Error(\"SDS PIV invoke envelope does not contain a request.\");let o=r.payloadArenaArray()??new Uint8Array,a=eh(r.inputsLength(),_=>r.INPUTS(_)),l=sh(o,t),E=ih(a,o,{...t,arenaLease:l});return{methodId:r.METHOD_ID()??null,inputFrames:E,inputs:E,payloadArena:o,arenaLease:l,traceId:r.TRACE_ID()??BigInt(0),outputStreamCap:r.OUTPUT_STREAM_CAP()??0,envelope:\"PIV\"}}function nh(e={}){return e.status!==void 0?e.status:e.yielded===!0?St.YIELDED:Number(e.statusCode??0)!==0||e.errorCode?St.FAILED:St.OK}function bi(e={}){let t=Array.isArray(e.outputs)?e.outputs:e.outputFrames??[],{frames:s,arena:i,arenaAlignment:r}=e.externalArena!==void 0?zf(t,e.externalArena):$f(t),o=new Jt(1024),a=e.errorCode!==null&&e.errorCode!==void 0?o.createString(String(e.errorCode)):0,l=e.errorMessage!==null&&e.errorMessage!==void 0?o.createString(String(e.errorMessage)):0,E=B.createOutputsVector(o,rh(o,s)),_=Kf(o,i,r);B.startPIVResponse(o),B.addStatusCode(o,Number(e.statusCode??0)),B.addStatus(o,nh(e)),B.addYielded(o,e.yielded===!0),B.addBacklogRemaining(o,ui(e.backlogRemaining)),B.addOutputs(o,E),B.addPayloadArena(o,_),B.addErrorCode(o,a),B.addErrorMessage(o,l),B.addTraceId(o,jt(e.traceId));let I=B.endPIVResponse(o);W.startPIV(o),W.addResponse(o,I),W.finishPIVBuffer(o,W.endPIV(o));let m=o.asUint8Array(),A=W.getRootAsPIV(new pt(m));return Wf(m,A.RESPONSE()?.payloadArenaArray(),\"response\",r),m}var Cn=Object.freeze({Inline:0,Ref:1}),Pn=Object.freeze({Duplicates:0,None:1,Current:2}),Ne=Object.freeze({Stream:0,Rows:1,Auto:2}),Un=Object.freeze({Default:0,Ed25519:1,Secp256k1:2,Secp256k1Digest:3,X25519:4,Sha256:5,Sha512:6,Aes256Gcm:7,HkdfSha256:8});var r_=Object.freeze({TimerTick:\"TICK\",HttpRequest:\"HREQ\",HttpResponse:\"HRSP\",ModuleConfig:\"MCFG\",IngestRequest:\"INGQ\",IngestResult:\"INGR\",FlowNotice:\"FNTC\"});function oh(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return t.length<8?\"\":String.fromCharCode(t[4],t[5],t[6],t[7])}var ah=e=>e==null?\"\":String(e);function fh(e,t){let s=new Zt(256);return t(s,e.pack(s)),s.asUint8Array().slice()}function hh(e,t){let s=new Qt(String(e));if(typeof t==\"string\")s.KIND=$.String,s.STRING_VALUE=t;else if(typeof t==\"number\"||typeof t==\"bigint\")s.KIND=$.Number,s.NUMBER_VALUE=Number(t);else if(typeof t==\"boolean\")s.KIND=$.Bool,s.BOOL_VALUE=t;else if(Array.isArray(t))if(t.every(i=>typeof i==\"number\"))s.KIND=$.NumberList,s.NUMBERS=t.map(Number);else if(t.every(i=>i&&typeof i==\"object\"&&!Array.isArray(i)))s.KIND=$.TableList,s.TABLES=t.map(i=>new Ft(wi(i)));else if(t.every(i=>typeof i==\"string\"))s.KIND=$.StringList,s.STRINGS=t.slice();else throw new Error(`ModuleConfig: ${e} mixes value kinds`);else if(t&&typeof t==\"object\")s.KIND=$.TableList,s.TABLES=[new Ft(wi(t))];else throw new Error(`ModuleConfig: ${e} has no config value kind (${t===null?\"null\":typeof t})`);return s}var wi=e=>Object.keys(e||{}).filter(t=>e[t]!==void 0&&e[t]!==null).sort().map(t=>hh(t,e[t]));function Mn(e={}){return fh(new zt(wi(e)),xt.finishModuleConfigBuffer)}var ch={duplicates:Vt.Duplicates,none:Vt.None,current:Vt.Current},n_=Object.fromEntries(Object.entries(ch).map(([e,t])=>[t,e]));var uh={unchanged:wt.Unchanged,skipped:wt.Skipped,missing:wt.Missing,expired:wt.Expired,info:wt.Info},o_=Object.fromEntries(Object.entries(uh).map(([e,t])=>[t,e]));var Hn=\"HostOps.fbs\";function ie(e){let t=Gt[e];if(typeof t!=\"function\"||!t.SIZE)throw new Error(`hostcall: ${e} is not a HostOps record`);return t}var Bn=e=>e[0].toLowerCase()+e.slice(1);function lh(e){let t=Object.getOwnPropertyNames(e.prototype);return t.filter(s=>s.startsWith(\"set\")&&!s.startsWith(\"setHas\")&&!s.endsWith(\"Length\")&&!s.endsWith(\"At\")).map(s=>s.slice(3)).concat(t.filter(s=>s.startsWith(\"set\")&&s.endsWith(\"At\")&&!s.startsWith(\"setHas\")).map(s=>s.slice(3,-2)))}function Ti(e,t,s,i){for(let[r,o]of Object.entries(s||{})){if(o==null)continue;let a=e.prototype,l=Bn(r);if(typeof a[`set${r}At`]==\"function\"){if(t[`set${r}Length`](o.length),o.forEach((E,_)=>t[`set${r}At`](_,E)),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`${l}Length`]()!==o.length)throw new RangeError(`${i}.${r}: ${o.length} items exceed the record's bound`);continue}if(typeof a[`set${r}`]!=\"function\"){if(typeof a[l]==\"function\"&&typeof o==\"object\"){let E=t[l]();Ti(E.constructor,E,o,`${i}.${r}`),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0);continue}throw new Error(`${i}: no field ${r}`)}if(typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`set${r}`](typeof o==\"number\"&&typeof t[l]()==\"bigint\"?BigInt(o):o),typeof o==\"string\"&&t[l]()!==o)throw new RangeError(`${i}.${r}: \"${o.slice(0,40)}...\" exceeds the record's ${new TextEncoder().encode(t[l]()).length}-byte string`)}}function Fn(e,t){let s={};for(let i of lh(e)){let r=Bn(i);if(typeof t[`has${i}`]==\"function\"&&!t[`has${i}`]()){s[i]=typeof t[`${r}Length`]==\"function\"?[]:null;continue}if(typeof t[`${r}Length`]==\"function\"){s[i]=Array.from({length:t[`${r}Length`]()},(o,a)=>t[`${r}At`](a));continue}s[i]=t[r]()}for(let i of Object.getOwnPropertyNames(e.prototype)){if(i.startsWith(\"has\")||i.startsWith(\"set\")||i===\"constructor\")continue;let r=i[0].toUpperCase()+i.slice(1);r in s||typeof e.prototype[`setHas${r}`]!=\"function\"||(s[r]=t[`has${r}`]()?Fn(t[i]().constructor,t[i]()):null)}return s}function Eh(e,t){let s=ie(e),i=new Uint8Array(s.SIZE);return Ti(s,s.fromPointer(i.buffer,0),t,e),i}function _h(e,t){let s=ie(e),i=new Uint8Array(s.SIZE*t.length);return t.forEach((r,o)=>Ti(s,s.fromPointer(i.buffer,o*s.SIZE),r,`${e}[${o}]`)),i}function dh(e,t){let s={},i={},r={};for(let o of e||[]){let a=o.portId??o.PORT_ID,l=o.typeRef||{},E=l.rootType??l.rootTypeName??l.ROOT_TYPE??null,_=o.payload instanceof Uint8Array?o.payload:new Uint8Array(o.payload||[]);if((o.wireFormat??l.wireFormat)===\"aligned-binary\"&&E){let I=ie(E),m=_.slice();if(m.length%I.SIZE)throw new RangeError(`${t}: ${a} is ${m.length} bytes, not a whole number of ${E} (${I.SIZE})`);let A=Array.from({length:m.length/I.SIZE},(T,w)=>Fn(I,I.fromPointer(m.buffer,w*I.SIZE)));Number(l.byteLength??0)>0?s[a]={type:E,value:A[0]??null}:i[a]={type:E,values:A}}else r[a]=_.slice()}return{records:s,lists:i,raw:r}}var ph=e=>typeof e==\"string\"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e);function Ih(e,{record:t,recordPort:s,recordType:i,raw:r={},lists:o={}},a,l,E){let _=[];if(t!=null){if(!i)throw new Error(`${E}: takes no ${s} record`);let I=ie(i);_.push({portId:s,wireFormat:\"aligned-binary\",typeRef:{schemaName:Hn,rootType:i,wireFormat:\"aligned-binary\",byteLength:I.SIZE,requiredAlignment:I.ALIGN},payload:Eh(i,t)})}for(let[I,m]of Object.entries(o)){let A=l[I];if(!A)throw new Error(`${E}: no list port ${I}`);let T=ie(A);_.push({portId:I,wireFormat:\"aligned-binary\",typeRef:{schemaName:Hn,rootType:A,wireFormat:\"aligned-binary\",byteLength:0,requiredAlignment:T.ALIGN},payload:_h(A,m)})}for(let[I,m]of Object.entries(r)){if(!a.includes(I))throw new Error(`${E}: no raw port ${I}`);_.push({portId:I,payload:ph(m)})}return _}function Vn(e){let t=Ln(e),s=t.methodId??\"\",{records:i,lists:r,raw:o}=dh(t.inputs,s),a=re[s];if(a&&i.params&&i.params.type!==a.params)throw new Error(`hostcall: ${s} takes ${a.params}, the frame carries ${i.params.type}`);return{op:s,params:i.params?.value??null,lists:Object.fromEntries(Object.entries(r).map(([l,E])=>[l,E.values])),raw:o}}var xn=Object.freeze({null:0,bool:1,i64:2,f64:3,str:4,bytes:5}),Sh=Object.fromEntries(Object.entries(xn).map(([e,t])=>[t,e]));function Gn(e){let t=(e||[]).map(o=>{let a=o&&typeof o==\"object\"&&!(o instanceof Uint8Array)&&\"t\"in o?o:null,l=a?a.t:o==null?\"null\":typeof o==\"boolean\"?\"bool\":typeof o==\"bigint\"?\"i64\":typeof o==\"number\"?Number.isInteger(o)?\"i64\":\"f64\":typeof o==\"string\"?\"str\":o instanceof Uint8Array?\"bytes\":null,E=a?a.v:o,_;switch(l){case\"null\":_=new Uint8Array(0);break;case\"bool\":_=Uint8Array.of(E?1:0);break;case\"i64\":_=new Uint8Array(8),new DataView(_.buffer).setBigInt64(0,BigInt(E),!0);break;case\"f64\":_=new Uint8Array(8),new DataView(_.buffer).setFloat64(0,Number(E),!0);break;case\"str\":_=new TextEncoder().encode(String(E));break;case\"bytes\":_=E instanceof Uint8Array?E:new Uint8Array(E);break;default:throw new TypeError(`SQL value ${String(o)} has no FlatSQL parameter tag`)}return[xn[l],_]}),s=new Uint8Array(t.reduce((o,[,a])=>o+5+a.length,0)),i=new DataView(s.buffer),r=0;for(let[o,a]of t)s[r]=o,i.setUint32(r+1,a.length,!0),s.set(a,r+5),r+=5+a.length;return s}function kn(e){let t=e instanceof Uint8Array?e:new Uint8Array(e||[]),s=new DataView(t.buffer,t.byteOffset,t.byteLength),i=[],r=0;for(;r<t.length;){if(r+5>t.length)throw new RangeError(\"SQL values: truncated value header\");let o=t[r],a=s.getUint32(r+1,!0),l=r+5;if(l+a>t.length)throw new RangeError(\"SQL values: payload exceeds the buffer\");let E=Sh[o],_={null:0,bool:1,i64:8,f64:8}[E];if(E===void 0)throw new RangeError(`SQL values: unknown tag ${o}`);if(_!==void 0&&a!==_)throw new RangeError(`SQL values: a ${E} carries ${_} bytes, not ${a}`);let I=t.subarray(l,l+a);i.push({t:E,v:E===\"null\"?null:E===\"bool\"?I[0]!==0:E===\"i64\"?s.getBigInt64(l,!0):E===\"f64\"?s.getFloat64(l,!0):E===\"str\"?new TextDecoder().decode(I):I.slice()}),r=l+a}return i}var Ah=Object.freeze([\"unsupported\",\"not-authorized\",\"invalid-params\",\"failed\",\"refused\",\"sandbox\",\"timeout\",\"too-large\"]);function Oi(e){if(e?.ok){let s=re[e.op];if(!s)throw new Error(`hostcall: unknown operation ${e.op}`);let i=Ih(s,{record:e.result,recordPort:\"result\",recordType:s.result,raw:e.raw,lists:e.lists},s.rawOut,s.listsOut,`${e.op} result`);return bi({statusCode:0,outputs:i})}let t=e?.error?.code??\"failed\";if(!Ah.includes(t))throw new Error(`hostcall: unknown error code ${t}`);return bi({statusCode:1,status:\"FAILED\",errorCode:t,errorMessage:ah(e?.error?.message)})}function Yn(e){return oh(e)===\"$PIV\"}var p=(e,t,s,i={})=>Object.freeze({params:e,result:t,capability:s,rawIn:Object.freeze(i.rawIn||[]),rawOut:Object.freeze(i.rawOut||[]),listsIn:Object.freeze(i.listsIn||{}),listsOut:Object.freeze(i.listsOut||{})}),bh=[\"data\",\"key\",\"private_key\",\"public_key\",\"signature\",\"nonce\",\"aad\",\"ikm\",\"salt\",\"info\",\"envelope\"],Rh=[\"data\",\"nonce\",\"private_key\",\"public_key\"],C=(e,t)=>p(\"CryptoParams\",e,t,{rawIn:bh,rawOut:Rh}),vn={rawOut:[\"stream\"]},Ri={rawIn:[\"sql\",\"params\"]},re=Object.freeze({\"host.runtimeTarget\":p(null,null,null,{rawOut:[\"value\"]}),\"host.listCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listSupportedCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listOperations\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.hasCapability\":p(\"HasCapabilityParams\",\"BoolValue\",null),\"clock.now\":p(null,\"TimeValue\",\"clock\"),\"clock.nowIso\":p(null,null,\"clock\",{rawOut:[\"value\"]}),\"clock.monotonicNow\":p(null,\"NumberValue\",\"clock\"),\"random.bytes\":p(\"RandomBytesParams\",null,\"random\",{rawOut:[\"data\"]}),\"node.publicKey\":p(null,null,null,{rawOut:[\"value\"]}),\"node.peerId\":p(null,null,null,{rawOut:[\"value\"]}),\"plugin.getConfig\":p(null,null,null,{rawOut:[\"config\"]}),\"http.request\":p(\"HttpParams\",\"HttpResult\",\"http\",{rawIn:[\"url\",\"headers\",\"body\"],rawOut:[\"url\",\"headers\",\"body\"]}),\"websocket.exchange\":p(\"WebsocketParams\",\"WebsocketResult\",\"websocket\",{rawIn:[\"url\",\"protocols\",\"message\"],rawOut:[\"url\",\"body\"]}),\"mqtt.publish\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"payload\",\"password\"]}),\"mqtt.subscribeOnce\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"password\"],rawOut:[\"body\"]}),\"tcp.request\":p(\"SocketParams\",\"SocketResult\",\"tcp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"udp.request\":p(\"SocketParams\",\"SocketResult\",\"udp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"tls.request\":p(\"SocketParams\",\"SocketResult\",\"tls\",{rawIn:[\"data\",\"ca\",\"cert\",\"key\"],rawOut:[\"body\"]}),\"storage.query\":p(\"StorageQueryParams\",null,\"storage_query\",{listsOut:{records_meta:\"StoredRecordMeta\"},rawOut:[\"records\"]}),\"storage.write\":p(\"StorageWriteParams\",\"StorageWriteResult\",\"storage_write\",{rawIn:[\"data\"]}),\"storage.delete\":p(\"StorageDeleteParams\",null,\"storage_write\"),\"storage.expire\":p(\"StorageExpireParams\",\"StorageExpireResult\",\"storage_write\"),\"storage.ingest_with_source\":p(\"StorageIngestParams\",\"StorageIngestResult\",\"storage_ingest\",{rawIn:[\"records\",\"archive\"],listsIn:{provenance:\"Provenance\",provenance_attributes:\"ProvenanceAttribute\"}}),\"storage.flatsql_query_stream\":p(\"SqlStreamParams\",\"StreamResult\",\"storage_query\",{...Ri,...vn}),\"storage.flatsql_epoch_stream\":p(\"EpochStreamParams\",\"StreamResult\",\"storage_query\",vn),\"storage.query_sandboxed\":p(\"SandboxQueryParams\",\"SandboxQueryResult\",\"storage_query\",{...Ri,rawOut:[\"stream\",\"cells\"],listsOut:{columns:\"TextValue\"}}),\"storage.query_surface\":p(null,\"QuerySurfaceLimits\",\"storage_query\",{listsOut:{tables:\"SurfaceTable\",columns:\"SurfaceColumn\"}}),\"storage.flatsql_cache_key\":p(\"CacheKeyParams\",null,\"storage_query\",{...Ri,listsIn:{projection:\"TextValue\"},rawOut:[\"value\"]}),\"crypto.hash\":C(null,\"crypto_hash\"),\"crypto.sign\":C(null,\"crypto_sign\"),\"crypto.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.encrypt\":C(null,\"crypto_encrypt\"),\"crypto.decrypt\":C(null,\"crypto_decrypt\"),\"crypto.key_agreement\":C(null,\"crypto_key_agreement\"),\"crypto.kdf\":C(null,\"crypto_kdf\"),\"crypto.generate_key\":C(null,\"crypto_sign\"),\"crypto.random\":C(null,\"crypto_hash\"),\"crypto.ed25519.publicKeyFromSeed\":C(null,\"crypto_sign\"),\"crypto.ed25519.sign\":C(null,\"crypto_sign\"),\"crypto.ed25519.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.secp256k1.publicKeyFromPrivate\":C(null,\"crypto_sign\"),\"crypto.secp256k1.sign\":C(null,\"crypto_sign\"),\"crypto.secp256k1.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.sha256\":C(null,\"crypto_hash\"),\"crypto.sha512\":C(null,\"crypto_hash\"),\"crypto.hkdf\":C(null,\"crypto_kdf\"),\"crypto.aesGcmEncrypt\":C(null,\"crypto_encrypt\"),\"crypto.aesGcmDecrypt\":C(null,\"crypto_decrypt\"),\"crypto.x25519.generateKeypair\":C(null,\"crypto_key_agreement\"),\"crypto.x25519.publicKey\":C(null,\"crypto_key_agreement\"),\"crypto.x25519.sharedSecret\":C(null,\"crypto_key_agreement\"),\"crypto.sealedBox.encryptForRecipient\":C(null,\"crypto_encrypt\"),\"crypto.sealedBox.decryptFromEnvelope\":C(null,\"crypto_decrypt\"),\"crypto.secp256k1.signDigest\":C(null,\"crypto_sign\"),\"crypto.secp256k1.verifyDigest\":C(\"BoolValue\",\"crypto_verify\"),\"keyslot.sign\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"keyslot.unwrap\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"ephemeral_public_key\",\"nonce\",\"ciphertext\"],rawOut:[\"data\"]}),\"secrets.get\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawOut:[\"secret\"]}),\"secrets.status\":p(\"SecretParams\",\"SecretResult\",\"secrets\"),\"secrets.put\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawIn:[\"secret\"]}),\"secrets.clear\":p(\"SecretParams\",null,\"secrets\"),\"ipfs.add\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\",{rawIn:[\"data\"]}),\"ipfs.cat\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{links:\"IpfsLink\"}}),\"ipfs.pin_add\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_rm\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{pins:\"IpfsPin\"}}),\"ipfs.dag_get\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.name_resolve\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.name_publish\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.id\":p(null,\"IpfsResult\",\"ipfs\",{listsOut:{addresses:\"TextValue\"}}),\"ipfs.swarm_peers\":p(null,null,\"ipfs\",{listsOut:{peers:\"IpfsSwarmPeer\"}}),\"ipfs.pubsub_publish\":p(\"PubsubParams\",null,\"ipfs\",{rawIn:[\"data\"]}),\"pubsub.publish\":p(\"PubsubParams\",null,\"pubsub\",{rawIn:[\"data\"]}),\"pubsub.subscribe\":p(\"PubsubParams\",\"PubsubSubscribed\",\"pubsub\"),\"pubsub.unsubscribe\":p(\"PubsubParams\",null,\"pubsub\"),\"pubsub.list_topics\":p(null,null,\"pubsub\",{listsOut:{items:\"TextValue\"}}),\"protocol.request\":p(\"ProtocolParams\",null,\"protocol_dial\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"protocol_dial.dial\":p(\"ProtocolParams\",null,\"protocol_dial\"),\"protocol_handle.register\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"protocol_handle.unregister\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"p2p.peers_snapshot\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{peers:\"P2pPeer\",peer_addresses:\"P2pPeerValue\",peer_standards:\"P2pPeerValue\"},rawOut:[\"records\"]}),\"p2p.standards_snapshot\":p(\"P2pParams\",null,\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.pnm_history\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.latest_dataset\":p(\"P2pParams\",\"P2pLatestDataset\",\"p2p_read\",{rawOut:[\"stream\"]}),\"node_status_read.status\":p(null,\"NodeStatusReport\",\"node_status_read\",{listsOut:{bandwidth_history:\"NodeBandwidthSample\"}}),\"node_activity_read.activity\":p(\"NodeActivityParams\",null,\"node_activity_read\",{listsOut:{events:\"NodeActivityEvent\"}}),\"timers.delay\":p(\"TimersDelayParams\",null,\"timers\"),\"schedule.parse\":p(\"ScheduleParams\",null,\"schedule_cron\",{listsOut:{fields:\"CronField\"}}),\"schedule.matches\":p(\"ScheduleParams\",\"BoolValue\",\"schedule_cron\"),\"schedule.next\":p(\"ScheduleParams\",\"TimeValue\",\"schedule_cron\"),\"filesystem.resolvePath\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.readFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"data\"]}),\"filesystem.writeFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.appendFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.deleteFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.mkdir\":p(\"FsParams\",null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.readdir\":p(null,null,\"filesystem\",{rawIn:[\"path\"],listsOut:{entries:\"FsEntry\"}}),\"filesystem.stat\":p(null,\"FsStat\",\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.rename\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"to_path\"]}),\"exec.execFile\":p(\"ExecParams\",\"ExecResult\",\"process_exec\",{rawIn:[\"file\",\"cwd\",\"input\"],listsIn:{args:\"TextValue\",env:\"EnvVar\"},rawOut:[\"stdout\",\"stderr\"]}),\"context.get\":p(\"ContextParams\",\"BoolValue\",\"context_read\",{rawOut:[\"value\"]}),\"context.listKeys\":p(\"ContextParams\",null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.listScopes\":p(null,null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.set\":p(\"ContextParams\",null,\"context_write\",{rawIn:[\"value\"]}),\"context.delete\":p(\"ContextParams\",\"BoolValue\",\"context_write\")});function wh(e){if(!Number.isInteger(e)||e<0||e>255)throw new TypeError(\"Expected byte values in range 0..255.\")}function Th(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(Array.isArray(e))return e.forEach(wh),Uint8Array.from(e);throw new TypeError(\"Expected Uint8Array, ArrayBuffer, ArrayBufferView, or byte array.\")}function mi(e){return Buffer.from(Th(e)).toString(\"base64\")}var qn=256*1024*1024;function gi(e){let t=String(e??\"\").trim();if(t.length>qn)throw new RangeError(`Base64 input exceeds ${qn} character limit.`);return new Uint8Array(Buffer.from(t,\"base64\"))}var Hi=new TextEncoder,U=e=>e===void 0?void 0:Ht(e),ct=e=>e==null?void 0:e instanceof Uint8Array?e:typeof e==\"string\"?Hi.encode(e):new Uint8Array(e),ne=e=>(e||[]).map(t=>({VALUE:String(t)})),jn=e=>BigInt(Math.round(e instanceof Date?e.getTime():Number(e))),Xn=e=>e.toLowerCase().replace(/_([a-z0-9])/g,(t,s)=>s.toUpperCase()),Oh=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1_$2\").toUpperCase();function He(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===0||i===0n||i===!1||(t[Xn(s)]=typeof i==\"bigint\"?Number(i):i);return t}function ve(e,t){if(!e||!t||typeof t!=\"object\")return null;let s={};for(let[i,r]of Object.entries(t))r==null||r instanceof Uint8Array||typeof r==\"object\"||(s[Oh(i)]=r);return mh(e,s)}function mh(e,t){let s=Gt[e]?.prototype;return s?Object.fromEntries(Object.entries(t).filter(([i])=>typeof s[`set${i}`]==\"function\")):t}function gh(e){if(!e)return;let t={};for(let s of U(e).split(/\\r?\\n/)){let i=s.indexOf(\":\");i>0&&(t[s.slice(0,i).trim()]=s.slice(i+1).trim())}return t}function yh(e){return e?(typeof e.entries==\"function\"&&!(e instanceof Map)&&!Array.isArray(e)?Array.from(e.entries()):e instanceof Map?Array.from(e):Object.entries(e)).map(([s,i])=>`${s}: ${Array.isArray(i)?i.join(\", \"):i}`).join(`\\r\n`):void 0}var yi=16;function Nh(e){if(!e||e.length<yi)throw Object.assign(new Error(\"AES-GCM data is shorter than its 16-byte tag\"),{hostcallCode:\"invalid-params\"});return{ciphertext:e.subarray(0,e.length-yi),tag:e.subarray(e.length-yi)}}var Dh=(e,t)=>{let s=new Uint8Array(e.length+t.length);return s.set(e,0),s.set(t,e.length),s},nt=(e,t=\"failed\")=>Object.assign(new Error(e),{hostcallCode:t}),R=e=>e==null?\"\":String(e);function bt(e){if(e==null||e===\"\")return;if(e instanceof Date)return BigInt(Number.isFinite(e.getTime())?e.getTime():0);if(typeof e==\"bigint\")return e;if(typeof e==\"number\")return BigInt(Number.isFinite(e)?Math.trunc(e):0);let t=Date.parse(String(e));return BigInt(Number.isFinite(t)?t:0)}var Ue=(e,t)=>Object.keys(e).find(s=>e[s]===Number(t??0))??\"\",rt=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):void 0,Kn=new Map;function Lh(e){let t=Kn.get(e);return t||Kn.set(e,t=e.fromPointer(new ArrayBuffer(e.SIZE),0)),t}function Ch(e){if(typeof e==\"bigint\")return e;if(typeof e==\"boolean\")return e?1n:0n;if(typeof e==\"string\"&&/^-?\\d+$/.test(e.trim()))return BigInt(e.trim());let t=Number(e);return BigInt(Number.isFinite(t)?Math.trunc(t):0)}function Jn(e,t){let s=Lh(e),i=e.prototype,r={};for(let[o,a]of Object.entries(t||{})){if(a==null)continue;let l=o[0].toLowerCase()+o.slice(1);if(typeof i[`set${o}`]!=\"function\"){typeof i[l]==\"function\"&&typeof i[`setHas${o}`]==\"function\"&&typeof a==\"object\"&&(r[o]=Jn(s[l]().constructor,a));continue}let E=typeof s[l]();r[o]=E===\"bigint\"?Ch(a):E===\"number\"?Number.isFinite(Number(a))?Number(a):0:E===\"boolean\"?a===!0||a===\"true\":String(a)}return r}var H=(e,t)=>Jn(Gt[e],t);function De(e,t){let s={};for(let[i,r]of Object.entries(t||{}))[\"string\",\"number\",\"boolean\",\"bigint\"].includes(typeof r)&&(s[i.toUpperCase()]=r);return H(e,s)}function G(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===!1||i===0||i===0n||Array.isArray(i)&&i.length===0||(t[s.toLowerCase()]=typeof i==\"bigint\"?Number(i):i);return t}function Ph(e){let t=new Uint8Array(e.reduce((r,o)=>r+4+o.length,0)),s=new DataView(t.buffer),i=0;for(let r of e)s.setUint32(i,r.length,!0),t.set(r,i+4),i+=4+r.length;return t}var Wn=2**53;function Uh(e){if(!e.params)return;let t;try{t=kn(e.params)}catch(s){throw nt(`params: ${s.message}`,\"invalid-params\")}return t.map(({t:s,v:i})=>s===\"null\"?{t:s}:s===\"i64\"?{t:s,v:i>BigInt(Wn)||i<-BigInt(Wn)?i.toString():Number(i)}:{t:s,v:i})}var Hh=e=>Ue(Cn,e?.DELIVER)===\"Ref\"?\"ref\":void 0;function Mi(e,t){delete e.deliver;let s=Hh(t);return s&&(e.deliver=s),e}function Ni({params:e,raw:t}){let s={sql:U(t.sql)??\"\"},i=Uh(t);return i&&(s.params=i),Mi(s,e)}var to=e=>({TOKEN:e.token,SIZE:e.size,FRAMES:e.frames??-1,FNV1A64:R(e.fnv1a64)});function Di(e,t=\"StreamResult\"){let s={ROWS:e?.rows??0,COLUMNS:e?.columns??0},i={raw:{}};return e?.ref&&typeof e.ref==\"object\"?s.REF=to(e.ref):rt(e?.stream)&&(i.raw.stream=rt(e.stream)),i.result=H(t,s),i}function vh(e){if(e==null)return{t:\"null\"};if(typeof e==\"boolean\")return{t:\"bool\",v:e};if(typeof e==\"number\")return Number.isInteger(e)?{t:\"i64\",v:BigInt(e)}:{t:\"f64\",v:e};if(typeof e==\"string\")return{t:\"str\",v:e};throw nt(`storage.query_sandboxed: a cell is a ${Array.isArray(e)?\"list\":typeof e} (nested values are not SQL values)`)}function vi(e,t){if(e!=null){if(typeof e==\"bigint\")return Number(e);if(Array.isArray(e))return e.filter(s=>s!=null).map((s,i)=>vi(s,`${t}.${i}`));if(typeof e==\"object\"){if(e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)throw nt(`plugin.getConfig: ${t} is a ${e.constructor?.name??\"object\"}`);let s={};for(let i of Object.keys(e)){let r=vi(e[i],t?`${t}.${i}`:i);r!==void 0&&(s[i]=r)}return s}if(typeof e==\"string\"||typeof e==\"number\"||typeof e==\"boolean\")return e;throw nt(`plugin.getConfig: ${t} is a ${typeof e}`)}}function Mh(e){let t=vi(e??{},\"\")??{};if(Array.isArray(t)||typeof t!=\"object\")throw nt(\"plugin.getConfig: the config is not an object\");try{return Mn(t)}catch(s){throw nt(`plugin.getConfig: ${s.message}`)}}function Le({params:e,raw:t}){let s={id:R(e?.ID)};return e?.USERNAME&&(s.username=e.USERNAME),t.secret&&(s.secret=U(t.secret)),s}function $n(e){return{result:H(\"SecretResult\",{ID:R(e?.id),CONFIGURED:e?.configured===!0||e?.stored===!0,USERNAME_MASKED:R(e?.username_masked),UPDATED_MS:bt(e?.updated_at??e?.updatedAt)??0n,VERIFIED_MS:bt(e?.verified_at)??0n})}}function Zn(e){return t=>{if(t==null||t===\"\")throw nt(`node ${e} not available`);return{raw:{value:String(t)}}}}function Qn(e){return H(\"P2pPnmEntry\",{PEER_ID:e.peer_id,PUBLISHER_PEER_ID:e.publisher_peer_id,GOSSIP_PEER_ID:e.gossip_peer_id,STANDARD:e.standard,SCHEMA:e.schema,FILE_ID:e.file_id,FILE_NAME:e.file_name,CID:e.cid,PUBLISH_MS:bt(e.publish_timestamp??e.publish_ms),SIGNATURE_TYPE:e.signature_type,SIGNATURE_HEX:e.signature??e.signature_hex,SIGNATURE_VERIFIED:e.signature_verified,ATTRIBUTION:e.attribution,PNM_INDEX:e.pnm_index??-1,PUBLISHER_KEY_HEX:e.publisher_key??e.publisher_key_hex,PUBLISHER_KEY_SOURCE:e.publisher_key_source})}var Li=e=>rt(e?.records)?{records:rt(e.records)}:{},Bh={Default:\"\",Ed25519:\"ed25519\",Secp256k1:\"secp256k1\",X25519:\"x25519\",Sha256:\"sha256\",Sha512:\"sha512\",Aes256Gcm:\"aes-256-gcm\",HkdfSha256:\"hkdf-sha256\"},Fh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Vh(e){let t=rt(e);if(t)return t;let s=typeof e==\"string\"?e:e&&typeof e==\"object\"&&e.__type===\"bytes\"?R(e.base64):void 0;if(!(s===void 0||!Fh.test(s)))return gi(s)}function Ce(e,t){return(s,{op:i})=>{let r=t===void 0?s:s&&typeof s==\"object\"&&!rt(s)?s[t]:void 0,o=Vh(r);if(!o)throw nt(`${i}: the host answered no ${t??\"bytes\"}`);return{raw:{[e]:o}}}}function Kt(e,t,s,i){return s[i]!==void 0&&(e[t]=mi(s[i])),e}var zn=e=>{let t=Number(e);return Number.isFinite(t)?Math.trunc(t):0},Ci=e=>t=>({lists:{items:(Array.isArray(t?.[e])?t[e]:[]).map(R).sort().map(s=>({VALUE:s}))}}),xh={ns:1e-6,us:.001,µs:.001,μs:.001,ms:1,s:1e3,m:6e4,h:36e5};function Gh(e){let t=R(e);if(t===\"0\")return 0;let s=/^([-+]?)((?:(?:\\d+\\.?\\d*|\\.\\d+)(?:ns|us|µs|μs|ms|s|m|h))+)$/.exec(t);if(!s)return 0;let i=0;for(let[,r,o]of s[2].matchAll(/(\\d+\\.?\\d*|\\.\\d+)(ns|us|µs|μs|ms|s|m|h)/g))i+=Number(r)*xh[o];return s[1]===\"-\"?-i:i}function kh(e){let t=s=>Array.isArray(s)?s.map(t):s&&typeof s==\"object\"?Object.fromEntries(Object.keys(s).sort().map(i=>[i,t(s[i])])):s;return JSON.stringify(t(e)??null).replace(/[<>&\\u2028\\u2029]/g,s=>`\\\\u${s.charCodeAt(0).toString(16).padStart(4,\"0\")}`)}var oe=e=>e&&typeof e==\"object\"&&!Array.isArray(e)?e:{},Pe=({params:e})=>Mi(G(e),e),At=e=>Array.isArray(e)?e.filter(t=>t&&typeof t==\"object\"):[],eo={\"host.runtimeTarget\":{out:e=>({raw:{value:String(e)}})},\"host.listCapabilities\":{out:e=>({lists:{items:ne(e)}})},\"host.listSupportedCapabilities\":{out:e=>({lists:{items:ne(e)}})},\"host.listOperations\":{out:e=>({lists:{items:ne(e)}})},\"host.hasCapability\":{in:({params:e})=>({capability:e?.CAPABILITY}),out:e=>({result:{VALUE:!!e}})},\"clock.now\":{out:e=>({result:{UNIX_MS:jn(e)}})},\"clock.nowIso\":{out:e=>({raw:{value:String(e)}})},\"clock.monotonicNow\":{out:e=>({result:{VALUE:Number(e)}})},\"random.bytes\":{in:({params:e})=>({length:e?.LENGTH||32}),out:e=>({raw:{data:ct(e)}})},\"timers.delay\":{in:({params:e})=>({ms:e?.MS??0}),out:()=>({})},\"schedule.parse\":{in:({params:e})=>({expression:e?.EXPRESSION}),out:e=>({lists:{fields:Object.entries(e||{}).filter(([,t])=>t&&typeof t==\"object\"&&Array.isArray(t.values)).map(([t,s])=>({NAME:t,SOURCE:String(s.source??\"\"),HAS_WILDCARD:!!s.hasWildcard,VALUES:s.values}))}})},\"schedule.matches\":{in:({params:e})=>({expression:e?.EXPRESSION,date:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{VALUE:!!e}})},\"schedule.next\":{in:({params:e})=>({expression:e?.EXPRESSION,from:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{UNIX_MS:jn(e)}})},\"http.request\":{in:({params:e,raw:t})=>({url:U(t.url),method:e?.METHOD||\"GET\",headers:gh(t.headers),body:t.body,timeoutMs:e?.TIMEOUT_MS||void 0,responseType:\"bytes\",redirect:e?.NO_REDIRECTS?\"manual\":\"follow\",maxBytes:e?.MAX_BYTES?Number(e.MAX_BYTES):void 0}),out:(e,{params:t})=>{let s=ct(e?.body)??new Uint8Array(0);if(t?.MAX_BYTES&&s.length>Number(t.MAX_BYTES))throw Object.assign(new Error(`HTTP body of ${s.length} bytes exceeds MAX_BYTES ${t.MAX_BYTES}`),{hostcallCode:\"too-large\"});return{result:{STATUS:e?.status??0,RETRIEVED_MS:BigInt(Date.now())},raw:{url:String(e?.url??\"\"),headers:yh(e?.headers)??\"\",body:s}}}},\"websocket.exchange\":{in:({params:e,raw:t})=>({url:U(t.url),protocols:t.protocols?U(t.protocols).split(\",\").map(s=>s.trim()).filter(Boolean):void 0,message:t.message===void 0?void 0:e?.MESSAGE_IS_TEXT?U(t.message):t.message,timeoutMs:e?.TIMEOUT_MS||void 0,expectResponse:!e?.NO_RESPONSE,responseType:\"bytes\"}),out:e=>({result:{PROTOCOL:e?.protocol??\"\",EXTENSIONS:e?.extensions??\"\",CLOSE_CODE:e?.closeCode??-1,CLOSE_REASON:e?.closeReason??\"\",BODY_IS_TEXT:typeof e?.body==\"string\"},raw:{url:String(e?.url??\"\"),...e?.body==null?{}:{body:ct(e.body)}}})},\"mqtt.publish\":{in:({params:e,raw:t})=>({...He(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,payload:t.payload,password:U(t.password)}),out:e=>({result:ve(\"MqttResult\",e)})},\"mqtt.subscribeOnce\":{in:({params:e,raw:t})=>({...He(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,password:U(t.password),responseType:\"bytes\"}),out:e=>({result:ve(\"MqttResult\",e),raw:e?.payload==null&&e?.body==null?{}:{body:ct(e.payload??e.body)}})},\"tcp.request\":Ui(),\"udp.request\":Ui(),\"tls.request\":Ui(({raw:e})=>({ca:U(e.ca),cert:U(e.cert),key:U(e.key)})),\"filesystem.resolvePath\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{path:String(e)}})},\"filesystem.readFile\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{data:ct(e)}})},\"filesystem.writeFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.appendFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.deleteFile\":{in:({raw:e})=>({path:U(e.path)}),out:()=>({})},\"filesystem.mkdir\":{in:({params:e,raw:t})=>({path:U(t.path),recursive:!e?.NOT_RECURSIVE}),out:()=>({})},\"filesystem.readdir\":{in:({raw:e})=>({path:U(e.path)??\".\"}),out:e=>({lists:{entries:(e||[]).map(t=>({NAME:t.name,IS_FILE:!!t.isFile,IS_DIRECTORY:!!t.isDirectory}))}})},\"filesystem.stat\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({result:{SIZE:BigInt(e?.size??0),IS_FILE:!!e?.isFile,IS_DIRECTORY:!!e?.isDirectory,CTIME_MS:Number(e?.ctimeMs??0),MTIME_MS:Number(e?.mtimeMs??0)},raw:{path:String(e?.path??\"\")}})},\"filesystem.rename\":{in:({raw:e})=>({fromPath:U(e.path),toPath:U(e.to_path)}),out:()=>({})},\"exec.execFile\":{in:({params:e,raw:t,lists:s})=>({file:U(t.file),args:(s.args||[]).map(i=>i.VALUE),cwd:U(t.cwd),input:t.input,env:s.env?Object.fromEntries(s.env.map(i=>[i.NAME,i.VALUE])):void 0,timeoutMs:e?.TIMEOUT_MS||void 0}),out:e=>({result:{EXIT_CODE:e?.exitCode??-1,SIGNAL:e?.signal??\"\"},raw:{stdout:ct(e?.stdout)??new Uint8Array(0),stderr:ct(e?.stderr)??new Uint8Array(0)}})},\"context.get\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:e!=null},raw:e==null?{}:{value:ct(e)}})},\"context.set\":{in:({params:e,raw:t})=>({scope:e?.SCOPE,key:e?.KEY,value:t.value??new Uint8Array(0)}),out:()=>({})},\"context.delete\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:!!e}})},\"context.listKeys\":{in:({params:e})=>({scope:e?.SCOPE}),out:e=>({lists:{items:ne(e)}})},\"context.listScopes\":{out:e=>({lists:{items:ne(e)}})},\"crypto.sha256\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.sha512\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.hkdf\":{in:({params:e,raw:t})=>({ikm:t.ikm,salt:t.salt??new Uint8Array(0),info:t.info,length:e?.LENGTH||32}),out:it},\"crypto.aesGcmEncrypt\":{in:({raw:e})=>({key:e.key,plaintext:e.data??new Uint8Array(0),iv:e.nonce,aad:e.aad}),out:(e,{raw:t})=>({raw:{data:Dh(e.ciphertext,e.tag),nonce:t.nonce}})},\"crypto.aesGcmDecrypt\":{in:({raw:e})=>({key:e.key,...Nh(e.data),iv:e.nonce,aad:e.aad}),out:it},\"crypto.x25519.generateKeypair\":{out:e=>({raw:{private_key:e.privateKey,public_key:e.publicKey}})},\"crypto.x25519.publicKey\":{in:({raw:e})=>({privateKey:e.private_key}),out:it},\"crypto.x25519.sharedSecret\":{in:({raw:e})=>({privateKey:e.private_key,publicKey:e.public_key}),out:it},\"crypto.sealedBox.encryptForRecipient\":{in:({raw:e})=>({plaintext:e.data??new Uint8Array(0),recipientPublicKey:e.public_key,context:e.info?U(e.info):void 0}),out:e=>({raw:{data:gi(e.protectedBlobBase64)}})},\"crypto.sealedBox.decryptFromEnvelope\":{in:({raw:e})=>({envelope:{protectedBlobBase64:mi(e.envelope??e.data)},recipientPrivateKey:e.private_key}),out:it},\"crypto.secp256k1.publicKeyFromPrivate\":{in:({raw:e})=>({privateKey:e.private_key}),out:it},\"crypto.secp256k1.sign\":{in:({raw:e})=>({message:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Pi},\"crypto.secp256k1.signDigest\":{in:({raw:e})=>({digest:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verifyDigest\":{in:({raw:e})=>({digest:e.data,signature:e.signature,publicKey:e.public_key}),out:Pi},\"crypto.ed25519.publicKeyFromSeed\":{in:({raw:e})=>({seed:e.private_key}),out:it},\"crypto.ed25519.sign\":{in:({raw:e})=>({message:e.data,seed:e.private_key}),out:it},\"crypto.ed25519.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Pi},\"plugin.getConfig\":{in:()=>({}),out:e=>({raw:{config:Mh(e)}})},\"node.peerId\":{in:()=>({}),out:Zn(\"peer ID\")},\"node.publicKey\":{in:()=>({}),out:Zn(\"public key\")},\"secrets.get\":{in:Le,out:e=>({result:H(\"SecretResult\",{ID:R(e?.id),USERNAME:R(e?.username),CONFIGURED:!0}),raw:{secret:ct(e?.secret)??new Uint8Array(0)}})},\"secrets.status\":{in:Le,out:$n},\"secrets.put\":{in:Le,out:$n},\"secrets.clear\":{in:Le,out:()=>({})},\"storage.write\":{in:({params:e,raw:t})=>({...G(e),data:t.data??new Uint8Array(0)}),out:e=>({result:H(\"StorageWriteResult\",{CID:R(e?.cid)})})},\"storage.query\":{in:({params:e})=>G(e),out:e=>{let t=[],s=[];for(let i of At(Array.isArray(e)?e:e?.records)){let r=i.SourceTags||{},o=rt(i.Data)??new Uint8Array(0);s.push(o),t.push(H(\"StoredRecordMeta\",{CID:R(i.CID),ROW_ID:i.RowID??0,PEER_ID:R(i.PeerID),TIMESTAMP_MS:bt(i.Timestamp)??0n,MATERIALIZED_MS:bt(i.MaterializedAt)??0n,LENGTH:o.length,PROVIDER_ID:R(r.ProviderID),SOURCE_NAME:R(r.SourceName),BATCH_ID:R(r.BatchID),PRODUCER_PEER_ID:R(r.ProducerPeerID),LICENSE:R(r.License)}))}return{lists:{records_meta:t},raw:{records:Ph(s)}}}},\"storage.delete\":{in:({params:e})=>G(e),out:()=>({})},\"storage.expire\":{in:({params:e})=>G(e),out:e=>({result:De(\"StorageExpireResult\",e)})},\"storage.ingest_with_source\":{in:({params:e,raw:t,lists:s})=>{let i=G(e);delete i.archive_source,delete i.archive_name,i.reconcile=Ue(Pn,e?.RECONCILE).toLowerCase(),t.records&&(i.records=t.records),t.archive&&(i.archive={source:R(e?.ARCHIVE_SOURCE),name:R(e?.ARCHIVE_NAME),raw:t.archive});let r=s.provenance?.[0],o=s.provenance_attributes;if(r||o?.length){let a={};o?.length&&(a.attributes=o.map(E=>({name:R(E.NAME),value:R(E.VALUE)})));for(let[E,_]of Object.entries(r||{}))a[E.toLowerCase()]=typeof _==\"bigint\"?Number(_):_??\"\";let l=Object.fromEntries(Object.keys(a).sort().map(E=>[E,a[E]]));i.provenance={source:R(e?.SOURCE_NAME),json:Hi.encode(JSON.stringify(l))}}return i},out:e=>{let t=De(\"StorageIngestResult\",e);return e?.provenance&&(t.PROVENANCE_FILE=R(e.provenance)),{result:t}}},\"storage.flatsql_query_stream\":{in:Ni,out:e=>Di(e)},\"storage.flatsql_epoch_stream\":{in:({params:e})=>Mi(G(e),e),out:e=>Di(e)},\"storage.query_sandboxed\":{in:e=>({...Ni(e),want:Ue(Ne,e.params?.WANT).toLowerCase()}),out:e=>{if(e?.kind!==\"rows\"){let o=Di(e,\"SandboxQueryResult\");return o.result.KIND=Ne.Stream,o}let t=typeof e.json==\"string\"?e.json:rt(e.json)?U(rt(e.json)):void 0;if(t===void 0)throw nt(\"storage.query_sandboxed: rows answer carries no rows\");let s;try{s=JSON.parse(t)}catch(o){throw nt(`storage.query_sandboxed: ${o.message}`)}if(!Array.isArray(s))throw nt(\"storage.query_sandboxed: rows are not a JSON array\");let i=s.length&&s[0]&&typeof s[0]==\"object\"?Object.keys(s[0]):[],r=[];for(let o of s){if(!o||typeof o!=\"object\"||Array.isArray(o))throw nt(\"storage.query_sandboxed: a row is not an object\");for(let a of Object.values(o))r.push(vh(a))}return{result:H(\"SandboxQueryResult\",{KIND:Ne.Rows,ROWS:s.length,COLUMNS:i.length}),lists:{columns:i.map(o=>({VALUE:o}))},raw:{cells:Gn(r)}}}},\"storage.query_surface\":{in:()=>({}),out:e=>{let t=[],s=[];for(let r of At(e?.tables)){let o=R(r.name);t.push(H(\"SurfaceTable\",{NAME:o,KIND:R(r.kind),SOURCE:R(r.source),RECORDS:r.records??0}));for(let a of Array.isArray(r.columns)?r.columns:[])typeof a==\"string\"?s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:a})):a&&typeof a==\"object\"&&s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:R(a.name),PLACEHOLDER:a.placeholder===!0}))}let i=e?.caps&&typeof e.caps==\"object\"?e.caps:null;return{...i?{result:H(\"QuerySurfaceLimits\",{TIMEOUT_MS:i.timeout_ms??0,MAX_ROWS:i.max_rows??0,MAX_BYTES:i.max_bytes??0})}:{},lists:{tables:t,columns:s}}}},\"storage.flatsql_cache_key\":{in:e=>{let t={...G(e.params),...Ni(e)};return e.lists.projection&&(t.projection=e.lists.projection.map(s=>R(s.VALUE))),t},out:e=>({raw:{value:R(e?.key)}})},\"p2p.peers_snapshot\":{in:Pe,out:e=>{let t=[],s=[],i=[];for(let r of At(e?.peers)){t.push(H(\"P2pPeer\",{PEER_ID:R(r.peer_id),CONNECTED:r.connected===!0,SELF:r.self===!0,EPM_INDEX:r.epm_index??-1,AGENT_VERSION:r.agent_version}));for(let o of Array.isArray(r.addrs)?r.addrs:[])s.push(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}));for(let o of Array.isArray(r.standards)?r.standards:[])i.push(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}))}return{result:De(\"P2pSummary\",e),lists:{peers:t,peer_addresses:s,peer_standards:i},raw:Li(e)}}},\"p2p.standards_snapshot\":{in:Pe,out:e=>({lists:{entries:At(e?.entries).map(Qn)},raw:Li(e)})},\"p2p.pnm_history\":{in:Pe,out:e=>({result:De(\"P2pSummary\",e),lists:{entries:At(e?.entries).map(Qn)},raw:Li(e)})},\"p2p.latest_dataset\":{in:Pe,out:e=>{let t=e?.serving&&typeof e.serving==\"object\"?e.serving:{},s=(t.pnm&&typeof t.pnm==\"object\"?t.pnm:e?.pnm)||{};return{result:H(\"P2pLatestDataset\",{KNOWN:e?.known===!0,REASON:e?.reason,PINNED:e?.pinned,SELF:e?.self,FRESH:e?.fresh,STANDARD:e?.standard,SCHEMA:e?.schema,PNM_CID:s.CID??s.cid,PNM_FILE_ID:s.FILE_ID??s.file_id,PNM_PUBLISH_MS:bt(s.PUBLISH_TIMESTAMP??s.publish_timestamp),PNM_SIGNATURE_VERIFIED:s.signature_verified,PNM_ATTRIBUTION:s.attribution,BATCH_ID:t.batch_id,PROVIDER_ID:t.provider_id,SOURCE_NAME:t.source_name,RECORD_COUNT:t.record_count,BYTE_COUNT:t.byte_count,PARTS:t.parts,PUBLISHED_MS:bt(t.published_at),ETAG_FNV1A64:t.etag_fnv1a64,REF:t.ref&&typeof t.ref==\"object\"?to(t.ref):void 0}),raw:rt(t.stream)?{stream:rt(t.stream)}:{}}}},\"keyslot.sign\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)},i=Bh[Ue(Un,e?.ALGORITHM)];return i&&(s.algorithm=i),Kt(s,\"payload\",t,\"payload\")},out:Ce(\"data\",\"signature\")},\"keyslot.unwrap\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)};return Kt(s,\"ephemeralPublicKey\",t,\"ephemeral_public_key\"),Kt(s,\"nonce\",t,\"nonce\"),Kt(s,\"ciphertext\",t,\"ciphertext\")},out:Ce(\"data\",\"plaintext\")},\"protocol.request\":{in:({params:e,raw:t})=>{let s={target:R(e?.TARGET),protocolId:R(e?.PROTOCOL_ID)};return Number(e?.TIMEOUT_MS)>0&&(s.timeoutMs=Number(e.TIMEOUT_MS)),Kt(s,\"payloadBase64\",t,\"payload\")},out:Ce(\"data\")},\"pubsub.list_topics\":{in:()=>({}),out:Ci(\"topics\")},\"ipfs.cat\":{in:({params:e})=>G(e),out:Ce(\"data\")},\"ipfs.dag_get\":{in:({params:e})=>G(e),out:e=>({raw:{data:rt(e)??Hi.encode(kh(e))}})},\"ipfs.ls\":{in:({params:e})=>G(e),out:e=>({lists:{links:At(oe(e).Objects).flatMap(t=>At(t.Links)).map(t=>H(\"IpfsLink\",{NAME:R(t.Name),CID:R(t.Hash),SIZE:zn(t.Size),TYPE:zn(t.Type)}))}})},\"ipfs.pin_add\":{in:({params:e})=>G(e),out:Ci(\"Pins\")},\"ipfs.pin_rm\":{in:({params:e})=>G(e),out:Ci(\"Pins\")},\"ipfs.pin_ls\":{in:({params:e})=>G(e),out:e=>{let t=oe(oe(e).Keys);return{lists:{pins:Object.keys(t).sort().map(s=>H(\"IpfsPin\",{CID:s,TYPE:R(oe(t[s]).Type)}))}}}},\"ipfs.name_resolve\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{VALUE:R(e?.Path)})})},\"ipfs.name_publish\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.Name),VALUE:R(e?.Value)})})},\"ipfs.id\":{in:()=>({}),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.ID),VALUE:R(e?.PublicKey),AGENT_VERSION:R(e?.AgentVersion),PROTOCOL_VERSION:R(e?.ProtocolVersion)}),lists:{addresses:(Array.isArray(e?.Addresses)?e.Addresses:[]).map(t=>({VALUE:R(t)}))}})},\"ipfs.swarm_peers\":{in:()=>({}),out:e=>({lists:{peers:At(oe(e).Peers).map(t=>H(\"IpfsSwarmPeer\",{PEER_ID:R(t.Peer),ADDRESS:R(t.Addr),LATENCY_MS:Gh(t.Latency)}))}})},\"ipfs.pubsub_publish\":{in:({params:e,raw:t})=>Kt({topic:R(e?.TOPIC)},\"base64\",t,\"data\"),out:()=>({})},\"node_status_read.status\":{in:()=>({}),out:e=>{let t=e?.store||{},s=e?.service||{},i={UPTIME_S:e?.uptime_seconds??0,STARTED_MS:bt(e?.started_at)??0n,STORE_TOTAL_BYTES:t.total_bytes??0,STORE_TOTAL_RECORDS:t.total_records??0,STORAGE_PATH:R(t.storage_path),SERVICE_STATE:R(s.state),SERVICE_MODE:R(s.mode)};e?.disk&&typeof e.disk==\"object\"&&Object.assign(i,{HAS_DISK:!0,DISK_CAPACITY_BYTES:e.disk.capacity_bytes??0,DISK_FREE_BYTES:e.disk.free_bytes??0,DISK_AVAILABLE_BYTES:e.disk.available_bytes??0});let r=[];if(e?.bandwidth&&typeof e.bandwidth==\"object\"){let o=e.bandwidth;Object.assign(i,{HAS_BANDWIDTH:!0,TOTAL_IN_BYTES:o.total_in_bytes??0,TOTAL_OUT_BYTES:o.total_out_bytes??0,RATE_IN_BPS:o.rate_in_bps??0,RATE_OUT_BPS:o.rate_out_bps??0});for(let a of At(o.history))r.push(H(\"NodeBandwidthSample\",{TS_MS:bt(a.ts)??0n,TOTAL_IN_BYTES:a.total_in_bytes??0,TOTAL_OUT_BYTES:a.total_out_bytes??0,RATE_IN_BPS:a.rate_in_bps??0,RATE_OUT_BPS:a.rate_out_bps??0}))}return{result:H(\"NodeStatusReport\",i),lists:{bandwidth_history:r}}}},\"node_activity_read.activity\":{in:({params:e})=>G(e),out:e=>({lists:{events:At(e?.events).map(t=>H(\"NodeActivityEvent\",{TS_MS:bt(t.ts)??0n,KIND:R(t.kind),DETAIL:R(t.detail),PEER_ID:R(t.peer_id)}))}})}};function it(e){return{raw:{data:ct(e)??new Uint8Array(0)}}}function Pi(e){return{result:{VALUE:e!==null&&typeof e==\"object\"?e.result===!0:!!e}}}function Ui(e=()=>({})){return{in:t=>{let{params:s,raw:i}=t,r=He(s);return delete r.noResponse,delete r.allowUnauthorized,delete r.serverName,{...r,data:i.data,responseEncoding:\"bytes\",expectResponse:!s?.NO_RESPONSE,rejectUnauthorized:!s?.ALLOW_UNAUTHORIZED,servername:s?.SERVER_NAME||void 0,...e(t)}},out:t=>({result:ve(\"SocketResult\",t),raw:t?.body==null?{}:{body:ct(t.body)}})}}function Yh(e){let t=eo[e.op];return t?.in?t.in(e):{...He(e.params),...Object.fromEntries(Object.entries(e.raw).map(([s,i])=>[Xn(s),i]))}}function qh(e,t){let s=eo[e.op];if(s?.out)return s.out(t,e);let i=re[e.op];return{result:i?.result?ve(i.result,t):void 0}}function jh(e){if(e?.hostcallCode)return e.hostcallCode;let t=e?.name??e?.constructor?.name??\"\";return t===\"HostCapabilityError\"||t===\"BrowserHostCapabilityError\"||e?.code===\"host-capability-denied\"?\"not-authorized\":t===\"HostFilesystemScopeError\"?\"sandbox\":t===\"AbortError\"||t===\"TimeoutError\"||/timed out/i.test(e?.message??\"\")?\"timeout\":/^Unknown .* operation|not available in the synchronous hostcall ABI|does not implement/.test(e?.message??\"\")?\"unsupported\":/exceeds? the record/.test(e?.message??\"\")?\"too-large\":e instanceof RangeError||e instanceof TypeError||t===\"RangeError\"||t===\"TypeError\"?\"invalid-params\":\"failed\"}function so(e,t,{allowAsync:s=!1}={}){let i,r=a=>Oi({ok:!1,error:{code:jh(a),message:String(a?.message??a)}}),o=a=>{try{return Oi({ok:!0,op:i.op,...qh(i,a)})}catch(l){return r(l)}};try{if(i=Vn(e),!re[i.op])throw Object.assign(new Error(`Unknown host operation \"${i.op}\".`),{hostcallCode:\"unsupported\"});let a=t(i.op,Yh(i));if(a&&typeof a.then==\"function\"){if(!s)throw typeof a.catch==\"function\"&&a.catch(()=>{}),Object.assign(new Error(`Operation \"${i.op}\" is not available in the synchronous hostcall ABI.`),{hostcallCode:\"unsupported\"});return a.then(o,r)}return o(a)}catch(a){return a&&!a.hostcallCode&&i===void 0&&(a.hostcallCode=\"invalid-params\"),r(a)}}var io=Object.freeze({\"node.peerId\":{capability:null,adapter:\"node\",method:\"peerId\"},\"node.publicKey\":{capability:null,adapter:\"node\",method:\"publicKey\"},\"secrets.get\":{capability:\"secrets\",adapter:\"secrets\",method:\"get\"},\"secrets.status\":{capability:\"secrets\",adapter:\"secrets\",method:\"status\"},\"secrets.put\":{capability:\"secrets\",adapter:\"secrets\",method:\"put\"},\"secrets.clear\":{capability:\"secrets\",adapter:\"secrets\",method:\"clear\"},\"storage.write\":{capability:\"storage_write\",adapter:\"storage\",method:\"write\"},\"storage.query\":{capability:\"storage_query\",adapter:\"storage\",method:\"query\"},\"storage.delete\":{capability:\"storage_write\",adapter:\"storage\",method:\"delete\"},\"storage.expire\":{capability:\"storage_write\",adapter:\"storage\",method:\"expire\"},\"storage.ingest_with_source\":{capability:\"storage_ingest\",adapter:\"storage\",method:\"ingest_with_source\"},\"storage.flatsql_query_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_query_stream\"},\"storage.flatsql_epoch_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_epoch_stream\"},\"storage.query_sandboxed\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_sandboxed\"},\"storage.query_surface\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_surface\"},\"storage.flatsql_cache_key\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_cache_key\"},\"p2p.peers_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"peers_snapshot\"},\"p2p.standards_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"standards_snapshot\"},\"p2p.pnm_history\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"pnm_history\"},\"p2p.latest_dataset\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"latest_dataset\"},\"node_status_read.status\":{capability:\"node_status_read\",adapter:\"node\",method:\"status\"},\"node_activity_read.activity\":{capability:\"node_activity_read\",adapter:\"node\",method:\"activity\"}}),p_=Object.freeze([\"ipfs.ls\",\"ipfs.pin_add\",\"ipfs.pin_rm\",\"ipfs.pin_ls\",\"ipfs.dag_get\",\"ipfs.id\",\"ipfs.swarm_peers\",\"ipfs.name_resolve\",\"ipfs.name_publish\",\"ipfs.pubsub_publish\"]),I_=Object.freeze([...new Set(Object.values(io).map(e=>e.capability).filter(Boolean))]);var Fi=\"space_data_module_host\",Dt=0,Bi=1,O_=Object.freeze([\"host.runtimeTarget\",\"host.listCapabilities\",\"host.listSupportedCapabilities\",\"host.listOperations\",\"host.hasCapability\",\"plugin.getConfig\",\"clock.now\",\"clock.monotonicNow\",\"clock.nowIso\",\"random.bytes\",\"schedule.parse\",\"schedule.matches\",\"schedule.next\",\"filesystem.resolvePath\"]);function Kh(e,t){let s=String(e??\"\").trim();if(!s)throw new TypeError(`${t} is required.`);return s}function oo(e){if(typeof e!=\"function\")throw new TypeError(\"getMemory must be a function returning WebAssembly.Memory.\");let t=e();if(!t||typeof t!=\"object\"||!(\"buffer\"in t))throw new TypeError(\"getMemory must return a WebAssembly.Memory-like object.\");let s=t.buffer;if(!(s instanceof ArrayBuffer||s instanceof SharedArrayBuffer))throw new TypeError(\"Hostcall memory buffer must be an ArrayBuffer or SharedArrayBuffer.\");return s}function ro(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(`${i} pointer must be a non-negative integer.`);if(!Number.isInteger(s)||s<0)throw new RangeError(`${i} length must be a non-negative integer.`);let r=oo(e);if(t+s>r.byteLength)throw new RangeError(`${i} range exceeds guest memory bounds.`);return new Uint8Array(r,t,s)}function Wh(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(\"Response pointer must be a non-negative integer.\");if(!Number.isInteger(i)||i<0)throw new RangeError(\"Response max length must be a non-negative integer.\");let r=s instanceof Uint8Array?s:new Uint8Array(s),o=oo(e),a=Math.min(r.length,i);if(t+a>o.byteLength)throw new RangeError(\"Response range exceeds guest memory bounds.\");return new Uint8Array(o,t,a).set(r.subarray(0,a)),a}function $h(e){if(e.length===0)return null;let{meta:t,segments:s}=Ie(e);return vt(t,s)}function no(e,t=null){return{name:e?.name??\"Error\",message:e?.message??String(e),code:e?.code??null,operation:e?.operation??t,capability:e?.capability??null}}function Zh(e){return e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"}function ao(e={}){let t=e.dispatch;if(typeof t!=\"function\")throw new TypeError(\"createHostcallBridge requires a dispatch function.\");let s=e.getMemory,i=Kh(e.moduleName??Fi,\"Hostcall import module name\"),r=Number.isInteger(e.maxRequestBytes)?e.maxRequestBytes:16*1024*1024,o=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:64*1024*1024,a=Dt,l={ok:!0,result:null},E=qe(l,[]);function _(d,S){let b=[],y=pe(S,b),g=qe(y,b);if(g.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);a=d,l=S,E=g}function I(d,S,b,y){try{if(y>r)throw new Error(`Hostcall request exceeds ${r} byte limit.`);let g=Ht(ro(s,d,S,\"Operation\")),M=ro(s,b,y,\"Payload\");if(Yn(M)){let Rt=so(M.slice(),t);if(Rt.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);return a=Dt,l=null,E=Rt,Dt}let K=$h(M),F=t(g,K);if(Zh(F))throw typeof F.catch==\"function\"&&F.catch(()=>{}),new Error(`Operation \"${g}\" returned a Promise. The synchronous hostcall ABI only supports synchronous operations.`);return _(Dt,{ok:!0,result:F===void 0?null:F}),Dt}catch(g){try{_(Bi,{ok:!1,error:no(g)})}catch(M){_(Bi,{ok:!1,error:no(M)})}return Bi}}function m(){return E.length}function A(d,S){return Wh(s,d,E,S)}function T(){return _(Dt,{ok:!0,result:null}),Dt}function w(){return a}return{moduleName:i,imports:{[i]:{call:I,response_len:m,read_response:A,clear_response:T,last_status_code:w}},getLastEnvelope(){return structuredClone(l)},getLastResponseBytes(){return new Uint8Array(E)},getLastResponseEnvelope(){let{meta:d,segments:S}=Ie(E);return vt(d,S)}}}var g_=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),y_=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var N_=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Me=4096;var D_=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function fo(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t>>>0}var Qh=1330201683,zh=1,Xh=0,Jh=1,tc=2,ec=3,sc=4,co=5;var ic=7;var rc=9,Fe=10,nc=11;var oc=13,So=64,uo=So*4;var ac=1;var fc=1,hc=2,cc=3,fe=32767,he=0,Ao=1,lo=2,uc=3,lc=4,Ec=5,_c=6,dc=7,pc=8,Ic=9,Eo=10,bo=11,Sc=12,Ac=13,bc=8,Ro=9,Vi=128,xi=0,Rc=1,wc=2;var Tc=4,Oc=0;var mc=0,gc=1,yc=1,ae=2,Be=3,Nc=4,Dc=5,Lc=6,Cc=7;var P_=64*1024;var _o=250,Pc=20;function po(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function Uc(e,t){return Math.ceil(e/t)*t}function wo(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function Hc(e){wo(e);let t=new Int32Array(e,0,So);if(t[Xh]!==Qh||t[Jh]!==zh)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let s=t[tc],i=t[ec],r=t[sc],o=t[nc],a=Uc(uo+r*4,64),l=new Int32Array(e,uo,r),E=[];for(let _=0;_<s;_+=1){let I=a+_*i;E.push({index:_,base:I,i32:new Int32Array(e,I,Vi/4),f64:new Float64Array(e,I,Vi/8),data:new Uint8Array(e,I+Vi,o)})}return{buffer:e,header:t,instances:l,slots:E,slotCount:s,slotBytes:i,dataBytes:o,maxInstances:r,channelId:t[oc]}}function vc(e){return`sdm-sab-io-doorbell-${e}`}function Mc(e,t){Atomics.add(e.header,co,1),Atomics.notify(e.header,co),Atomics.load(e.header,ic)===ac&&t()?.postMessage(0)}function Bc(e){let t=null;return{get(){return!t&&typeof BroadcastChannel==\"function\"&&(t=new BroadcastChannel(e)),t},close(){t?.close(),t=null}}}var Fc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Vc(){return(Math.random()*2147483646|0)+1}function xc(e,t){let s=(Atomics.add(e.header,rc,1)>>>0)%e.slotCount;for(let i=0;i<e.slotCount;i+=1){let r=e.slots[(s+i)%e.slotCount];if(Atomics.compareExchange(r.i32,he,xi,Rc)===xi)return Atomics.store(r.i32,Ao,t),r}return null}function Io(e,t){Atomics.store(t.i32,Ao,0),Atomics.store(t.i32,he,xi),Atomics.add(e.header,Fe,1),Atomics.notify(e.header,Fe)}function Gc(e,t,s){let i=e.i32;i[lc]=t,i[Ec]=s.instanceId??fe,i[_c]=s.handle??-1,i[dc]=s.flags??0,i[pc]=s.ptr??0,i[Ic]=s.len??0,i[Ac]=s.dataInSlot?gc:mc,i[bo]=0,e.f64[bc]=s.offset??0,e.f64[Ro]=0,s.path?(e.data.set(s.path,0),i[Eo]=s.path.length):i[Eo]=0}function kc(e){return Atomics.load(e.i32,bo)}function To(e={}){wo(e.buffer);let t=Hc(e.buffer),s=Number.isInteger(e.instanceId)?e.instanceId:fe;if(s!==fe&&(s<0||s>=t.maxInstances))throw new RangeError(`instanceId ${s} is outside 0..${t.maxInstances-1}.`);let i=typeof e.getMemory==\"function\"?e.getMemory:()=>null,r=Number.isFinite(e.spinMicros)?Math.max(0,e.spinMicros):Pc,o=Vc(),a=Bc(vc(t.channelId)),l=0;function E(){for(;;){let d=Atomics.load(t.header,Fe),S=xc(t,o);if(S)return S;Atomics.wait(t.header,Fe,d,_o)}}function _(d,S,b){let y=Atomics.load(d.i32,lo)+1|0||1;Gc(d,S,b),Atomics.store(d.i32,Sc,Oc),Atomics.store(d.i32,lo,y),Atomics.store(d.i32,he,wc),Mc(t,a.get);let g=r>0?po()+r/1e3:0;for(;;){let M=Atomics.load(d.i32,he);if(M===Tc&&Atomics.load(d.i32,uc)===y)break;g>0&&po()<g||Atomics.wait(d.i32,he,M,_o)}return l+=1,{status:kc(d),result:d.f64[Ro]}}function I(d,S){let b=E();try{return _(b,d,S)}finally{Io(t,b)}}function m(){return s!==fe&&Atomics.load(t.instances,s)===fc}function A(){if(s===fe)return!1;let d=Atomics.load(t.instances,s);return d===hc||d===cc}function T(d,S,b,y){let g=0;for(;g<b.length;){let M=Math.min(t.dataBytes,b.length-g),K=E(),F;try{d===Be&&K.data.set(b.subarray(g,g+M),0),F=_(K,d,{instanceId:s,dataInSlot:!0,handle:S,ptr:0,len:M,offset:y+g}).status,d===ae&&F>0&&b.set(K.data.subarray(0,F),g)}finally{Io(t,K)}if(F<0)return g>0&&d===ae?g:F;if(g+=F,F<M)break}return g}function w(d,S){let b=i(),y=b?.buffer??b;return!y||d<0||S<0||d+S>y.byteLength?null:new Uint8Array(y,d,S)}return{instanceId:s,get requests(){return l},open(d,S){let b=typeof d==\"string\"?Fc.encode(d):d;return!(b instanceof Uint8Array)||b.length===0?-1:b.length>Math.min(t.dataBytes,Me)?-1:I(yc,{instanceId:s,flags:S|0,path:b}).status},read(d,S,b,y){if(b===0)return 0;if(m())return I(ae,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(ae,d,g,y):A()?-3:-1},write(d,S,b,y){if(b===0)return 0;if(m())return I(Be,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(Be,d,g,y):A()?-3:-1},readInto(d,S,b){return S.length===0?0:T(ae,d,S,b)},writeFrom(d,S,b){return S.length===0?0:T(Be,d,S,b)},truncate(d,S){return I(Nc,{instanceId:s,handle:d,offset:S}).status},sync(d){return I(Dc,{instanceId:s,handle:d}).status},size(d){let{status:S,result:b}=I(Lc,{instanceId:s,handle:d});return S<0?S:b},close(d){return I(Cc,{instanceId:s,handle:d}).status},release(){a.close()}}}var Yc=typeof TextEncoder==\"function\"?new TextEncoder:null;function qc(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t|0}var Oo=new WeakMap;function mo(e){let t=Oo.get(e);if(t)return t;let s=new Int32Array(e,0,16);if(s[0]!==1380795475||s[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let i=s[2],r=s[3],o=s[4],a=64,l=a+i*32,E=l+i*o;return t={entries:i,entryBytes:r,maxPathBytes:o,i32:new Int32Array(e,a,i*32/4),f64:new Float64Array(e,a,i*32/8),paths:new Uint8Array(e,l,i*o),data:new Uint8Array(e,E,i*r)},Oo.set(e,t),t}function jc(e){return typeof e==\"string\"?Yc.encode(e):e}function Kc(e,t,s){let i=t*8;if(Atomics.load(e.i32,i+3)!==s.length)return!1;let r=t*e.maxPathBytes;for(let o=0;o<s.length;o+=1)if(e.paths[r+o]!==s[o])return!1;return!0}function Wc(e,t,s){let i=(s>>>0)%e.entries;for(let r=0;r<e.entries;r+=1){let o=i*8,a=Atomics.load(e.i32,o+0);if(a===0)return-1;if((a===2||a===3)&&Atomics.load(e.i32,o+2)===s&&Kc(e,i,t))return i;i=(i+1)%e.entries}return-1}function go(e,t){let s=mo(e),i=jc(t);if(i.length>s.maxPathBytes)return-1;let r=Wc(s,i,qc(i));return r<0?-1:Atomics.load(s.i32,r*(32/4)+0)===2?r:-1}function yo(e,t,s,i){let r=mo(e),o=t*(32/4),a=t*(32/8)+3,l=t*r.entryBytes;for(let E=0;E<64;E+=1){let _=Atomics.load(r.i32,o+1);if(_&1)continue;if(Atomics.load(r.i32,o+0)!==2)return-1;let I=r.f64[a],m=Atomics.load(r.i32,o+4),A;if(i>=I)A=0;else{let T=Math.min(s.length,I-i);i+T>m?A=-1:(s.set(r.data.subarray(l+i,l+i+T),0),A=T)}if(Atomics.load(r.i32,o+1)===_)return A}return-1}function No(e=[\"/h.fsh\"]){let t=Array.from(e,String);return s=>{let i=String(s);for(let r of t)if(i.endsWith(r)||i===r.replace(/^\\//,\"\"))return!0;return!1}}var $c=\"flatsql-io\",mt=Object.freeze({open:1,read:2,write:3,truncate:4,sync:5,size:6,close:7,mirrorRead:8}),Do=24,Lo=16777215;function Gi(){return typeof performance<\"u\"&&performance.now?performance.now()*1e3:Date.now()*1e3}function Zc(e){if(!e?.buffer)return null;let t=new Int32Array(e.buffer,0,4),s=t[1],i=new Float64Array(e.buffer,16,s),r=new Uint8Array(e.buffer,16+s*8,s);return(o,a)=>{let l=Atomics.add(t,0,1);l<s&&(i[l]=Gi()-a,r[l]=o)}}function Qc(e,t,s){if(!e||s<=0||s>Me||t<0)return null;let i=e.buffer??e;return t+s>i.byteLength?null:new Uint8Array(i,t,s).slice()}function zc(e={}){let t=e.getMemory;if(typeof t!=\"function\")throw new TypeError(\"createFlatsqlIoImports requires getMemory().\");let s=Array.isArray(e.provider)?e.provider:[e.provider];if(s.length===0||s.some(A=>!A||typeof A.open!=\"function\"))throw new TypeError(\"createFlatsqlIoImports requires at least one provider.\");if(s.length>127)throw new RangeError(\"At most 127 providers can be routed.\");let i=s.length>1,r=Zc(e.trace),o=e.mirror?.buffer??null,a=o?No(e.mirror.suffixes??[\"/h.fsh\"]):null,l=new Map,E=new TextDecoder;function _(A){if(!i)return{provider:s[0],local:A};let T=A>>>Do,w=s[T];return w?{provider:w,local:A&Lo}:null}function I(A,T,w){let d=r?Gi():0,S;try{S=w()}catch{S=T}return r&&r(A,d),S}return{env:{flatsql_io_open(A,T,w){return I(mt.open,-1,()=>{let d=Qc(t(),A,T);if(!d)return-1;let S=i?fo(d)%s.length:0,b=s[S].open(d,w|0);if(b<0)return b;if(i&&b>Lo)return-4;let y=i?S<<Do|b:b;if(a){let g=E.decode(d);a(g)&&l.set(y,g)}return y})},flatsql_io_read(A,T,w,d){if(o&&l.has(A)){let S=r?Gi():0;try{let b=t(),y=b.buffer??b;if(T>=0&&w>=0&&T+w<=y.byteLength){let g=go(o,l.get(A));if(g>=0){let M=yo(o,g,new Uint8Array(y,T,w),d);if(M>=0)return r&&r(mt.mirrorRead,S),M}}}catch{}}return I(mt.read,-4,()=>{let S=_(A);return S?S.provider.read(S.local,T,w,d):-6})},flatsql_io_write(A,T,w,d){return I(mt.write,-4,()=>{let S=_(A);return S?S.provider.write(S.local,T,w,d):-6})},flatsql_io_truncate(A,T){return I(mt.truncate,-4,()=>{let w=_(A);return w?w.provider.truncate(w.local,T):-6})},flatsql_io_sync(A){return I(mt.sync,-4,()=>{let T=_(A);return T?T.provider.sync(T.local):-6})},flatsql_io_size(A){return I(mt.size,-4,()=>{let T=_(A);return T?T.provider.size(T.local):-6})},flatsql_io_close(A){return I(mt.close,-4,()=>{l.delete(A);let T=_(A);return T?T.provider.close(T.local):-6})}}}}function Xc(e,{getMemory:t}){let s=Array.isArray(e.channels)?e.channels:[e.channel??e.buffer];if(s.length===0||s.some(o=>!(o instanceof SharedArrayBuffer)))throw new TypeError(\"A flatsql-io descriptor needs channels: SharedArrayBuffer[].\");let i=s.map(o=>To({buffer:o,instanceId:e.instanceId,getMemory:t}));return{imports:zc({getMemory:t,provider:i,mirror:e.mirror,trace:e.trace}),close(){for(let o of i)o.release()}}}function Co(e,t){let s=[],i=[];for(let r of e??[]){let o;if(typeof r==\"function\")o=r(t);else if(r&&r.provider===$c)o=Xc(r,t);else if(r&&typeof r.factory==\"function\")o=r.factory({...t,config:r.config});else throw new TypeError(`Unresolvable extraImports entry ${JSON.stringify(r?.provider??r?.moduleUrl??typeof r)}; pass a factory function, a { provider: \"flatsql-io\" } descriptor, or (module workers) a { moduleUrl } descriptor.`);o&&o.imports&&typeof o.close==\"function\"?(s.push(o.imports),i.push(o.close)):o&&s.push(o)}return{fragments:s,close(){for(let r of i)try{r()}catch{}}}}function Po(e,t){for(let s of t)for(let[i,r]of Object.entries(s??{}))e[i]={...e[i]??{},...r};return e}var ce=0,Jc=1,tu=2,Ho=4,ki=0,Uo=1;var eu=0;var Yi=Ho*4,su=4*1024*1024;function iu(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"SAB hostcall channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function vo(e={}){if(typeof SharedArrayBuffer!=\"function\")throw new Error(\"SharedArrayBuffer is unavailable; the async hostcall bridge requires it (browsers additionally require cross-origin isolation: COOP+COEP).\");let t=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:su;if(t<=0)throw new RangeError(\"maxResponseBytes must be a positive integer.\");return new SharedArrayBuffer(Yi+t)}function Mo(e={}){iu(e.buffer);let t=e.postRequest;if(typeof t!=\"function\")throw new TypeError(\"createSabHostcallClientDispatch requires a postRequest function.\");let s=Number.isFinite(e.timeoutMs)&&e.timeoutMs>0?e.timeoutMs:12e4,i=new Int32Array(e.buffer,0,Ho),r=e.buffer.byteLength-Yi;return function(a,l=null){if(Atomics.store(i,ce,Uo),t({operation:a,params:l}),Atomics.wait(i,ce,Uo,s)===\"timed-out\")throw Atomics.store(i,ce,ki),new Error(`Hostcall \"${a}\" timed out after ${s}ms waiting for the controlling thread.`);let _=Atomics.load(i,Jc),I=Atomics.load(i,tu);if(I<0||I>r)throw Atomics.store(i,ce,ki),new RangeError(`Hostcall \"${a}\" response length ${I} exceeds channel capacity ${r}.`);let m=new Uint8Array(I);m.set(new Uint8Array(e.buffer,Yi,I)),Atomics.store(i,ce,ki);let A=Qi(m);if(_!==eu){let T=new Error(A?.message??`Hostcall \"${a}\" failed on the host thread.`);throw T.name=A?.name??\"Error\",T.code=A?.code??null,T.operation=A?.operation??a,T.capability=A?.capability??null,A?.hostcallCode&&(T.hostcallCode=A.hostcallCode),T}return A}}var qi=class extends Error{constructor(t){super(`WASI exit with code ${t}`),this.name=\"WasiExitError\",this.code=t}};function ru(e,t,s,i){for(;;){let r=Atomics.load(e,t);if(s>i-r)return-1;if(Atomics.compareExchange(e,t,r,r+s)===r)return r}}function Bo(e={}){let t=e.processState,s=t?.args??e.args??[],i=t?.env??e.env??{},r=t?.input??new Uint8Array(e.stdinBytes??[]),o=e.logOutput===!0,a=e.performance??globalThis.performance??{now:()=>Date.now(),timeOrigin:0},l=e.crypto??globalThis.crypto??null,E=[],_=[],I=0,m=null;function A(O){m=O}function T(){return m}function w(){return new Uint8Array(m.buffer)}function d(){return new DataView(m.buffer)}let b=Object.entries(i).map(([O,N])=>`${O}=${N}`).map(O=>new TextEncoder().encode(O)),y=s.map(O=>new TextEncoder().encode(O));function g(O,N,D){let v;if(O===0)v=BigInt(Math.round((a.timeOrigin+a.now())*1e6));else if(O===1)v=BigInt(Math.round(a.now()*1e6));else return 28;return d().setBigUint64(D,v,!0),0}function M(O,N,D,v){if(O!==1&&O!==2)return 8;let P=O===1?E:_,k=0,Ct=d(),Pt=w();for(let Ut=0;Ut<D;Ut++){let de=N+Ut*8,gt=Ct.getUint32(de,!0),q=Ct.getUint32(de+4,!0);if(t){let ut=O===1?t.stdout:t.stderr,Zi=ru(t.control,O,q,ut.length);if(Zi<0)return 51;ut.set(Pt.subarray(gt,gt+q),Zi)}else P.push(Pt.slice(gt,gt+q));k+=q}return Ct.setUint32(v,k,!0),0}function K(O,N,D,v){if(O!==0)return d().setUint32(v,0,!0),8;let P=d(),k=w(),Ct=0;for(let Pt=0;Pt<D;Pt+=1){let Ut=N+Pt*8,de=P.getUint32(Ut,!0),gt=P.getUint32(Ut+4,!0),q,ut;if(t)do q=Atomics.load(t.control,0),ut=Math.min(gt,r.length-q);while(Atomics.compareExchange(t.control,0,q,q+ut)!==q);else q=I,ut=Math.min(gt,r.length-q),I+=ut;if(ut===0){if(q>=r.length)break;continue}k.set(r.subarray(q,q+ut),de),Ct+=ut}return P.setUint32(v,Ct,!0),0}function F(O){return O<=2?0:8}function Rt(O,N,D,v){return O<=2?70:8}function $o(O,N){if(O>2)return 8;let D=d();return D.setUint8(N,2),D.setUint16(N+2,0,!0),D.setBigUint64(N+8,0n,!0),D.setBigUint64(N+16,0n,!0),0}function Zo(O,N){return O<=2?0:8}function Qo(O,N){return 8}function zo(O,N,D){return 8}function Xo(){return 8}function Jo(O,N){let D=d();D.setUint32(O,b.length,!0);let v=0;for(let P of b)v+=P.length+1;return D.setUint32(N,v,!0),0}function ta(O,N){let D=d(),v=w(),P=N;for(let k=0;k<b.length;k++)D.setUint32(O+k*4,P,!0),v.set(b[k],P),P+=b[k].length,v[P]=0,P+=1;return 0}function ea(O,N){let D=d();D.setUint32(O,y.length,!0);let v=0;for(let P of y)v+=P.length+1;return D.setUint32(N,v,!0),0}function sa(O,N){let D=d(),v=w(),P=N;for(let k=0;k<y.length;k++)D.setUint32(O+k*4,P,!0),v.set(y[k],P),P+=y[k].length,v[P]=0,P+=1;return 0}function ia(O,N){if(!l?.getRandomValues)return 52;let D=new Uint8Array(N);return l.getRandomValues(D),w().set(D,O),0}function ra(O){throw t&&(Atomics.store(t.control,4,O),Atomics.store(t.control,3,1)),o&&$i(),new qi(O)}function na(){return 0}function $i(){if(E.length>0){let O=_e(E);if(o){let N=new TextDecoder().decode(O);N&&console.log(N)}E.length=0}if(_.length>0){let O=_e(_);if(o){let N=new TextDecoder().decode(O);N&&console.warn(N)}_.length=0}}function _e(O){let N=0;for(let P of O)N+=P.length;let D=new Uint8Array(N),v=0;for(let P of O)D.set(P,v),v+=P.length;return D}return{imports:{wasi_snapshot_preview1:{clock_time_get:g,fd_write:M,fd_read:K,fd_close:F,fd_seek:Rt,fd_fdstat_get:$o,fd_fdstat_set_flags:Zo,fd_prestat_get:Qo,fd_prestat_dir_name:zo,path_open:Xo,environ_sizes_get:Jo,environ_get:ta,args_sizes_get:ea,args_get:sa,random_get:ia,proc_exit:ra,sched_yield:na}},setMemory:A,getMemory:T,flushOutput:$i,get stdout(){return t?t.stdout.slice(0,Atomics.load(t.control,1)):_e(E)},get stderr(){return t?t.stderr.slice(0,Atomics.load(t.control,2)):_e(_)}}}var nu=\"sdm.thread-hostcall\";function ou(e){return WebAssembly.Module.imports(e).some(t=>t.module===Fi)}function au(e){if(!e||typeof e!=\"object\")throw new Error(\"A threaded guest that imports space_data_module_host requires an owning hostcall channel.\");let t=String(e.channelName??\"\").trim(),s=String(e.token??\"\").trim();if(!t||!s)throw new Error(\"The owning thread-hostcall channel name and token are required.\");if(typeof BroadcastChannel!=\"function\")throw new Error(\"BroadcastChannel is required for nested pthread hostcalls.\");let i=vo({maxResponseBytes:e.maxResponseBytes}),r=new BroadcastChannel(t),o=1;return{dispatch:Mo({buffer:i,timeoutMs:e.timeoutMs,postRequest(l){r.postMessage({type:nu,token:s,requestId:o++,buffer:i,...l})}}),close(){r.close()}}}function Fo({wasmModule:e,memory:t,hostcallChannel:s,processState:i,extraImports:r,workerIndex:o,tid:a,threadSpawn:l}={}){let E=Bo({processState:i});E.setMemory(t);let _=null,I=null,m={...E.imports,env:{memory:t},wasi:{\"thread-spawn\":typeof l==\"function\"?l:()=>-1}};if(ou(e)){I=au(s);let T=ao({dispatch:I.dispatch,getMemory:()=>_?.exports?.memory??t});Object.assign(m,T.imports)}let A=Co(r,{memory:t,getMemory:()=>_?.exports?.memory??t,workerIndex:o??null,tid:a??null});return Po(m,A.fragments),m.env.memory=t,{imports:m,instantiate(){return _=new WebAssembly.Instance(e,m),E.setMemory(_.exports.memory??t),_},close(){I?.close(),A.close()}}}async function Vo(e){let t=[];for(let s of e??[])if(s&&typeof s.moduleUrl==\"string\"){let r=(await import(s.moduleUrl))[s.exportName??\"default\"];if(typeof r!=\"function\")throw new TypeError(`extraImports module ${s.moduleUrl} exports no factory \"${s.exportName??\"default\"}\".`);t.push({factory:r,config:s.config??null})}else t.push(s);return t}var fu=Object.freeze({PENDING:0,IDLE:1,CLAIMED:2,ASSIGNED:3,RUNNING:4,RETIRED:5}),{PENDING:$_,IDLE:ue,CLAIMED:xo,ASSIGNED:le,RUNNING:xe,RETIRED:Ki}=fu,Ge=0,hu=1,cu=2,uu=3,lu=4,Ve=5,Eu=6,_u=8,du=8,J=0,Wi=1,Yo=2,Go=3,pu=4,ko=1,Iu=536870911,Su=2;var ot=e=>_u+du*e;function ji(){return typeof performance<\"u\"&&typeof performance.now==\"function\"?performance.now():Date.now()}function ke(e){Atomics.add(e,Ge,1),Atomics.notify(e,Ge)}function Au(e,t,s){Atomics.store(e,ot(t)+J,s),Atomics.notify(e,ot(t)+J),ke(e)}function qo(e,t){Au(e.control,t,Ki)}function bu(e,t,s){let{control:i}=e,r=ot(t);for(;;){let o=Atomics.load(i,r+J);if(o!==le&&o!==xe||Atomics.load(i,r+Wi)!==s)return!1;if(Atomics.compareExchange(i,r+J,o,ue)===o)return ke(i),!0}}function Ru(e,t){let{control:s}=e,i=ot(t);return Atomics.compareExchange(s,i+J,le,xe)!==le?null:{tid:Atomics.load(s,i+Wi),startArg:Atomics.load(s,i+Yo)}}function wu(e,t){let{control:s}=e;Atomics.compareExchange(s,ot(t)+J,xe,ue)===xe&&ke(s)}function jo(e,t,{runThread:s,osThreadId:i=0}){let{control:r}=e,o=ot(t)+J;for(i&&Atomics.store(r,ot(t)+pu,i);;){let a=Atomics.load(r,o);if(a===Ki)return;if(a!==le){Atomics.wait(r,o,a);continue}let l=Ru(e,t);if(l){if(s(l.tid,l.startArg)===!1){qo(e,t);return}wu(e,t)}}}function Ko(e,{owner:t=!1,grow:s=null,dispatchMessage:i=null}={}){let{control:r,spawnWaitMs:o}=e,a=Atomics.load(r,Eu),l=null,E=!0,_=w=>t||(Atomics.load(r,ot(w)+Go)&ko)===0,I=()=>{let w=Math.min(Atomics.load(r,Ve),a),d=0;for(let S=0;S<w;S+=1)if(_(S)){if(Atomics.compareExchange(r,ot(S)+J,ue,xo)===ue)return{slot:S,live:d+1};Atomics.load(r,ot(S)+J)!==Ki&&(d+=1)}return{slot:-1,live:d}},m=()=>{for(;;){let w=Atomics.load(r,Ve);if(w>=a)return-1;if(Atomics.compareExchange(r,Ve,w,w+1)===w)return Atomics.store(r,ot(w)+J,xo),w}},A=()=>{let w=m();if(w<0)return{slot:-1,reason:null};try{return s(w),{slot:w,reason:null}}catch{return qo(e,w),{slot:-1,reason:\"worker-create-failed\"}}},T=()=>{let w=I();if(w.slot>=0)return{slot:w.slot,waited:!1,reason:null};let d=typeof s==\"function\",S=ji(),b=S+(E?o:0),y=S+(E?Math.min(Su,o):0),g=!1;for(;;){let M=Atomics.load(r,Ge);if(w=I(),w.slot>=0)return{slot:w.slot,waited:g,reason:null};let K=d&&Math.min(Atomics.load(r,Ve),a)<a;if(K&&(w.live===0||ji()>=y)){let Rt=A();if(Rt.slot>=0||Rt.reason)return{...Rt,waited:g};continue}if(w.live===0)return{slot:-1,waited:g,reason:\"pool-exhausted\"};if(M===l&&!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};let F=(K?y:b)-ji();if(!K&&F<=0)return l=M,{slot:-1,waited:g,reason:\"pool-exhausted\"};if(F>0){try{Atomics.wait(r,Ge,M,F)}catch{if(E=!1,!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};y=0;continue}g=!0}}};return w=>{let d=T();if(d.slot<0)return d.reason===\"pool-exhausted\"&&Atomics.add(r,lu,1),{tid:-1,slot:-1,reason:d.reason};let{slot:S}=d,b=ot(S),y=Atomics.add(r,hu,1);if(y>Iu)return Atomics.store(r,b+J,ue),ke(r),{tid:-1,slot:-1,reason:\"tid-exhausted\"};if(Atomics.store(r,b+Wi,y),Atomics.store(r,b+Yo,w|0),Atomics.store(r,b+J,le),(Atomics.load(r,b+Go)&ko)!==0)try{i(S,y,w)}catch{return bu(e,S,y),{tid:-1,slot:-1,reason:\"dispatch-failed\"}}else Atomics.notify(r,b+J);return Atomics.add(r,cu,1),d.waited&&Atomics.add(r,uu,1),{tid:y,slot:S,reason:null}}}var Ee=null;function Wo(e,t){try{return Ee.instantiate().exports.wasi_thread_start(e,t),!0}catch(s){return s&&s.name===\"WasiExitError\"?!0:(console.error(`[wasi-thread] guest thread ${e} trapped:`,s),self.postMessage({t:\"error\",tid:e,error:String(s?.message??s)}),!1)}}self.onmessage=async e=>{let t=e.data??{};if(t.t===\"probe\"){let s=t.pool??null;try{let i=await Vo(t.extraImports??[]),r=s?Ko(s):null;Ee=Fo({wasmModule:t.wasmModule,memory:t.memory,hostcallChannel:t.hostcallChannel??null,processState:t.processState,extraImports:i,workerIndex:t.workerIndex,threadSpawn:r?o=>r(o).tid:void 0}),Ee.instantiate(),self.postMessage({t:\"ready\",ok:!0,protocol:2})}catch(i){Ee?.close(),Ee=null,self.postMessage({t:\"ready\",ok:!1,error:String(i?.message??i)});return}s&&jo(s,t.slot,{runThread:Wo});return}t.t===\"run\"&&(Wo(t.tid,t.startArg),self.postMessage({t:\"exit\",tid:t.tid}))};})();\n";
7
- export const WASI_THREAD_POOL_WORKER_BUNDLE_SHA256 = "517c4666d450e9f7cc71fb8f5386c09f55773c453b73ec5b67c92b5ed4ea4eea";
5
+ /** src/host/wasiThreadBrowserWorker.mjs, sha256 4ba02d86c6244b3fe88a27b76da10b8b760b6b3ec75ea58657e39be927e67323. */
6
+ export const WASI_THREAD_POOL_WORKER_BUNDLE = "(()=>{var aa=Object.defineProperty;var fa=(e,t)=>{for(var s in t)aa(e,s,{get:t[s],enumerable:!0})};var ha=new TextDecoder;function vt(e){return ha.decode(e.slice())}var ca=new TextEncoder,qe=\"$bin\";function ua(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function la(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Ie(e,t){if(e==null)return e??null;if(ua(e)){let s=t.length;return t.push(la(e)),{[qe]:s}}return e instanceof Date?e.toISOString():typeof e==\"bigint\"?e.toString():Array.isArray(e)?e.map(s=>Ie(s,t)):typeof e==\"object\"?Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0).map(([s,i])=>[s,Ie(i,t)])):e}function Mt(e,t){if(e==null)return e;if(Array.isArray(e))return e.map(s=>Mt(s,t));if(typeof e==\"object\"){let s=Object.keys(e);if(s.length===1&&s[0]===qe){let i=e[qe];if(!Number.isInteger(i)||i<0||i>=t.length)throw new RangeError(`Hostcall envelope references missing binary segment ${i}.`);return t[i]}return Object.fromEntries(s.map(i=>[i,Mt(e[i],t)]))}return e}function je(e,t=[]){let s=ca.encode(JSON.stringify(e??null)),i=4+s.length+4;for(let c of t)i+=4+c.length;let r=new Uint8Array(i),o=new DataView(r.buffer),a=0;o.setUint32(a,s.length,!0),a+=4,r.set(s,a),a+=s.length,o.setUint32(a,t.length,!0),a+=4;for(let c of t)o.setUint32(a,c.length,!0),a+=4,r.set(c,a),a+=c.length;return r}function Se(e){if(!(e instanceof Uint8Array))throw new TypeError(\"Hostcall envelope must be a Uint8Array.\");if(e.length<8)throw new RangeError(\"Hostcall envelope is truncated.\");let t=new DataView(e.buffer,e.byteOffset,e.byteLength),s=0,i=t.getUint32(s,!0);if(s+=4,s+i+4>e.length)throw new RangeError(\"Hostcall envelope meta exceeds envelope bounds.\");let r=JSON.parse(vt(e.subarray(s,s+i)));s+=i;let o=t.getUint32(s,!0);s+=4;let a=[];for(let c=0;c<o;c+=1){if(s+4>e.length)throw new RangeError(\"Hostcall envelope segment table is truncated.\");let E=t.getUint32(s,!0);if(s+=4,s+E>e.length)throw new RangeError(\"Hostcall envelope segment exceeds envelope bounds.\");a.push(e.subarray(s,s+E)),s+=E}return{meta:r,segments:a}}function zi(e){let{meta:t,segments:s}=Se(e);return Mt(t,s)}var Et=new Int32Array(2),Ae=new Float32Array(Et.buffer),be=new Float64Array(Et.buffer),Bt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Zt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Zt||(Zt={}));var Nt=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return Et[0]=this.readInt32(t),Ae[0]}readFloat64(t){return Et[Bt?0:1]=this.readInt32(t),Et[Bt?1:0]=this.readInt32(t+4),be[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){Ae[0]=s,this.writeInt32(t,Et[0])}writeFloat64(t,s){be[0]=s,this.writeInt32(t,Et[Bt?0:1]),this.writeInt32(t+4,Et[Bt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Zt.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var Qt=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=Nt.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=Nt.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,c=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(c+_)!=this.bb.readInt16(E+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var Ea=Object.defineProperty,_a=(e,t,s)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ke=(e,t,s)=>_a(e,typeof t!=\"symbol\"?t+\"\":t,s),Ft=class e{constructor(){Ke(this,\"bb\",null),Ke(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigTable(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigTable(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new _t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigTable(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endConfigTable(t){return t.endObject()}static createConfigTable(t,s){return e.startConfigTable(t),e.addEntries(t,s),e.endConfigTable(t)}unpack(){return new Vt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Vt=class{constructor(t=[]){Ke(this,\"ENTRIES\",t)}pack(t){let s=Ft.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Ft.createConfigTable(t,s)}};var $=(e=>(e[e.String=0]=\"String\",e[e.Number=1]=\"Number\",e[e.Bool=2]=\"Bool\",e[e.StringList=3]=\"StringList\",e[e.NumberList=4]=\"NumberList\",e[e.TableList=5]=\"TableList\",e))($||{});var da=Object.defineProperty,pa=(e,t,s)=>t in e?da(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,dt=(e,t,s)=>pa(e,typeof t!=\"symbol\"?t+\"\":t,s),_t=class e{constructor(){dt(this,\"bb\",null),dt(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsConfigEntry(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsConfigEntry(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}KEY(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}KIND(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):$.String}STRING_VALUE(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}NUMBER_VALUE(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb_pos+t):0}BOOL_VALUE(){let t=this.bb.__offset(this.bb_pos,12);return t?!!this.bb.readInt8(this.bb_pos+t):!1}STRINGS(t,s){let i=this.bb.__offset(this.bb_pos,14);return i?this.bb.__string(this.bb.__vector(this.bb_pos+i)+t*4,s):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}NUMBERS(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.readFloat64(this.bb.__vector(this.bb_pos+s)+t*8):0}numbersLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}numbersArray(){let t=this.bb.__offset(this.bb_pos,16);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TABLES(t,s){let i=this.bb.__offset(this.bb_pos,18);return i?(s||new Ft).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}tablesLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startConfigEntry(t){t.startObject(8)}static addKey(t,s){t.addFieldOffset(0,s,0)}static addKind(t,s){t.addFieldInt8(1,s,$.String)}static addStringValue(t,s){t.addFieldOffset(2,s,0)}static addNumberValue(t,s){t.addFieldFloat64(3,s,0)}static addBoolValue(t,s){t.addFieldInt8(4,+s,0)}static addStrings(t,s){t.addFieldOffset(5,s,0)}static createStringsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startStringsVector(t,s){t.startVector(4,s,4)}static addNumbers(t,s){t.addFieldOffset(6,s,0)}static createNumbersVector(t,s){t.startVector(8,s.length,8);for(let i=s.length-1;i>=0;i--)t.addFloat64(s[i]);return t.endVector()}static startNumbersVector(t,s){t.startVector(8,s,8)}static addTables(t,s){t.addFieldOffset(7,s,0)}static createTablesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startTablesVector(t,s){t.startVector(4,s,4)}static endConfigEntry(t){let s=t.endObject();return t.requiredField(s,4),s}static createConfigEntry(t,s,i,r,o,a,c,E,_){return e.startConfigEntry(t),e.addKey(t,s),e.addKind(t,i),e.addStringValue(t,r),e.addNumberValue(t,o),e.addBoolValue(t,a),e.addStrings(t,c),e.addNumbers(t,E),e.addTables(t,_),e.endConfigEntry(t)}unpack(){return new zt(this.KEY(),this.KIND(),this.STRING_VALUE(),this.NUMBER_VALUE(),this.BOOL_VALUE(),this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),this.bb.createObjList(this.TABLES.bind(this),this.tablesLength()))}unpackTo(t){t.KEY=this.KEY(),t.KIND=this.KIND(),t.STRING_VALUE=this.STRING_VALUE(),t.NUMBER_VALUE=this.NUMBER_VALUE(),t.BOOL_VALUE=this.BOOL_VALUE(),t.STRINGS=this.bb.createScalarList(this.STRINGS.bind(this),this.stringsLength()),t.NUMBERS=this.bb.createScalarList(this.NUMBERS.bind(this),this.numbersLength()),t.TABLES=this.bb.createObjList(this.TABLES.bind(this),this.tablesLength())}},zt=class{constructor(t=null,s=$.String,i=null,r=0,o=!1,a=[],c=[],E=[]){dt(this,\"KEY\",t),dt(this,\"KIND\",s),dt(this,\"STRING_VALUE\",i),dt(this,\"NUMBER_VALUE\",r),dt(this,\"BOOL_VALUE\",o),dt(this,\"STRINGS\",a),dt(this,\"NUMBERS\",c),dt(this,\"TABLES\",E)}pack(t){let s=this.KEY!==null?t.createString(this.KEY):0,i=this.STRING_VALUE!==null?t.createString(this.STRING_VALUE):0,r=_t.createStringsVector(t,t.createObjectOffsetList(this.STRINGS)),o=_t.createNumbersVector(t,this.NUMBERS),a=_t.createTablesVector(t,t.createObjectOffsetList(this.TABLES));return _t.createConfigEntry(t,s,this.KIND,i,this.NUMBER_VALUE,this.BOOL_VALUE,r,o,a)}};var Tt=(e=>(e[e.Unchanged=0]=\"Unchanged\",e[e.Skipped=1]=\"Skipped\",e[e.Missing=2]=\"Missing\",e[e.Expired=3]=\"Expired\",e[e.Info=4]=\"Info\",e))(Tt||{});var xt=(e=>(e[e.Duplicates=0]=\"Duplicates\",e[e.None=1]=\"None\",e[e.Current=2]=\"Current\",e))(xt||{});var Ia=Object.defineProperty,Sa=(e,t,s)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t,s)=>Sa(e,typeof t!=\"symbol\"?t+\"\":t,s),Gt=class e{constructor(){We(this,\"bb\",null),We(this,\"bb_pos\",0)}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsModuleConfig(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModuleConfig(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"MCFG\")}ENTRIES(t,s){let i=this.bb.__offset(this.bb_pos,4);return i?(s||new _t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}entriesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startModuleConfig(t){t.startObject(1)}static addEntries(t,s){t.addFieldOffset(0,s,0)}static createEntriesVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startEntriesVector(t,s){t.startVector(4,s,4)}static endModuleConfig(t){return t.endObject()}static finishModuleConfigBuffer(t,s){t.finish(s,\"MCFG\")}static finishSizePrefixedModuleConfigBuffer(t,s){t.finish(s,\"MCFG\",!0)}static createModuleConfig(t,s){return e.startModuleConfig(t),e.addEntries(t,s),e.endModuleConfig(t)}unpack(){return new Xt(this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength()))}unpackTo(t){t.ENTRIES=this.bb.createObjList(this.ENTRIES.bind(this),this.entriesLength())}},Xt=class{constructor(t=[]){We(this,\"ENTRIES\",t)}pack(t){let s=Gt.createEntriesVector(t,t.createObjectOffsetList(this.ENTRIES));return Gt.createModuleConfig(t,s)}};var kt={};fa(kt,{BodyRef:()=>we,BoolValue:()=>Ra,CacheKeyParams:()=>Za,ContextParams:()=>Hf,CountValue:()=>Oa,CronField:()=>Rf,CryptoParams:()=>Qa,EnvVar:()=>Pf,EpochStreamParams:()=>Ya,ExecParams:()=>Cf,ExecResult:()=>Uf,FsEntry:()=>Df,FsParams:()=>Nf,FsStat:()=>Lf,HasCapabilityParams:()=>ga,HttpParams:()=>Na,HttpResult:()=>Da,IpfsLink:()=>sf,IpfsParams:()=>tf,IpfsPin:()=>rf,IpfsResult:()=>ef,IpfsSwarmPeer:()=>nf,KeyslotParams:()=>za,MqttParams:()=>Of,MqttResult:()=>mf,NodeActivityEvent:()=>Sf,NodeActivityParams:()=>If,NodeBandwidthSample:()=>pf,NodeStatusReport:()=>df,NumberValue:()=>wa,P2pLatestDataset:()=>_f,P2pParams:()=>hf,P2pPeer:()=>uf,P2pPeerValue:()=>lf,P2pPnmEntry:()=>Ef,P2pSummary:()=>cf,ProtocolParams:()=>ff,Provenance:()=>Fa,ProvenanceAttribute:()=>Va,PubsubParams:()=>of,PubsubSubscribed:()=>af,QuerySurfaceLimits:()=>$a,RandomBytesParams:()=>ya,SandboxQueryParams:()=>qa,SandboxQueryResult:()=>ja,ScheduleParams:()=>bf,SecretParams:()=>Xa,SecretResult:()=>Ja,SocketParams:()=>gf,SocketResult:()=>yf,SqlStreamParams:()=>Ga,StorageDeleteParams:()=>Ha,StorageExpireParams:()=>va,StorageExpireResult:()=>Ma,StorageIngestParams:()=>Ba,StorageIngestResult:()=>xa,StorageQueryParams:()=>La,StorageWriteParams:()=>Pa,StorageWriteResult:()=>Ua,StoredRecordMeta:()=>Ca,StreamResult:()=>ka,SurfaceColumn:()=>Wa,SurfaceTable:()=>Ka,TextValue:()=>ma,TimeValue:()=>Ta,TimersDelayParams:()=>Af,WebsocketParams:()=>wf,WebsocketResult:()=>Tf});var Aa=Object.defineProperty,ba=(e,t,s)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,n=(e,t,s)=>ba(e,typeof t!=\"symbol\"?t+\"\":t,s);function f(e,t,s){let i=Math.floor(s/8),r=1<<s%8;return(e.getUint8(t+i)&r)!==0}function h(e,t,s,i){let r=Math.floor(s/8),o=1<<s%8,a=e.getUint8(t+r);e.setUint8(t+r,i?a|o:a&~o)}function u(e,t,s){let i=Math.min(e.getUint8(t),s),r=new Uint8Array(e.buffer,e.byteOffset+t+1,i);return new TextDecoder().decode(r)}function l(e,t,s,i){let o=new TextEncoder().encode(i),a=Math.min(o.length,s);e.setUint8(t,a);let c=new Uint8Array(e.buffer,e.byteOffset+t+1,s);c.fill(0),c.set(o.subarray(0,a))}var $e=class Ji{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ji(t,s)}vALUE(){return this.view.getUint8(this.offset+0)!==0}setVALUE(t){this.view.setUint8(this.offset+0,t?1:0)}};n($e,\"SIZE\",1);n($e,\"ALIGN\",1);var Ra=$e,Ze=class tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tr(t,s)}vALUE(){return this.view.getFloat64(this.offset+0,!0)}setVALUE(t){this.view.setFloat64(this.offset+0,t,!0)}};n(Ze,\"SIZE\",8);n(Ze,\"ALIGN\",8);var wa=Ze,Qe=class er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new er(t,s)}uNIX_MS(){return this.view.getBigUint64(this.offset+0,!0)}setUNIX_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(Qe,\"SIZE\",8);n(Qe,\"ALIGN\",8);var Ta=Qe,ze=class sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sr(t,s)}vALUE(){return this.view.getBigUint64(this.offset+0,!0)}setVALUE(t){this.view.setBigUint64(this.offset+0,t,!0)}};n(ze,\"SIZE\",8);n(ze,\"ALIGN\",8);var Oa=ze,Xe=class ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ir(t,s)}hasVALUE(){return f(this.view,this.offset,0)}setHasVALUE(t){h(this.view,this.offset,0,t)}vALUE(){return u(this.view,this.offset+1,255)}setVALUE(t){l(this.view,this.offset+1,255,t),this.setHasVALUE(!0)}};n(Xe,\"SIZE\",257);n(Xe,\"ALIGN\",1);var ma=Xe,Je=class rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rr(t,s)}tOKEN(){return this.view.getBigUint64(this.offset+8,!0)}setTOKEN(t){this.view.setBigUint64(this.offset+8,t,!0)}sIZE(){return this.view.getBigUint64(this.offset+16,!0)}setSIZE(t){this.view.setBigUint64(this.offset+16,t,!0)}fRAMES(){return this.view.getBigInt64(this.offset+24,!0)}setFRAMES(t){this.view.setBigInt64(this.offset+24,t,!0)}hasFNV1A64(){return f(this.view,this.offset,0)}setHasFNV1A64(t){h(this.view,this.offset,0,t)}fNV1A64(){return u(this.view,this.offset+32,16)}setFNV1A64(t){l(this.view,this.offset+32,16,t),this.setHasFNV1A64(!0)}};n(Je,\"SIZE\",56);n(Je,\"ALIGN\",8);var we=Je,ts=class nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nr(t,s)}hasCAPABILITY(){return f(this.view,this.offset,0)}setHasCAPABILITY(t){h(this.view,this.offset,0,t)}cAPABILITY(){return u(this.view,this.offset+1,64)}setCAPABILITY(t){l(this.view,this.offset+1,64,t),this.setHasCAPABILITY(!0)}};n(ts,\"SIZE\",66);n(ts,\"ALIGN\",1);var ga=ts,es=class or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new or(t,s)}lENGTH(){return this.view.getUint32(this.offset+0,!0)}setLENGTH(t){this.view.setUint32(this.offset+0,t,!0)}};n(es,\"SIZE\",4);n(es,\"ALIGN\",4);var ya=es,ss=class ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ar(t,s)}hasMETHOD(){return f(this.view,this.offset,0)}setHasMETHOD(t){h(this.view,this.offset,0,t)}mETHOD(){return u(this.view,this.offset+1,16)}setMETHOD(t){l(this.view,this.offset+1,16,t),this.setHasMETHOD(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+20,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+20,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}nO_REDIRECTS(){return this.view.getUint8(this.offset+32)!==0}setNO_REDIRECTS(t){this.view.setUint8(this.offset+32,t?1:0)}};n(ss,\"SIZE\",40);n(ss,\"ALIGN\",8);var Na=ss,is=class fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fr(t,s)}sTATUS(){return this.view.getInt32(this.offset+0,!0)}setSTATUS(t){this.view.setInt32(this.offset+0,t,!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+8,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}};n(is,\"SIZE\",16);n(is,\"ALIGN\",8);var Da=is,rs=class hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasDAY(){return f(this.view,this.offset,1)}setHasDAY(t){h(this.view,this.offset,1,t)}dAY(){return u(this.view,this.offset+66,16)}setDAY(t){l(this.view,this.offset+66,16,t),this.setHasDAY(!0)}hasENTITY_ID(){return f(this.view,this.offset,2)}setHasENTITY_ID(t){h(this.view,this.offset,2,t)}eNTITY_ID(){return u(this.view,this.offset+83,255)}setENTITY_ID(t){l(this.view,this.offset+83,255,t),this.setHasENTITY_ID(!0)}nORAD_CAT_ID(){return this.view.getUint32(this.offset+340,!0)}setNORAD_CAT_ID(t){this.view.setUint32(this.offset+340,t,!0)}lIMIT(){return this.view.getUint32(this.offset+344,!0)}setLIMIT(t){this.view.setUint32(this.offset+344,t,!0)}};n(rs,\"SIZE\",348);n(rs,\"ALIGN\",4);var La=rs,ns=class cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return u(this.view,this.offset+1,128)}setCID(t){l(this.view,this.offset+1,128,t),this.setHasCID(!0)}rOW_ID(){return this.view.getBigInt64(this.offset+136,!0)}setROW_ID(t){this.view.setBigInt64(this.offset+136,t,!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return u(this.view,this.offset+144,128)}setPEER_ID(t){l(this.view,this.offset+144,128,t),this.setHasPEER_ID(!0)}tIMESTAMP_MS(){return this.view.getBigInt64(this.offset+280,!0)}setTIMESTAMP_MS(t){this.view.setBigInt64(this.offset+280,t,!0)}mATERIALIZED_MS(){return this.view.getBigInt64(this.offset+288,!0)}setMATERIALIZED_MS(t){this.view.setBigInt64(this.offset+288,t,!0)}lENGTH(){return this.view.getUint32(this.offset+296,!0)}setLENGTH(t){this.view.setUint32(this.offset+296,t,!0)}hasPROVIDER_ID(){return f(this.view,this.offset,2)}setHasPROVIDER_ID(t){h(this.view,this.offset,2,t)}pROVIDER_ID(){return u(this.view,this.offset+300,128)}setPROVIDER_ID(t){l(this.view,this.offset+300,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,3)}setHasSOURCE_NAME(t){h(this.view,this.offset,3,t)}sOURCE_NAME(){return u(this.view,this.offset+429,128)}setSOURCE_NAME(t){l(this.view,this.offset+429,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,4)}setHasBATCH_ID(t){h(this.view,this.offset,4,t)}bATCH_ID(){return u(this.view,this.offset+558,128)}setBATCH_ID(t){l(this.view,this.offset+558,128,t),this.setHasBATCH_ID(!0)}hasPRODUCER_PEER_ID(){return f(this.view,this.offset,5)}setHasPRODUCER_PEER_ID(t){h(this.view,this.offset,5,t)}pRODUCER_PEER_ID(){return u(this.view,this.offset+687,128)}setPRODUCER_PEER_ID(t){l(this.view,this.offset+687,128,t),this.setHasPRODUCER_PEER_ID(!0)}hasLICENSE(){return f(this.view,this.offset,6)}setHasLICENSE(t){h(this.view,this.offset,6,t)}lICENSE(){return u(this.view,this.offset+816,128)}setLICENSE(t){l(this.view,this.offset+816,128,t),this.setHasLICENSE(!0)}};n(ns,\"SIZE\",952);n(ns,\"ALIGN\",8);var Ca=ns,os=class ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ur(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}};n(os,\"SIZE\",66);n(os,\"ALIGN\",1);var Pa=os,as=class lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new lr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return u(this.view,this.offset+1,128)}setCID(t){l(this.view,this.offset+1,128,t),this.setHasCID(!0)}};n(as,\"SIZE\",130);n(as,\"ALIGN\",1);var Ua=as,fs=class Er{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Er(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return u(this.view,this.offset+66,128)}setCID(t){l(this.view,this.offset+66,128,t),this.setHasCID(!0)}};n(fs,\"SIZE\",195);n(fs,\"ALIGN\",1);var Ha=fs,hs=class _r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new _r(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return u(this.view,this.offset+66,128)}setPROVIDER_ID(t){l(this.view,this.offset+66,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return u(this.view,this.offset+195,128)}setSOURCE_NAME(t){l(this.view,this.offset+195,128,t),this.setHasSOURCE_NAME(!0)}bEFORE_MS(){return this.view.getBigUint64(this.offset+328,!0)}setBEFORE_MS(t){this.view.setBigUint64(this.offset+328,t,!0)}bATCH(){return this.view.getUint32(this.offset+336,!0)}setBATCH(t){this.view.setUint32(this.offset+336,t,!0)}mAX_DELETES(){return this.view.getUint32(this.offset+340,!0)}setMAX_DELETES(t){this.view.setUint32(this.offset+340,t,!0)}};n(hs,\"SIZE\",344);n(hs,\"ALIGN\",8);var va=hs,cs=class dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new dr(t,s)}dELETED(){return this.view.getBigUint64(this.offset+0,!0)}setDELETED(t){this.view.setBigUint64(this.offset+0,t,!0)}mISSING(){return this.view.getBigUint64(this.offset+8,!0)}setMISSING(t){this.view.setBigUint64(this.offset+8,t,!0)}cAPPED(){return this.view.getUint8(this.offset+16)!==0}setCAPPED(t){this.view.setUint8(this.offset+16,t?1:0)}};n(cs,\"SIZE\",24);n(cs,\"ALIGN\",8);var Ma=cs,us=class pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new pr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+2,64)}setSCHEMA(t){l(this.view,this.offset+2,64,t),this.setHasSCHEMA(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,1)}setHasPROVIDER_ID(t){h(this.view,this.offset,1,t)}pROVIDER_ID(){return u(this.view,this.offset+67,128)}setPROVIDER_ID(t){l(this.view,this.offset+67,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,2)}setHasSOURCE_NAME(t){h(this.view,this.offset,2,t)}sOURCE_NAME(){return u(this.view,this.offset+196,128)}setSOURCE_NAME(t){l(this.view,this.offset+196,128,t),this.setHasSOURCE_NAME(!0)}hasBATCH_ID(){return f(this.view,this.offset,3)}setHasBATCH_ID(t){h(this.view,this.offset,3,t)}bATCH_ID(){return u(this.view,this.offset+325,128)}setBATCH_ID(t){l(this.view,this.offset+325,128,t),this.setHasBATCH_ID(!0)}hasSOURCE_URL(){return f(this.view,this.offset,4)}setHasSOURCE_URL(t){h(this.view,this.offset,4,t)}sOURCE_URL(){return u(this.view,this.offset+454,255)}setSOURCE_URL(t){l(this.view,this.offset+454,255,t),this.setHasSOURCE_URL(!0)}hasCONTENT_KEY_ID(){return f(this.view,this.offset,5)}setHasCONTENT_KEY_ID(t){h(this.view,this.offset,5,t)}cONTENT_KEY_ID(){return u(this.view,this.offset+710,128)}setCONTENT_KEY_ID(t){l(this.view,this.offset+710,128,t),this.setHasCONTENT_KEY_ID(!0)}hasSOURCE_PEER(){return f(this.view,this.offset,6)}setHasSOURCE_PEER(t){h(this.view,this.offset,6,t)}sOURCE_PEER(){return u(this.view,this.offset+839,128)}setSOURCE_PEER(t){l(this.view,this.offset+839,128,t),this.setHasSOURCE_PEER(!0)}hasLICENSE(){return f(this.view,this.offset,7)}setHasLICENSE(t){h(this.view,this.offset,7,t)}lICENSE(){return u(this.view,this.offset+968,128)}setLICENSE(t){l(this.view,this.offset+968,128,t),this.setHasLICENSE(!0)}hasLICENSE_URL(){return f(this.view,this.offset,8)}setHasLICENSE_URL(t){h(this.view,this.offset,8,t)}lICENSE_URL(){return u(this.view,this.offset+1097,255)}setLICENSE_URL(t){l(this.view,this.offset+1097,255,t),this.setHasLICENSE_URL(!0)}hasCITATION(){return f(this.view,this.offset,9)}setHasCITATION(t){h(this.view,this.offset,9,t)}cITATION(){return u(this.view,this.offset+1353,255)}setCITATION(t){l(this.view,this.offset+1353,255,t),this.setHasCITATION(!0)}sHARE_ALIKE(){return this.view.getUint8(this.offset+1609)!==0}setSHARE_ALIKE(t){this.view.setUint8(this.offset+1609,t?1:0)}rECONCILE(){return this.view.getUint8(this.offset+1610)}setRECONCILE(t){this.view.setUint8(this.offset+1610,t)}hasARCHIVE_SOURCE(){return f(this.view,this.offset,10)}setHasARCHIVE_SOURCE(t){h(this.view,this.offset,10,t)}aRCHIVE_SOURCE(){return u(this.view,this.offset+1611,128)}setARCHIVE_SOURCE(t){l(this.view,this.offset+1611,128,t),this.setHasARCHIVE_SOURCE(!0)}hasARCHIVE_NAME(){return f(this.view,this.offset,11)}setHasARCHIVE_NAME(t){h(this.view,this.offset,11,t)}aRCHIVE_NAME(){return u(this.view,this.offset+1740,255)}setARCHIVE_NAME(t){l(this.view,this.offset+1740,255,t),this.setHasARCHIVE_NAME(!0)}};n(us,\"SIZE\",1996);n(us,\"ALIGN\",1);var Ba=us,ls=class Ir{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ir(t,s)}hasSOURCE_URL(){return f(this.view,this.offset,0)}setHasSOURCE_URL(t){h(this.view,this.offset,0,t)}sOURCE_URL(){return u(this.view,this.offset+1,255)}setSOURCE_URL(t){l(this.view,this.offset+1,255,t),this.setHasSOURCE_URL(!0)}hTTP_STATUS(){return this.view.getInt32(this.offset+260,!0)}setHTTP_STATUS(t){this.view.setInt32(this.offset+260,t,!0)}hasETAG(){return f(this.view,this.offset,1)}setHasETAG(t){h(this.view,this.offset,1,t)}eTAG(){return u(this.view,this.offset+264,255)}setETAG(t){l(this.view,this.offset+264,255,t),this.setHasETAG(!0)}hasLAST_MODIFIED(){return f(this.view,this.offset,2)}setHasLAST_MODIFIED(t){h(this.view,this.offset,2,t)}lAST_MODIFIED(){return u(this.view,this.offset+520,64)}setLAST_MODIFIED(t){l(this.view,this.offset+520,64,t),this.setHasLAST_MODIFIED(!0)}hasCONTENT_TYPE(){return f(this.view,this.offset,3)}setHasCONTENT_TYPE(t){h(this.view,this.offset,3,t)}cONTENT_TYPE(){return u(this.view,this.offset+585,128)}setCONTENT_TYPE(t){l(this.view,this.offset+585,128,t),this.setHasCONTENT_TYPE(!0)}rETRIEVED_MS(){return this.view.getBigUint64(this.offset+720,!0)}setRETRIEVED_MS(t){this.view.setBigUint64(this.offset+720,t,!0)}hasPARSER(){return f(this.view,this.offset,4)}setHasPARSER(t){h(this.view,this.offset,4,t)}pARSER(){return u(this.view,this.offset+728,128)}setPARSER(t){l(this.view,this.offset+728,128,t),this.setHasPARSER(!0)}hasPARSER_VERSION(){return f(this.view,this.offset,5)}setHasPARSER_VERSION(t){h(this.view,this.offset,5,t)}pARSER_VERSION(){return u(this.view,this.offset+857,64)}setPARSER_VERSION(t){l(this.view,this.offset+857,64,t),this.setHasPARSER_VERSION(!0)}hasSOURCE_SHA256(){return f(this.view,this.offset,6)}setHasSOURCE_SHA256(t){h(this.view,this.offset,6,t)}sOURCE_SHA256(){return u(this.view,this.offset+922,64)}setSOURCE_SHA256(t){l(this.view,this.offset+922,64,t),this.setHasSOURCE_SHA256(!0)}hasNORMALIZED_SHA256(){return f(this.view,this.offset,7)}setHasNORMALIZED_SHA256(t){h(this.view,this.offset,7,t)}nORMALIZED_SHA256(){return u(this.view,this.offset+987,64)}setNORMALIZED_SHA256(t){l(this.view,this.offset+987,64,t),this.setHasNORMALIZED_SHA256(!0)}nORMALIZED_COUNT(){return this.view.getBigUint64(this.offset+1056,!0)}setNORMALIZED_COUNT(t){this.view.setBigUint64(this.offset+1056,t,!0)}fROM_CACHE(){return this.view.getUint8(this.offset+1064)!==0}setFROM_CACHE(t){this.view.setUint8(this.offset+1064,t?1:0)}};n(ls,\"SIZE\",1072);n(ls,\"ALIGN\",8);var Fa=ls,Es=class Sr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Sr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,128)}setNAME(t){l(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return u(this.view,this.offset+130,255)}setVALUE(t){l(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Es,\"SIZE\",386);n(Es,\"ALIGN\",1);var Va=Es,_s=class Ar{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ar(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasBATCH_ID(){return f(this.view,this.offset,1)}setHasBATCH_ID(t){h(this.view,this.offset,1,t)}bATCH_ID(){return u(this.view,this.offset+66,128)}setBATCH_ID(t){l(this.view,this.offset+66,128,t),this.setHasBATCH_ID(!0)}iNSERTED(){return this.view.getBigUint64(this.offset+200,!0)}setINSERTED(t){this.view.setBigUint64(this.offset+200,t,!0)}rECONCILED_DUPLICATES(){return this.view.getBigUint64(this.offset+208,!0)}setRECONCILED_DUPLICATES(t){this.view.setBigUint64(this.offset+208,t,!0)}rECONCILED_OLD_BATCHES(){return this.view.getBigUint64(this.offset+216,!0)}setRECONCILED_OLD_BATCHES(t){this.view.setBigUint64(this.offset+216,t,!0)}hasARCHIVED(){return f(this.view,this.offset,2)}setHasARCHIVED(t){h(this.view,this.offset,2,t)}aRCHIVED(){return u(this.view,this.offset+224,255)}setARCHIVED(t){l(this.view,this.offset+224,255,t),this.setHasARCHIVED(!0)}hasPROVENANCE_FILE(){return f(this.view,this.offset,3)}setHasPROVENANCE_FILE(t){h(this.view,this.offset,3,t)}pROVENANCE_FILE(){return u(this.view,this.offset+480,255)}setPROVENANCE_FILE(t){l(this.view,this.offset+480,255,t),this.setHasPROVENANCE_FILE(!0)}};n(_s,\"SIZE\",736);n(_s,\"ALIGN\",8);var xa=_s,ds=class br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new br(t,s)}dELIVER(){return this.view.getUint8(this.offset+0)}setDELIVER(t){this.view.setUint8(this.offset+0,t)}};n(ds,\"SIZE\",1);n(ds,\"ALIGN\",1);var Ga=ds,ps=class Rr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Rr(t,s)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new we(this.buffer,this.offset+24)}};n(ps,\"SIZE\",80);n(ps,\"ALIGN\",8);var ka=ps,Is=class wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new wr(t,s)}hasSCHEMA(){return f(this.view,this.offset,0)}setHasSCHEMA(t){h(this.view,this.offset,0,t)}sCHEMA(){return u(this.view,this.offset+1,64)}setSCHEMA(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return u(this.view,this.offset+66,128)}setSOURCE(t){l(this.view,this.offset+66,128,t),this.setHasSOURCE(!0)}hasPROFILE(){return f(this.view,this.offset,2)}setHasPROFILE(t){h(this.view,this.offset,2,t)}pROFILE(){return u(this.view,this.offset+195,32)}setPROFILE(t){l(this.view,this.offset+195,32,t),this.setHasPROFILE(!0)}ePOCH(){return this.view.getFloat64(this.offset+232,!0)}setEPOCH(t){this.view.setFloat64(this.offset+232,t,!0)}lIMIT(){return this.view.getUint32(this.offset+240,!0)}setLIMIT(t){this.view.setUint32(this.offset+240,t,!0)}dELIVER(){return this.view.getUint8(this.offset+244)}setDELIVER(t){this.view.setUint8(this.offset+244,t)}};n(Is,\"SIZE\",248);n(Is,\"ALIGN\",8);var Ya=Is,Ss=class Tr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Tr(t,s)}wANT(){return this.view.getUint8(this.offset+0)}setWANT(t){this.view.setUint8(this.offset+0,t)}dELIVER(){return this.view.getUint8(this.offset+1)}setDELIVER(t){this.view.setUint8(this.offset+1,t)}};n(Ss,\"SIZE\",2);n(Ss,\"ALIGN\",1);var qa=Ss,As=class Or{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Or(t,s)}kIND(){return this.view.getUint8(this.offset+1)}setKIND(t){this.view.setUint8(this.offset+1,t)}rOWS(){return this.view.getBigUint64(this.offset+8,!0)}setROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}cOLUMNS(){return this.view.getUint32(this.offset+16,!0)}setCOLUMNS(t){this.view.setUint32(this.offset+16,t,!0)}hasREF(){return f(this.view,this.offset,0)}setHasREF(t){h(this.view,this.offset,0,t)}rEF(){return new we(this.buffer,this.offset+24)}};n(As,\"SIZE\",80);n(As,\"ALIGN\",8);var ja=As,bs=class mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new mr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,128)}setNAME(t){l(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasKIND(){return f(this.view,this.offset,1)}setHasKIND(t){h(this.view,this.offset,1,t)}kIND(){return u(this.view,this.offset+130,16)}setKIND(t){l(this.view,this.offset+130,16,t),this.setHasKIND(!0)}hasSOURCE(){return f(this.view,this.offset,2)}setHasSOURCE(t){h(this.view,this.offset,2,t)}sOURCE(){return u(this.view,this.offset+147,128)}setSOURCE(t){l(this.view,this.offset+147,128,t),this.setHasSOURCE(!0)}rECORDS(){return this.view.getBigInt64(this.offset+280,!0)}setRECORDS(t){this.view.setBigInt64(this.offset+280,t,!0)}};n(bs,\"SIZE\",288);n(bs,\"ALIGN\",8);var Ka=bs,Rs=class gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new gr(t,s)}hasTABLE(){return f(this.view,this.offset,0)}setHasTABLE(t){h(this.view,this.offset,0,t)}tABLE(){return u(this.view,this.offset+1,128)}setTABLE(t){l(this.view,this.offset+1,128,t),this.setHasTABLE(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return u(this.view,this.offset+130,128)}setNAME(t){l(this.view,this.offset+130,128,t),this.setHasNAME(!0)}pLACEHOLDER(){return this.view.getUint8(this.offset+259)!==0}setPLACEHOLDER(t){this.view.setUint8(this.offset+259,t?1:0)}};n(Rs,\"SIZE\",260);n(Rs,\"ALIGN\",1);var Wa=Rs,ws=class yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new yr(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}mAX_ROWS(){return this.view.getBigUint64(this.offset+8,!0)}setMAX_ROWS(t){this.view.setBigUint64(this.offset+8,t,!0)}mAX_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setMAX_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}};n(ws,\"SIZE\",24);n(ws,\"ALIGN\",8);var $a=ws,Ts=class Nr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Nr(t,s)}hasSCHEMA_NAME(){return f(this.view,this.offset,0)}setHasSCHEMA_NAME(t){h(this.view,this.offset,0,t)}sCHEMA_NAME(){return u(this.view,this.offset+1,64)}setSCHEMA_NAME(t){l(this.view,this.offset+1,64,t),this.setHasSCHEMA_NAME(!0)}hasSCHEMA_VERSION(){return f(this.view,this.offset,1)}setHasSCHEMA_VERSION(t){h(this.view,this.offset,1,t)}sCHEMA_VERSION(){return u(this.view,this.offset+66,32)}setSCHEMA_VERSION(t){l(this.view,this.offset+66,32,t),this.setHasSCHEMA_VERSION(!0)}hasFORMAT(){return f(this.view,this.offset,2)}setHasFORMAT(t){h(this.view,this.offset,2,t)}fORMAT(){return u(this.view,this.offset+99,32)}setFORMAT(t){l(this.view,this.offset+99,32,t),this.setHasFORMAT(!0)}hasPUBLISH_EVENT_KEY(){return f(this.view,this.offset,3)}setHasPUBLISH_EVENT_KEY(t){h(this.view,this.offset,3,t)}pUBLISH_EVENT_KEY(){return u(this.view,this.offset+132,128)}setPUBLISH_EVENT_KEY(t){l(this.view,this.offset+132,128,t),this.setHasPUBLISH_EVENT_KEY(!0)}};n(Ts,\"SIZE\",261);n(Ts,\"ALIGN\",1);var Za=Ts,Os=class Dr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Dr(t,s)}aLGORITHM(){return this.view.getUint8(this.offset+0)}setALGORITHM(t){this.view.setUint8(this.offset+0,t)}lENGTH(){return this.view.getUint32(this.offset+4,!0)}setLENGTH(t){this.view.setUint32(this.offset+4,t,!0)}};n(Os,\"SIZE\",8);n(Os,\"ALIGN\",4);var Qa=Os,ms=class Lr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Lr(t,s)}hasSLOT_ID(){return f(this.view,this.offset,0)}setHasSLOT_ID(t){h(this.view,this.offset,0,t)}sLOT_ID(){return u(this.view,this.offset+1,128)}setSLOT_ID(t){l(this.view,this.offset+1,128,t),this.setHasSLOT_ID(!0)}aLGORITHM(){return this.view.getUint8(this.offset+130)}setALGORITHM(t){this.view.setUint8(this.offset+130,t)}};n(ms,\"SIZE\",131);n(ms,\"ALIGN\",1);var za=ms,gs=class Cr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Cr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return u(this.view,this.offset+1,128)}setID(t){l(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return u(this.view,this.offset+130,255)}setUSERNAME(t){l(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}};n(gs,\"SIZE\",386);n(gs,\"ALIGN\",1);var Xa=gs,ys=class Pr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Pr(t,s)}hasID(){return f(this.view,this.offset,0)}setHasID(t){h(this.view,this.offset,0,t)}iD(){return u(this.view,this.offset+1,128)}setID(t){l(this.view,this.offset+1,128,t),this.setHasID(!0)}hasUSERNAME(){return f(this.view,this.offset,1)}setHasUSERNAME(t){h(this.view,this.offset,1,t)}uSERNAME(){return u(this.view,this.offset+130,255)}setUSERNAME(t){l(this.view,this.offset+130,255,t),this.setHasUSERNAME(!0)}cONFIGURED(){return this.view.getUint8(this.offset+386)!==0}setCONFIGURED(t){this.view.setUint8(this.offset+386,t?1:0)}hasUSERNAME_MASKED(){return f(this.view,this.offset,2)}setHasUSERNAME_MASKED(t){h(this.view,this.offset,2,t)}uSERNAME_MASKED(){return u(this.view,this.offset+387,255)}setUSERNAME_MASKED(t){l(this.view,this.offset+387,255,t),this.setHasUSERNAME_MASKED(!0)}uPDATED_MS(){return this.view.getBigUint64(this.offset+648,!0)}setUPDATED_MS(t){this.view.setBigUint64(this.offset+648,t,!0)}vERIFIED_MS(){return this.view.getBigUint64(this.offset+656,!0)}setVERIFIED_MS(t){this.view.setBigUint64(this.offset+656,t,!0)}};n(ys,\"SIZE\",664);n(ys,\"ALIGN\",8);var Ja=ys,Ns=class Ur{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Ur(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return u(this.view,this.offset+1,128)}setCID(t){l(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return u(this.view,this.offset+130,255)}setNAME(t){l(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasTYPE(){return f(this.view,this.offset,2)}setHasTYPE(t){h(this.view,this.offset,2,t)}tYPE(){return u(this.view,this.offset+386,32)}setTYPE(t){l(this.view,this.offset+386,32,t),this.setHasTYPE(!0)}hasLIFETIME(){return f(this.view,this.offset,3)}setHasLIFETIME(t){h(this.view,this.offset,3,t)}lIFETIME(){return u(this.view,this.offset+419,32)}setLIFETIME(t){l(this.view,this.offset+419,32,t),this.setHasLIFETIME(!0)}hasTTL(){return f(this.view,this.offset,4)}setHasTTL(t){h(this.view,this.offset,4,t)}tTL(){return u(this.view,this.offset+452,32)}setTTL(t){l(this.view,this.offset+452,32,t),this.setHasTTL(!0)}nO_PIN(){return this.view.getUint8(this.offset+485)!==0}setNO_PIN(t){this.view.setUint8(this.offset+485,t?1:0)}};n(Ns,\"SIZE\",486);n(Ns,\"ALIGN\",1);var tf=Ns,Ds=class Hr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Hr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return u(this.view,this.offset+1,128)}setCID(t){l(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasNAME(){return f(this.view,this.offset,1)}setHasNAME(t){h(this.view,this.offset,1,t)}nAME(){return u(this.view,this.offset+130,255)}setNAME(t){l(this.view,this.offset+130,255,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,2)}setHasVALUE(t){h(this.view,this.offset,2,t)}vALUE(){return u(this.view,this.offset+386,255)}setVALUE(t){l(this.view,this.offset+386,255,t),this.setHasVALUE(!0)}sIZE(){return this.view.getBigUint64(this.offset+648,!0)}setSIZE(t){this.view.setBigUint64(this.offset+648,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,3)}setHasAGENT_VERSION(t){h(this.view,this.offset,3,t)}aGENT_VERSION(){return u(this.view,this.offset+656,128)}setAGENT_VERSION(t){l(this.view,this.offset+656,128,t),this.setHasAGENT_VERSION(!0)}hasPROTOCOL_VERSION(){return f(this.view,this.offset,4)}setHasPROTOCOL_VERSION(t){h(this.view,this.offset,4,t)}pROTOCOL_VERSION(){return u(this.view,this.offset+785,64)}setPROTOCOL_VERSION(t){l(this.view,this.offset+785,64,t),this.setHasPROTOCOL_VERSION(!0)}};n(Ds,\"SIZE\",856);n(Ds,\"ALIGN\",8);var ef=Ds,Ls=class vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new vr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,255)}setNAME(t){l(this.view,this.offset+1,255,t),this.setHasNAME(!0)}hasCID(){return f(this.view,this.offset,1)}setHasCID(t){h(this.view,this.offset,1,t)}cID(){return u(this.view,this.offset+257,128)}setCID(t){l(this.view,this.offset+257,128,t),this.setHasCID(!0)}sIZE(){return this.view.getBigUint64(this.offset+392,!0)}setSIZE(t){this.view.setBigUint64(this.offset+392,t,!0)}tYPE(){return this.view.getInt32(this.offset+400,!0)}setTYPE(t){this.view.setInt32(this.offset+400,t,!0)}};n(Ls,\"SIZE\",408);n(Ls,\"ALIGN\",8);var sf=Ls,Cs=class Mr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Mr(t,s)}hasCID(){return f(this.view,this.offset,0)}setHasCID(t){h(this.view,this.offset,0,t)}cID(){return u(this.view,this.offset+1,128)}setCID(t){l(this.view,this.offset+1,128,t),this.setHasCID(!0)}hasTYPE(){return f(this.view,this.offset,1)}setHasTYPE(t){h(this.view,this.offset,1,t)}tYPE(){return u(this.view,this.offset+130,32)}setTYPE(t){l(this.view,this.offset+130,32,t),this.setHasTYPE(!0)}};n(Cs,\"SIZE\",163);n(Cs,\"ALIGN\",1);var rf=Cs,Ps=class Br{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Br(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return u(this.view,this.offset+1,128)}setPEER_ID(t){l(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasADDRESS(){return f(this.view,this.offset,1)}setHasADDRESS(t){h(this.view,this.offset,1,t)}aDDRESS(){return u(this.view,this.offset+130,255)}setADDRESS(t){l(this.view,this.offset+130,255,t),this.setHasADDRESS(!0)}lATENCY_MS(){return this.view.getFloat64(this.offset+392,!0)}setLATENCY_MS(t){this.view.setFloat64(this.offset+392,t,!0)}};n(Ps,\"SIZE\",400);n(Ps,\"ALIGN\",8);var nf=Ps,Us=class Fr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Fr(t,s)}hasTOPIC(){return f(this.view,this.offset,0)}setHasTOPIC(t){h(this.view,this.offset,0,t)}tOPIC(){return u(this.view,this.offset+1,255)}setTOPIC(t){l(this.view,this.offset+1,255,t),this.setHasTOPIC(!0)}};n(Us,\"SIZE\",257);n(Us,\"ALIGN\",1);var of=Us,Hs=class Vr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Vr(t,s)}aLREADY(){return this.view.getUint8(this.offset+0)!==0}setALREADY(t){this.view.setUint8(this.offset+0,t?1:0)}};n(Hs,\"SIZE\",1);n(Hs,\"ALIGN\",1);var af=Hs,vs=class xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new xr(t,s)}hasTARGET(){return f(this.view,this.offset,0)}setHasTARGET(t){h(this.view,this.offset,0,t)}tARGET(){return u(this.view,this.offset+1,255)}setTARGET(t){l(this.view,this.offset+1,255,t),this.setHasTARGET(!0)}hasPROTOCOL_ID(){return f(this.view,this.offset,1)}setHasPROTOCOL_ID(t){h(this.view,this.offset,1,t)}pROTOCOL_ID(){return u(this.view,this.offset+257,128)}setPROTOCOL_ID(t){l(this.view,this.offset+257,128,t),this.setHasPROTOCOL_ID(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return u(this.view,this.offset+386,128)}setPEER_ID(t){l(this.view,this.offset+386,128,t),this.setHasPEER_ID(!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+516,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+516,t,!0)}};n(vs,\"SIZE\",520);n(vs,\"ALIGN\",4);var ff=vs,Ms=class Gr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Gr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return u(this.view,this.offset+1,128)}setPEER_ID(t){l(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}lIMIT(){return this.view.getUint32(this.offset+132,!0)}setLIMIT(t){this.view.setUint32(this.offset+132,t,!0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return u(this.view,this.offset+136,16)}setSTANDARD(t){l(this.view,this.offset+136,16,t),this.setHasSTANDARD(!0)}dELIVER(){return this.view.getUint8(this.offset+153)}setDELIVER(t){this.view.setUint8(this.offset+153,t)}};n(Ms,\"SIZE\",156);n(Ms,\"ALIGN\",4);var hf=Ms,Bs=class kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new kr(t,s)}hasSELF(){return f(this.view,this.offset,0)}setHasSELF(t){h(this.view,this.offset,0,t)}sELF(){return u(this.view,this.offset+1,128)}setSELF(t){l(this.view,this.offset+1,128,t),this.setHasSELF(!0)}hasPEER_ID(){return f(this.view,this.offset,1)}setHasPEER_ID(t){h(this.view,this.offset,1,t)}pEER_ID(){return u(this.view,this.offset+130,128)}setPEER_ID(t){l(this.view,this.offset+130,128,t),this.setHasPEER_ID(!0)}pUBLISHER_KEY_AVAILABLE(){return this.view.getUint8(this.offset+259)!==0}setPUBLISHER_KEY_AVAILABLE(t){this.view.setUint8(this.offset+259,t?1:0)}gOSSIP_ONLY_EXCLUDED(){return this.view.getUint32(this.offset+260,!0)}setGOSSIP_ONLY_EXCLUDED(t){this.view.setUint32(this.offset+260,t,!0)}};n(Bs,\"SIZE\",264);n(Bs,\"ALIGN\",4);var cf=Bs,Fs=class Yr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Yr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return u(this.view,this.offset+1,128)}setPEER_ID(t){l(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}cONNECTED(){return this.view.getUint8(this.offset+130)!==0}setCONNECTED(t){this.view.setUint8(this.offset+130,t?1:0)}sELF(){return this.view.getUint8(this.offset+131)!==0}setSELF(t){this.view.setUint8(this.offset+131,t?1:0)}ePM_INDEX(){return this.view.getInt32(this.offset+132,!0)}setEPM_INDEX(t){this.view.setInt32(this.offset+132,t,!0)}hasAGENT_VERSION(){return f(this.view,this.offset,1)}setHasAGENT_VERSION(t){h(this.view,this.offset,1,t)}aGENT_VERSION(){return u(this.view,this.offset+136,128)}setAGENT_VERSION(t){l(this.view,this.offset+136,128,t),this.setHasAGENT_VERSION(!0)}};n(Fs,\"SIZE\",268);n(Fs,\"ALIGN\",4);var uf=Fs,Vs=class qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new qr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return u(this.view,this.offset+1,128)}setPEER_ID(t){l(this.view,this.offset+1,128,t),this.setHasPEER_ID(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return u(this.view,this.offset+130,255)}setVALUE(t){l(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(Vs,\"SIZE\",386);n(Vs,\"ALIGN\",1);var lf=Vs,xs=class jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new jr(t,s)}hasPEER_ID(){return f(this.view,this.offset,0)}setHasPEER_ID(t){h(this.view,this.offset,0,t)}pEER_ID(){return u(this.view,this.offset+2,128)}setPEER_ID(t){l(this.view,this.offset+2,128,t),this.setHasPEER_ID(!0)}hasPUBLISHER_PEER_ID(){return f(this.view,this.offset,1)}setHasPUBLISHER_PEER_ID(t){h(this.view,this.offset,1,t)}pUBLISHER_PEER_ID(){return u(this.view,this.offset+131,128)}setPUBLISHER_PEER_ID(t){l(this.view,this.offset+131,128,t),this.setHasPUBLISHER_PEER_ID(!0)}hasGOSSIP_PEER_ID(){return f(this.view,this.offset,2)}setHasGOSSIP_PEER_ID(t){h(this.view,this.offset,2,t)}gOSSIP_PEER_ID(){return u(this.view,this.offset+260,128)}setGOSSIP_PEER_ID(t){l(this.view,this.offset+260,128,t),this.setHasGOSSIP_PEER_ID(!0)}hasSTANDARD(){return f(this.view,this.offset,3)}setHasSTANDARD(t){h(this.view,this.offset,3,t)}sTANDARD(){return u(this.view,this.offset+389,16)}setSTANDARD(t){l(this.view,this.offset+389,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,4)}setHasSCHEMA(t){h(this.view,this.offset,4,t)}sCHEMA(){return u(this.view,this.offset+406,64)}setSCHEMA(t){l(this.view,this.offset+406,64,t),this.setHasSCHEMA(!0)}hasFILE_ID(){return f(this.view,this.offset,5)}setHasFILE_ID(t){h(this.view,this.offset,5,t)}fILE_ID(){return u(this.view,this.offset+471,255)}setFILE_ID(t){l(this.view,this.offset+471,255,t),this.setHasFILE_ID(!0)}hasFILE_NAME(){return f(this.view,this.offset,6)}setHasFILE_NAME(t){h(this.view,this.offset,6,t)}fILE_NAME(){return u(this.view,this.offset+727,255)}setFILE_NAME(t){l(this.view,this.offset+727,255,t),this.setHasFILE_NAME(!0)}hasCID(){return f(this.view,this.offset,7)}setHasCID(t){h(this.view,this.offset,7,t)}cID(){return u(this.view,this.offset+983,128)}setCID(t){l(this.view,this.offset+983,128,t),this.setHasCID(!0)}pUBLISH_MS(){return this.view.getBigUint64(this.offset+1112,!0)}setPUBLISH_MS(t){this.view.setBigUint64(this.offset+1112,t,!0)}hasSIGNATURE_TYPE(){return f(this.view,this.offset,8)}setHasSIGNATURE_TYPE(t){h(this.view,this.offset,8,t)}sIGNATURE_TYPE(){return u(this.view,this.offset+1120,32)}setSIGNATURE_TYPE(t){l(this.view,this.offset+1120,32,t),this.setHasSIGNATURE_TYPE(!0)}hasSIGNATURE_HEX(){return f(this.view,this.offset,9)}setHasSIGNATURE_HEX(t){h(this.view,this.offset,9,t)}sIGNATURE_HEX(){return u(this.view,this.offset+1153,255)}setSIGNATURE_HEX(t){l(this.view,this.offset+1153,255,t),this.setHasSIGNATURE_HEX(!0)}sIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+1409)!==0}setSIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+1409,t?1:0)}hasATTRIBUTION(){return f(this.view,this.offset,10)}setHasATTRIBUTION(t){h(this.view,this.offset,10,t)}aTTRIBUTION(){return u(this.view,this.offset+1410,16)}setATTRIBUTION(t){l(this.view,this.offset+1410,16,t),this.setHasATTRIBUTION(!0)}pNM_INDEX(){return this.view.getInt32(this.offset+1428,!0)}setPNM_INDEX(t){this.view.setInt32(this.offset+1428,t,!0)}hasPUBLISHER_KEY_HEX(){return f(this.view,this.offset,11)}setHasPUBLISHER_KEY_HEX(t){h(this.view,this.offset,11,t)}pUBLISHER_KEY_HEX(){return u(this.view,this.offset+1432,128)}setPUBLISHER_KEY_HEX(t){l(this.view,this.offset+1432,128,t),this.setHasPUBLISHER_KEY_HEX(!0)}hasPUBLISHER_KEY_SOURCE(){return f(this.view,this.offset,12)}setHasPUBLISHER_KEY_SOURCE(t){h(this.view,this.offset,12,t)}pUBLISHER_KEY_SOURCE(){return u(this.view,this.offset+1561,64)}setPUBLISHER_KEY_SOURCE(t){l(this.view,this.offset+1561,64,t),this.setHasPUBLISHER_KEY_SOURCE(!0)}};n(xs,\"SIZE\",1632);n(xs,\"ALIGN\",8);var Ef=xs,Gs=class Kr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Kr(t,s)}kNOWN(){return this.view.getUint8(this.offset+2)!==0}setKNOWN(t){this.view.setUint8(this.offset+2,t?1:0)}hasREASON(){return f(this.view,this.offset,0)}setHasREASON(t){h(this.view,this.offset,0,t)}rEASON(){return u(this.view,this.offset+3,64)}setREASON(t){l(this.view,this.offset+3,64,t),this.setHasREASON(!0)}pINNED(){return this.view.getUint8(this.offset+68)!==0}setPINNED(t){this.view.setUint8(this.offset+68,t?1:0)}sELF(){return this.view.getUint8(this.offset+69)!==0}setSELF(t){this.view.setUint8(this.offset+69,t?1:0)}fRESH(){return this.view.getUint8(this.offset+70)!==0}setFRESH(t){this.view.setUint8(this.offset+70,t?1:0)}hasSTANDARD(){return f(this.view,this.offset,1)}setHasSTANDARD(t){h(this.view,this.offset,1,t)}sTANDARD(){return u(this.view,this.offset+71,16)}setSTANDARD(t){l(this.view,this.offset+71,16,t),this.setHasSTANDARD(!0)}hasSCHEMA(){return f(this.view,this.offset,2)}setHasSCHEMA(t){h(this.view,this.offset,2,t)}sCHEMA(){return u(this.view,this.offset+88,64)}setSCHEMA(t){l(this.view,this.offset+88,64,t),this.setHasSCHEMA(!0)}hasPNM_CID(){return f(this.view,this.offset,3)}setHasPNM_CID(t){h(this.view,this.offset,3,t)}pNM_CID(){return u(this.view,this.offset+153,128)}setPNM_CID(t){l(this.view,this.offset+153,128,t),this.setHasPNM_CID(!0)}hasPNM_FILE_ID(){return f(this.view,this.offset,4)}setHasPNM_FILE_ID(t){h(this.view,this.offset,4,t)}pNM_FILE_ID(){return u(this.view,this.offset+282,255)}setPNM_FILE_ID(t){l(this.view,this.offset+282,255,t),this.setHasPNM_FILE_ID(!0)}pNM_PUBLISH_MS(){return this.view.getBigUint64(this.offset+544,!0)}setPNM_PUBLISH_MS(t){this.view.setBigUint64(this.offset+544,t,!0)}pNM_SIGNATURE_VERIFIED(){return this.view.getUint8(this.offset+552)!==0}setPNM_SIGNATURE_VERIFIED(t){this.view.setUint8(this.offset+552,t?1:0)}hasPNM_ATTRIBUTION(){return f(this.view,this.offset,5)}setHasPNM_ATTRIBUTION(t){h(this.view,this.offset,5,t)}pNM_ATTRIBUTION(){return u(this.view,this.offset+553,16)}setPNM_ATTRIBUTION(t){l(this.view,this.offset+553,16,t),this.setHasPNM_ATTRIBUTION(!0)}hasBATCH_ID(){return f(this.view,this.offset,6)}setHasBATCH_ID(t){h(this.view,this.offset,6,t)}bATCH_ID(){return u(this.view,this.offset+570,128)}setBATCH_ID(t){l(this.view,this.offset+570,128,t),this.setHasBATCH_ID(!0)}hasPROVIDER_ID(){return f(this.view,this.offset,7)}setHasPROVIDER_ID(t){h(this.view,this.offset,7,t)}pROVIDER_ID(){return u(this.view,this.offset+699,128)}setPROVIDER_ID(t){l(this.view,this.offset+699,128,t),this.setHasPROVIDER_ID(!0)}hasSOURCE_NAME(){return f(this.view,this.offset,8)}setHasSOURCE_NAME(t){h(this.view,this.offset,8,t)}sOURCE_NAME(){return u(this.view,this.offset+828,128)}setSOURCE_NAME(t){l(this.view,this.offset+828,128,t),this.setHasSOURCE_NAME(!0)}rECORD_COUNT(){return this.view.getBigUint64(this.offset+960,!0)}setRECORD_COUNT(t){this.view.setBigUint64(this.offset+960,t,!0)}bYTE_COUNT(){return this.view.getBigUint64(this.offset+968,!0)}setBYTE_COUNT(t){this.view.setBigUint64(this.offset+968,t,!0)}pARTS(){return this.view.getUint32(this.offset+976,!0)}setPARTS(t){this.view.setUint32(this.offset+976,t,!0)}pUBLISHED_MS(){return this.view.getBigUint64(this.offset+984,!0)}setPUBLISHED_MS(t){this.view.setBigUint64(this.offset+984,t,!0)}hasETAG_FNV1A64(){return f(this.view,this.offset,9)}setHasETAG_FNV1A64(t){h(this.view,this.offset,9,t)}eTAG_FNV1A64(){return u(this.view,this.offset+992,16)}setETAG_FNV1A64(t){l(this.view,this.offset+992,16,t),this.setHasETAG_FNV1A64(!0)}hasREF(){return f(this.view,this.offset,10)}setHasREF(t){h(this.view,this.offset,10,t)}rEF(){return new we(this.buffer,this.offset+1016)}};n(Gs,\"SIZE\",1072);n(Gs,\"ALIGN\",8);var _f=Gs,ks=class Wr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Wr(t,s)}uPTIME_S(){return this.view.getBigUint64(this.offset+8,!0)}setUPTIME_S(t){this.view.setBigUint64(this.offset+8,t,!0)}sTARTED_MS(){return this.view.getBigUint64(this.offset+16,!0)}setSTARTED_MS(t){this.view.setBigUint64(this.offset+16,t,!0)}sTORE_TOTAL_BYTES(){return this.view.getBigUint64(this.offset+24,!0)}setSTORE_TOTAL_BYTES(t){this.view.setBigUint64(this.offset+24,t,!0)}sTORE_TOTAL_RECORDS(){return this.view.getBigUint64(this.offset+32,!0)}setSTORE_TOTAL_RECORDS(t){this.view.setBigUint64(this.offset+32,t,!0)}hasSTORAGE_PATH(){return f(this.view,this.offset,0)}setHasSTORAGE_PATH(t){h(this.view,this.offset,0,t)}sTORAGE_PATH(){return u(this.view,this.offset+40,255)}setSTORAGE_PATH(t){l(this.view,this.offset+40,255,t),this.setHasSTORAGE_PATH(!0)}hAS_DISK(){return this.view.getUint8(this.offset+296)!==0}setHAS_DISK(t){this.view.setUint8(this.offset+296,t?1:0)}dISK_CAPACITY_BYTES(){return this.view.getBigUint64(this.offset+304,!0)}setDISK_CAPACITY_BYTES(t){this.view.setBigUint64(this.offset+304,t,!0)}dISK_FREE_BYTES(){return this.view.getBigUint64(this.offset+312,!0)}setDISK_FREE_BYTES(t){this.view.setBigUint64(this.offset+312,t,!0)}dISK_AVAILABLE_BYTES(){return this.view.getBigUint64(this.offset+320,!0)}setDISK_AVAILABLE_BYTES(t){this.view.setBigUint64(this.offset+320,t,!0)}hasSERVICE_STATE(){return f(this.view,this.offset,1)}setHasSERVICE_STATE(t){h(this.view,this.offset,1,t)}sERVICE_STATE(){return u(this.view,this.offset+328,32)}setSERVICE_STATE(t){l(this.view,this.offset+328,32,t),this.setHasSERVICE_STATE(!0)}hasSERVICE_MODE(){return f(this.view,this.offset,2)}setHasSERVICE_MODE(t){h(this.view,this.offset,2,t)}sERVICE_MODE(){return u(this.view,this.offset+361,32)}setSERVICE_MODE(t){l(this.view,this.offset+361,32,t),this.setHasSERVICE_MODE(!0)}hAS_BANDWIDTH(){return this.view.getUint8(this.offset+394)!==0}setHAS_BANDWIDTH(t){this.view.setUint8(this.offset+394,t?1:0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+400,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+400,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+408,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+408,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+416,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+416,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+424,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+424,t,!0)}};n(ks,\"SIZE\",432);n(ks,\"ALIGN\",8);var df=ks,Ys=class $r{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new $r(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+0,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+0,t,!0)}tOTAL_IN_BYTES(){return this.view.getBigUint64(this.offset+8,!0)}setTOTAL_IN_BYTES(t){this.view.setBigUint64(this.offset+8,t,!0)}tOTAL_OUT_BYTES(){return this.view.getBigUint64(this.offset+16,!0)}setTOTAL_OUT_BYTES(t){this.view.setBigUint64(this.offset+16,t,!0)}rATE_IN_BPS(){return this.view.getFloat64(this.offset+24,!0)}setRATE_IN_BPS(t){this.view.setFloat64(this.offset+24,t,!0)}rATE_OUT_BPS(){return this.view.getFloat64(this.offset+32,!0)}setRATE_OUT_BPS(t){this.view.setFloat64(this.offset+32,t,!0)}};n(Ys,\"SIZE\",40);n(Ys,\"ALIGN\",8);var pf=Ys,qs=class Zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Zr(t,s)}lIMIT(){return this.view.getUint32(this.offset+0,!0)}setLIMIT(t){this.view.setUint32(this.offset+0,t,!0)}};n(qs,\"SIZE\",4);n(qs,\"ALIGN\",4);var If=qs,js=class Qr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Qr(t,s)}tS_MS(){return this.view.getBigUint64(this.offset+8,!0)}setTS_MS(t){this.view.setBigUint64(this.offset+8,t,!0)}hasKIND(){return f(this.view,this.offset,0)}setHasKIND(t){h(this.view,this.offset,0,t)}kIND(){return u(this.view,this.offset+16,32)}setKIND(t){l(this.view,this.offset+16,32,t),this.setHasKIND(!0)}hasDETAIL(){return f(this.view,this.offset,1)}setHasDETAIL(t){h(this.view,this.offset,1,t)}dETAIL(){return u(this.view,this.offset+49,255)}setDETAIL(t){l(this.view,this.offset+49,255,t),this.setHasDETAIL(!0)}hasPEER_ID(){return f(this.view,this.offset,2)}setHasPEER_ID(t){h(this.view,this.offset,2,t)}pEER_ID(){return u(this.view,this.offset+305,128)}setPEER_ID(t){l(this.view,this.offset+305,128,t),this.setHasPEER_ID(!0)}};n(js,\"SIZE\",440);n(js,\"ALIGN\",8);var Sf=js,Ks=class zr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new zr(t,s)}mS(){return this.view.getUint32(this.offset+0,!0)}setMS(t){this.view.setUint32(this.offset+0,t,!0)}};n(Ks,\"SIZE\",4);n(Ks,\"ALIGN\",4);var Af=Ks,Ws=class Xr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Xr(t,s)}hasEXPRESSION(){return f(this.view,this.offset,0)}setHasEXPRESSION(t){h(this.view,this.offset,0,t)}eXPRESSION(){return u(this.view,this.offset+1,128)}setEXPRESSION(t){l(this.view,this.offset+1,128,t),this.setHasEXPRESSION(!0)}aT_MS(){return this.view.getBigUint64(this.offset+136,!0)}setAT_MS(t){this.view.setBigUint64(this.offset+136,t,!0)}};n(Ws,\"SIZE\",144);n(Ws,\"ALIGN\",8);var bf=Ws,$s=class Jr{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new Jr(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,16)}setNAME(t){l(this.view,this.offset+1,16,t),this.setHasNAME(!0)}hasSOURCE(){return f(this.view,this.offset,1)}setHasSOURCE(t){h(this.view,this.offset,1,t)}sOURCE(){return u(this.view,this.offset+18,64)}setSOURCE(t){l(this.view,this.offset+18,64,t),this.setHasSOURCE(!0)}hAS_WILDCARD(){return this.view.getUint8(this.offset+83)!==0}setHAS_WILDCARD(t){this.view.setUint8(this.offset+83,t?1:0)}hasVALUES(){return f(this.view,this.offset,2)}setHasVALUES(t){h(this.view,this.offset,2,t)}vALUESLength(){return this.hasVALUES()?Math.min(this.view.getUint32(this.offset+84,!0),60):0}setVALUESLength(t){let s=Math.max(0,Math.min(t,60));this.view.setUint32(this.offset+84,s,!0),this.setHasVALUES(!0)}vALUESAt(t){return this.view.getInt32(this.offset+84+4+t*4,!0)}setVALUESAt(t,s){this.view.setInt32(this.offset+84+4+t*4,s,!0),this.setHasVALUES(!0)}};n($s,\"SIZE\",328);n($s,\"ALIGN\",4);var Rf=$s,Zs=class tn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new tn(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+4)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+4,t?1:0)}mESSAGE_IS_TEXT(){return this.view.getUint8(this.offset+5)!==0}setMESSAGE_IS_TEXT(t){this.view.setUint8(this.offset+5,t?1:0)}};n(Zs,\"SIZE\",8);n(Zs,\"ALIGN\",4);var wf=Zs,Qs=class en{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new en(t,s)}hasPROTOCOL(){return f(this.view,this.offset,0)}setHasPROTOCOL(t){h(this.view,this.offset,0,t)}pROTOCOL(){return u(this.view,this.offset+1,64)}setPROTOCOL(t){l(this.view,this.offset+1,64,t),this.setHasPROTOCOL(!0)}hasEXTENSIONS(){return f(this.view,this.offset,1)}setHasEXTENSIONS(t){h(this.view,this.offset,1,t)}eXTENSIONS(){return u(this.view,this.offset+66,255)}setEXTENSIONS(t){l(this.view,this.offset+66,255,t),this.setHasEXTENSIONS(!0)}cLOSE_CODE(){return this.view.getInt32(this.offset+324,!0)}setCLOSE_CODE(t){this.view.setInt32(this.offset+324,t,!0)}hasCLOSE_REASON(){return f(this.view,this.offset,2)}setHasCLOSE_REASON(t){h(this.view,this.offset,2,t)}cLOSE_REASON(){return u(this.view,this.offset+328,255)}setCLOSE_REASON(t){l(this.view,this.offset+328,255,t),this.setHasCLOSE_REASON(!0)}bODY_IS_TEXT(){return this.view.getUint8(this.offset+584)!==0}setBODY_IS_TEXT(t){this.view.setUint8(this.offset+584,t?1:0)}};n(Qs,\"SIZE\",588);n(Qs,\"ALIGN\",4);var Tf=Qs,zs=class sn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new sn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return u(this.view,this.offset+1,255)}setHOST(t){l(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return u(this.view,this.offset+260,128)}setCLIENT_ID(t){l(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return u(this.view,this.offset+389,255)}setTOPIC(t){l(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}hasUSERNAME(){return f(this.view,this.offset,3)}setHasUSERNAME(t){h(this.view,this.offset,3,t)}uSERNAME(){return u(this.view,this.offset+645,128)}setUSERNAME(t){l(this.view,this.offset+645,128,t),this.setHasUSERNAME(!0)}kEEP_ALIVE_S(){return this.view.getUint16(this.offset+774,!0)}setKEEP_ALIVE_S(t){this.view.setUint16(this.offset+774,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+776,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+776,t,!0)}pACKET_ID(){return this.view.getUint16(this.offset+780,!0)}setPACKET_ID(t){this.view.setUint16(this.offset+780,t,!0)}};n(zs,\"SIZE\",784);n(zs,\"ALIGN\",4);var Of=zs,Xs=class rn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new rn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return u(this.view,this.offset+1,255)}setHOST(t){l(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasCLIENT_ID(){return f(this.view,this.offset,1)}setHasCLIENT_ID(t){h(this.view,this.offset,1,t)}cLIENT_ID(){return u(this.view,this.offset+260,128)}setCLIENT_ID(t){l(this.view,this.offset+260,128,t),this.setHasCLIENT_ID(!0)}hasTOPIC(){return f(this.view,this.offset,2)}setHasTOPIC(t){h(this.view,this.offset,2,t)}tOPIC(){return u(this.view,this.offset+389,255)}setTOPIC(t){l(this.view,this.offset+389,255,t),this.setHasTOPIC(!0)}pAYLOAD_BYTES(){return this.view.getBigUint64(this.offset+648,!0)}setPAYLOAD_BYTES(t){this.view.setBigUint64(this.offset+648,t,!0)}};n(Xs,\"SIZE\",656);n(Xs,\"ALIGN\",8);var mf=Xs,Js=class nn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new nn(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return u(this.view,this.offset+1,255)}setHOST(t){l(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}tIMEOUT_MS(){return this.view.getUint32(this.offset+260,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+260,t,!0)}nO_RESPONSE(){return this.view.getUint8(this.offset+264)!==0}setNO_RESPONSE(t){this.view.setUint8(this.offset+264,t?1:0)}hasBIND_ADDRESS(){return f(this.view,this.offset,1)}setHasBIND_ADDRESS(t){h(this.view,this.offset,1,t)}bIND_ADDRESS(){return u(this.view,this.offset+265,64)}setBIND_ADDRESS(t){l(this.view,this.offset+265,64,t),this.setHasBIND_ADDRESS(!0)}bIND_PORT(){return this.view.getUint16(this.offset+330,!0)}setBIND_PORT(t){this.view.setUint16(this.offset+330,t,!0)}hasUDP_TYPE(){return f(this.view,this.offset,2)}setHasUDP_TYPE(t){h(this.view,this.offset,2,t)}uDP_TYPE(){return u(this.view,this.offset+332,8)}setUDP_TYPE(t){l(this.view,this.offset+332,8,t),this.setHasUDP_TYPE(!0)}aLLOW_UNAUTHORIZED(){return this.view.getUint8(this.offset+341)!==0}setALLOW_UNAUTHORIZED(t){this.view.setUint8(this.offset+341,t?1:0)}hasSERVER_NAME(){return f(this.view,this.offset,3)}setHasSERVER_NAME(t){h(this.view,this.offset,3,t)}sERVER_NAME(){return u(this.view,this.offset+342,255)}setSERVER_NAME(t){l(this.view,this.offset+342,255,t),this.setHasSERVER_NAME(!0)}};n(Js,\"SIZE\",600);n(Js,\"ALIGN\",4);var gf=Js,ti=class on{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new on(t,s)}hasHOST(){return f(this.view,this.offset,0)}setHasHOST(t){h(this.view,this.offset,0,t)}hOST(){return u(this.view,this.offset+1,255)}setHOST(t){l(this.view,this.offset+1,255,t),this.setHasHOST(!0)}pORT(){return this.view.getUint16(this.offset+258,!0)}setPORT(t){this.view.setUint16(this.offset+258,t,!0)}hasLOCAL_ADDRESS(){return f(this.view,this.offset,1)}setHasLOCAL_ADDRESS(t){h(this.view,this.offset,1,t)}lOCAL_ADDRESS(){return u(this.view,this.offset+260,64)}setLOCAL_ADDRESS(t){l(this.view,this.offset+260,64,t),this.setHasLOCAL_ADDRESS(!0)}lOCAL_PORT(){return this.view.getUint16(this.offset+326,!0)}setLOCAL_PORT(t){this.view.setUint16(this.offset+326,t,!0)}hasREMOTE_ADDRESS(){return f(this.view,this.offset,2)}setHasREMOTE_ADDRESS(t){h(this.view,this.offset,2,t)}rEMOTE_ADDRESS(){return u(this.view,this.offset+328,64)}setREMOTE_ADDRESS(t){l(this.view,this.offset+328,64,t),this.setHasREMOTE_ADDRESS(!0)}rEMOTE_PORT(){return this.view.getUint16(this.offset+394,!0)}setREMOTE_PORT(t){this.view.setUint16(this.offset+394,t,!0)}aUTHORIZED(){return this.view.getUint8(this.offset+396)!==0}setAUTHORIZED(t){this.view.setUint8(this.offset+396,t?1:0)}hasAUTHORIZATION_ERROR(){return f(this.view,this.offset,3)}setHasAUTHORIZATION_ERROR(t){h(this.view,this.offset,3,t)}aUTHORIZATION_ERROR(){return u(this.view,this.offset+397,255)}setAUTHORIZATION_ERROR(t){l(this.view,this.offset+397,255,t),this.setHasAUTHORIZATION_ERROR(!0)}};n(ti,\"SIZE\",654);n(ti,\"ALIGN\",2);var yf=ti,ei=class an{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new an(t,s)}nOT_RECURSIVE(){return this.view.getUint8(this.offset+0)!==0}setNOT_RECURSIVE(t){this.view.setUint8(this.offset+0,t?1:0)}};n(ei,\"SIZE\",1);n(ei,\"ALIGN\",1);var Nf=ei,si=class fn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new fn(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,255)}setNAME(t){l(this.view,this.offset+1,255,t),this.setHasNAME(!0)}iS_FILE(){return this.view.getUint8(this.offset+257)!==0}setIS_FILE(t){this.view.setUint8(this.offset+257,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+258)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+258,t?1:0)}};n(si,\"SIZE\",259);n(si,\"ALIGN\",1);var Df=si,ii=class hn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new hn(t,s)}sIZE(){return this.view.getBigUint64(this.offset+0,!0)}setSIZE(t){this.view.setBigUint64(this.offset+0,t,!0)}iS_FILE(){return this.view.getUint8(this.offset+8)!==0}setIS_FILE(t){this.view.setUint8(this.offset+8,t?1:0)}iS_DIRECTORY(){return this.view.getUint8(this.offset+9)!==0}setIS_DIRECTORY(t){this.view.setUint8(this.offset+9,t?1:0)}cTIME_MS(){return this.view.getFloat64(this.offset+16,!0)}setCTIME_MS(t){this.view.setFloat64(this.offset+16,t,!0)}mTIME_MS(){return this.view.getFloat64(this.offset+24,!0)}setMTIME_MS(t){this.view.setFloat64(this.offset+24,t,!0)}};n(ii,\"SIZE\",32);n(ii,\"ALIGN\",8);var Lf=ii,ri=class cn{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new cn(t,s)}tIMEOUT_MS(){return this.view.getUint32(this.offset+0,!0)}setTIMEOUT_MS(t){this.view.setUint32(this.offset+0,t,!0)}};n(ri,\"SIZE\",4);n(ri,\"ALIGN\",4);var Cf=ri,ni=class un{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new un(t,s)}hasNAME(){return f(this.view,this.offset,0)}setHasNAME(t){h(this.view,this.offset,0,t)}nAME(){return u(this.view,this.offset+1,128)}setNAME(t){l(this.view,this.offset+1,128,t),this.setHasNAME(!0)}hasVALUE(){return f(this.view,this.offset,1)}setHasVALUE(t){h(this.view,this.offset,1,t)}vALUE(){return u(this.view,this.offset+130,255)}setVALUE(t){l(this.view,this.offset+130,255,t),this.setHasVALUE(!0)}};n(ni,\"SIZE\",386);n(ni,\"ALIGN\",1);var Pf=ni,oi=class ln{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new ln(t,s)}eXIT_CODE(){return this.view.getInt32(this.offset+4,!0)}setEXIT_CODE(t){this.view.setInt32(this.offset+4,t,!0)}hasSIGNAL(){return f(this.view,this.offset,0)}setHasSIGNAL(t){h(this.view,this.offset,0,t)}sIGNAL(){return u(this.view,this.offset+8,16)}setSIGNAL(t){l(this.view,this.offset+8,16,t),this.setHasSIGNAL(!0)}};n(oi,\"SIZE\",28);n(oi,\"ALIGN\",4);var Uf=oi,ai=class En{constructor(t,s=0){n(this,\"buffer\",t),n(this,\"offset\",s),n(this,\"view\"),this.view=new DataView(t)}static fromPointer(t,s=0){return new En(t,s)}hasSCOPE(){return f(this.view,this.offset,0)}setHasSCOPE(t){h(this.view,this.offset,0,t)}sCOPE(){return u(this.view,this.offset+1,128)}setSCOPE(t){l(this.view,this.offset+1,128,t),this.setHasSCOPE(!0)}hasKEY(){return f(this.view,this.offset,1)}setHasKEY(t){h(this.view,this.offset,1,t)}kEY(){return u(this.view,this.offset+130,255)}setKEY(t){l(this.view,this.offset+130,255,t),this.setHasKEY(!0)}};n(ai,\"SIZE\",386);n(ai,\"ALIGN\",1);var Hf=ai;var pt=new Int32Array(2),Te=new Float32Array(pt.buffer),Oe=new Float64Array(pt.buffer),Yt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Jt;(function(e){e[e.UTF8_BYTES=1]=\"UTF8_BYTES\",e[e.UTF16_STRING=2]=\"UTF16_STRING\"})(Jt||(Jt={}));var It=class e{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return pt[0]=this.readInt32(t),Te[0]}readFloat64(t){return pt[Yt?0:1]=this.readInt32(t),pt[Yt?1:0]=this.readInt32(t+4),Oe[0]}writeInt8(t,s){this.bytes_[t]=s}writeUint8(t,s){this.bytes_[t]=s}writeInt16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeUint16(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8}writeInt32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeUint32(t,s){this.bytes_[t]=s,this.bytes_[t+1]=s>>8,this.bytes_[t+2]=s>>16,this.bytes_[t+3]=s>>24}writeInt64(t,s){this.writeInt32(t,Number(BigInt.asIntN(32,s))),this.writeInt32(t+4,Number(BigInt.asIntN(32,s>>BigInt(32))))}writeUint64(t,s){this.writeUint32(t,Number(BigInt.asUintN(32,s))),this.writeUint32(t+4,Number(BigInt.asUintN(32,s>>BigInt(32))))}writeFloat32(t,s){Te[0]=s,this.writeInt32(t,pt[0])}writeFloat64(t,s){Oe[0]=s,this.writeInt32(t,pt[Yt?0:1]),this.writeInt32(t+4,pt[Yt?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error(\"FlatBuffers: ByteBuffer is too short to contain an identifier.\");let t=\"\";for(let s=0;s<4;s++)t+=String.fromCharCode(this.readInt8(this.position_+4+s));return t}__offset(t,s){let i=t-this.readInt32(t);return s<this.readInt16(i)?this.readInt16(i+s):0}__union(t,s){return t.bb_pos=s+this.readInt32(s),t.bb=this,t}__string(t,s){t+=this.readInt32(t);let i=this.readInt32(t);t+=4;let r=this.bytes_.subarray(t,t+i);return s===Jt.UTF8_BYTES?r:this.text_decoder_.decode(r)}__union_with_string(t,s){return typeof t==\"string\"?this.__string(s):this.__union(t,s)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error(\"FlatBuffers: file identifier must be length \"+4);for(let s=0;s<4;s++)if(t.charCodeAt(s)!=this.readInt8(this.position()+4+s))return!1;return!0}createScalarList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o)}return i}createObjList(t,s){let i=[];for(let r=0;r<s;++r){let o=t(r);o!==null&&i.push(o.unpack())}return i}};var te=class e{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let s;t?s=t:s=1024,this.bb=It.allocate(s),this.space=s}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,s){t>this.minalign&&(this.minalign=t);let i=~(this.bb.capacity()-this.space+s)+1&t-1;for(;this.space<i+t+s;){let r=this.bb.capacity();this.bb=e.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}pad(t){for(let s=0;s<t;s++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,s,i){(this.force_defaults||s!=i)&&(this.addInt8(s),this.slot(t))}addFieldInt16(t,s,i){(this.force_defaults||s!=i)&&(this.addInt16(s),this.slot(t))}addFieldInt32(t,s,i){(this.force_defaults||s!=i)&&(this.addInt32(s),this.slot(t))}addFieldInt64(t,s,i){(this.force_defaults||s!==i)&&(this.addInt64(s),this.slot(t))}addFieldFloat32(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat32(s),this.slot(t))}addFieldFloat64(t,s,i){(this.force_defaults||s!=i)&&(this.addFloat64(s),this.slot(t))}addFieldOffset(t,s,i){(this.force_defaults||s!=i)&&(this.addOffset(s),this.slot(t))}addFieldStruct(t,s,i){s!=i&&(this.nested(s),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError(\"FlatBuffers: struct must be serialized inline.\")}notNested(){if(this.isNested)throw new TypeError(\"FlatBuffers: object serialization must not be nested.\")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let s=t.capacity();if(s&3221225472)throw new Error(\"FlatBuffers: cannot grow buffer beyond 2 gigabytes.\");let i=s<<1,r=It.allocate(i);return r.setPosition(i-s),r.bytes().set(t.bytes(),i-s),r}addOffset(t){this.prep(4,0),this.writeInt32(this.offset()-t+4)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let s=0;s<t;s++)this.vtable[s]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error(\"FlatBuffers: endObject called without startObject\");this.addInt32(0);let t=this.offset(),s=this.vtable_in_use-1;for(;s>=0&&this.vtable[s]==0;s--);let i=s+1;for(;s>=0;s--)this.addInt16(this.vtable[s]!=0?t-this.vtable[s]:0);let r=2;this.addInt16(t-this.object_start);let o=(i+r)*2;this.addInt16(o);let a=0,c=this.space;t:for(s=0;s<this.vtables.length;s++){let E=this.bb.capacity()-this.vtables[s];if(o==this.bb.readInt16(E)){for(let _=2;_<o;_+=2)if(this.bb.readInt16(c+_)!=this.bb.readInt16(E+_))continue t;a=this.vtables[s];break}}return a?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,a-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,s,i){let r=i?4:0;if(s){let o=s;if(this.prep(this.minalign,8+r),o.length!=4)throw new TypeError(\"FlatBuffers: file identifier must be length \"+4);for(let a=3;a>=0;a--)this.writeInt8(o.charCodeAt(a))}this.prep(this.minalign,4+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,s){this.finish(t,s,!0)}requiredField(t,s){let i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(s<this.bb.readInt16(r)&&this.bb.readInt16(r+s)!=0))throw new TypeError(\"FlatBuffers: field \"+s+\" must be set\")}startVector(t,s,i){this.notNested(),this.vector_num_elems=s,this.prep(4,t*s),this.prep(i,t*s)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let s=this.createString(t);return this.string_maps.set(t,s),s}createString(t){if(t==null)return 0;let s;return t instanceof Uint8Array?s=t:s=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,s.length,1),this.bb.setPosition(this.space-=s.length),this.bb.bytes().set(s,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t==\"string\"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let s=[];for(let i=0;i<t.length;++i){let r=t[i];if(r!==null)s.push(this.createObjectOffset(r));else throw new TypeError(\"FlatBuffers: Argument for createObjectOffsetList cannot contain null.\")}return s}createStructOffsetList(t,s){return s(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}};var fi;(function(e){e[e.DIRECT=0]=\"DIRECT\",e[e.COMMAND=1]=\"COMMAND\"})(fi||(fi={}));var St;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.APPEND_ONLY=1]=\"APPEND_ONLY\",e[e.MUTABLE=2]=\"MUTABLE\"})(St||(St={}));var Z;(function(e){e[e.BORROWED=0]=\"BORROWED\",e[e.PRODUCER_OWNED=1]=\"PRODUCER_OWNED\",e[e.HOST_OWNED=2]=\"HOST_OWNED\",e[e.SHARED=3]=\"SHARED\"})(Z||(Z={}));function dn(e){if(e==null)return{valid:!0,present:!1,bytes:[]};if(typeof e==\"string\"){let s=e.startsWith(\"0x\")?e.slice(2):e;if(s.length===0)return{valid:!0,present:!1,bytes:[]};if(s.length%2!==0||!/^[0-9a-fA-F]+$/.test(s))return{valid:!1,present:!0,bytes:[]};let i=[];for(let r=0;r<s.length;r+=2)i.push(Number.parseInt(s.slice(r,r+2),16));return{valid:!0,present:!0,bytes:i}}if(!Array.isArray(e)&&!(e instanceof Uint8Array))return{valid:!1,present:!0,bytes:[]};let t=Array.from(e);return t.length===0?{valid:!0,present:!1,bytes:[]}:t.some(s=>!Number.isInteger(s)||s<0||s>255)?{valid:!1,present:!0,bytes:[]}:{valid:!0,present:!0,bytes:t}}function pn(e){let t=dn(e);return t.valid&&t.present?t.bytes:void 0}function In(e){return dn(e).valid}function Mf(e){return Object.prototype.toString.call(e)}function Bf(e){if(!e||typeof e!=\"object\")return!1;let t=Mf(e);return t===\"[object ArrayBuffer]\"||t===\"[object SharedArrayBuffer]\"}function st(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Bf(e)?new Uint8Array(e):null}var j;(function(e){e[e.FLATBUFFER=0]=\"FLATBUFFER\",e[e.ALIGNED_BINARY=1]=\"ALIGNED_BINARY\"})(j||(j={}));var qt=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsFlatBufferTypeRef(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFlatBufferTypeRef(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}SCHEMA_NAME(t){let s=this.bb.__offset(this.bb_pos,4);return s?this.bb.__string(this.bb_pos+s,t):null}FILE_IDENTIFIER(t){let s=this.bb.__offset(this.bb_pos,6);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_VERSION(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.__string(this.bb_pos+s,t):null}ROOT_TYPE(t){let s=this.bb.__offset(this.bb_pos,10);return s?this.bb.__string(this.bb_pos+s,t):null}SCHEMA_HASH(t){let s=this.bb.__offset(this.bb_pos,12);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}schemaHashLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}schemaHashArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ACCEPTS_ANY_FLATBUFFER(){let t=this.bb.__offset(this.bb_pos,14);return t?!!this.bb.readInt8(this.bb_pos+t):!1}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):j.FLATBUFFER}FIXED_STRING_LENGTH(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint16(this.bb_pos+t):0}BYTE_LENGTH(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint32(this.bb_pos+t):0}REQUIRED_ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):0}static startFlatBufferTypeRef(t){t.startObject(10)}static addSchemaName(t,s){t.addFieldOffset(0,s,0)}static addFileIdentifier(t,s){t.addFieldOffset(1,s,0)}static addSchemaVersion(t,s){t.addFieldOffset(2,s,0)}static addRootType(t,s){t.addFieldOffset(3,s,0)}static addSchemaHash(t,s){t.addFieldOffset(4,s,0)}static createSchemaHashVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startSchemaHashVector(t,s){t.startVector(1,s,1)}static addAcceptsAnyFlatbuffer(t,s){t.addFieldInt8(5,+s,0)}static addWireFormat(t,s){t.addFieldInt8(6,s,j.FLATBUFFER)}static addFixedStringLength(t,s){t.addFieldInt16(7,s,0)}static addByteLength(t,s){t.addFieldInt32(8,s,0)}static addRequiredAlignment(t,s){t.addFieldInt16(9,s,0)}static endFlatBufferTypeRef(t){return t.endObject()}static createFlatBufferTypeRef(t,s,i,r,o,a,c,E,_,I,m){return e.startFlatBufferTypeRef(t),e.addSchemaName(t,s),e.addFileIdentifier(t,i),e.addSchemaVersion(t,r),e.addRootType(t,o),e.addSchemaHash(t,a),e.addAcceptsAnyFlatbuffer(t,c),e.addWireFormat(t,E),e.addFixedStringLength(t,_),e.addByteLength(t,I),e.addRequiredAlignment(t,m),e.endFlatBufferTypeRef(t)}unpack(){return new ee(this.SCHEMA_NAME(),this.FILE_IDENTIFIER(),this.SCHEMA_VERSION(),this.ROOT_TYPE(),this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),this.ACCEPTS_ANY_FLATBUFFER(),this.WIRE_FORMAT(),this.FIXED_STRING_LENGTH(),this.BYTE_LENGTH(),this.REQUIRED_ALIGNMENT())}unpackTo(t){t.SCHEMA_NAME=this.SCHEMA_NAME(),t.FILE_IDENTIFIER=this.FILE_IDENTIFIER(),t.SCHEMA_VERSION=this.SCHEMA_VERSION(),t.ROOT_TYPE=this.ROOT_TYPE(),t.SCHEMA_HASH=this.bb.createScalarList(this.SCHEMA_HASH.bind(this),this.schemaHashLength()),t.ACCEPTS_ANY_FLATBUFFER=this.ACCEPTS_ANY_FLATBUFFER(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.FIXED_STRING_LENGTH=this.FIXED_STRING_LENGTH(),t.BYTE_LENGTH=this.BYTE_LENGTH(),t.REQUIRED_ALIGNMENT=this.REQUIRED_ALIGNMENT()}},ee=class{constructor(t=null,s=null,i=null,r=null,o=[],a=!1,c=j.FLATBUFFER,E=0,_=0,I=0){this.SCHEMA_NAME=t,this.FILE_IDENTIFIER=s,this.SCHEMA_VERSION=i,this.ROOT_TYPE=r,this.SCHEMA_HASH=o,this.ACCEPTS_ANY_FLATBUFFER=a,this.WIRE_FORMAT=c,this.FIXED_STRING_LENGTH=E,this.BYTE_LENGTH=_,this.REQUIRED_ALIGNMENT=I}pack(t){let s=this.SCHEMA_NAME!==null?t.createString(this.SCHEMA_NAME):0,i=this.FILE_IDENTIFIER!==null?t.createString(this.FILE_IDENTIFIER):0,r=this.SCHEMA_VERSION!==null?t.createString(this.SCHEMA_VERSION):0,o=this.ROOT_TYPE!==null?t.createString(this.ROOT_TYPE):0,a=qt.createSchemaHashVector(t,this.SCHEMA_HASH);return qt.createFlatBufferTypeRef(t,s,i,r,o,a,this.ACCEPTS_ANY_FLATBUFFER,this.WIRE_FORMAT,this.FIXED_STRING_LENGTH,this.BYTE_LENGTH,this.REQUIRED_ALIGNMENT)}};var Q;(function(e){e[e.IMMUTABLE=0]=\"IMMUTABLE\",e[e.SINGLE_WRITER_MUTABLE=1]=\"SINGLE_WRITER_MUTABLE\",e[e.APPEND_ONLY=2]=\"APPEND_ONLY\"})(Q||(Q={}));var z;(function(e){e[e.HOST_OWNED=0]=\"HOST_OWNED\",e[e.PLUGIN_OWNED=1]=\"PLUGIN_OWNED\",e[e.TRANSFERRED=2]=\"TRANSFERRED\"})(z||(z={}));var x=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsTAB(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTAB(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$TAB\")}OFFSET(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}SIZE(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0}ALIGNMENT(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0}WIRE_FORMAT(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint8(this.bb_pos+t):j.FLATBUFFER}TYPE_REF(t){let s=this.bb.__offset(this.bb_pos,12);return s?(t||new qt).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}MUTABILITY(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint8(this.bb_pos+t):Q.IMMUTABLE}OWNERSHIP(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):z.HOST_OWNED}FRAME_ID(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}PORT_ID(t){let s=this.bb.__offset(this.bb_pos,20);return s?this.bb.__string(this.bb_pos+s,t):null}static startTAB(t){t.startObject(9)}static addOffset(t,s){t.addFieldInt32(0,s,0)}static addSize(t,s){t.addFieldInt32(1,s,0)}static addAlignment(t,s){t.addFieldInt32(2,s,0)}static addWireFormat(t,s){t.addFieldInt8(3,s,j.FLATBUFFER)}static addTypeRef(t,s){t.addFieldOffset(4,s,0)}static addMutability(t,s){t.addFieldInt8(5,s,Q.IMMUTABLE)}static addOwnership(t,s){t.addFieldInt8(6,s,z.HOST_OWNED)}static addFrameId(t,s){t.addFieldInt64(7,s,BigInt(\"0\"))}static addPortId(t,s){t.addFieldOffset(8,s,0)}static endTAB(t){return t.endObject()}static finishTABBuffer(t,s){t.finish(s,\"$TAB\")}static finishSizePrefixedTABBuffer(t,s){t.finish(s,\"$TAB\",!0)}unpack(){return new jt(this.OFFSET(),this.SIZE(),this.ALIGNMENT(),this.WIRE_FORMAT(),this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,this.MUTABILITY(),this.OWNERSHIP(),this.FRAME_ID(),this.PORT_ID())}unpackTo(t){t.OFFSET=this.OFFSET(),t.SIZE=this.SIZE(),t.ALIGNMENT=this.ALIGNMENT(),t.WIRE_FORMAT=this.WIRE_FORMAT(),t.TYPE_REF=this.TYPE_REF()!==null?this.TYPE_REF().unpack():null,t.MUTABILITY=this.MUTABILITY(),t.OWNERSHIP=this.OWNERSHIP(),t.FRAME_ID=this.FRAME_ID(),t.PORT_ID=this.PORT_ID()}},jt=class{constructor(t=0,s=0,i=0,r=j.FLATBUFFER,o=null,a=Q.IMMUTABLE,c=z.HOST_OWNED,E=BigInt(\"0\"),_=null){this.OFFSET=t,this.SIZE=s,this.ALIGNMENT=i,this.WIRE_FORMAT=r,this.TYPE_REF=o,this.MUTABILITY=a,this.OWNERSHIP=c,this.FRAME_ID=E,this.PORT_ID=_}pack(t){let s=this.TYPE_REF!==null?this.TYPE_REF.pack(t):0,i=this.PORT_ID!==null?t.createString(this.PORT_ID):0;return x.startTAB(t),x.addOffset(t,this.OFFSET),x.addSize(t,this.SIZE),x.addAlignment(t,this.ALIGNMENT),x.addWireFormat(t,this.WIRE_FORMAT),x.addTypeRef(t,s),x.addMutability(t,this.MUTABILITY),x.addOwnership(t,this.OWNERSHIP),x.addFrameId(t,this.FRAME_ID),x.addPortId(t,i),x.endTAB(t)}};var Ot=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVRequest(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVRequest(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}METHOD_ID(t){let s=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+s,t)}INPUTS(t,s){let i=this.bb.__offset(this.bb_pos,6);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,8);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,8);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}OUTPUT_STREAM_CAP(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}static startPIVRequest(t){t.startObject(5)}static addMethodId(t,s){t.addFieldOffset(0,s,0)}static addInputs(t,s){t.addFieldOffset(1,s,0)}static createInputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startInputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(2,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addTraceId(t,s){t.addFieldInt64(3,s,BigInt(\"0\"))}static addOutputStreamCap(t,s){t.addFieldInt32(4,s,0)}static endPIVRequest(t){let s=t.endObject();return t.requiredField(s,4),s}static createPIVRequest(t,s,i,r,o,a){return e.startPIVRequest(t),e.addMethodId(t,s),e.addInputs(t,i),e.addPayloadArena(t,r),e.addTraceId(t,o),e.addOutputStreamCap(t,a),e.endPIVRequest(t)}unpack(){return new hi(this.METHOD_ID(),this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.TRACE_ID(),this.OUTPUT_STREAM_CAP())}unpackTo(t){t.METHOD_ID=this.METHOD_ID(),t.INPUTS=this.bb.createObjList(this.INPUTS.bind(this),this.inputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.TRACE_ID=this.TRACE_ID(),t.OUTPUT_STREAM_CAP=this.OUTPUT_STREAM_CAP()}},hi=class{constructor(t=null,s=[],i=[],r=BigInt(\"0\"),o=0){this.METHOD_ID=t,this.INPUTS=s,this.PAYLOAD_ARENA=i,this.TRACE_ID=r,this.OUTPUT_STREAM_CAP=o}pack(t){let s=this.METHOD_ID!==null?t.createString(this.METHOD_ID):0,i=Ot.createInputsVector(t,t.createObjectOffsetList(this.INPUTS)),r=Ot.createPayloadArenaVector(t,this.PAYLOAD_ARENA);return Ot.createPIVRequest(t,s,i,r,this.TRACE_ID,this.OUTPUT_STREAM_CAP)}};var At;(function(e){e[e.OK=0]=\"OK\",e[e.NOT_FOUND=1]=\"NOT_FOUND\",e[e.YIELDED=2]=\"YIELDED\",e[e.FAILED=3]=\"FAILED\"})(At||(At={}));var B=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIVResponse(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIVResponse(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}STATUS_CODE(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}STATUS(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):At.OK}YIELDED(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}BACKLOG_REMAINING(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}OUTPUTS(t,s){let i=this.bb.__offset(this.bb_pos,12);return i?(s||new x).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}PAYLOAD_ARENA(t){let s=this.bb.__offset(this.bb_pos,14);return s?this.bb.readUint8(this.bb.__vector(this.bb_pos+s)+t):0}payloadArenaLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}payloadArenaArray(){let t=this.bb.__offset(this.bb_pos,14);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ERROR_CODE(t){let s=this.bb.__offset(this.bb_pos,16);return s?this.bb.__string(this.bb_pos+s,t):null}ERROR_MESSAGE(t){let s=this.bb.__offset(this.bb_pos,18);return s?this.bb.__string(this.bb_pos+s,t):null}TRACE_ID(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt(\"0\")}static startPIVResponse(t){t.startObject(9)}static addStatusCode(t,s){t.addFieldInt32(0,s,0)}static addStatus(t,s){t.addFieldInt32(1,s,At.OK)}static addYielded(t,s){t.addFieldInt8(2,+s,0)}static addBacklogRemaining(t,s){t.addFieldInt32(3,s,0)}static addOutputs(t,s){t.addFieldOffset(4,s,0)}static createOutputsVector(t,s){t.startVector(4,s.length,4);for(let i=s.length-1;i>=0;i--)t.addOffset(s[i]);return t.endVector()}static startOutputsVector(t,s){t.startVector(4,s,4)}static addPayloadArena(t,s){t.addFieldOffset(5,s,0)}static createPayloadArenaVector(t,s){t.startVector(1,s.length,1);for(let i=s.length-1;i>=0;i--)t.addInt8(s[i]);return t.endVector()}static startPayloadArenaVector(t,s){t.startVector(1,s,1)}static addErrorCode(t,s){t.addFieldOffset(6,s,0)}static addErrorMessage(t,s){t.addFieldOffset(7,s,0)}static addTraceId(t,s){t.addFieldInt64(8,s,BigInt(\"0\"))}static endPIVResponse(t){return t.endObject()}static createPIVResponse(t,s,i,r,o,a,c,E,_,I){return e.startPIVResponse(t),e.addStatusCode(t,s),e.addStatus(t,i),e.addYielded(t,r),e.addBacklogRemaining(t,o),e.addOutputs(t,a),e.addPayloadArena(t,c),e.addErrorCode(t,E),e.addErrorMessage(t,_),e.addTraceId(t,I),e.endPIVResponse(t)}unpack(){return new ci(this.STATUS_CODE(),this.STATUS(),this.YIELDED(),this.BACKLOG_REMAINING(),this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),this.ERROR_CODE(),this.ERROR_MESSAGE(),this.TRACE_ID())}unpackTo(t){t.STATUS_CODE=this.STATUS_CODE(),t.STATUS=this.STATUS(),t.YIELDED=this.YIELDED(),t.BACKLOG_REMAINING=this.BACKLOG_REMAINING(),t.OUTPUTS=this.bb.createObjList(this.OUTPUTS.bind(this),this.outputsLength()),t.PAYLOAD_ARENA=this.bb.createScalarList(this.PAYLOAD_ARENA.bind(this),this.payloadArenaLength()),t.ERROR_CODE=this.ERROR_CODE(),t.ERROR_MESSAGE=this.ERROR_MESSAGE(),t.TRACE_ID=this.TRACE_ID()}},ci=class{constructor(t=0,s=At.OK,i=!1,r=0,o=[],a=[],c=null,E=null,_=BigInt(\"0\")){this.STATUS_CODE=t,this.STATUS=s,this.YIELDED=i,this.BACKLOG_REMAINING=r,this.OUTPUTS=o,this.PAYLOAD_ARENA=a,this.ERROR_CODE=c,this.ERROR_MESSAGE=E,this.TRACE_ID=_}pack(t){let s=B.createOutputsVector(t,t.createObjectOffsetList(this.OUTPUTS)),i=B.createPayloadArenaVector(t,this.PAYLOAD_ARENA),r=this.ERROR_CODE!==null?t.createString(this.ERROR_CODE):0,o=this.ERROR_MESSAGE!==null?t.createString(this.ERROR_MESSAGE):0;return B.createPIVResponse(t,this.STATUS_CODE,this.STATUS,this.YIELDED,this.BACKLOG_REMAINING,s,i,r,o,this.TRACE_ID)}};var W=class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,s){return this.bb_pos=t,this.bb=s,this}static getRootAsPIV(t,s){return(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsPIV(t,s){return t.setPosition(t.position()+4),(s||new e).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier(\"$PIV\")}REQUEST(t){let s=this.bb.__offset(this.bb_pos,4);return s?(t||new Ot).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}RESPONSE(t){let s=this.bb.__offset(this.bb_pos,6);return s?(t||new B).__init(this.bb.__indirect(this.bb_pos+s),this.bb):null}static startPIV(t){t.startObject(2)}static addRequest(t,s){t.addFieldOffset(0,s,0)}static addResponse(t,s){t.addFieldOffset(1,s,0)}static endPIV(t){return t.endObject()}static finishPIVBuffer(t,s){t.finish(s,\"$PIV\")}static finishSizePrefixedPIVBuffer(t,s){t.finish(s,\"$PIV\",!0)}unpack(){return new ui(this.REQUEST()!==null?this.REQUEST().unpack():null,this.RESPONSE()!==null?this.RESPONSE().unpack():null)}unpackTo(t){t.REQUEST=this.REQUEST()!==null?this.REQUEST().unpack():null,t.RESPONSE=this.RESPONSE()!==null?this.RESPONSE().unpack():null}},ui=class{constructor(t=null,s=null){this.REQUEST=t,this.RESPONSE=s}pack(t){let s=this.REQUEST!==null?this.REQUEST.pack(t):0,i=this.RESPONSE!==null?this.RESPONSE.pack(t):0;return W.startPIV(t),W.addRequest(t,s),W.addResponse(t,i),W.endPIV(t)}};var ie=65535,ht=4294967295,An=new WeakMap,Ff=new WeakMap,Vf=new WeakMap;function Y(...e){return e.find(t=>t!=null)}function X(e,t,s={}){let{defaultValue:i,minimum:r=0,maximum:o=Number.MAX_SAFE_INTEGER}=s;if(e==null||e===\"\"){if(i!==void 0)return i;throw new TypeError(`${t} is required.`)}let a;if(typeof e==\"bigint\"){if(e<BigInt(r)||e>BigInt(o))throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);a=Number(e)}else a=typeof e==\"number\"?e:Number(e);if(!Number.isSafeInteger(a)||a<r||a>o)throw new RangeError(`${t} must be an integer between ${r} and ${o}.`);return a}function ge(e){return e>0&&Number.isInteger(Math.log2(e))}function _i(e,t,s={}){let i=X(e,t,{defaultValue:s.defaultValue,minimum:0,maximum:s.maximum??ht});if(!ge(i))throw new RangeError(`${t} must be a positive power of two.`);return i}function di(e,t,s){if(e>ht-t)throw new RangeError(`${s} offset + size exceeds the uint32 address range.`)}function pi(e,t,s){if(e.buffer!==t.buffer||e.byteOffset<t.byteOffset||e.byteOffset+e.byteLength>t.byteOffset+t.byteLength)throw new Error(`${s} is outside its arena lease.`)}function Ii(e){let t=An.get(e);if(!t)throw new TypeError(\"SDS PIV/TAB arena lease is invalid.\");return t}function xf(e,t,s,i){let r=Ii(e);if(r.closed)throw new Error(`${i} arena lease is closed.`);if(t!==r.generation)throw new Error(`${i} has stale arena lease generation ${String(t)}; active generation is ${r.generation}.`);return s&&pi(s,r.arena,i),r}function bn(e,t,s={}){let i=e?.arenaLease;if(!i){if(s.required===!0)throw new Error(`${t} requires a live arena lease.`);return null}let r=st(e.payload),o=Y(e.generation,e.arenaGeneration);return xf(i,o,r,t)}function Rn(e,t){let s=bn(e,t);if(!s)return null;let i=gn(e.ownership),r=mn(e.mutability);if(i===Z.PRODUCER_OWNED||r!==St.IMMUTABLE){let o=st(e.payload),a=Y(e.generation,e.arenaGeneration),c=Vf.get(e);if(c&&i===Z.SHARED&&c.lease===e.arenaLease&&c.generation===a&&c.payloadBuffer===o?.buffer&&c.payloadByteOffset===o?.byteOffset&&c.payloadByteLength===o?.byteLength&&c.frameId===ye(e)&&c.ownership===i&&c.mutability===r)return s;throw new Error(`${t} producer-owned or mutable cross-invocation alias requires explicit compatible transfer forwarding.`)}return s}function Gf(e){if(e instanceof It)return e;let t=st(e);if(t)return new It(t);throw new TypeError(\"Expected ByteBuffer, Uint8Array, ArrayBufferView, or ArrayBuffer.\")}function li(e,t=0){let s=Number(e??t);return Number.isFinite(s)?Math.max(0,Math.trunc(s)):t}function Kt(e,t=BigInt(0)){if(typeof e==\"bigint\")return e;if(typeof e==\"number\"&&Number.isFinite(e))return BigInt(Math.trunc(e));if(typeof e==\"string\"&&e.trim())try{return BigInt(e.trim())}catch{return t}return t}function se(e){let t=typeof e==\"string\"?e.trim().toLowerCase():\"\";if(e===1||t===\"aligned-binary\"||t===\"aligned_binary\"||t===\"alignedbinary\")return\"aligned-binary\";if(e==null||e===0||t===\"\"||t===\"flatbuffer\")return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format: ${String(e)}.`)}function Si(e){return se(e)===\"aligned-binary\"?j.ALIGNED_BINARY:j.FLATBUFFER}function wn(e){if(e===j.ALIGNED_BINARY)return\"aligned-binary\";if(e===j.FLATBUFFER)return\"flatbuffer\";throw new TypeError(`Unsupported SDS PIV/TAB wire format value: ${e}.`)}function Ai(e){if(e==null||e===St.IMMUTABLE||e===\"immutable\"||e===\"IMMUTABLE\")return Q.IMMUTABLE;if(e===St.APPEND_ONLY||e===\"append-only\"||e===\"APPEND_ONLY\")return Q.APPEND_ONLY;if(e===St.MUTABLE||e===\"mutable\"||e===\"single-writer-mutable\"||e===\"SINGLE_WRITER_MUTABLE\")return Q.SINGLE_WRITER_MUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability: ${String(e)}.`)}function Tn(e){if(e===Q.APPEND_ONLY)return St.APPEND_ONLY;if(e===Q.SINGLE_WRITER_MUTABLE)return St.MUTABLE;if(e===Q.IMMUTABLE)return St.IMMUTABLE;throw new TypeError(`Unsupported SDS PIV/TAB mutability value: ${e}.`)}function bi(e){if(e==null||e===Z.BORROWED||e===Z.HOST_OWNED||e===\"borrowed\"||e===\"BORROWED\"||e===\"host-owned\"||e===\"host_owned\"||e===\"HOST_OWNED\")return z.HOST_OWNED;if(e===Z.PRODUCER_OWNED||e===\"producer-owned\"||e===\"producer_owned\"||e===\"PRODUCER_OWNED\"||e===\"plugin-owned\"||e===\"plugin_owned\"||e===\"PLUGIN_OWNED\")return z.PLUGIN_OWNED;if(e===Z.SHARED||e===\"shared\"||e===\"SHARED\"||e===\"transferred\"||e===\"TRANSFERRED\")return z.TRANSFERRED;throw new TypeError(`Unsupported SDS PIV/TAB ownership: ${String(e)}.`)}function On(e){if(e===z.PLUGIN_OWNED)return Z.PRODUCER_OWNED;if(e===z.TRANSFERRED)return Z.SHARED;if(e===z.HOST_OWNED)return Z.HOST_OWNED;throw new TypeError(`Unsupported SDS PIV/TAB ownership value: ${e}.`)}function mn(e){return Tn(Ai(e))}function gn(e){return On(bi(e))}function kf(e={},t=void 0){let s=Y(e.schemaHash,e.SCHEMA_HASH);if(!In(s))throw new TypeError(\"SDS PIV/TAB schemaHash must contain valid bytes or hex.\");let i=se(Y(e.wireFormat,e.WIRE_FORMAT,t));return new ee(e.schemaName??e.SCHEMA_NAME??null,e.fileIdentifier??e.FILE_IDENTIFIER??null,e.schemaVersion??e.SCHEMA_VERSION??null,e.rootTypeName??e.rootType??e.ROOT_TYPE??null,pn(s)??[],!!(e.acceptsAnyFlatbuffer??e.ACCEPTS_ANY_FLATBUFFER??!1),Si(i),X(Y(e.fixedStringLength,e.FIXED_STRING_LENGTH),\"SDS PIV/TAB fixedStringLength\",{defaultValue:0,maximum:ie}),X(Y(e.byteLength,e.BYTE_LENGTH),\"SDS PIV/TAB byteLength\",{defaultValue:0,maximum:ht}),X(Y(e.requiredAlignment,e.REQUIRED_ALIGNMENT),\"SDS PIV/TAB requiredAlignment\",{defaultValue:0,maximum:ie}))}function yn(e={}){let t=e.typeRef??e.allowedType??{},s=Y(e.wireFormat,e.WIRE_FORMAT),i=Y(t.wireFormat,t.WIRE_FORMAT),r=se(Y(i,s));if(i!==void 0&&s!==void 0&&se(i)!==se(s))throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let o=kf(t,r);if(r===\"aligned-binary\")o.REQUIRED_ALIGNMENT=_i(o.REQUIRED_ALIGNMENT,\"SDS PIV/TAB aligned type requiredAlignment\",{maximum:ie}),o.BYTE_LENGTH=X(o.BYTE_LENGTH,\"SDS PIV/TAB aligned type byteLength\",{minimum:0,maximum:ht});else if(o.REQUIRED_ALIGNMENT>0&&!ge(o.REQUIRED_ALIGNMENT))throw new RangeError(\"SDS PIV/TAB type requiredAlignment must be a positive power of two when declared.\");return{typeRef:o,wireFormat:r}}function Nn(e,t){let s=Y(e?.alignment,e?.ALIGNMENT),i=_i(s,\"SDS PIV/TAB frame alignment\",{defaultValue:Math.max(Dt,t||1)});if(i<t)throw new RangeError(`SDS PIV/TAB frame alignment ${i} is below required alignment ${t}.`);return i}function Dn(e,t,s){if(e===\"aligned-binary\"&&t.BYTE_LENGTH>0&&s!==t.BYTE_LENGTH)throw new RangeError(`SDS PIV/TAB aligned payload size ${s} does not match declared byteLength ${t.BYTE_LENGTH}.`)}function ye(e={}){return e.frameId!==void 0&&e.frameId!==null?Kt(e.frameId):e.sequence!==void 0||e.endOfStream!==void 0||e.endOfStream===!0?Kt(e.sequence)<<BigInt(1)|(e.endOfStream===!0?BigInt(1):BigInt(0)):Kt(e.traceId)}function Yf(e){let t=Kt(e);return{sequence:t>>BigInt(1),endOfStream:(t&BigInt(1))===BigInt(1)}}function qf(e,t){if(t<=1)return e;let s=e%t;return s===0?e:e+t-s}function Ei(e){return X(Y(e?.offset,e?.OFFSET),\"SDS PIV/TAB frame offset\",{defaultValue:0,maximum:ht})}function Ln(e){return X(Y(e?.size,e?.SIZE),\"SDS PIV/TAB frame size\",{defaultValue:0,maximum:ht})}function Ne(e){return _i(Y(e?.alignment,e?.ALIGNMENT),\"SDS PIV/TAB frame alignment\",{defaultValue:Dt})}function jf(e={},t){let s=st(e.payload??new Uint8Array)??new Uint8Array;Rn(e,\"SDS PIV/TAB frame forwarding\");let{typeRef:i,wireFormat:r}=yn(e),o=i.REQUIRED_ALIGNMENT,a=Nn(e,o);Dn(r,i,s.length);let c=qf(t,a);return di(c,s.length,\"SDS PIV/TAB frame\"),{payload:s,padding:c-t,buffer:new jt(c,s.length,a,Si(r),i,Ai(e.mutability),bi(e.ownership),ye(e),e.portId??null)}}var Dt=8;function Kf(e,t={}){let s=st(e);if(!s)throw new TypeError(\"createInvokeArenaLease requires Uint8Array-compatible arena bytes.\");let i={arena:s,generation:X(t.generation,\"SDS PIV/TAB arena lease generation\",{defaultValue:1,maximum:ht}),closed:!1},r={get arena(){return i.arena},get generation(){return i.generation},get closed(){return i.closed},advance(o=void 0){if(i.closed)throw new Error(\"SDS PIV/TAB arena lease is closed.\");if(i.generation>=ht)throw new RangeError(\"SDS PIV/TAB arena lease generation exceeds the uint32 range.\");if(o!==void 0){let a=st(o);if(!a)throw new TypeError(\"SDS PIV/TAB arena lease advance requires Uint8Array-compatible bytes.\");i.arena=a}return i.generation+=1,i.generation},close(){i.closed=!0},createTransferToken(o,a={}){if(bn(o,\"SDS PIV/TAB arena transfer\",{required:!0})!==i||o.arenaLease!==r)throw new Error(\"SDS PIV/TAB arena transfer frame belongs to a different lease.\");let E=gn(a.ownership??\"transferred\");if(E!==Z.SHARED)throw new Error(\"SDS PIV/TAB arena transfer ownership must be transferred/shared.\");let _=mn(a.mutability??o.mutability),I=st(o.payload),m=Object.freeze({});return Ff.set(m,{lease:r,generation:i.generation,payloadBuffer:I.buffer,payloadByteOffset:I.byteOffset,payloadByteLength:I.byteLength,frameId:ye(o),ownership:E,mutability:_,consumed:!1}),m}};return An.set(r,i),Object.freeze(r)}function Wf(e,t,s){return e.startVector(1,t.length,s),e.bb.setPosition(e.space-=t.length),e.bb.bytes().set(t,e.space),e.endVector()}function Sn(e){return e===\"request\"?\"PIV request\":\"PIV response\"}function $f(e,t,s,i=Dt){if(e.byteOffset%Dt!==0)throw new Error(`${Sn(s)} buffer base is not ${Dt}-byte aligned (byteOffset ${e.byteOffset}).`);if(t&&t.length>0&&t.byteOffset%i!==0)throw new Error(`${Sn(s)} payload arena base is not ${i}-byte aligned (byteOffset ${t.byteOffset}).`)}function Zf(e=[],t=jf){let s=[],i=[],r=0,o=Dt;for(let c of e){let E=t(c,r);r=Ei(E.buffer)+Ln(E.buffer),o=Math.max(o,Ne(E.buffer)),s.push(E.buffer),i.push(E)}let a=new Uint8Array(r);for(let c of i)a.set(c.payload,Ei(c.buffer));return{frames:s,arena:a,arenaAlignment:o}}function Qf(e={}){return e.offset!==void 0||e.OFFSET!==void 0}function zf(e={},t){let s=st(e.payload),i=Rn(e,\"SDS PIV/TAB external frame forwarding\");i&&t&&pi(t,i.arena,\"SDS PIV/TAB external arena\");let{typeRef:r,wireFormat:o}=yn(e),a=Nn(e,r.REQUIRED_ALIGNMENT),c=X(Y(e.offset,e.OFFSET),\"SDS PIV/TAB external arena frame offset\",{defaultValue:0,maximum:ht});!Qf(e)&&s&&t&&s.buffer===t.buffer&&(c=s.byteOffset-t.byteOffset);let E=X(Y(e.size,e.SIZE,e.byteLength,s?.byteLength),\"SDS PIV/TAB external arena frame size\",{defaultValue:0,maximum:ht});if(di(c,E,\"SDS PIV/TAB external arena frame\"),Dn(o,r,E),E>0&&t){if(c>t.length||E>t.length-c)throw new Error(\"SDS PIV external arena frame range exceeds externalArena.\");let _=t.byteOffset+c;if(a>1&&_%a!==0)throw new Error(`SDS PIV external arena frame \"${e.portId??\"\"}\" is misaligned: absolute offset ${_} violates alignment ${a}.`)}return new jt(c,E,a,Si(o),r,Ai(e.mutability),bi(e.ownership),ye(e),e.portId??null)}function Xf(e=[],t){let s=st(t);if(!s)throw new TypeError(\"SDS PIV external arena encoding requires externalArena bytes.\");let i=Dt;return{frames:e.map(o=>{let a=zf(o,s);return i=Math.max(i,Ne(a)),a}),arena:new Uint8Array,arenaAlignment:i,externalArena:s}}function Jf(e){if(!e)return null;let t=e.schemaHashArray?.()??new Uint8Array;return{schemaName:e.SCHEMA_NAME()??null,fileIdentifier:e.FILE_IDENTIFIER()??null,schemaVersion:e.SCHEMA_VERSION()??null,schemaHash:t.byteLength>0?new Uint8Array(t):void 0,acceptsAnyFlatbuffer:e.ACCEPTS_ANY_FLATBUFFER?.()===!0,wireFormat:wn(e.WIRE_FORMAT()),rootTypeName:e.ROOT_TYPE()??null,fixedStringLength:X(e.FIXED_STRING_LENGTH(),\"SDS PIV/TAB decoded fixedStringLength\",{defaultValue:0,maximum:ie}),byteLength:X(e.BYTE_LENGTH(),\"SDS PIV/TAB decoded byteLength\",{defaultValue:0,maximum:ht}),requiredAlignment:X(e.REQUIRED_ALIGNMENT(),\"SDS PIV/TAB decoded requiredAlignment\",{defaultValue:0,maximum:ie})}}function th(e){let t=e.typeRef;if(t&&t.wireFormat!==e.wireFormat)throw new Error(\"SDS PIV/TAB frame and typeRef wire formats disagree.\");let s=t?.requiredAlignment??0;if(s>0&&!ge(s))throw new RangeError(\"SDS PIV/TAB decoded requiredAlignment must be a positive power of two.\");if(e.alignment<s)throw new RangeError(`SDS PIV/TAB frame alignment ${e.alignment} is below required alignment ${s}.`);if(e.wireFormat===\"aligned-binary\"){if(!t)throw new Error(\"SDS PIV/TAB aligned frame requires a typeRef.\");if(!ge(s))throw new RangeError(\"SDS PIV/TAB aligned type requiredAlignment must be a positive power of two.\");let i=Number(t.byteLength??0);if(i>0&&e.size!==i)throw new RangeError(`SDS PIV/TAB aligned payload size ${e.size} does not match declared byteLength ${i}.`)}}function eh(e){if(!e)return null;let t=li(e.OFFSET()),s=li(e.SIZE()),i=Ne({ALIGNMENT:e.ALIGNMENT()}),r=wn(e.WIRE_FORMAT()),o=Kt(e.FRAME_ID()),a=Yf(o),c={typeRef:Jf(e.TYPE_REF()),portId:e.PORT_ID()??null,alignment:i,offset:t,size:s,ownership:On(e.OWNERSHIP()),generation:0,mutability:Tn(e.MUTABILITY()),frameId:o,traceId:o,streamId:0,sequence:a.sequence,endOfStream:a.endOfStream,wireFormat:r};return th(c),c}function sh(e,t){let s=[];for(let i=0;i<e;i++){let r=eh(t(i));r&&s.push(r)}return s}function ih(e,t={}){let s=st(t.externalArena),i=e.length>0?e:s??e;if(!t.arenaLease)return Kf(i);let r=Ii(t.arenaLease);if(r.closed)throw new Error(\"SDS PIV/TAB decoded arena lease is closed.\");return pi(i,r.arena,\"SDS PIV/TAB decoded arena\"),t.arenaLease}function rh(e=[],t,s={}){let i=st(s.externalArena),r=s.arenaLease,o=r?Ii(r).generation:void 0;return e.map(a=>{let c=Ei(a),E=Ln(a),_=t.length>0?t:i,I=t.length>0?\"PAYLOAD_ARENA\":\"external arena\";if(di(c,E,\"SDS PIV/TAB decoded frame\"),E>0&&!_)throw new Error(\"SDS PIV external arena bytes are required when PAYLOAD_ARENA is empty.\");if(_&&(c>_.length||E>_.length-c))throw new Error(`SDS PIV TAB payload range exceeds ${I}.`);let m=Ne(a);if(_&&m>1&&E>0){let T=_.byteOffset+c;if(T%m!==0)throw new Error(`SDS PIV TAB \"${a.portId??\"\"}\" payload is misaligned: absolute offset ${T} violates alignment ${m}.`)}let A=_?_.subarray(c,c+E):new Uint8Array;return{...a,payload:A,typeRef:a.typeRef??null,arenaLease:r,arenaGeneration:o,generation:o}})}function nh(e,t){return t.map(s=>s.pack(e))}function Cn(e,t={}){let s=Gf(e);if(!W.bufferHasIdentifier(s))throw new Error(\"SDS PIV invoke request buffer identifier mismatch.\");let r=W.getRootAsPIV(s).REQUEST();if(!r)throw new Error(\"SDS PIV invoke envelope does not contain a request.\");let o=r.payloadArenaArray()??new Uint8Array,a=sh(r.inputsLength(),_=>r.INPUTS(_)),c=ih(o,t),E=rh(a,o,{...t,arenaLease:c});return{methodId:r.METHOD_ID()??null,inputFrames:E,inputs:E,payloadArena:o,arenaLease:c,traceId:r.TRACE_ID()??BigInt(0),outputStreamCap:r.OUTPUT_STREAM_CAP()??0,envelope:\"PIV\"}}function oh(e={}){return e.status!==void 0?e.status:e.yielded===!0?At.YIELDED:Number(e.statusCode??0)!==0||e.errorCode?At.FAILED:At.OK}function Ri(e={}){let t=Array.isArray(e.outputs)?e.outputs:e.outputFrames??[],{frames:s,arena:i,arenaAlignment:r}=e.externalArena!==void 0?Xf(t,e.externalArena):Zf(t),o=new te(1024),a=e.errorCode!==null&&e.errorCode!==void 0?o.createString(String(e.errorCode)):0,c=e.errorMessage!==null&&e.errorMessage!==void 0?o.createString(String(e.errorMessage)):0,E=B.createOutputsVector(o,nh(o,s)),_=Wf(o,i,r);B.startPIVResponse(o),B.addStatusCode(o,Number(e.statusCode??0)),B.addStatus(o,oh(e)),B.addYielded(o,e.yielded===!0),B.addBacklogRemaining(o,li(e.backlogRemaining)),B.addOutputs(o,E),B.addPayloadArena(o,_),B.addErrorCode(o,a),B.addErrorMessage(o,c),B.addTraceId(o,Kt(e.traceId));let I=B.endPIVResponse(o);W.startPIV(o),W.addResponse(o,I),W.finishPIVBuffer(o,W.endPIV(o));let m=o.asUint8Array(),A=W.getRootAsPIV(new It(m));return $f(m,A.RESPONSE()?.payloadArenaArray(),\"response\",r),m}var Pn=Object.freeze({Inline:0,Ref:1}),Un=Object.freeze({Duplicates:0,None:1,Current:2}),De=Object.freeze({Stream:0,Rows:1,Auto:2}),Hn=Object.freeze({Default:0,Ed25519:1,Secp256k1:2,Secp256k1Digest:3,X25519:4,Sha256:5,Sha512:6,Aes256Gcm:7,HkdfSha256:8});var o_=Object.freeze({TimerTick:\"TICK\",HttpRequest:\"HREQ\",HttpResponse:\"HRSP\",ModuleConfig:\"MCFG\",IngestRequest:\"INGQ\",IngestResult:\"INGR\",FlowNotice:\"FNTC\"});function ah(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return t.length<8?\"\":String.fromCharCode(t[4],t[5],t[6],t[7])}var fh=e=>e==null?\"\":String(e);function hh(e,t){let s=new Qt(256);return t(s,e.pack(s)),s.asUint8Array().slice()}function ch(e,t){let s=new zt(String(e));if(typeof t==\"string\")s.KIND=$.String,s.STRING_VALUE=t;else if(typeof t==\"number\"||typeof t==\"bigint\")s.KIND=$.Number,s.NUMBER_VALUE=Number(t);else if(typeof t==\"boolean\")s.KIND=$.Bool,s.BOOL_VALUE=t;else if(Array.isArray(t))if(t.every(i=>typeof i==\"number\"))s.KIND=$.NumberList,s.NUMBERS=t.map(Number);else if(t.every(i=>i&&typeof i==\"object\"&&!Array.isArray(i)))s.KIND=$.TableList,s.TABLES=t.map(i=>new Vt(Ti(i)));else if(t.every(i=>typeof i==\"string\"))s.KIND=$.StringList,s.STRINGS=t.slice();else throw new Error(`ModuleConfig: ${e} mixes value kinds`);else if(t&&typeof t==\"object\")s.KIND=$.TableList,s.TABLES=[new Vt(Ti(t))];else throw new Error(`ModuleConfig: ${e} has no config value kind (${t===null?\"null\":typeof t})`);return s}var Ti=e=>Object.keys(e||{}).filter(t=>e[t]!==void 0&&e[t]!==null).sort().map(t=>ch(t,e[t]));function Bn(e={}){return hh(new Xt(Ti(e)),Gt.finishModuleConfigBuffer)}var uh={duplicates:xt.Duplicates,none:xt.None,current:xt.Current},a_=Object.fromEntries(Object.entries(uh).map(([e,t])=>[t,e]));var lh={unchanged:Tt.Unchanged,skipped:Tt.Skipped,missing:Tt.Missing,expired:Tt.Expired,info:Tt.Info},f_=Object.fromEntries(Object.entries(lh).map(([e,t])=>[t,e]));var vn=\"HostOps.fbs\";function re(e){let t=kt[e];if(typeof t!=\"function\"||!t.SIZE)throw new Error(`hostcall: ${e} is not a HostOps record`);return t}var Fn=e=>e[0].toLowerCase()+e.slice(1);function Eh(e){let t=Object.getOwnPropertyNames(e.prototype);return t.filter(s=>s.startsWith(\"set\")&&!s.startsWith(\"setHas\")&&!s.endsWith(\"Length\")&&!s.endsWith(\"At\")).map(s=>s.slice(3)).concat(t.filter(s=>s.startsWith(\"set\")&&s.endsWith(\"At\")&&!s.startsWith(\"setHas\")).map(s=>s.slice(3,-2)))}function Oi(e,t,s,i){for(let[r,o]of Object.entries(s||{})){if(o==null)continue;let a=e.prototype,c=Fn(r);if(typeof a[`set${r}At`]==\"function\"){if(t[`set${r}Length`](o.length),o.forEach((E,_)=>t[`set${r}At`](_,E)),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`${c}Length`]()!==o.length)throw new RangeError(`${i}.${r}: ${o.length} items exceed the record's bound`);continue}if(typeof a[`set${r}`]!=\"function\"){if(typeof a[c]==\"function\"&&typeof o==\"object\"){let E=t[c]();Oi(E.constructor,E,o,`${i}.${r}`),typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0);continue}throw new Error(`${i}: no field ${r}`)}if(typeof a[`setHas${r}`]==\"function\"&&t[`setHas${r}`](!0),t[`set${r}`](typeof o==\"number\"&&typeof t[c]()==\"bigint\"?BigInt(o):o),typeof o==\"string\"&&t[c]()!==o)throw new RangeError(`${i}.${r}: \"${o.slice(0,40)}...\" exceeds the record's ${new TextEncoder().encode(t[c]()).length}-byte string`)}}function Vn(e,t){let s={};for(let i of Eh(e)){let r=Fn(i);if(typeof t[`has${i}`]==\"function\"&&!t[`has${i}`]()){s[i]=typeof t[`${r}Length`]==\"function\"?[]:null;continue}if(typeof t[`${r}Length`]==\"function\"){s[i]=Array.from({length:t[`${r}Length`]()},(o,a)=>t[`${r}At`](a));continue}s[i]=t[r]()}for(let i of Object.getOwnPropertyNames(e.prototype)){if(i.startsWith(\"has\")||i.startsWith(\"set\")||i===\"constructor\")continue;let r=i[0].toUpperCase()+i.slice(1);r in s||typeof e.prototype[`setHas${r}`]!=\"function\"||(s[r]=t[`has${r}`]()?Vn(t[i]().constructor,t[i]()):null)}return s}function _h(e,t){let s=re(e),i=new Uint8Array(s.SIZE);return Oi(s,s.fromPointer(i.buffer,0),t,e),i}function dh(e,t){let s=re(e),i=new Uint8Array(s.SIZE*t.length);return t.forEach((r,o)=>Oi(s,s.fromPointer(i.buffer,o*s.SIZE),r,`${e}[${o}]`)),i}function ph(e,t){let s={},i={},r={};for(let o of e||[]){let a=o.portId??o.PORT_ID,c=o.typeRef||{},E=c.rootType??c.rootTypeName??c.ROOT_TYPE??null,_=o.payload instanceof Uint8Array?o.payload:new Uint8Array(o.payload||[]);if((o.wireFormat??c.wireFormat)===\"aligned-binary\"&&E){let I=re(E),m=_.slice();if(m.length%I.SIZE)throw new RangeError(`${t}: ${a} is ${m.length} bytes, not a whole number of ${E} (${I.SIZE})`);let A=Array.from({length:m.length/I.SIZE},(T,w)=>Vn(I,I.fromPointer(m.buffer,w*I.SIZE)));Number(c.byteLength??0)>0?s[a]={type:E,value:A[0]??null}:i[a]={type:E,values:A}}else r[a]=_.slice()}return{records:s,lists:i,raw:r}}var Ih=e=>typeof e==\"string\"?new TextEncoder().encode(e):e instanceof Uint8Array?e:new Uint8Array(e);function Sh(e,{record:t,recordPort:s,recordType:i,raw:r={},lists:o={}},a,c,E){let _=[];if(t!=null){if(!i)throw new Error(`${E}: takes no ${s} record`);let I=re(i);_.push({portId:s,wireFormat:\"aligned-binary\",typeRef:{schemaName:vn,rootType:i,wireFormat:\"aligned-binary\",byteLength:I.SIZE,requiredAlignment:I.ALIGN},payload:_h(i,t)})}for(let[I,m]of Object.entries(o)){let A=c[I];if(!A)throw new Error(`${E}: no list port ${I}`);let T=re(A);_.push({portId:I,wireFormat:\"aligned-binary\",typeRef:{schemaName:vn,rootType:A,wireFormat:\"aligned-binary\",byteLength:0,requiredAlignment:T.ALIGN},payload:dh(A,m)})}for(let[I,m]of Object.entries(r)){if(!a.includes(I))throw new Error(`${E}: no raw port ${I}`);_.push({portId:I,payload:Ih(m)})}return _}function xn(e){let t=Cn(e),s=t.methodId??\"\",{records:i,lists:r,raw:o}=ph(t.inputs,s),a=ne[s];if(a&&i.params&&i.params.type!==a.params)throw new Error(`hostcall: ${s} takes ${a.params}, the frame carries ${i.params.type}`);return{op:s,params:i.params?.value??null,lists:Object.fromEntries(Object.entries(r).map(([c,E])=>[c,E.values])),raw:o}}var Gn=Object.freeze({null:0,bool:1,i64:2,f64:3,str:4,bytes:5}),Ah=Object.fromEntries(Object.entries(Gn).map(([e,t])=>[t,e]));function kn(e){let t=(e||[]).map(o=>{let a=o&&typeof o==\"object\"&&!(o instanceof Uint8Array)&&\"t\"in o?o:null,c=a?a.t:o==null?\"null\":typeof o==\"boolean\"?\"bool\":typeof o==\"bigint\"?\"i64\":typeof o==\"number\"?Number.isInteger(o)?\"i64\":\"f64\":typeof o==\"string\"?\"str\":o instanceof Uint8Array?\"bytes\":null,E=a?a.v:o,_;switch(c){case\"null\":_=new Uint8Array(0);break;case\"bool\":_=Uint8Array.of(E?1:0);break;case\"i64\":_=new Uint8Array(8),new DataView(_.buffer).setBigInt64(0,BigInt(E),!0);break;case\"f64\":_=new Uint8Array(8),new DataView(_.buffer).setFloat64(0,Number(E),!0);break;case\"str\":_=new TextEncoder().encode(String(E));break;case\"bytes\":_=E instanceof Uint8Array?E:new Uint8Array(E);break;default:throw new TypeError(`SQL value ${String(o)} has no FlatSQL parameter tag`)}return[Gn[c],_]}),s=new Uint8Array(t.reduce((o,[,a])=>o+5+a.length,0)),i=new DataView(s.buffer),r=0;for(let[o,a]of t)s[r]=o,i.setUint32(r+1,a.length,!0),s.set(a,r+5),r+=5+a.length;return s}function Yn(e){let t=e instanceof Uint8Array?e:new Uint8Array(e||[]),s=new DataView(t.buffer,t.byteOffset,t.byteLength),i=[],r=0;for(;r<t.length;){if(r+5>t.length)throw new RangeError(\"SQL values: truncated value header\");let o=t[r],a=s.getUint32(r+1,!0),c=r+5;if(c+a>t.length)throw new RangeError(\"SQL values: payload exceeds the buffer\");let E=Ah[o],_={null:0,bool:1,i64:8,f64:8}[E];if(E===void 0)throw new RangeError(`SQL values: unknown tag ${o}`);if(_!==void 0&&a!==_)throw new RangeError(`SQL values: a ${E} carries ${_} bytes, not ${a}`);let I=t.subarray(c,c+a);i.push({t:E,v:E===\"null\"?null:E===\"bool\"?I[0]!==0:E===\"i64\"?s.getBigInt64(c,!0):E===\"f64\"?s.getFloat64(c,!0):E===\"str\"?new TextDecoder().decode(I):I.slice()}),r=c+a}return i}var bh=Object.freeze([\"unsupported\",\"not-authorized\",\"invalid-params\",\"failed\",\"refused\",\"sandbox\",\"timeout\",\"too-large\"]);function mi(e){if(e?.ok){let s=ne[e.op];if(!s)throw new Error(`hostcall: unknown operation ${e.op}`);let i=Sh(s,{record:e.result,recordPort:\"result\",recordType:s.result,raw:e.raw,lists:e.lists},s.rawOut,s.listsOut,`${e.op} result`);return Ri({statusCode:0,outputs:i})}let t=e?.error?.code??\"failed\";if(!bh.includes(t))throw new Error(`hostcall: unknown error code ${t}`);return Ri({statusCode:1,status:\"FAILED\",errorCode:t,errorMessage:fh(e?.error?.message)})}function qn(e){return ah(e)===\"$PIV\"}var p=(e,t,s,i={})=>Object.freeze({params:e,result:t,capability:s,rawIn:Object.freeze(i.rawIn||[]),rawOut:Object.freeze(i.rawOut||[]),listsIn:Object.freeze(i.listsIn||{}),listsOut:Object.freeze(i.listsOut||{})}),Rh=[\"data\",\"key\",\"private_key\",\"public_key\",\"signature\",\"nonce\",\"aad\",\"ikm\",\"salt\",\"info\",\"envelope\"],wh=[\"data\",\"nonce\",\"private_key\",\"public_key\"],C=(e,t)=>p(\"CryptoParams\",e,t,{rawIn:Rh,rawOut:wh}),Mn={rawOut:[\"stream\"]},wi={rawIn:[\"sql\",\"params\"]},ne=Object.freeze({\"host.runtimeTarget\":p(null,null,null,{rawOut:[\"value\"]}),\"host.listCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listSupportedCapabilities\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.listOperations\":p(null,null,null,{listsOut:{items:\"TextValue\"}}),\"host.hasCapability\":p(\"HasCapabilityParams\",\"BoolValue\",null),\"clock.now\":p(null,\"TimeValue\",\"clock\"),\"clock.nowIso\":p(null,null,\"clock\",{rawOut:[\"value\"]}),\"clock.monotonicNow\":p(null,\"NumberValue\",\"clock\"),\"random.bytes\":p(\"RandomBytesParams\",null,\"random\",{rawOut:[\"data\"]}),\"node.publicKey\":p(null,null,null,{rawOut:[\"value\"]}),\"node.peerId\":p(null,null,null,{rawOut:[\"value\"]}),\"plugin.getConfig\":p(null,null,null,{rawOut:[\"config\"]}),\"http.request\":p(\"HttpParams\",\"HttpResult\",\"http\",{rawIn:[\"url\",\"headers\",\"body\"],rawOut:[\"url\",\"headers\",\"body\"]}),\"websocket.exchange\":p(\"WebsocketParams\",\"WebsocketResult\",\"websocket\",{rawIn:[\"url\",\"protocols\",\"message\"],rawOut:[\"url\",\"body\"]}),\"mqtt.publish\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"payload\",\"password\"]}),\"mqtt.subscribeOnce\":p(\"MqttParams\",\"MqttResult\",\"mqtt\",{rawIn:[\"password\"],rawOut:[\"body\"]}),\"tcp.request\":p(\"SocketParams\",\"SocketResult\",\"tcp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"udp.request\":p(\"SocketParams\",\"SocketResult\",\"udp\",{rawIn:[\"data\"],rawOut:[\"body\"]}),\"tls.request\":p(\"SocketParams\",\"SocketResult\",\"tls\",{rawIn:[\"data\",\"ca\",\"cert\",\"key\"],rawOut:[\"body\"]}),\"storage.query\":p(\"StorageQueryParams\",null,\"storage_query\",{listsOut:{records_meta:\"StoredRecordMeta\"},rawOut:[\"records\"]}),\"storage.write\":p(\"StorageWriteParams\",\"StorageWriteResult\",\"storage_write\",{rawIn:[\"data\"]}),\"storage.delete\":p(\"StorageDeleteParams\",null,\"storage_write\"),\"storage.expire\":p(\"StorageExpireParams\",\"StorageExpireResult\",\"storage_write\"),\"storage.ingest_with_source\":p(\"StorageIngestParams\",\"StorageIngestResult\",\"storage_ingest\",{rawIn:[\"records\",\"archive\"],listsIn:{provenance:\"Provenance\",provenance_attributes:\"ProvenanceAttribute\"}}),\"storage.flatsql_query_stream\":p(\"SqlStreamParams\",\"StreamResult\",\"storage_query\",{...wi,...Mn}),\"storage.flatsql_epoch_stream\":p(\"EpochStreamParams\",\"StreamResult\",\"storage_query\",Mn),\"storage.query_sandboxed\":p(\"SandboxQueryParams\",\"SandboxQueryResult\",\"storage_query\",{...wi,rawOut:[\"stream\",\"cells\"],listsOut:{columns:\"TextValue\"}}),\"storage.query_surface\":p(null,\"QuerySurfaceLimits\",\"storage_query\",{listsOut:{tables:\"SurfaceTable\",columns:\"SurfaceColumn\"}}),\"storage.flatsql_cache_key\":p(\"CacheKeyParams\",null,\"storage_query\",{...wi,listsIn:{projection:\"TextValue\"},rawOut:[\"value\"]}),\"crypto.hash\":C(null,\"crypto_hash\"),\"crypto.sign\":C(null,\"crypto_sign\"),\"crypto.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.encrypt\":C(null,\"crypto_encrypt\"),\"crypto.decrypt\":C(null,\"crypto_decrypt\"),\"crypto.key_agreement\":C(null,\"crypto_key_agreement\"),\"crypto.kdf\":C(null,\"crypto_kdf\"),\"crypto.generate_key\":C(null,\"crypto_sign\"),\"crypto.random\":C(null,\"crypto_hash\"),\"crypto.ed25519.publicKeyFromSeed\":C(null,\"crypto_sign\"),\"crypto.ed25519.sign\":C(null,\"crypto_sign\"),\"crypto.ed25519.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.secp256k1.publicKeyFromPrivate\":C(null,\"crypto_sign\"),\"crypto.secp256k1.sign\":C(null,\"crypto_sign\"),\"crypto.secp256k1.verify\":C(\"BoolValue\",\"crypto_verify\"),\"crypto.sha256\":C(null,\"crypto_hash\"),\"crypto.sha512\":C(null,\"crypto_hash\"),\"crypto.hkdf\":C(null,\"crypto_kdf\"),\"crypto.aesGcmEncrypt\":C(null,\"crypto_encrypt\"),\"crypto.aesGcmDecrypt\":C(null,\"crypto_decrypt\"),\"crypto.x25519.generateKeypair\":C(null,\"crypto_key_agreement\"),\"crypto.x25519.publicKey\":C(null,\"crypto_key_agreement\"),\"crypto.x25519.sharedSecret\":C(null,\"crypto_key_agreement\"),\"crypto.sealedBox.encryptForRecipient\":C(null,\"crypto_encrypt\"),\"crypto.sealedBox.decryptFromEnvelope\":C(null,\"crypto_decrypt\"),\"crypto.secp256k1.signDigest\":C(null,\"crypto_sign\"),\"crypto.secp256k1.verifyDigest\":C(\"BoolValue\",\"crypto_verify\"),\"keyslot.sign\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"keyslot.unwrap\":p(\"KeyslotParams\",null,\"wallet_sign\",{rawIn:[\"ephemeral_public_key\",\"nonce\",\"ciphertext\"],rawOut:[\"data\"]}),\"secrets.get\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawOut:[\"secret\"]}),\"secrets.status\":p(\"SecretParams\",\"SecretResult\",\"secrets\"),\"secrets.put\":p(\"SecretParams\",\"SecretResult\",\"secrets\",{rawIn:[\"secret\"]}),\"secrets.clear\":p(\"SecretParams\",null,\"secrets\"),\"ipfs.add\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\",{rawIn:[\"data\"]}),\"ipfs.cat\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{links:\"IpfsLink\"}}),\"ipfs.pin_add\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_rm\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{items:\"TextValue\"}}),\"ipfs.pin_ls\":p(\"IpfsParams\",null,\"ipfs\",{listsOut:{pins:\"IpfsPin\"}}),\"ipfs.dag_get\":p(\"IpfsParams\",null,\"ipfs\",{rawOut:[\"data\"]}),\"ipfs.name_resolve\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.name_publish\":p(\"IpfsParams\",\"IpfsResult\",\"ipfs\"),\"ipfs.id\":p(null,\"IpfsResult\",\"ipfs\",{listsOut:{addresses:\"TextValue\"}}),\"ipfs.swarm_peers\":p(null,null,\"ipfs\",{listsOut:{peers:\"IpfsSwarmPeer\"}}),\"ipfs.pubsub_publish\":p(\"PubsubParams\",null,\"ipfs\",{rawIn:[\"data\"]}),\"pubsub.publish\":p(\"PubsubParams\",null,\"pubsub\",{rawIn:[\"data\"]}),\"pubsub.subscribe\":p(\"PubsubParams\",\"PubsubSubscribed\",\"pubsub\"),\"pubsub.unsubscribe\":p(\"PubsubParams\",null,\"pubsub\"),\"pubsub.list_topics\":p(null,null,\"pubsub\",{listsOut:{items:\"TextValue\"}}),\"protocol.request\":p(\"ProtocolParams\",null,\"protocol_dial\",{rawIn:[\"payload\"],rawOut:[\"data\"]}),\"protocol_dial.dial\":p(\"ProtocolParams\",null,\"protocol_dial\"),\"protocol_handle.register\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"protocol_handle.unregister\":p(\"ProtocolParams\",null,\"protocol_handle\"),\"p2p.peers_snapshot\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{peers:\"P2pPeer\",peer_addresses:\"P2pPeerValue\",peer_standards:\"P2pPeerValue\"},rawOut:[\"records\"]}),\"p2p.standards_snapshot\":p(\"P2pParams\",null,\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.pnm_history\":p(\"P2pParams\",\"P2pSummary\",\"p2p_read\",{listsOut:{entries:\"P2pPnmEntry\"},rawOut:[\"records\"]}),\"p2p.latest_dataset\":p(\"P2pParams\",\"P2pLatestDataset\",\"p2p_read\",{rawOut:[\"stream\"]}),\"node_status_read.status\":p(null,\"NodeStatusReport\",\"node_status_read\",{listsOut:{bandwidth_history:\"NodeBandwidthSample\"}}),\"node_activity_read.activity\":p(\"NodeActivityParams\",null,\"node_activity_read\",{listsOut:{events:\"NodeActivityEvent\"}}),\"timers.delay\":p(\"TimersDelayParams\",null,\"timers\"),\"schedule.parse\":p(\"ScheduleParams\",null,\"schedule_cron\",{listsOut:{fields:\"CronField\"}}),\"schedule.matches\":p(\"ScheduleParams\",\"BoolValue\",\"schedule_cron\"),\"schedule.next\":p(\"ScheduleParams\",\"TimeValue\",\"schedule_cron\"),\"filesystem.resolvePath\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.readFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"],rawOut:[\"data\"]}),\"filesystem.writeFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.appendFile\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"data\"]}),\"filesystem.deleteFile\":p(null,null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.mkdir\":p(\"FsParams\",null,\"filesystem\",{rawIn:[\"path\"]}),\"filesystem.readdir\":p(null,null,\"filesystem\",{rawIn:[\"path\"],listsOut:{entries:\"FsEntry\"}}),\"filesystem.stat\":p(null,\"FsStat\",\"filesystem\",{rawIn:[\"path\"],rawOut:[\"path\"]}),\"filesystem.rename\":p(null,null,\"filesystem\",{rawIn:[\"path\",\"to_path\"]}),\"exec.execFile\":p(\"ExecParams\",\"ExecResult\",\"process_exec\",{rawIn:[\"file\",\"cwd\",\"input\"],listsIn:{args:\"TextValue\",env:\"EnvVar\"},rawOut:[\"stdout\",\"stderr\"]}),\"context.get\":p(\"ContextParams\",\"BoolValue\",\"context_read\",{rawOut:[\"value\"]}),\"context.listKeys\":p(\"ContextParams\",null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.listScopes\":p(null,null,\"context_read\",{listsOut:{items:\"TextValue\"}}),\"context.set\":p(\"ContextParams\",null,\"context_write\",{rawIn:[\"value\"]}),\"context.delete\":p(\"ContextParams\",\"BoolValue\",\"context_write\")});function Th(e){if(!Number.isInteger(e)||e<0||e>255)throw new TypeError(\"Expected byte values in range 0..255.\")}function Oh(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(Array.isArray(e))return e.forEach(Th),Uint8Array.from(e);throw new TypeError(\"Expected Uint8Array, ArrayBuffer, ArrayBufferView, or byte array.\")}var ct=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",mh=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<ct.length;t+=1)e[ct.charCodeAt(t)]=t;return e[45]=62,e[95]=63,e})();function gi(e){let t=Oh(e),s=\"\",i=0;for(;i+2<t.length;i+=3){let o=t[i]<<16|t[i+1]<<8|t[i+2];s+=ct[o>>>18&63]+ct[o>>>12&63]+ct[o>>>6&63]+ct[o&63]}let r=t.length-i;if(r===1){let o=t[i]<<16;s+=`${ct[o>>>18&63]}${ct[o>>>12&63]}==`}else if(r===2){let o=t[i]<<16|t[i+1]<<8;s+=`${ct[o>>>18&63]}${ct[o>>>12&63]}${ct[o>>>6&63]}=`}return s}var jn=256*1024*1024;function yi(e){let t=String(e??\"\").trim();if(t.length>jn)throw new RangeError(`Base64 input exceeds ${jn} character limit.`);let s=new Uint8Array(Math.floor(t.length*3/4)+3),i=0,r=0,o=0;for(let a=0;a<t.length;a+=1){let c=t.charCodeAt(a);if(c===61)break;let E=c<128?mh[c]:-1;E<0||(r=(r<<6|E)&16777215,o+=6,o>=8&&(o-=8,s[i]=r>>>o&255,i+=1))}return s.slice(0,i)}var vi=new TextEncoder,U=e=>e===void 0?void 0:vt(e),ut=e=>e==null?void 0:e instanceof Uint8Array?e:typeof e==\"string\"?vi.encode(e):new Uint8Array(e),oe=e=>(e||[]).map(t=>({VALUE:String(t)})),Kn=e=>BigInt(Math.round(e instanceof Date?e.getTime():Number(e))),Jn=e=>e.toLowerCase().replace(/_([a-z0-9])/g,(t,s)=>s.toUpperCase()),gh=e=>e.replace(/([a-z0-9])([A-Z])/g,\"$1_$2\").toUpperCase();function ve(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===0||i===0n||i===!1||(t[Jn(s)]=typeof i==\"bigint\"?Number(i):i);return t}function Me(e,t){if(!e||!t||typeof t!=\"object\")return null;let s={};for(let[i,r]of Object.entries(t))r==null||r instanceof Uint8Array||typeof r==\"object\"||(s[gh(i)]=r);return yh(e,s)}function yh(e,t){let s=kt[e]?.prototype;return s?Object.fromEntries(Object.entries(t).filter(([i])=>typeof s[`set${i}`]==\"function\")):t}function Nh(e){if(!e)return;let t={};for(let s of U(e).split(/\\r?\\n/)){let i=s.indexOf(\":\");i>0&&(t[s.slice(0,i).trim()]=s.slice(i+1).trim())}return t}function Dh(e){return e?(typeof e.entries==\"function\"&&!(e instanceof Map)&&!Array.isArray(e)?Array.from(e.entries()):e instanceof Map?Array.from(e):Object.entries(e)).map(([s,i])=>`${s}: ${Array.isArray(i)?i.join(\", \"):i}`).join(`\\r\n`):void 0}var Ni=16;function Lh(e){if(!e||e.length<Ni)throw Object.assign(new Error(\"AES-GCM data is shorter than its 16-byte tag\"),{hostcallCode:\"invalid-params\"});return{ciphertext:e.subarray(0,e.length-Ni),tag:e.subarray(e.length-Ni)}}var Ch=(e,t)=>{let s=new Uint8Array(e.length+t.length);return s.set(e,0),s.set(t,e.length),s},nt=(e,t=\"failed\")=>Object.assign(new Error(e),{hostcallCode:t}),R=e=>e==null?\"\":String(e);function Rt(e){if(e==null||e===\"\")return;if(e instanceof Date)return BigInt(Number.isFinite(e.getTime())?e.getTime():0);if(typeof e==\"bigint\")return e;if(typeof e==\"number\")return BigInt(Number.isFinite(e)?Math.trunc(e):0);let t=Date.parse(String(e));return BigInt(Number.isFinite(t)?t:0)}var He=(e,t)=>Object.keys(e).find(s=>e[s]===Number(t??0))??\"\",rt=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?new Uint8Array(e):void 0,Wn=new Map;function Ph(e){let t=Wn.get(e);return t||Wn.set(e,t=e.fromPointer(new ArrayBuffer(e.SIZE),0)),t}function Uh(e){if(typeof e==\"bigint\")return e;if(typeof e==\"boolean\")return e?1n:0n;if(typeof e==\"string\"&&/^-?\\d+$/.test(e.trim()))return BigInt(e.trim());let t=Number(e);return BigInt(Number.isFinite(t)?Math.trunc(t):0)}function to(e,t){let s=Ph(e),i=e.prototype,r={};for(let[o,a]of Object.entries(t||{})){if(a==null)continue;let c=o[0].toLowerCase()+o.slice(1);if(typeof i[`set${o}`]!=\"function\"){typeof i[c]==\"function\"&&typeof i[`setHas${o}`]==\"function\"&&typeof a==\"object\"&&(r[o]=to(s[c]().constructor,a));continue}let E=typeof s[c]();r[o]=E===\"bigint\"?Uh(a):E===\"number\"?Number.isFinite(Number(a))?Number(a):0:E===\"boolean\"?a===!0||a===\"true\":String(a)}return r}var H=(e,t)=>to(kt[e],t);function Le(e,t){let s={};for(let[i,r]of Object.entries(t||{}))[\"string\",\"number\",\"boolean\",\"bigint\"].includes(typeof r)&&(s[i.toUpperCase()]=r);return H(e,s)}function G(e){let t={};for(let[s,i]of Object.entries(e||{}))i==null||i===\"\"||i===!1||i===0||i===0n||Array.isArray(i)&&i.length===0||(t[s.toLowerCase()]=typeof i==\"bigint\"?Number(i):i);return t}function Hh(e){let t=new Uint8Array(e.reduce((r,o)=>r+4+o.length,0)),s=new DataView(t.buffer),i=0;for(let r of e)s.setUint32(i,r.length,!0),t.set(r,i+4),i+=4+r.length;return t}var $n=2**53;function vh(e){if(!e.params)return;let t;try{t=Yn(e.params)}catch(s){throw nt(`params: ${s.message}`,\"invalid-params\")}return t.map(({t:s,v:i})=>s===\"null\"?{t:s}:s===\"i64\"?{t:s,v:i>BigInt($n)||i<-BigInt($n)?i.toString():Number(i)}:{t:s,v:i})}var Mh=e=>He(Pn,e?.DELIVER)===\"Ref\"?\"ref\":void 0;function Bi(e,t){delete e.deliver;let s=Mh(t);return s&&(e.deliver=s),e}function Di({params:e,raw:t}){let s={sql:U(t.sql)??\"\"},i=vh(t);return i&&(s.params=i),Bi(s,e)}var eo=e=>({TOKEN:e.token,SIZE:e.size,FRAMES:e.frames??-1,FNV1A64:R(e.fnv1a64)});function Li(e,t=\"StreamResult\"){let s={ROWS:e?.rows??0,COLUMNS:e?.columns??0},i={raw:{}};return e?.ref&&typeof e.ref==\"object\"?s.REF=eo(e.ref):rt(e?.stream)&&(i.raw.stream=rt(e.stream)),i.result=H(t,s),i}function Bh(e){if(e==null)return{t:\"null\"};if(typeof e==\"boolean\")return{t:\"bool\",v:e};if(typeof e==\"number\")return Number.isInteger(e)?{t:\"i64\",v:BigInt(e)}:{t:\"f64\",v:e};if(typeof e==\"string\")return{t:\"str\",v:e};throw nt(`storage.query_sandboxed: a cell is a ${Array.isArray(e)?\"list\":typeof e} (nested values are not SQL values)`)}function Mi(e,t){if(e!=null){if(typeof e==\"bigint\")return Number(e);if(Array.isArray(e))return e.filter(s=>s!=null).map((s,i)=>Mi(s,`${t}.${i}`));if(typeof e==\"object\"){if(e instanceof Date||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)throw nt(`plugin.getConfig: ${t} is a ${e.constructor?.name??\"object\"}`);let s={};for(let i of Object.keys(e)){let r=Mi(e[i],t?`${t}.${i}`:i);r!==void 0&&(s[i]=r)}return s}if(typeof e==\"string\"||typeof e==\"number\"||typeof e==\"boolean\")return e;throw nt(`plugin.getConfig: ${t} is a ${typeof e}`)}}function Fh(e){let t=Mi(e??{},\"\")??{};if(Array.isArray(t)||typeof t!=\"object\")throw nt(\"plugin.getConfig: the config is not an object\");try{return Bn(t)}catch(s){throw nt(`plugin.getConfig: ${s.message}`)}}function Ce({params:e,raw:t}){let s={id:R(e?.ID)};return e?.USERNAME&&(s.username=e.USERNAME),t.secret&&(s.secret=U(t.secret)),s}function Zn(e){return{result:H(\"SecretResult\",{ID:R(e?.id),CONFIGURED:e?.configured===!0||e?.stored===!0,USERNAME_MASKED:R(e?.username_masked),UPDATED_MS:Rt(e?.updated_at??e?.updatedAt)??0n,VERIFIED_MS:Rt(e?.verified_at)??0n})}}function Qn(e){return t=>{if(t==null||t===\"\")throw nt(`node ${e} not available`);return{raw:{value:String(t)}}}}function zn(e){return H(\"P2pPnmEntry\",{PEER_ID:e.peer_id,PUBLISHER_PEER_ID:e.publisher_peer_id,GOSSIP_PEER_ID:e.gossip_peer_id,STANDARD:e.standard,SCHEMA:e.schema,FILE_ID:e.file_id,FILE_NAME:e.file_name,CID:e.cid,PUBLISH_MS:Rt(e.publish_timestamp??e.publish_ms),SIGNATURE_TYPE:e.signature_type,SIGNATURE_HEX:e.signature??e.signature_hex,SIGNATURE_VERIFIED:e.signature_verified,ATTRIBUTION:e.attribution,PNM_INDEX:e.pnm_index??-1,PUBLISHER_KEY_HEX:e.publisher_key??e.publisher_key_hex,PUBLISHER_KEY_SOURCE:e.publisher_key_source})}var Ci=e=>rt(e?.records)?{records:rt(e.records)}:{},Vh={Default:\"\",Ed25519:\"ed25519\",Secp256k1:\"secp256k1\",X25519:\"x25519\",Sha256:\"sha256\",Sha512:\"sha512\",Aes256Gcm:\"aes-256-gcm\",HkdfSha256:\"hkdf-sha256\"},xh=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function Gh(e){let t=rt(e);if(t)return t;let s=typeof e==\"string\"?e:e&&typeof e==\"object\"&&e.__type===\"bytes\"?R(e.base64):void 0;if(!(s===void 0||!xh.test(s)))return yi(s)}function Pe(e,t){return(s,{op:i})=>{let r=t===void 0?s:s&&typeof s==\"object\"&&!rt(s)?s[t]:void 0,o=Gh(r);if(!o)throw nt(`${i}: the host answered no ${t??\"bytes\"}`);return{raw:{[e]:o}}}}function Wt(e,t,s,i){return s[i]!==void 0&&(e[t]=gi(s[i])),e}var Xn=e=>{let t=Number(e);return Number.isFinite(t)?Math.trunc(t):0},Pi=e=>t=>({lists:{items:(Array.isArray(t?.[e])?t[e]:[]).map(R).sort().map(s=>({VALUE:s}))}}),kh={ns:1e-6,us:.001,µs:.001,μs:.001,ms:1,s:1e3,m:6e4,h:36e5};function Yh(e){let t=R(e);if(t===\"0\")return 0;let s=/^([-+]?)((?:(?:\\d+\\.?\\d*|\\.\\d+)(?:ns|us|µs|μs|ms|s|m|h))+)$/.exec(t);if(!s)return 0;let i=0;for(let[,r,o]of s[2].matchAll(/(\\d+\\.?\\d*|\\.\\d+)(ns|us|µs|μs|ms|s|m|h)/g))i+=Number(r)*kh[o];return s[1]===\"-\"?-i:i}function qh(e){let t=s=>Array.isArray(s)?s.map(t):s&&typeof s==\"object\"?Object.fromEntries(Object.keys(s).sort().map(i=>[i,t(s[i])])):s;return JSON.stringify(t(e)??null).replace(/[<>&\\u2028\\u2029]/g,s=>`\\\\u${s.charCodeAt(0).toString(16).padStart(4,\"0\")}`)}var ae=e=>e&&typeof e==\"object\"&&!Array.isArray(e)?e:{},Ue=({params:e})=>Bi(G(e),e),bt=e=>Array.isArray(e)?e.filter(t=>t&&typeof t==\"object\"):[],so={\"host.runtimeTarget\":{out:e=>({raw:{value:String(e)}})},\"host.listCapabilities\":{out:e=>({lists:{items:oe(e)}})},\"host.listSupportedCapabilities\":{out:e=>({lists:{items:oe(e)}})},\"host.listOperations\":{out:e=>({lists:{items:oe(e)}})},\"host.hasCapability\":{in:({params:e})=>({capability:e?.CAPABILITY}),out:e=>({result:{VALUE:!!e}})},\"clock.now\":{out:e=>({result:{UNIX_MS:Kn(e)}})},\"clock.nowIso\":{out:e=>({raw:{value:String(e)}})},\"clock.monotonicNow\":{out:e=>({result:{VALUE:Number(e)}})},\"random.bytes\":{in:({params:e})=>({length:e?.LENGTH||32}),out:e=>({raw:{data:ut(e)}})},\"timers.delay\":{in:({params:e})=>({ms:e?.MS??0}),out:()=>({})},\"schedule.parse\":{in:({params:e})=>({expression:e?.EXPRESSION}),out:e=>({lists:{fields:Object.entries(e||{}).filter(([,t])=>t&&typeof t==\"object\"&&Array.isArray(t.values)).map(([t,s])=>({NAME:t,SOURCE:String(s.source??\"\"),HAS_WILDCARD:!!s.hasWildcard,VALUES:s.values}))}})},\"schedule.matches\":{in:({params:e})=>({expression:e?.EXPRESSION,date:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{VALUE:!!e}})},\"schedule.next\":{in:({params:e})=>({expression:e?.EXPRESSION,from:e?.AT_MS?new Date(Number(e.AT_MS)):new Date}),out:e=>({result:{UNIX_MS:Kn(e)}})},\"http.request\":{in:({params:e,raw:t})=>({url:U(t.url),method:e?.METHOD||\"GET\",headers:Nh(t.headers),body:t.body,timeoutMs:e?.TIMEOUT_MS||void 0,responseType:\"bytes\",redirect:e?.NO_REDIRECTS?\"manual\":\"follow\",maxBytes:e?.MAX_BYTES?Number(e.MAX_BYTES):void 0}),out:(e,{params:t})=>{let s=ut(e?.body)??new Uint8Array(0);if(t?.MAX_BYTES&&s.length>Number(t.MAX_BYTES))throw Object.assign(new Error(`HTTP body of ${s.length} bytes exceeds MAX_BYTES ${t.MAX_BYTES}`),{hostcallCode:\"too-large\"});return{result:{STATUS:e?.status??0,RETRIEVED_MS:BigInt(Date.now())},raw:{url:String(e?.url??\"\"),headers:Dh(e?.headers)??\"\",body:s}}}},\"websocket.exchange\":{in:({params:e,raw:t})=>({url:U(t.url),protocols:t.protocols?U(t.protocols).split(\",\").map(s=>s.trim()).filter(Boolean):void 0,message:t.message===void 0?void 0:e?.MESSAGE_IS_TEXT?U(t.message):t.message,timeoutMs:e?.TIMEOUT_MS||void 0,expectResponse:!e?.NO_RESPONSE,responseType:\"bytes\"}),out:e=>({result:{PROTOCOL:e?.protocol??\"\",EXTENSIONS:e?.extensions??\"\",CLOSE_CODE:e?.closeCode??-1,CLOSE_REASON:e?.closeReason??\"\",BODY_IS_TEXT:typeof e?.body==\"string\"},raw:{url:String(e?.url??\"\"),...e?.body==null?{}:{body:ut(e.body)}}})},\"mqtt.publish\":{in:({params:e,raw:t})=>({...ve(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,payload:t.payload,password:U(t.password)}),out:e=>({result:Me(\"MqttResult\",e)})},\"mqtt.subscribeOnce\":{in:({params:e,raw:t})=>({...ve(e),keepAliveSeconds:e?.KEEP_ALIVE_S||void 0,password:U(t.password),responseType:\"bytes\"}),out:e=>({result:Me(\"MqttResult\",e),raw:e?.payload==null&&e?.body==null?{}:{body:ut(e.payload??e.body)}})},\"tcp.request\":Hi(),\"udp.request\":Hi(),\"tls.request\":Hi(({raw:e})=>({ca:U(e.ca),cert:U(e.cert),key:U(e.key)})),\"filesystem.resolvePath\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{path:String(e)}})},\"filesystem.readFile\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({raw:{data:ut(e)}})},\"filesystem.writeFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.appendFile\":{in:({raw:e})=>({path:U(e.path),value:e.data??new Uint8Array(0)}),out:()=>({})},\"filesystem.deleteFile\":{in:({raw:e})=>({path:U(e.path)}),out:()=>({})},\"filesystem.mkdir\":{in:({params:e,raw:t})=>({path:U(t.path),recursive:!e?.NOT_RECURSIVE}),out:()=>({})},\"filesystem.readdir\":{in:({raw:e})=>({path:U(e.path)??\".\"}),out:e=>({lists:{entries:(e||[]).map(t=>({NAME:t.name,IS_FILE:!!t.isFile,IS_DIRECTORY:!!t.isDirectory}))}})},\"filesystem.stat\":{in:({raw:e})=>({path:U(e.path)}),out:e=>({result:{SIZE:BigInt(e?.size??0),IS_FILE:!!e?.isFile,IS_DIRECTORY:!!e?.isDirectory,CTIME_MS:Number(e?.ctimeMs??0),MTIME_MS:Number(e?.mtimeMs??0)},raw:{path:String(e?.path??\"\")}})},\"filesystem.rename\":{in:({raw:e})=>({fromPath:U(e.path),toPath:U(e.to_path)}),out:()=>({})},\"exec.execFile\":{in:({params:e,raw:t,lists:s})=>({file:U(t.file),args:(s.args||[]).map(i=>i.VALUE),cwd:U(t.cwd),input:t.input,env:s.env?Object.fromEntries(s.env.map(i=>[i.NAME,i.VALUE])):void 0,timeoutMs:e?.TIMEOUT_MS||void 0}),out:e=>({result:{EXIT_CODE:e?.exitCode??-1,SIGNAL:e?.signal??\"\"},raw:{stdout:ut(e?.stdout)??new Uint8Array(0),stderr:ut(e?.stderr)??new Uint8Array(0)}})},\"context.get\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:e!=null},raw:e==null?{}:{value:ut(e)}})},\"context.set\":{in:({params:e,raw:t})=>({scope:e?.SCOPE,key:e?.KEY,value:t.value??new Uint8Array(0)}),out:()=>({})},\"context.delete\":{in:({params:e})=>({scope:e?.SCOPE,key:e?.KEY}),out:e=>({result:{VALUE:!!e}})},\"context.listKeys\":{in:({params:e})=>({scope:e?.SCOPE}),out:e=>({lists:{items:oe(e)}})},\"context.listScopes\":{out:e=>({lists:{items:oe(e)}})},\"crypto.sha256\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.sha512\":{in:({raw:e})=>({value:e.data??new Uint8Array(0)}),out:it},\"crypto.hkdf\":{in:({params:e,raw:t})=>({ikm:t.ikm,salt:t.salt??new Uint8Array(0),info:t.info,length:e?.LENGTH||32}),out:it},\"crypto.aesGcmEncrypt\":{in:({raw:e})=>({key:e.key,plaintext:e.data??new Uint8Array(0),iv:e.nonce,aad:e.aad}),out:(e,{raw:t})=>({raw:{data:Ch(e.ciphertext,e.tag),nonce:t.nonce}})},\"crypto.aesGcmDecrypt\":{in:({raw:e})=>({key:e.key,...Lh(e.data),iv:e.nonce,aad:e.aad}),out:it},\"crypto.x25519.generateKeypair\":{out:e=>({raw:{private_key:e.privateKey,public_key:e.publicKey}})},\"crypto.x25519.publicKey\":{in:({raw:e})=>({privateKey:e.private_key}),out:it},\"crypto.x25519.sharedSecret\":{in:({raw:e})=>({privateKey:e.private_key,publicKey:e.public_key}),out:it},\"crypto.sealedBox.encryptForRecipient\":{in:({raw:e})=>({plaintext:e.data??new Uint8Array(0),recipientPublicKey:e.public_key,context:e.info?U(e.info):void 0}),out:e=>({raw:{data:yi(e.protectedBlobBase64)}})},\"crypto.sealedBox.decryptFromEnvelope\":{in:({raw:e})=>({envelope:{protectedBlobBase64:gi(e.envelope??e.data)},recipientPrivateKey:e.private_key}),out:it},\"crypto.secp256k1.publicKeyFromPrivate\":{in:({raw:e})=>({privateKey:e.private_key}),out:it},\"crypto.secp256k1.sign\":{in:({raw:e})=>({message:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Ui},\"crypto.secp256k1.signDigest\":{in:({raw:e})=>({digest:e.data,privateKey:e.private_key}),out:it},\"crypto.secp256k1.verifyDigest\":{in:({raw:e})=>({digest:e.data,signature:e.signature,publicKey:e.public_key}),out:Ui},\"crypto.ed25519.publicKeyFromSeed\":{in:({raw:e})=>({seed:e.private_key}),out:it},\"crypto.ed25519.sign\":{in:({raw:e})=>({message:e.data,seed:e.private_key}),out:it},\"crypto.ed25519.verify\":{in:({raw:e})=>({message:e.data,signature:e.signature,publicKey:e.public_key}),out:Ui},\"plugin.getConfig\":{in:()=>({}),out:e=>({raw:{config:Fh(e)}})},\"node.peerId\":{in:()=>({}),out:Qn(\"peer ID\")},\"node.publicKey\":{in:()=>({}),out:Qn(\"public key\")},\"secrets.get\":{in:Ce,out:e=>({result:H(\"SecretResult\",{ID:R(e?.id),USERNAME:R(e?.username),CONFIGURED:!0}),raw:{secret:ut(e?.secret)??new Uint8Array(0)}})},\"secrets.status\":{in:Ce,out:Zn},\"secrets.put\":{in:Ce,out:Zn},\"secrets.clear\":{in:Ce,out:()=>({})},\"storage.write\":{in:({params:e,raw:t})=>({...G(e),data:t.data??new Uint8Array(0)}),out:e=>({result:H(\"StorageWriteResult\",{CID:R(e?.cid)})})},\"storage.query\":{in:({params:e})=>G(e),out:e=>{let t=[],s=[];for(let i of bt(Array.isArray(e)?e:e?.records)){let r=i.SourceTags||{},o=rt(i.Data)??new Uint8Array(0);s.push(o),t.push(H(\"StoredRecordMeta\",{CID:R(i.CID),ROW_ID:i.RowID??0,PEER_ID:R(i.PeerID),TIMESTAMP_MS:Rt(i.Timestamp)??0n,MATERIALIZED_MS:Rt(i.MaterializedAt)??0n,LENGTH:o.length,PROVIDER_ID:R(r.ProviderID),SOURCE_NAME:R(r.SourceName),BATCH_ID:R(r.BatchID),PRODUCER_PEER_ID:R(r.ProducerPeerID),LICENSE:R(r.License)}))}return{lists:{records_meta:t},raw:{records:Hh(s)}}}},\"storage.delete\":{in:({params:e})=>G(e),out:()=>({})},\"storage.expire\":{in:({params:e})=>G(e),out:e=>({result:Le(\"StorageExpireResult\",e)})},\"storage.ingest_with_source\":{in:({params:e,raw:t,lists:s})=>{let i=G(e);delete i.archive_source,delete i.archive_name,i.reconcile=He(Un,e?.RECONCILE).toLowerCase(),t.records&&(i.records=t.records),t.archive&&(i.archive={source:R(e?.ARCHIVE_SOURCE),name:R(e?.ARCHIVE_NAME),raw:t.archive});let r=s.provenance?.[0],o=s.provenance_attributes;if(r||o?.length){let a={};o?.length&&(a.attributes=o.map(E=>({name:R(E.NAME),value:R(E.VALUE)})));for(let[E,_]of Object.entries(r||{}))a[E.toLowerCase()]=typeof _==\"bigint\"?Number(_):_??\"\";let c=Object.fromEntries(Object.keys(a).sort().map(E=>[E,a[E]]));i.provenance={source:R(e?.SOURCE_NAME),json:vi.encode(JSON.stringify(c))}}return i},out:e=>{let t=Le(\"StorageIngestResult\",e);return e?.provenance&&(t.PROVENANCE_FILE=R(e.provenance)),{result:t}}},\"storage.flatsql_query_stream\":{in:Di,out:e=>Li(e)},\"storage.flatsql_epoch_stream\":{in:({params:e})=>Bi(G(e),e),out:e=>Li(e)},\"storage.query_sandboxed\":{in:e=>({...Di(e),want:He(De,e.params?.WANT).toLowerCase()}),out:e=>{if(e?.kind!==\"rows\"){let o=Li(e,\"SandboxQueryResult\");return o.result.KIND=De.Stream,o}let t=typeof e.json==\"string\"?e.json:rt(e.json)?U(rt(e.json)):void 0;if(t===void 0)throw nt(\"storage.query_sandboxed: rows answer carries no rows\");let s;try{s=JSON.parse(t)}catch(o){throw nt(`storage.query_sandboxed: ${o.message}`)}if(!Array.isArray(s))throw nt(\"storage.query_sandboxed: rows are not a JSON array\");let i=s.length&&s[0]&&typeof s[0]==\"object\"?Object.keys(s[0]):[],r=[];for(let o of s){if(!o||typeof o!=\"object\"||Array.isArray(o))throw nt(\"storage.query_sandboxed: a row is not an object\");for(let a of Object.values(o))r.push(Bh(a))}return{result:H(\"SandboxQueryResult\",{KIND:De.Rows,ROWS:s.length,COLUMNS:i.length}),lists:{columns:i.map(o=>({VALUE:o}))},raw:{cells:kn(r)}}}},\"storage.query_surface\":{in:()=>({}),out:e=>{let t=[],s=[];for(let r of bt(e?.tables)){let o=R(r.name);t.push(H(\"SurfaceTable\",{NAME:o,KIND:R(r.kind),SOURCE:R(r.source),RECORDS:r.records??0}));for(let a of Array.isArray(r.columns)?r.columns:[])typeof a==\"string\"?s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:a})):a&&typeof a==\"object\"&&s.push(H(\"SurfaceColumn\",{TABLE:o,NAME:R(a.name),PLACEHOLDER:a.placeholder===!0}))}let i=e?.caps&&typeof e.caps==\"object\"?e.caps:null;return{...i?{result:H(\"QuerySurfaceLimits\",{TIMEOUT_MS:i.timeout_ms??0,MAX_ROWS:i.max_rows??0,MAX_BYTES:i.max_bytes??0})}:{},lists:{tables:t,columns:s}}}},\"storage.flatsql_cache_key\":{in:e=>{let t={...G(e.params),...Di(e)};return e.lists.projection&&(t.projection=e.lists.projection.map(s=>R(s.VALUE))),t},out:e=>({raw:{value:R(e?.key)}})},\"p2p.peers_snapshot\":{in:Ue,out:e=>{let t=[],s=[],i=[];for(let r of bt(e?.peers)){t.push(H(\"P2pPeer\",{PEER_ID:R(r.peer_id),CONNECTED:r.connected===!0,SELF:r.self===!0,EPM_INDEX:r.epm_index??-1,AGENT_VERSION:r.agent_version}));for(let o of Array.isArray(r.addrs)?r.addrs:[])s.push(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}));for(let o of Array.isArray(r.standards)?r.standards:[])i.push(H(\"P2pPeerValue\",{PEER_ID:R(r.peer_id),VALUE:R(o)}))}return{result:Le(\"P2pSummary\",e),lists:{peers:t,peer_addresses:s,peer_standards:i},raw:Ci(e)}}},\"p2p.standards_snapshot\":{in:Ue,out:e=>({lists:{entries:bt(e?.entries).map(zn)},raw:Ci(e)})},\"p2p.pnm_history\":{in:Ue,out:e=>({result:Le(\"P2pSummary\",e),lists:{entries:bt(e?.entries).map(zn)},raw:Ci(e)})},\"p2p.latest_dataset\":{in:Ue,out:e=>{let t=e?.serving&&typeof e.serving==\"object\"?e.serving:{},s=(t.pnm&&typeof t.pnm==\"object\"?t.pnm:e?.pnm)||{};return{result:H(\"P2pLatestDataset\",{KNOWN:e?.known===!0,REASON:e?.reason,PINNED:e?.pinned,SELF:e?.self,FRESH:e?.fresh,STANDARD:e?.standard,SCHEMA:e?.schema,PNM_CID:s.CID??s.cid,PNM_FILE_ID:s.FILE_ID??s.file_id,PNM_PUBLISH_MS:Rt(s.PUBLISH_TIMESTAMP??s.publish_timestamp),PNM_SIGNATURE_VERIFIED:s.signature_verified,PNM_ATTRIBUTION:s.attribution,BATCH_ID:t.batch_id,PROVIDER_ID:t.provider_id,SOURCE_NAME:t.source_name,RECORD_COUNT:t.record_count,BYTE_COUNT:t.byte_count,PARTS:t.parts,PUBLISHED_MS:Rt(t.published_at),ETAG_FNV1A64:t.etag_fnv1a64,REF:t.ref&&typeof t.ref==\"object\"?eo(t.ref):void 0}),raw:rt(t.stream)?{stream:rt(t.stream)}:{}}}},\"keyslot.sign\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)},i=Vh[He(Hn,e?.ALGORITHM)];return i&&(s.algorithm=i),Wt(s,\"payload\",t,\"payload\")},out:Pe(\"data\",\"signature\")},\"keyslot.unwrap\":{in:({params:e,raw:t})=>{let s={slotId:R(e?.SLOT_ID)};return Wt(s,\"ephemeralPublicKey\",t,\"ephemeral_public_key\"),Wt(s,\"nonce\",t,\"nonce\"),Wt(s,\"ciphertext\",t,\"ciphertext\")},out:Pe(\"data\",\"plaintext\")},\"protocol.request\":{in:({params:e,raw:t})=>{let s={target:R(e?.TARGET),protocolId:R(e?.PROTOCOL_ID)};return Number(e?.TIMEOUT_MS)>0&&(s.timeoutMs=Number(e.TIMEOUT_MS)),Wt(s,\"payloadBase64\",t,\"payload\")},out:Pe(\"data\")},\"pubsub.list_topics\":{in:()=>({}),out:Pi(\"topics\")},\"ipfs.cat\":{in:({params:e})=>G(e),out:Pe(\"data\")},\"ipfs.dag_get\":{in:({params:e})=>G(e),out:e=>({raw:{data:rt(e)??vi.encode(qh(e))}})},\"ipfs.ls\":{in:({params:e})=>G(e),out:e=>({lists:{links:bt(ae(e).Objects).flatMap(t=>bt(t.Links)).map(t=>H(\"IpfsLink\",{NAME:R(t.Name),CID:R(t.Hash),SIZE:Xn(t.Size),TYPE:Xn(t.Type)}))}})},\"ipfs.pin_add\":{in:({params:e})=>G(e),out:Pi(\"Pins\")},\"ipfs.pin_rm\":{in:({params:e})=>G(e),out:Pi(\"Pins\")},\"ipfs.pin_ls\":{in:({params:e})=>G(e),out:e=>{let t=ae(ae(e).Keys);return{lists:{pins:Object.keys(t).sort().map(s=>H(\"IpfsPin\",{CID:s,TYPE:R(ae(t[s]).Type)}))}}}},\"ipfs.name_resolve\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{VALUE:R(e?.Path)})})},\"ipfs.name_publish\":{in:({params:e})=>G(e),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.Name),VALUE:R(e?.Value)})})},\"ipfs.id\":{in:()=>({}),out:e=>({result:H(\"IpfsResult\",{NAME:R(e?.ID),VALUE:R(e?.PublicKey),AGENT_VERSION:R(e?.AgentVersion),PROTOCOL_VERSION:R(e?.ProtocolVersion)}),lists:{addresses:(Array.isArray(e?.Addresses)?e.Addresses:[]).map(t=>({VALUE:R(t)}))}})},\"ipfs.swarm_peers\":{in:()=>({}),out:e=>({lists:{peers:bt(ae(e).Peers).map(t=>H(\"IpfsSwarmPeer\",{PEER_ID:R(t.Peer),ADDRESS:R(t.Addr),LATENCY_MS:Yh(t.Latency)}))}})},\"ipfs.pubsub_publish\":{in:({params:e,raw:t})=>Wt({topic:R(e?.TOPIC)},\"base64\",t,\"data\"),out:()=>({})},\"node_status_read.status\":{in:()=>({}),out:e=>{let t=e?.store||{},s=e?.service||{},i={UPTIME_S:e?.uptime_seconds??0,STARTED_MS:Rt(e?.started_at)??0n,STORE_TOTAL_BYTES:t.total_bytes??0,STORE_TOTAL_RECORDS:t.total_records??0,STORAGE_PATH:R(t.storage_path),SERVICE_STATE:R(s.state),SERVICE_MODE:R(s.mode)};e?.disk&&typeof e.disk==\"object\"&&Object.assign(i,{HAS_DISK:!0,DISK_CAPACITY_BYTES:e.disk.capacity_bytes??0,DISK_FREE_BYTES:e.disk.free_bytes??0,DISK_AVAILABLE_BYTES:e.disk.available_bytes??0});let r=[];if(e?.bandwidth&&typeof e.bandwidth==\"object\"){let o=e.bandwidth;Object.assign(i,{HAS_BANDWIDTH:!0,TOTAL_IN_BYTES:o.total_in_bytes??0,TOTAL_OUT_BYTES:o.total_out_bytes??0,RATE_IN_BPS:o.rate_in_bps??0,RATE_OUT_BPS:o.rate_out_bps??0});for(let a of bt(o.history))r.push(H(\"NodeBandwidthSample\",{TS_MS:Rt(a.ts)??0n,TOTAL_IN_BYTES:a.total_in_bytes??0,TOTAL_OUT_BYTES:a.total_out_bytes??0,RATE_IN_BPS:a.rate_in_bps??0,RATE_OUT_BPS:a.rate_out_bps??0}))}return{result:H(\"NodeStatusReport\",i),lists:{bandwidth_history:r}}}},\"node_activity_read.activity\":{in:({params:e})=>G(e),out:e=>({lists:{events:bt(e?.events).map(t=>H(\"NodeActivityEvent\",{TS_MS:Rt(t.ts)??0n,KIND:R(t.kind),DETAIL:R(t.detail),PEER_ID:R(t.peer_id)}))}})}};function it(e){return{raw:{data:ut(e)??new Uint8Array(0)}}}function Ui(e){return{result:{VALUE:e!==null&&typeof e==\"object\"?e.result===!0:!!e}}}function Hi(e=()=>({})){return{in:t=>{let{params:s,raw:i}=t,r=ve(s);return delete r.noResponse,delete r.allowUnauthorized,delete r.serverName,{...r,data:i.data,responseEncoding:\"bytes\",expectResponse:!s?.NO_RESPONSE,rejectUnauthorized:!s?.ALLOW_UNAUTHORIZED,servername:s?.SERVER_NAME||void 0,...e(t)}},out:t=>({result:Me(\"SocketResult\",t),raw:t?.body==null?{}:{body:ut(t.body)}})}}function jh(e){let t=so[e.op];return t?.in?t.in(e):{...ve(e.params),...Object.fromEntries(Object.entries(e.raw).map(([s,i])=>[Jn(s),i]))}}function Kh(e,t){let s=so[e.op];if(s?.out)return s.out(t,e);let i=ne[e.op];return{result:i?.result?Me(i.result,t):void 0}}function Wh(e){if(e?.hostcallCode)return e.hostcallCode;let t=e?.name??e?.constructor?.name??\"\";return t===\"HostCapabilityError\"||t===\"BrowserHostCapabilityError\"||e?.code===\"host-capability-denied\"?\"not-authorized\":t===\"HostFilesystemScopeError\"?\"sandbox\":t===\"AbortError\"||t===\"TimeoutError\"||/timed out/i.test(e?.message??\"\")?\"timeout\":/^Unknown .* operation|not available in the synchronous hostcall ABI|does not implement/.test(e?.message??\"\")?\"unsupported\":/exceeds? the record/.test(e?.message??\"\")?\"too-large\":e instanceof RangeError||e instanceof TypeError||t===\"RangeError\"||t===\"TypeError\"?\"invalid-params\":\"failed\"}function io(e,t,{allowAsync:s=!1}={}){let i,r=a=>mi({ok:!1,error:{code:Wh(a),message:String(a?.message??a)}}),o=a=>{try{return mi({ok:!0,op:i.op,...Kh(i,a)})}catch(c){return r(c)}};try{if(i=xn(e),!ne[i.op])throw Object.assign(new Error(`Unknown host operation \"${i.op}\".`),{hostcallCode:\"unsupported\"});let a=t(i.op,jh(i));if(a&&typeof a.then==\"function\"){if(!s)throw typeof a.catch==\"function\"&&a.catch(()=>{}),Object.assign(new Error(`Operation \"${i.op}\" is not available in the synchronous hostcall ABI.`),{hostcallCode:\"unsupported\"});return a.then(o,r)}return o(a)}catch(a){return a&&!a.hostcallCode&&i===void 0&&(a.hostcallCode=\"invalid-params\"),r(a)}}var ro=Object.freeze({\"node.peerId\":{capability:null,adapter:\"node\",method:\"peerId\"},\"node.publicKey\":{capability:null,adapter:\"node\",method:\"publicKey\"},\"secrets.get\":{capability:\"secrets\",adapter:\"secrets\",method:\"get\"},\"secrets.status\":{capability:\"secrets\",adapter:\"secrets\",method:\"status\"},\"secrets.put\":{capability:\"secrets\",adapter:\"secrets\",method:\"put\"},\"secrets.clear\":{capability:\"secrets\",adapter:\"secrets\",method:\"clear\"},\"storage.write\":{capability:\"storage_write\",adapter:\"storage\",method:\"write\"},\"storage.query\":{capability:\"storage_query\",adapter:\"storage\",method:\"query\"},\"storage.delete\":{capability:\"storage_write\",adapter:\"storage\",method:\"delete\"},\"storage.expire\":{capability:\"storage_write\",adapter:\"storage\",method:\"expire\"},\"storage.ingest_with_source\":{capability:\"storage_ingest\",adapter:\"storage\",method:\"ingest_with_source\"},\"storage.flatsql_query_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_query_stream\"},\"storage.flatsql_epoch_stream\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_epoch_stream\"},\"storage.query_sandboxed\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_sandboxed\"},\"storage.query_surface\":{capability:\"storage_query\",adapter:\"storage\",method:\"query_surface\"},\"storage.flatsql_cache_key\":{capability:\"storage_query\",adapter:\"storage\",method:\"flatsql_cache_key\"},\"p2p.peers_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"peers_snapshot\"},\"p2p.standards_snapshot\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"standards_snapshot\"},\"p2p.pnm_history\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"pnm_history\"},\"p2p.latest_dataset\":{capability:\"p2p_read\",adapter:\"p2p\",method:\"latest_dataset\"},\"node_status_read.status\":{capability:\"node_status_read\",adapter:\"node\",method:\"status\"},\"node_activity_read.activity\":{capability:\"node_activity_read\",adapter:\"node\",method:\"activity\"}}),S_=Object.freeze([\"ipfs.ls\",\"ipfs.pin_add\",\"ipfs.pin_rm\",\"ipfs.pin_ls\",\"ipfs.dag_get\",\"ipfs.id\",\"ipfs.swarm_peers\",\"ipfs.name_resolve\",\"ipfs.name_publish\",\"ipfs.pubsub_publish\"]),A_=Object.freeze([...new Set(Object.values(ro).map(e=>e.capability).filter(Boolean))]);var Vi=\"space_data_module_host\",Lt=0,Fi=1,g_=Object.freeze([\"host.runtimeTarget\",\"host.listCapabilities\",\"host.listSupportedCapabilities\",\"host.listOperations\",\"host.hasCapability\",\"plugin.getConfig\",\"clock.now\",\"clock.monotonicNow\",\"clock.nowIso\",\"random.bytes\",\"schedule.parse\",\"schedule.matches\",\"schedule.next\",\"filesystem.resolvePath\"]);function $h(e,t){let s=String(e??\"\").trim();if(!s)throw new TypeError(`${t} is required.`);return s}function ao(e){if(typeof e!=\"function\")throw new TypeError(\"getMemory must be a function returning WebAssembly.Memory.\");let t=e();if(!t||typeof t!=\"object\"||!(\"buffer\"in t))throw new TypeError(\"getMemory must return a WebAssembly.Memory-like object.\");let s=t.buffer;if(!(s instanceof ArrayBuffer||s instanceof SharedArrayBuffer))throw new TypeError(\"Hostcall memory buffer must be an ArrayBuffer or SharedArrayBuffer.\");return s}function no(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(`${i} pointer must be a non-negative integer.`);if(!Number.isInteger(s)||s<0)throw new RangeError(`${i} length must be a non-negative integer.`);let r=ao(e);if(t+s>r.byteLength)throw new RangeError(`${i} range exceeds guest memory bounds.`);return new Uint8Array(r,t,s)}function Zh(e,t,s,i){if(!Number.isInteger(t)||t<0)throw new RangeError(\"Response pointer must be a non-negative integer.\");if(!Number.isInteger(i)||i<0)throw new RangeError(\"Response max length must be a non-negative integer.\");let r=s instanceof Uint8Array?s:new Uint8Array(s),o=ao(e),a=Math.min(r.length,i);if(t+a>o.byteLength)throw new RangeError(\"Response range exceeds guest memory bounds.\");return new Uint8Array(o,t,a).set(r.subarray(0,a)),a}function Qh(e){if(e.length===0)return null;let{meta:t,segments:s}=Se(e);return Mt(t,s)}function oo(e,t=null){return{name:e?.name??\"Error\",message:e?.message??String(e),code:e?.code??null,operation:e?.operation??t,capability:e?.capability??null}}function zh(e){return e!==null&&typeof e==\"object\"&&typeof e.then==\"function\"}function fo(e={}){let t=e.dispatch;if(typeof t!=\"function\")throw new TypeError(\"createHostcallBridge requires a dispatch function.\");let s=e.getMemory,i=$h(e.moduleName??Vi,\"Hostcall import module name\"),r=Number.isInteger(e.maxRequestBytes)?e.maxRequestBytes:16*1024*1024,o=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:64*1024*1024,a=Lt,c={ok:!0,result:null},E=je(c,[]);function _(d,S){let b=[],y=Ie(S,b),g=je(y,b);if(g.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);a=d,c=S,E=g}function I(d,S,b,y){try{if(y>r)throw new Error(`Hostcall request exceeds ${r} byte limit.`);let g=vt(no(s,d,S,\"Operation\")),M=no(s,b,y,\"Payload\");if(qn(M)){let wt=io(M.slice(),t);if(wt.length>o)throw new Error(`Hostcall response exceeds ${o} byte limit.`);return a=Lt,c=null,E=wt,Lt}let K=Qh(M),F=t(g,K);if(zh(F))throw typeof F.catch==\"function\"&&F.catch(()=>{}),new Error(`Operation \"${g}\" returned a Promise. The synchronous hostcall ABI only supports synchronous operations.`);return _(Lt,{ok:!0,result:F===void 0?null:F}),Lt}catch(g){try{_(Fi,{ok:!1,error:oo(g)})}catch(M){_(Fi,{ok:!1,error:oo(M)})}return Fi}}function m(){return E.length}function A(d,S){return Zh(s,d,E,S)}function T(){return _(Lt,{ok:!0,result:null}),Lt}function w(){return a}return{moduleName:i,imports:{[i]:{call:I,response_len:m,read_response:A,clear_response:T,last_status_code:w}},getLastEnvelope(){return structuredClone(c)},getLastResponseBytes(){return new Uint8Array(E)},getLastResponseEnvelope(){let{meta:d,segments:S}=Se(E);return Mt(d,S)}}}var N_=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),D_=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var L_=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Be=4096;var C_=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function ho(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t>>>0}var Xh=1330201683,Jh=1,tc=0,ec=1,sc=2,ic=3,rc=4,uo=5;var nc=7;var oc=9,Ve=10,ac=11;var fc=13,Ao=64,lo=Ao*4;var hc=1;var cc=1,uc=2,lc=3,he=32767,ce=0,bo=1,Eo=2,Ec=3,_c=4,dc=5,pc=6,Ic=7,Sc=8,Ac=9,_o=10,Ro=11,bc=12,Rc=13,wc=8,wo=9,xi=128,Gi=0,Tc=1,Oc=2;var mc=4,gc=0;var yc=0,Nc=1,Dc=1,fe=2,Fe=3,Lc=4,Cc=5,Pc=6,Uc=7;var H_=64*1024;var po=250,Hc=20;function Io(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function vc(e,t){return Math.ceil(e/t)*t}function To(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function Mc(e){To(e);let t=new Int32Array(e,0,Ao);if(t[tc]!==Xh||t[ec]!==Jh)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let s=t[sc],i=t[ic],r=t[rc],o=t[ac],a=vc(lo+r*4,64),c=new Int32Array(e,lo,r),E=[];for(let _=0;_<s;_+=1){let I=a+_*i;E.push({index:_,base:I,i32:new Int32Array(e,I,xi/4),f64:new Float64Array(e,I,xi/8),data:new Uint8Array(e,I+xi,o)})}return{buffer:e,header:t,instances:c,slots:E,slotCount:s,slotBytes:i,dataBytes:o,maxInstances:r,channelId:t[fc]}}function Bc(e){return`sdm-sab-io-doorbell-${e}`}function Fc(e,t){Atomics.add(e.header,uo,1),Atomics.notify(e.header,uo),Atomics.load(e.header,nc)===hc&&t()?.postMessage(0)}function Vc(e){let t=null;return{get(){return!t&&typeof BroadcastChannel==\"function\"&&(t=new BroadcastChannel(e)),t},close(){t?.close(),t=null}}}var xc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Gc(){return(Math.random()*2147483646|0)+1}function kc(e,t){let s=(Atomics.add(e.header,oc,1)>>>0)%e.slotCount;for(let i=0;i<e.slotCount;i+=1){let r=e.slots[(s+i)%e.slotCount];if(Atomics.compareExchange(r.i32,ce,Gi,Tc)===Gi)return Atomics.store(r.i32,bo,t),r}return null}function So(e,t){Atomics.store(t.i32,bo,0),Atomics.store(t.i32,ce,Gi),Atomics.add(e.header,Ve,1),Atomics.notify(e.header,Ve)}function Yc(e,t,s){let i=e.i32;i[_c]=t,i[dc]=s.instanceId??he,i[pc]=s.handle??-1,i[Ic]=s.flags??0,i[Sc]=s.ptr??0,i[Ac]=s.len??0,i[Rc]=s.dataInSlot?Nc:yc,i[Ro]=0,e.f64[wc]=s.offset??0,e.f64[wo]=0,s.path?(e.data.set(s.path,0),i[_o]=s.path.length):i[_o]=0}function qc(e){return Atomics.load(e.i32,Ro)}function Oo(e={}){To(e.buffer);let t=Mc(e.buffer),s=Number.isInteger(e.instanceId)?e.instanceId:he;if(s!==he&&(s<0||s>=t.maxInstances))throw new RangeError(`instanceId ${s} is outside 0..${t.maxInstances-1}.`);let i=typeof e.getMemory==\"function\"?e.getMemory:()=>null,r=Number.isFinite(e.spinMicros)?Math.max(0,e.spinMicros):Hc,o=Gc(),a=Vc(Bc(t.channelId)),c=0;function E(){for(;;){let d=Atomics.load(t.header,Ve),S=kc(t,o);if(S)return S;Atomics.wait(t.header,Ve,d,po)}}function _(d,S,b){let y=Atomics.load(d.i32,Eo)+1|0||1;Yc(d,S,b),Atomics.store(d.i32,bc,gc),Atomics.store(d.i32,Eo,y),Atomics.store(d.i32,ce,Oc),Fc(t,a.get);let g=r>0?Io()+r/1e3:0;for(;;){let M=Atomics.load(d.i32,ce);if(M===mc&&Atomics.load(d.i32,Ec)===y)break;g>0&&Io()<g||Atomics.wait(d.i32,ce,M,po)}return c+=1,{status:qc(d),result:d.f64[wo]}}function I(d,S){let b=E();try{return _(b,d,S)}finally{So(t,b)}}function m(){return s!==he&&Atomics.load(t.instances,s)===cc}function A(){if(s===he)return!1;let d=Atomics.load(t.instances,s);return d===uc||d===lc}function T(d,S,b,y){let g=0;for(;g<b.length;){let M=Math.min(t.dataBytes,b.length-g),K=E(),F;try{d===Fe&&K.data.set(b.subarray(g,g+M),0),F=_(K,d,{instanceId:s,dataInSlot:!0,handle:S,ptr:0,len:M,offset:y+g}).status,d===fe&&F>0&&b.set(K.data.subarray(0,F),g)}finally{So(t,K)}if(F<0)return g>0&&d===fe?g:F;if(g+=F,F<M)break}return g}function w(d,S){let b=i(),y=b?.buffer??b;return!y||d<0||S<0||d+S>y.byteLength?null:new Uint8Array(y,d,S)}return{instanceId:s,get requests(){return c},open(d,S){let b=typeof d==\"string\"?xc.encode(d):d;return!(b instanceof Uint8Array)||b.length===0?-1:b.length>Math.min(t.dataBytes,Be)?-1:I(Dc,{instanceId:s,flags:S|0,path:b}).status},read(d,S,b,y){if(b===0)return 0;if(m())return I(fe,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(fe,d,g,y):A()?-3:-1},write(d,S,b,y){if(b===0)return 0;if(m())return I(Fe,{instanceId:s,handle:d,ptr:S,len:b,offset:y}).status;let g=w(S,b);return g?T(Fe,d,g,y):A()?-3:-1},readInto(d,S,b){return S.length===0?0:T(fe,d,S,b)},writeFrom(d,S,b){return S.length===0?0:T(Fe,d,S,b)},truncate(d,S){return I(Lc,{instanceId:s,handle:d,offset:S}).status},sync(d){return I(Cc,{instanceId:s,handle:d}).status},size(d){let{status:S,result:b}=I(Pc,{instanceId:s,handle:d});return S<0?S:b},close(d){return I(Uc,{instanceId:s,handle:d}).status},release(){a.close()}}}var jc=typeof TextEncoder==\"function\"?new TextEncoder:null;function Kc(e){let t=2166136261;for(let s=0;s<e.length;s+=1)t^=e[s],t=Math.imul(t,16777619);return t|0}var mo=new WeakMap;function go(e){let t=mo.get(e);if(t)return t;let s=new Int32Array(e,0,16);if(s[0]!==1380795475||s[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let i=s[2],r=s[3],o=s[4],a=64,c=a+i*32,E=c+i*o;return t={entries:i,entryBytes:r,maxPathBytes:o,i32:new Int32Array(e,a,i*32/4),f64:new Float64Array(e,a,i*32/8),paths:new Uint8Array(e,c,i*o),data:new Uint8Array(e,E,i*r)},mo.set(e,t),t}function Wc(e){return typeof e==\"string\"?jc.encode(e):e}function $c(e,t,s){let i=t*8;if(Atomics.load(e.i32,i+3)!==s.length)return!1;let r=t*e.maxPathBytes;for(let o=0;o<s.length;o+=1)if(e.paths[r+o]!==s[o])return!1;return!0}function Zc(e,t,s){let i=(s>>>0)%e.entries;for(let r=0;r<e.entries;r+=1){let o=i*8,a=Atomics.load(e.i32,o+0);if(a===0)return-1;if((a===2||a===3)&&Atomics.load(e.i32,o+2)===s&&$c(e,i,t))return i;i=(i+1)%e.entries}return-1}function yo(e,t){let s=go(e),i=Wc(t);if(i.length>s.maxPathBytes)return-1;let r=Zc(s,i,Kc(i));return r<0?-1:Atomics.load(s.i32,r*(32/4)+0)===2?r:-1}function No(e,t,s,i){let r=go(e),o=t*(32/4),a=t*(32/8)+3,c=t*r.entryBytes;for(let E=0;E<64;E+=1){let _=Atomics.load(r.i32,o+1);if(_&1)continue;if(Atomics.load(r.i32,o+0)!==2)return-1;let I=r.f64[a],m=Atomics.load(r.i32,o+4),A;if(i>=I)A=0;else{let T=Math.min(s.length,I-i);i+T>m?A=-1:(s.set(r.data.subarray(c+i,c+i+T),0),A=T)}if(Atomics.load(r.i32,o+1)===_)return A}return-1}function Do(e=[\"/h.fsh\"]){let t=Array.from(e,String);return s=>{let i=String(s);for(let r of t)if(i.endsWith(r)||i===r.replace(/^\\//,\"\"))return!0;return!1}}var Qc=\"flatsql-io\",gt=Object.freeze({open:1,read:2,write:3,truncate:4,sync:5,size:6,close:7,mirrorRead:8}),Lo=24,Co=16777215;function ki(){return typeof performance<\"u\"&&performance.now?performance.now()*1e3:Date.now()*1e3}function zc(e){if(!e?.buffer)return null;let t=new Int32Array(e.buffer,0,4),s=t[1],i=new Float64Array(e.buffer,16,s),r=new Uint8Array(e.buffer,16+s*8,s);return(o,a)=>{let c=Atomics.add(t,0,1);c<s&&(i[c]=ki()-a,r[c]=o)}}function Xc(e,t,s){if(!e||s<=0||s>Be||t<0)return null;let i=e.buffer??e;return t+s>i.byteLength?null:new Uint8Array(i,t,s).slice()}function Jc(e={}){let t=e.getMemory;if(typeof t!=\"function\")throw new TypeError(\"createFlatsqlIoImports requires getMemory().\");let s=Array.isArray(e.provider)?e.provider:[e.provider];if(s.length===0||s.some(A=>!A||typeof A.open!=\"function\"))throw new TypeError(\"createFlatsqlIoImports requires at least one provider.\");if(s.length>127)throw new RangeError(\"At most 127 providers can be routed.\");let i=s.length>1,r=zc(e.trace),o=e.mirror?.buffer??null,a=o?Do(e.mirror.suffixes??[\"/h.fsh\"]):null,c=new Map,E=new TextDecoder;function _(A){if(!i)return{provider:s[0],local:A};let T=A>>>Lo,w=s[T];return w?{provider:w,local:A&Co}:null}function I(A,T,w){let d=r?ki():0,S;try{S=w()}catch{S=T}return r&&r(A,d),S}return{env:{flatsql_io_open(A,T,w){return I(gt.open,-1,()=>{let d=Xc(t(),A,T);if(!d)return-1;let S=i?ho(d)%s.length:0,b=s[S].open(d,w|0);if(b<0)return b;if(i&&b>Co)return-4;let y=i?S<<Lo|b:b;if(a){let g=E.decode(d);a(g)&&c.set(y,g)}return y})},flatsql_io_read(A,T,w,d){if(o&&c.has(A)){let S=r?ki():0;try{let b=t(),y=b.buffer??b;if(T>=0&&w>=0&&T+w<=y.byteLength){let g=yo(o,c.get(A));if(g>=0){let M=No(o,g,new Uint8Array(y,T,w),d);if(M>=0)return r&&r(gt.mirrorRead,S),M}}}catch{}}return I(gt.read,-4,()=>{let S=_(A);return S?S.provider.read(S.local,T,w,d):-6})},flatsql_io_write(A,T,w,d){return I(gt.write,-4,()=>{let S=_(A);return S?S.provider.write(S.local,T,w,d):-6})},flatsql_io_truncate(A,T){return I(gt.truncate,-4,()=>{let w=_(A);return w?w.provider.truncate(w.local,T):-6})},flatsql_io_sync(A){return I(gt.sync,-4,()=>{let T=_(A);return T?T.provider.sync(T.local):-6})},flatsql_io_size(A){return I(gt.size,-4,()=>{let T=_(A);return T?T.provider.size(T.local):-6})},flatsql_io_close(A){return I(gt.close,-4,()=>{c.delete(A);let T=_(A);return T?T.provider.close(T.local):-6})}}}}function tu(e,{getMemory:t}){let s=Array.isArray(e.channels)?e.channels:[e.channel??e.buffer];if(s.length===0||s.some(o=>!(o instanceof SharedArrayBuffer)))throw new TypeError(\"A flatsql-io descriptor needs channels: SharedArrayBuffer[].\");let i=s.map(o=>Oo({buffer:o,instanceId:e.instanceId,getMemory:t}));return{imports:Jc({getMemory:t,provider:i,mirror:e.mirror,trace:e.trace}),close(){for(let o of i)o.release()}}}function Po(e,t){let s=[],i=[];for(let r of e??[]){let o;if(typeof r==\"function\")o=r(t);else if(r&&r.provider===Qc)o=tu(r,t);else if(r&&typeof r.factory==\"function\")o=r.factory({...t,config:r.config});else throw new TypeError(`Unresolvable extraImports entry ${JSON.stringify(r?.provider??r?.moduleUrl??typeof r)}; pass a factory function, a { provider: \"flatsql-io\" } descriptor, or (module workers) a { moduleUrl } descriptor.`);o&&o.imports&&typeof o.close==\"function\"?(s.push(o.imports),i.push(o.close)):o&&s.push(o)}return{fragments:s,close(){for(let r of i)try{r()}catch{}}}}function Uo(e,t){for(let s of t)for(let[i,r]of Object.entries(s??{}))e[i]={...e[i]??{},...r};return e}var ue=0,eu=1,su=2,vo=4,Yi=0,Ho=1;var iu=0;var qi=vo*4,ru=4*1024*1024;function nu(e){if(typeof SharedArrayBuffer!=\"function\"||!(e instanceof SharedArrayBuffer))throw new TypeError(\"SAB hostcall channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function Mo(e={}){if(typeof SharedArrayBuffer!=\"function\")throw new Error(\"SharedArrayBuffer is unavailable; the async hostcall bridge requires it (browsers additionally require cross-origin isolation: COOP+COEP).\");let t=Number.isInteger(e.maxResponseBytes)?e.maxResponseBytes:ru;if(t<=0)throw new RangeError(\"maxResponseBytes must be a positive integer.\");return new SharedArrayBuffer(qi+t)}function Bo(e={}){nu(e.buffer);let t=e.postRequest;if(typeof t!=\"function\")throw new TypeError(\"createSabHostcallClientDispatch requires a postRequest function.\");let s=Number.isFinite(e.timeoutMs)&&e.timeoutMs>0?e.timeoutMs:12e4,i=new Int32Array(e.buffer,0,vo),r=e.buffer.byteLength-qi;return function(a,c=null){if(Atomics.store(i,ue,Ho),t({operation:a,params:c}),Atomics.wait(i,ue,Ho,s)===\"timed-out\")throw Atomics.store(i,ue,Yi),new Error(`Hostcall \"${a}\" timed out after ${s}ms waiting for the controlling thread.`);let _=Atomics.load(i,eu),I=Atomics.load(i,su);if(I<0||I>r)throw Atomics.store(i,ue,Yi),new RangeError(`Hostcall \"${a}\" response length ${I} exceeds channel capacity ${r}.`);let m=new Uint8Array(I);m.set(new Uint8Array(e.buffer,qi,I)),Atomics.store(i,ue,Yi);let A=zi(m);if(_!==iu){let T=new Error(A?.message??`Hostcall \"${a}\" failed on the host thread.`);throw T.name=A?.name??\"Error\",T.code=A?.code??null,T.operation=A?.operation??a,T.capability=A?.capability??null,A?.hostcallCode&&(T.hostcallCode=A.hostcallCode),T}return A}}var ji=class extends Error{constructor(t){super(`WASI exit with code ${t}`),this.name=\"WasiExitError\",this.code=t}};function ou(e,t,s,i){for(;;){let r=Atomics.load(e,t);if(s>i-r)return-1;if(Atomics.compareExchange(e,t,r,r+s)===r)return r}}function Fo(e={}){let t=e.processState,s=t?.args??e.args??[],i=t?.env??e.env??{},r=t?.input??new Uint8Array(e.stdinBytes??[]),o=e.logOutput===!0,a=e.performance??globalThis.performance??{now:()=>Date.now(),timeOrigin:0},c=e.crypto??globalThis.crypto??null,E=[],_=[],I=0,m=null;function A(O){m=O}function T(){return m}function w(){return new Uint8Array(m.buffer)}function d(){return new DataView(m.buffer)}let b=Object.entries(i).map(([O,N])=>`${O}=${N}`).map(O=>new TextEncoder().encode(O)),y=s.map(O=>new TextEncoder().encode(O));function g(O,N,D){let v;if(O===0)v=BigInt(Math.round((a.timeOrigin+a.now())*1e6));else if(O===1)v=BigInt(Math.round(a.now()*1e6));else return 28;return d().setBigUint64(D,v,!0),0}function M(O,N,D,v){if(O!==1&&O!==2)return 8;let P=O===1?E:_,k=0,Pt=d(),Ut=w();for(let Ht=0;Ht<D;Ht++){let pe=N+Ht*8,yt=Pt.getUint32(pe,!0),q=Pt.getUint32(pe+4,!0);if(t){let lt=O===1?t.stdout:t.stderr,Qi=ou(t.control,O,q,lt.length);if(Qi<0)return 51;lt.set(Ut.subarray(yt,yt+q),Qi)}else P.push(Ut.slice(yt,yt+q));k+=q}return Pt.setUint32(v,k,!0),0}function K(O,N,D,v){if(O!==0)return d().setUint32(v,0,!0),8;let P=d(),k=w(),Pt=0;for(let Ut=0;Ut<D;Ut+=1){let Ht=N+Ut*8,pe=P.getUint32(Ht,!0),yt=P.getUint32(Ht+4,!0),q,lt;if(t)do q=Atomics.load(t.control,0),lt=Math.min(yt,r.length-q);while(Atomics.compareExchange(t.control,0,q,q+lt)!==q);else q=I,lt=Math.min(yt,r.length-q),I+=lt;if(lt===0){if(q>=r.length)break;continue}k.set(r.subarray(q,q+lt),pe),Pt+=lt}return P.setUint32(v,Pt,!0),0}function F(O){return O<=2?0:8}function wt(O,N,D,v){return O<=2?70:8}function Zo(O,N){if(O>2)return 8;let D=d();return D.setUint8(N,2),D.setUint16(N+2,0,!0),D.setBigUint64(N+8,0n,!0),D.setBigUint64(N+16,0n,!0),0}function Qo(O,N){return O<=2?0:8}function zo(O,N){return 8}function Xo(O,N,D){return 8}function Jo(){return 8}function ta(O,N){let D=d();D.setUint32(O,b.length,!0);let v=0;for(let P of b)v+=P.length+1;return D.setUint32(N,v,!0),0}function ea(O,N){let D=d(),v=w(),P=N;for(let k=0;k<b.length;k++)D.setUint32(O+k*4,P,!0),v.set(b[k],P),P+=b[k].length,v[P]=0,P+=1;return 0}function sa(O,N){let D=d();D.setUint32(O,y.length,!0);let v=0;for(let P of y)v+=P.length+1;return D.setUint32(N,v,!0),0}function ia(O,N){let D=d(),v=w(),P=N;for(let k=0;k<y.length;k++)D.setUint32(O+k*4,P,!0),v.set(y[k],P),P+=y[k].length,v[P]=0,P+=1;return 0}function ra(O,N){if(!c?.getRandomValues)return 52;let D=new Uint8Array(N);return c.getRandomValues(D),w().set(D,O),0}function na(O){throw t&&(Atomics.store(t.control,4,O),Atomics.store(t.control,3,1)),o&&Zi(),new ji(O)}function oa(){return 0}function Zi(){if(E.length>0){let O=de(E);if(o){let N=new TextDecoder().decode(O);N&&console.log(N)}E.length=0}if(_.length>0){let O=de(_);if(o){let N=new TextDecoder().decode(O);N&&console.warn(N)}_.length=0}}function de(O){let N=0;for(let P of O)N+=P.length;let D=new Uint8Array(N),v=0;for(let P of O)D.set(P,v),v+=P.length;return D}return{imports:{wasi_snapshot_preview1:{clock_time_get:g,fd_write:M,fd_read:K,fd_close:F,fd_seek:wt,fd_fdstat_get:Zo,fd_fdstat_set_flags:Qo,fd_prestat_get:zo,fd_prestat_dir_name:Xo,path_open:Jo,environ_sizes_get:ta,environ_get:ea,args_sizes_get:sa,args_get:ia,random_get:ra,proc_exit:na,sched_yield:oa}},setMemory:A,getMemory:T,flushOutput:Zi,get stdout(){return t?t.stdout.slice(0,Atomics.load(t.control,1)):de(E)},get stderr(){return t?t.stderr.slice(0,Atomics.load(t.control,2)):de(_)}}}var au=\"sdm.thread-hostcall\";function fu(e){return WebAssembly.Module.imports(e).some(t=>t.module===Vi)}function hu(e){if(!e||typeof e!=\"object\")throw new Error(\"A threaded guest that imports space_data_module_host requires an owning hostcall channel.\");let t=String(e.channelName??\"\").trim(),s=String(e.token??\"\").trim();if(!t||!s)throw new Error(\"The owning thread-hostcall channel name and token are required.\");if(typeof BroadcastChannel!=\"function\")throw new Error(\"BroadcastChannel is required for nested pthread hostcalls.\");let i=Mo({maxResponseBytes:e.maxResponseBytes}),r=new BroadcastChannel(t),o=1;return{dispatch:Bo({buffer:i,timeoutMs:e.timeoutMs,postRequest(c){r.postMessage({type:au,token:s,requestId:o++,buffer:i,...c})}}),close(){r.close()}}}function Vo({wasmModule:e,memory:t,hostcallChannel:s,processState:i,extraImports:r,workerIndex:o,tid:a,threadSpawn:c}={}){let E=Fo({processState:i});E.setMemory(t);let _=null,I=null,m={...E.imports,env:{memory:t},wasi:{\"thread-spawn\":typeof c==\"function\"?c:()=>-1}};if(fu(e)){I=hu(s);let T=fo({dispatch:I.dispatch,getMemory:()=>_?.exports?.memory??t});Object.assign(m,T.imports)}let A=Po(r,{memory:t,getMemory:()=>_?.exports?.memory??t,workerIndex:o??null,tid:a??null});return Uo(m,A.fragments),m.env.memory=t,{imports:m,instantiate(){return _=new WebAssembly.Instance(e,m),E.setMemory(_.exports.memory??t),_},close(){I?.close(),A.close()}}}async function xo(e){let t=[];for(let s of e??[])if(s&&typeof s.moduleUrl==\"string\"){let r=(await import(s.moduleUrl))[s.exportName??\"default\"];if(typeof r!=\"function\")throw new TypeError(`extraImports module ${s.moduleUrl} exports no factory \"${s.exportName??\"default\"}\".`);t.push({factory:r,config:s.config??null})}else t.push(s);return t}var cu=Object.freeze({PENDING:0,IDLE:1,CLAIMED:2,ASSIGNED:3,RUNNING:4,RETIRED:5}),{PENDING:Q_,IDLE:le,CLAIMED:Go,ASSIGNED:Ee,RUNNING:Ge,RETIRED:Wi}=cu,ke=0,uu=1,lu=2,Eu=3,_u=4,xe=5,du=6,pu=8,Iu=8,J=0,$i=1,qo=2,ko=3,Su=4,Yo=1,Au=536870911,bu=2;var ot=e=>pu+Iu*e;function Ki(){return typeof performance<\"u\"&&typeof performance.now==\"function\"?performance.now():Date.now()}function Ye(e){Atomics.add(e,ke,1),Atomics.notify(e,ke)}function Ru(e,t,s){Atomics.store(e,ot(t)+J,s),Atomics.notify(e,ot(t)+J),Ye(e)}function jo(e,t){Ru(e.control,t,Wi)}function wu(e,t,s){let{control:i}=e,r=ot(t);for(;;){let o=Atomics.load(i,r+J);if(o!==Ee&&o!==Ge||Atomics.load(i,r+$i)!==s)return!1;if(Atomics.compareExchange(i,r+J,o,le)===o)return Ye(i),!0}}function Tu(e,t){let{control:s}=e,i=ot(t);return Atomics.compareExchange(s,i+J,Ee,Ge)!==Ee?null:{tid:Atomics.load(s,i+$i),startArg:Atomics.load(s,i+qo)}}function Ou(e,t){let{control:s}=e;Atomics.compareExchange(s,ot(t)+J,Ge,le)===Ge&&Ye(s)}function Ko(e,t,{runThread:s,osThreadId:i=0}){let{control:r}=e,o=ot(t)+J;for(i&&Atomics.store(r,ot(t)+Su,i);;){let a=Atomics.load(r,o);if(a===Wi)return;if(a!==Ee){Atomics.wait(r,o,a);continue}let c=Tu(e,t);if(c){if(s(c.tid,c.startArg)===!1){jo(e,t);return}Ou(e,t)}}}function Wo(e,{owner:t=!1,grow:s=null,dispatchMessage:i=null}={}){let{control:r,spawnWaitMs:o}=e,a=Atomics.load(r,du),c=null,E=!0,_=w=>t||(Atomics.load(r,ot(w)+ko)&Yo)===0,I=()=>{let w=Math.min(Atomics.load(r,xe),a),d=0;for(let S=0;S<w;S+=1)if(_(S)){if(Atomics.compareExchange(r,ot(S)+J,le,Go)===le)return{slot:S,live:d+1};Atomics.load(r,ot(S)+J)!==Wi&&(d+=1)}return{slot:-1,live:d}},m=()=>{for(;;){let w=Atomics.load(r,xe);if(w>=a)return-1;if(Atomics.compareExchange(r,xe,w,w+1)===w)return Atomics.store(r,ot(w)+J,Go),w}},A=()=>{let w=m();if(w<0)return{slot:-1,reason:null};try{return s(w),{slot:w,reason:null}}catch{return jo(e,w),{slot:-1,reason:\"worker-create-failed\"}}},T=()=>{let w=I();if(w.slot>=0)return{slot:w.slot,waited:!1,reason:null};let d=typeof s==\"function\",S=Ki(),b=S+(E?o:0),y=S+(E?Math.min(bu,o):0),g=!1;for(;;){let M=Atomics.load(r,ke);if(w=I(),w.slot>=0)return{slot:w.slot,waited:g,reason:null};let K=d&&Math.min(Atomics.load(r,xe),a)<a;if(K&&(w.live===0||Ki()>=y)){let wt=A();if(wt.slot>=0||wt.reason)return{...wt,waited:g};continue}if(w.live===0)return{slot:-1,waited:g,reason:\"pool-exhausted\"};if(M===c&&!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};let F=(K?y:b)-Ki();if(!K&&F<=0)return c=M,{slot:-1,waited:g,reason:\"pool-exhausted\"};if(F>0){try{Atomics.wait(r,ke,M,F)}catch{if(E=!1,!K)return{slot:-1,waited:g,reason:\"pool-exhausted\"};y=0;continue}g=!0}}};return w=>{let d=T();if(d.slot<0)return d.reason===\"pool-exhausted\"&&Atomics.add(r,_u,1),{tid:-1,slot:-1,reason:d.reason};let{slot:S}=d,b=ot(S),y=Atomics.add(r,uu,1);if(y>Au)return Atomics.store(r,b+J,le),Ye(r),{tid:-1,slot:-1,reason:\"tid-exhausted\"};if(Atomics.store(r,b+$i,y),Atomics.store(r,b+qo,w|0),Atomics.store(r,b+J,Ee),(Atomics.load(r,b+ko)&Yo)!==0)try{i(S,y,w)}catch{return wu(e,S,y),{tid:-1,slot:-1,reason:\"dispatch-failed\"}}else Atomics.notify(r,b+J);return Atomics.add(r,lu,1),d.waited&&Atomics.add(r,Eu,1),{tid:y,slot:S,reason:null}}}var _e=null;function $o(e,t){try{return _e.instantiate().exports.wasi_thread_start(e,t),!0}catch(s){return s&&s.name===\"WasiExitError\"?!0:(console.error(`[wasi-thread] guest thread ${e} trapped:`,s),self.postMessage({t:\"error\",tid:e,error:String(s?.message??s)}),!1)}}self.onmessage=async e=>{let t=e.data??{};if(t.t===\"probe\"){let s=t.pool??null;try{let i=await xo(t.extraImports??[]),r=s?Wo(s):null;_e=Vo({wasmModule:t.wasmModule,memory:t.memory,hostcallChannel:t.hostcallChannel??null,processState:t.processState,extraImports:i,workerIndex:t.workerIndex,threadSpawn:r?o=>r(o).tid:void 0}),_e.instantiate(),self.postMessage({t:\"ready\",ok:!0,protocol:2})}catch(i){_e?.close(),_e=null,self.postMessage({t:\"ready\",ok:!1,error:String(i?.message??i)});return}s&&Ko(s,t.slot,{runThread:$o});return}t.t===\"run\"&&($o(t.tid,t.startArg),self.postMessage({t:\"exit\",tid:t.tid}))};})();\n";
7
+ export const WASI_THREAD_POOL_WORKER_BUNDLE_SHA256 = "4ba02d86c6244b3fe88a27b76da10b8b760b6b3ec75ea58657e39be927e67323";
8
8
 
9
9
  /** src/host/opfsIoWorker.mjs, sha256 9b5cf50741217bd829e7f1ee4cbdbf3e6b6b8ecc20a700501adf0faf9ee429b1. */
10
10
  export const FLATSQL_IO_WORKER_BUNDLE = "(()=>{var Nn=Object.freeze({READ:1,WRITE:2,CREATE:4,EXCL:8,TRUNC:16,DELETE_ON_CLOSE:32,PROBE:64,UNLINK:128,CREATE_PARENTS:256,UNLINK_IF_UNUSED:512,OPEN_DEFERRED:1024}),Cn=Object.freeze({OK:0,GENERIC:-1,NOENT:-2,ACCESS:-3,IO:-4,NOSPACE:-5,BADHANDLE:-6,BUSY:-7});var Fn=Object.freeze([\"flatsql_io_open\",\"flatsql_io_read\",\"flatsql_io_write\",\"flatsql_io_truncate\",\"flatsql_io_sync\",\"flatsql_io_size\",\"flatsql_io_close\"]),Ye=4096;function vt(t,{during:n}={}){if(!t)return-1;let r=typeof t.code==\"string\"?t.code:null;if(r)switch(r){case\"ENOENT\":case\"ENOTDIR\":return-2;case\"EACCES\":case\"EPERM\":case\"EROFS\":return-3;case\"ENOSPC\":case\"EDQUOT\":return-5;case\"EBADF\":return-4;case\"EEXIST\":return-1;case\"EBUSY\":case\"ETXTBSY\":return-7;case\"ENAMETOOLONG\":case\"EINVAL\":return-1;default:return-4}switch(t.name){case\"NotFoundError\":return-2;case\"NoModificationAllowedError\":return-7;case\"InvalidStateError\":return n===\"open\"?-7:-6;case\"QuotaExceededError\":return-5;case\"TypeMismatchError\":case\"SecurityError\":case\"NotAllowedError\":return-3;case\"InvalidModificationError\":return-7;case\"TypeError\":case\"RangeError\":return-1;default:return-4}}var N=class extends Error{constructor(n,r){super(r??`flatsql_io status ${n}`),this.name=\"FlatsqlIoStatusError\",this.status=n}};function V(t,n){return t&&typeof t.status==\"number\"&&t.status<0?t.status:vt(t,n)}function oe(t){if(typeof t!=\"string\"||t.length===0||t.includes(\"\\0\"))return-1;let n=[];for(let r of t.split(\"/\"))if(!(r===\"\"||r===\".\")){if(r===\"..\")return-3;n.push(r)}return n.length===0?-1:n}var Ve=typeof TextDecoder==\"function\"?new TextDecoder(\"utf-8\",{fatal:!0}):null;function Ge(t){if(!Ve||t.length===0||t.length>Ye)return-1;let n=t.buffer instanceof ArrayBuffer?t:new Uint8Array(t);try{return Ve.decode(n)}catch{return-1}}var Vt=1330201683,Yt=1,Gt=0,qt=1,Wt=2,$t=3,Kt=4,H=5,Ie=6,We=7,$e=8;var Xt=11,Ke=12,zt=13,Xe=64,qe=Xe*4;var ze=1,Ze=2;var se=0,Oe=1,Je=0,ae=1,ie=2,ce=3,je=32767,G=0;var Zt=2,Jt=3,et=4,tt=5,nt=6,rt=7,ot=8,st=9,at=10,jt=11,en=12,it=13,ct=8,tn=9,de=128;var _e=2,_t=3,nn=4;var rn=1;var ft=1,pe=1,fe=2,he=3,Re=4,Te=5,me=6,Le=7;var Mn=64*1024;function on(t,n){return Math.ceil(t/n)*n}function sn(t){if(typeof SharedArrayBuffer!=\"function\"||!(t instanceof SharedArrayBuffer))throw new TypeError(\"The SAB I/O channel requires a SharedArrayBuffer (cross-origin isolation in browsers).\")}function lt(t){sn(t);let n=new Int32Array(t,0,Xe);if(n[Gt]!==Vt||n[qt]!==Yt)throw new TypeError(\"Not a SAB I/O channel buffer (bad magic or version).\");let r=n[Wt],s=n[$t],f=n[Kt],a=n[Xt],l=on(qe+f*4,64),L=new Int32Array(t,qe,f),S=[];for(let p=0;p<r;p+=1){let T=l+p*s;S.push({index:p,base:T,i32:new Int32Array(t,T,de/4),f64:new Float64Array(t,T,de/8),data:new Uint8Array(t,T+de,a)})}return{buffer:t,header:n,instances:L,slots:S,slotCount:r,slotBytes:s,dataBytes:a,maxInstances:f,channelId:n[zt]}}function ut(t){return`sdm-sab-io-doorbell-${t}`}function an(t){return`sdm-sab-io-done-${t}`}var Qn=typeof TextEncoder==\"function\"?new TextEncoder:null;var Y=null;function cn(t){return typeof BroadcastChannel!=\"function\"?null:((!Y||Y.id!==t.channelId)&&(Y?.channel.close(),Y={id:t.channelId,channel:new BroadcastChannel(an(t.channelId))}),Y.channel)}function Et(t,n,r,s=0){n.f64[tn]=s,Atomics.store(n.i32,jt,r|0),Atomics.store(n.i32,Jt,Atomics.load(n.i32,Zt)),Atomics.store(n.i32,G,nn),Atomics.notify(n.i32,G),Atomics.load(n.i32,en)===rn&&cn(t)?.postMessage(n.index)}var _n=typeof TextEncoder==\"function\"?new TextEncoder:null;function St(t){let n=2166136261;for(let r=0;r<t.length;r+=1)n^=t[r],n=Math.imul(n,16777619);return n|0}var At=new WeakMap;function ye(t){let n=At.get(t);if(n)return n;let r=new Int32Array(t,0,16);if(r[0]!==1380795475||r[1]!==1)throw new TypeError(\"Not a SAB I/O mirror buffer.\");let s=r[2],f=r[3],a=r[4],l=64,L=l+s*32,S=L+s*a;return n={entries:s,entryBytes:f,maxPathBytes:a,i32:new Int32Array(t,l,s*32/4),f64:new Float64Array(t,l,s*32/8),paths:new Uint8Array(t,L,s*a),data:new Uint8Array(t,S,s*f)},At.set(t,n),n}function dt(t){return ye(t).entryBytes}function It(t){return typeof t==\"string\"?_n.encode(t):t}function fn(t,n,r){let s=n*8;if(Atomics.load(t.i32,s+3)!==r.length)return!1;let f=n*t.maxPathBytes;for(let a=0;a<r.length;a+=1)if(t.paths[f+a]!==r[a])return!1;return!0}function Ot(t,n,r){let s=(r>>>0)%t.entries;for(let f=0;f<t.entries;f+=1){let a=s*8,l=Atomics.load(t.i32,a+0);if(l===0)return-1;if((l===2||l===3)&&Atomics.load(t.i32,a+2)===r&&fn(t,s,n))return s;s=(s+1)%t.entries}return-1}function ln(t,n,r){let s=(r>>>0)%t.entries;for(let f=0;f<t.entries;f+=1){let a=s*8;if(Atomics.compareExchange(t.i32,a+0,0,1)===0)return t.paths.set(n,s*t.maxPathBytes),Atomics.store(t.i32,a+3,n.length),Atomics.store(t.i32,a+2,r),Atomics.store(t.i32,a+4,0),t.f64[s*(32/8)+3]=0,Atomics.store(t.i32,a+0,3),s;s=(s+1)%t.entries}return-1}function W(t,n,r,s,{truncateTo:f}={}){let a=ye(t),l=It(n);if(l.length>a.maxPathBytes)return!1;let L=St(l),S=Ot(a,l,L);if(S<0&&(S=ln(a,l,L)),S<0)return!1;let p=S*(32/4),T=S*(32/8)+3,A=S*a.entryBytes,c=Atomics.load(a.i32,p+0)===2;Atomics.add(a.i32,p+1,1);let E=c?a.f64[T]:0,d=c?Atomics.load(a.i32,p+4):0;if(c||a.data.fill(0,A,A+a.entryBytes),s.length>0&&r<a.entryBytes){let m=Math.min(a.entryBytes,r+s.length);r>d&&a.data.fill(0,A+d,A+r),a.data.set(s.subarray(0,m-r),A+r)}return s.length>0&&(E=Math.max(E,r+s.length)),f!==void 0&&(f<d&&a.data.fill(0,A+f,A+d),E=f),d=Math.min(E,a.entryBytes),a.f64[T]=E,Atomics.store(a.i32,p+4,d),Atomics.store(a.i32,p+0,2),Atomics.add(a.i32,p+1,1),!0}function we(t,n){let r=ye(t),s=It(n);if(s.length>r.maxPathBytes)return;let f=Ot(r,s,St(s));if(f<0)return;let a=f*(32/4);Atomics.add(r.i32,a+1,1),Atomics.store(r.i32,a+0,3),Atomics.store(r.i32,a+4,0),r.f64[f*(32/8)+3]=0,Atomics.add(r.i32,a+1,1)}function pt(t=[\"/h.fsh\"]){let n=Array.from(t,String);return r=>{let s=String(r);for(let f of n)if(s.endsWith(f)||s===f.replace(/^\\//,\"\"))return!0;return!1}}var Ce=256*1024,dn=50,In=8,Tt=250,mt=16777215,R=0,xe=1,Lt=2;function le(){return typeof performance<\"u\"&&performance.now?performance.now():Date.now()}function On(){if(typeof MessageChannel==\"function\"){let t=new MessageChannel,n=[];return t.port1.onmessage=()=>n.shift()?.(),t.port1.unref?.(),t.port2.unref?.(),()=>new Promise(r=>{n.push(r),t.port2.postMessage(0)})}return()=>new Promise(t=>setTimeout(t,0))}function yt(t={}){let n=lt(t.buffer),r=t.backend;if(!r||typeof r.openFile!=\"function\")throw new TypeError(\"createFlatsqlIoServer requires a backend with openFile().\");let s=Number.isInteger(t.chunkBytes)&&t.chunkBytes>0?t.chunkBytes:Ce,f=t.doorbell??\"auto\",a=f===\"message\"||f===\"auto\"&&typeof Atomics.waitAsync!=\"function\"?Oe:se,l=t.mirror??null,L=Number.isFinite(t.spinMicros)?Math.max(0,t.spinMicros):dn,S=typeof t.onEvent==\"function\"?t.onEvent:null,p=On(),T=new Map,A=new Map,c=new Map,E=new Map,d=new Map,m=[],y=new Set,x=1,F=!1,g=null,D=null,U=null,J=null,j=!1,w={served:0,opens:0,deferredOpens:0,parked:0,chunks:0,busy:0,revoked:0,sharedViewsRejected:!1,maxReady:0};function v(e){if(S)try{S(e)}catch{}}function ee(){if(a===se)Atomics.add(n.header,H,1),Atomics.notify(n.header,H);else{let e=D;D=null,e?.()}}async function Ft(e){if(a===se){let o=Atomics.waitAsync(n.header,H,e,Tt);o.async&&await o.value;return}Atomics.load(n.header,H)===e&&await new Promise(o=>{let _=setTimeout(()=>{D===u&&(D=null),o()},Tt),u=()=>{clearTimeout(_),o()};D=u})}function Ae(e,o){let u=(d.get(e)??Promise.resolve()).then(o,o),i=u.then(()=>{},()=>{});return d.set(e,i),i.then(()=>{d.get(e)===i&&d.delete(e)}),u}function gt(){for(let e=0;e<mt;e+=1){let o=x;if(x=x>=mt?1:x+1,!c.has(o))return o}return-1}function te(e,o,_){let u=gt();if(u<0)return-1;let i=(_&2)!==0,O={id:u,entry:e,instanceId:o,canWrite:i,canRead:!i||(_&1)!==0};c.set(u,O),e.refs+=1,_&32&&(e.deleteOnClose=!0);let I=E.get(o);return I||(I=new Set,E.set(o,I)),I.add(u),u}function ne(e){if(!(e.refs>0||e.pins>0)){if(A.get(e.path)===e&&A.delete(e.path),e.file){try{e.file.close()}catch{}e.file=null}e.deleteOnClose&&e.openStatus===0&&Ae(e.path,async()=>{try{await r.remove(e.path,e.components)}catch{}l&&l.write!==!1&&we(l.buffer,e.path)})}}function De(e){c.delete(e.id)&&(E.get(e.instanceId)?.delete(e.id),e.entry.refs-=1,ne(e.entry))}function Dt(e){return e===je?ae:e<0||e>=n.maxInstances?-1:Atomics.load(n.instances,e)}function Se(e){let o=Dt(e);return o===ie||o===ce}function Me(e){let{slot:o,ptr:_,len:u}=e;if(u<0||_<0)return null;if(e.dataMode===ft)return _+u>o.data.length?null:o.data.subarray(_,_+u);let i=T.get(e.instanceId),O=i?.buffer??i;return!O||_+u>O.byteLength?null:new Uint8Array(O,_,u)}function Qe(e){return(!J||J.length<e)&&(J=new Uint8Array(Math.max(e,s))),J.subarray(0,e)}function Pe(e,o,_){if(!j)try{return e.read(o,{at:_})}catch(O){if(!(O instanceof TypeError)||!(o.buffer instanceof SharedArrayBuffer))throw O;j=!0,w.sharedViewsRejected=!0,v({type:\"shared-views-rejected\"})}let u=Qe(o.length),i=e.read(u,{at:_});return o.set(u.subarray(0,i),0),i}function Mt(e,o,_){if(!j)try{return e.write(o,{at:_})}catch(i){if(!(i instanceof TypeError)||!(o.buffer instanceof SharedArrayBuffer))throw i;j=!0,w.sharedViewsRejected=!0,v({type:\"shared-views-rejected\"})}let u=Qe(o.length);return u.set(o,0),e.write(u,{at:_})}function h(e,o,_=0){y.delete(e.slot.index),w.served+=1,Atomics.add(n.header,Ke,1),Et(n,e.slot,o,_)}function Qt(e){let o=e.i32;return{slot:e,op:o[et],instanceId:o[tt],handleId:o[nt],flags:o[rt],ptr:o[ot],len:o[st],dataMode:o[it],pathLen:o[at],offset:e.f64[ct],done:0,phase:0}}function He(){let e=0;for(let o of n.slots)y.has(o.index)||Atomics.load(o.i32,G)===_e&&Atomics.compareExchange(o.i32,G,_e,_t)===_e&&(y.add(o.index),m.push(Qt(o)),e+=1);return m.length>w.maxReady&&(w.maxReady=m.length),e}function Ue(){for(let e=0;e<n.maxInstances;e+=1){if(Atomics.load(n.instances,e)!==ie)continue;let o=E.get(e);if(o){for(let _ of Array.from(o)){let u=c.get(_);u&&De(u)}E.delete(e)}T.delete(e),w.revoked+=1,Atomics.store(n.instances,e,ce),Atomics.notify(n.instances,e),v({type:\"revoked\",instanceId:e})}}function re(e,o){return w.parked+=1,o.waiters.push(e),Lt}function ke(e,o,_){if(e.opening=null,e.openStatus=o,e.file=_??null,o===0&&l&&l.write!==!1&&l.match(e.path)&&e.file)try{let i=e.file.getSize(),O=new Uint8Array(Math.min(i,dt(l.buffer)));O.length>0&&Pe(e.file,O,0),W(l.buffer,e.path,0,O,{truncateTo:i})}catch{}let u=e.waiters;e.waiters=[];for(let i of u)i.op===pe&&i.phase===1&&i.entry===e&&(o<0?i.result=o:Se(i.instanceId)?i.result=-3:i.result=te(e,i.instanceId,i.flags),i.phase=2),m.push(i);o<0&&e.refs===0&&e.pins===0&&A.get(e.path)===e?A.delete(e.path):o===0&&e.refs===0&&e.pins===0&&ne(e),ee()}function be(e,o){w.opens+=1,e.opening=Ae(e.path,async()=>{try{let _=await r.openFile(e.path,e.components,o);ke(e,0,_)}catch(_){ke(e,V(_,{during:\"open\"}),null)}})}function Pt(e){if(e.phase===2)return h(e,e.result),R;if(Se(e.instanceId))return h(e,-3),R;if(e.path===void 0){let I=e.slot.data.slice(0,Math.max(0,e.pathLen)),Q=Ge(I);if(typeof Q!=\"string\")return h(e,Q),R;let P=oe(Q);if(!Array.isArray(P))return h(e,P),R;e.path=P.join(\"/\"),e.components=P}let{path:o,components:_,flags:u}=e,i=A.get(o);if(u&704)return i?.opening?re(e,i):u&64?i&&i.openStatus===0?(h(e,0),R):ve(e,async()=>await r.exists(o,_)?0:-2):i&&i.refs>0?(w.busy+=1,h(e,-7),R):(i&&i.pins>0&&(i.pins=0,ne(i)),ve(e,async()=>(await r.remove(o,_),l&&l.write!==!1&&we(l.buffer,o),0)));if(i){if(i.opening){if(u&1024){w.deferredOpens+=1;let I=te(i,e.instanceId,u);return h(e,I),R}return re(e,i)}if(i.openStatus===0){if(u&8)return h(e,-1),R;if(u&16&&u&2)try{i.file.truncate(0),l&&l.write!==!1&&l.match(o)&&W(l.buffer,o,0,new Uint8Array(0),{truncateTo:0})}catch(Q){return h(e,V(Q)),R}let I=te(i,e.instanceId,u);return h(e,I),R}A.get(o)===i&&A.delete(o)}let O={path:o,components:_,file:null,opening:null,openStatus:0,refs:0,pins:0,deleteOnClose:!1,waiters:[]};if(A.set(o,O),be(O,u),u&1024){w.deferredOpens+=1;let I=te(O,e.instanceId,u);return h(e,I),R}return e.phase=1,e.entry=O,re(e,O)}function ve(e,o){return e.phase=2,Ae(e.path,async()=>{try{e.result=await o()}catch(_){e.result=V(_)}m.push(e),ee()}),w.parked+=1,Lt}function Ht(e){if(Se(e.instanceId))return h(e,-3),R;let o=c.get(e.handleId);if(!o)return h(e,-6),R;let _=o.entry;if(_.opening)return re(e,_);if(e.op===Le)return De(o),h(e,0),R;if(_.openStatus<0||!_.file)return h(e,_.openStatus<0?_.openStatus:-6),R;let u=_.file;try{switch(e.op){case fe:{if(!o.canRead)return h(e,-4),R;let i=Me(e);if(!i)return h(e,-1),R;let O=Math.min(s,e.len-e.done),I=Pe(u,i.subarray(e.done,e.done+O),e.offset+e.done);return w.chunks+=1,e.done+=I,I<O||e.done>=e.len?(h(e,e.done),R):xe}case he:{if(!o.canWrite)return h(e,-4),R;let i=Me(e);if(!i)return h(e,-1),R;let O=Math.min(s,e.len-e.done),I=i.subarray(e.done,e.done+O),Q=e.offset+e.done,P=Mt(u,I,Q);return w.chunks+=1,l&&l.write!==!1&&l.match(_.path)&&W(l.buffer,_.path,Q,I.subarray(0,P)),e.done+=P,P<O||e.done>=e.len?(h(e,e.done),R):xe}case Re:return o.canWrite?(u.truncate(e.offset),l&&l.write!==!1&&l.match(_.path)&&W(l.buffer,_.path,0,new Uint8Array(0),{truncateTo:e.offset}),h(e,0),R):(h(e,-4),R);case Te:return u.flush(),h(e,0),R;case me:return h(e,0,u.getSize()),R;default:return h(e,-1),R}}catch(i){let O=V(i);return h(e,e.done>0&&e.op===fe?e.done:O),R}}function Ut(e){try{return e.op===pe?Pt(e):e.op===fe||e.op===he||e.op===Re||e.op===Te||e.op===me||e.op===Le?Ht(e):(h(e,-1),R)}catch(o){return v({type:\"step-error\",error:o}),h(e,-4),R}}function kt(){let e=le();for(;m.length>0;){let o=m.shift();if(Ut(o)===xe&&m.push(o),Ue(),He(),le()-e>In)return!1}return!0}async function bt(){for(Atomics.store(n.header,We,a),Atomics.add(n.header,$e,1),Atomics.store(n.header,Ie,ze);F;){let e=Atomics.load(n.header,H);Ue(),He();let o=kt();if(!F)break;if(!o||m.length>0){await p();continue}if(L>0){let _=le()+L/1e3;for(;le()<_&&Atomics.load(n.header,H)===e;);if(Atomics.load(n.header,H)!==e)continue}await Ft(e)}}return{doorbellMode:a,stats:w,start(){return F||(F=!0,a===Oe&&typeof BroadcastChannel==\"function\"&&(U=new BroadcastChannel(ut(n.channelId)),U.onmessage=()=>{let e=D;D=null,e?.()}),g=bt().catch(e=>{throw v({type:\"loop-error\",error:e}),e})),g},async stop(){F=!1,ee();try{await g}catch{}U?.close(),U=null;for(let e of A.values())try{e.file?.close()}catch{}A.clear(),c.clear(),E.clear(),Atomics.store(n.header,Ie,Ze)},attachMemory(e,o){if(!Number.isInteger(e)||e<0||e>=n.maxInstances)return!1;let _=Atomics.load(n.instances,e);return _===ie||_===ce?!1:(T.set(e,o),Atomics.store(n.instances,e,ae),!0)},detachMemory(e){T.delete(e),Atomics.load(n.instances,e)===ae&&Atomics.store(n.instances,e,Je)},async preopen(e,o=7){let _=await Promise.all(e.map(async u=>{let i=oe(String(u));if(!Array.isArray(i))return i;let O=i.join(\"/\"),I=A.get(O);return I||(I={path:O,components:i,file:null,opening:null,openStatus:0,refs:0,pins:0,deleteOnClose:!1,waiters:[]},A.set(O,I),be(I,o&-1025)),I.pins+=1,I.opening&&await I.opening,I.openStatus<0?(I.pins=Math.max(0,I.pins-1),I.openStatus):0}));return ee(),_},releasePreopen(e){for(let o of e){let _=oe(String(o));if(!Array.isArray(_))continue;let u=A.get(_.join(\"/\"));u&&u.pins>0&&(u.pins-=1,ne(u))}},inventory(){return{files:Array.from(A.values()).map(e=>({path:e.path,refs:e.refs,pins:e.pins,opening:!!e.opening,openStatus:e.openStatus})),handles:c.size}}}}var vn=263;var Fe=class{constructor(){this.bytes=new Uint8Array(0),this.length=0}ensureCapacity(n,r){if(n<=this.bytes.length)return;let s=Math.max(64,this.bytes.length);for(;s<n;)s*=2;r.reserve(s-this.bytes.length);let f=new Uint8Array(s);f.set(this.bytes.subarray(0,this.length)),this.bytes=f}};function wt(t={}){let n=Number.isFinite(t.maxBytes)?t.maxBytes:1/0,r=new Map,s=new Set([\"\"]),f=0,a={reserve(S){if(f+S>n)throw new N(-5,\"memory store budget exhausted\");f+=S},release(S){f=Math.max(0,f-S)}};function l(S){return S.slice(0,-1).join(\"/\")}function L(S){let p=!1,T=()=>{if(p){let c=new Error(\"handle closed\");throw c.name=\"InvalidStateError\",c}let A=r.get(S);if(!A){let c=new Error(\"file removed\");throw c.name=\"NotFoundError\",c}return A};return{read(A,{at:c=0}={}){let E=T();if(c>=E.length)return 0;let d=Math.min(A.length,E.length-c);return A.set(E.bytes.subarray(c,c+d),0),d},write(A,{at:c=0}={}){let E=T(),d=c+A.length;return E.ensureCapacity(d,a),c>E.length&&E.bytes.fill(0,E.length,c),E.bytes.set(A,c),d>E.length&&(E.length=d),A.length},truncate(A){let c=T();A>c.length&&(c.ensureCapacity(A,a),c.bytes.fill(0,c.length,A)),c.length=A},flush(){T()},getSize(){return T().length},close(){p=!0}}}return{kind:\"memory\",openFile(S,p,T){let A=l(p);if(!s.has(A)){if(!(T&256)||!(T&4))throw new N(-2,`no directory ${A}`);for(let E=1;E<p.length;E+=1)s.add(p.slice(0,E).join(\"/\"))}if(s.has(S))throw new N(-3,`${S} is a directory`);let c=r.get(S);if(c&&T&8)throw new N(-1,`${S} exists`);if(c)T&16&&(c.length=0);else{if(!(T&4))throw new N(-2,`no file ${S}`);c=new Fe,r.set(S,c)}return L(S)},exists(S){return r.has(S)||s.has(S)},remove(S){let p=r.get(S);if(!p)throw new N(-2,`no file ${S}`);a.release(p.bytes.length),r.delete(S)},reset(){r.clear(),s.clear(),s.add(\"\"),f=0},usage(){return{files:r.size,allocatedBytes:f}},list(){return Array.from(r.keys()).sort()}}}var Ee=\"readwrite-unsafe\";function hn(t){let n=new Error(t);return n.name=\"NotFoundError\",n}function Bt(t){return new Promise(n=>setTimeout(n,t))}async function Rn(t,n=\".sdm-mode-probe\"){let r=null,s=null;try{let f=await t.getFileHandle(n,{create:!0});return r=await f.createSyncAccessHandle({mode:Ee}),r.mode!==Ee?{supported:!1,detail:\"mode option ignored\"}:(s=await f.createSyncAccessHandle({mode:Ee}),{supported:!0,detail:\"two readwrite-unsafe handles\"})}catch(f){return{supported:!1,detail:`${f?.name??\"Error\"}: ${f?.message??f}`}}finally{try{s?.close()}catch{}try{r?.close()}catch{}try{await t.removeEntry(n)}catch{}}}async function Tn(t,n=\".sdm-view-probe\"){let r=null;try{r=await(await t.getFileHandle(n,{create:!0})).createSyncAccessHandle();let f=new Uint8Array(new SharedArrayBuffer(16));f.fill(90);let a=r.write(f,{at:0}),l=new Uint8Array(new SharedArrayBuffer(16)),L=r.read(l,{at:0});return a===16&&L===16&&l[15]===90}catch{return!1}finally{try{r?.close()}catch{}try{await t.removeEntry(n)}catch{}}}function xt(t={}){let n=t.root??null,r=!1,s=null,f=t.handleMode??\"auto\",a=typeof t.openDelayMs==\"function\"?t.openDelayMs:null,l=new Map,L={attempts:Math.max(0,t.busyRetry?.attempts??0),baseMs:Math.max(1,t.busyRetry?.baseMs??10)};async function S(c){for(let E=0;;E+=1)try{return r?await c.createSyncAccessHandle({mode:Ee}):await c.createSyncAccessHandle()}catch(d){if(!(d?.name===\"NoModificationAllowedError\"||d?.name===\"InvalidStateError\")||E>=L.attempts)throw d;await Bt(L.baseMs*2**Math.min(E,8))}}async function p(){if(!n){if(typeof navigator>\"u\"||!navigator.storage?.getDirectory)throw new N(-1,\"OPFS is unavailable here\");if(n=await navigator.storage.getDirectory(),t.rootDirectory)for(let E of String(t.rootDirectory).split(\"/\").filter(Boolean))n=await n.getDirectoryHandle(E,{create:!0})}let c=await Rn(n);if(s=await Tn(n),f===\"shared\"&&!c.supported)throw new N(-1,`shared OPFS handle modes are unsupported here (${c.detail})`);return r=f!==\"exclusive\"&&c.supported,l.set(\"\",n),{sharedModes:r,sharedModesDetail:c.detail,sharedViews:s}}async function T(c,E){let d=c.join(\"/\"),m=l.get(d);if(m)return m;let y=n,x=\"\";for(let F of c){x=x?`${x}/${F}`:F;let g=l.get(x);if(g){y=g;continue}y=await y.getDirectoryHandle(F,{create:E}),l.set(x,y)}return y}async function A(c,E){try{return await c.getFileHandle(E)}catch(d){if(d?.name===\"NotFoundError\")return null;throw d}}return{kind:\"opfs\",init:p,get sharedModes(){return r},get sharedViews(){return s},async openFile(c,E,d){if(n||await p(),a){let U=a(c);U>0&&await Bt(U)}let m=(d&4)!==0,y=m&&(d&256)!==0,x=await T(E.slice(0,-1),y),F=E[E.length-1],g=null;if(d&8&&await A(x,F))throw new N(-1,`${c} exists`);g=await x.getFileHandle(F,{create:m});let D=await S(g);return d&16&&D.truncate(0),D},async exists(c,E){n||await p();let d;try{d=await T(E.slice(0,-1),!1)}catch(y){if(y?.name===\"NotFoundError\"||y?.name===\"TypeMismatchError\")return!1;throw y}let m=E[E.length-1];if(await A(d,m))return!0;try{return await d.getDirectoryHandle(m),!0}catch{return!1}},async remove(c,E){n||await p();let d;try{d=await T(E.slice(0,-1),!1)}catch(m){throw m?.name===\"TypeMismatchError\"?hn(c):m}await d.removeEntry(E[E.length-1])},async clear(){n||await p();for await(let c of n.keys())await n.removeEntry(c,{recursive:!0});l.clear(),l.set(\"\",n)}}}var Nt=\"node:\";var mn=typeof process<\"u\"&&!!process.release&&process.release.name===\"node\",B=null,M=null,Z=null;function Ln({name:t,ifAvailable:n=!1}){return typeof navigator>\"u\"||!navigator.locks?Promise.reject(new Error(\"Web Locks are unavailable in this context\")):new Promise((r,s)=>{navigator.locks.request(t,{mode:\"exclusive\",ifAvailable:n},f=>{if(!f){r(!1);return}return r(!0),new Promise(a=>{Z=a})}).catch(s)})}function ge(t){return`${t?.name??\"Error\"}: ${t?.message??String(t)}`}function yn(t){if(!t||!t.pattern||!(t.ms>0))return;let n=new RegExp(t.pattern);return r=>n.test(r)?t.ms:0}async function wn(t,n){let r=t.role===\"reader\"?\"reader\":\"writer\";if(t.lock?.name&&!await Ln(t.lock)){let l=new Error(`the store lock ${t.lock.name} is held by another context`);throw l.name=\"LockUnavailableError\",l}t.backend===\"memory\"?M=wt({maxBytes:t.memoryMaxBytes}):M=xt({rootDirectory:t.rootDirectory,handleMode:t.handleMode??\"auto\",openDelayMs:yn(t.openDelay),busyRetry:t.busyRetry??void 0});let s={backend:M.kind,role:r,lock:t.lock?.name??null};M.init&&Object.assign(s,await M.init());let f=t.mirror?.buffer?{buffer:t.mirror.buffer,match:pt(t.mirror.suffixes??[\"/h.fsh\"]),write:t.mirror.write??r===\"writer\"}:null;return B=yt({buffer:t.buffer,backend:M,chunkBytes:t.chunkBytes??Ce,doorbell:t.doorbell??\"auto\",mirror:f,onEvent(a){(a.type===\"loop-error\"||a.type===\"step-error\")&&n({t:\"event\",event:{type:a.type,error:ge(a.error)}})}}),s.doorbellMode=B.doorbellMode===1?\"message\":\"atomics\",B.start().catch(a=>{setTimeout(()=>{throw a},0)}),s}async function Ct(t,n){switch(t?.t){case\"init\":try{let r=await wn(t,n);n({t:\"ready\",ok:!0,info:r})}catch(r){Z?.(),Z=null,n({t:\"ready\",ok:!1,error:ge(r),lockUnavailable:r?.name===\"LockUnavailableError\"})}return;case\"attach\":n({t:\"attached\",instanceId:t.instanceId,ok:!!B?.attachMemory(t.instanceId,t.memory)});return;case\"detach\":B?.detachMemory(t.instanceId);return;case\"preopen\":{let r=B?await B.preopen(t.paths??[],t.flags):[];n({t:\"preopened\",id:t.id,statuses:r});return}case\"release-preopen\":B?.releasePreopen(t.paths??[]);return;case\"stats\":n({t:\"stats\",id:t.id,stats:B?{...B.stats}:null,inventory:B?B.inventory():null,usage:M?.usage?M.usage():null});return;case\"reset\":M?.reset?.(),n({t:\"reset\",id:t.id});return;case\"clear\":try{await M?.clear?.(),n({t:\"cleared\",id:t.id,ok:!0})}catch(r){n({t:\"cleared\",id:t.id,ok:!1,error:ge(r)})}return;case\"stop\":await B?.stop(),B=null,Z?.(),Z=null,n({t:\"stopped\",id:t.id});return;default:}}function Bn(){let t=n=>self.postMessage(n);self.onmessage=n=>{Ct(n.data,t)}}async function xn(){let t=Nt+\"worker_threads\",{parentPort:n}=await import(t);if(!n)return;let r=s=>n.postMessage(s);n.on(\"message\",s=>{Ct(s,r)})}mn?xn():typeof self<\"u\"&&typeof self.postMessage==\"function\"&&typeof window>\"u\"&&Bn();})();\n";