@dfinity/nns 0.5.0 → 0.6.0-nightly-2022-07-21

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 (105) hide show
  1. package/README.md +1 -1
  2. package/dist/candid/genesis_token.certified.idl.d.ts +2 -0
  3. package/dist/candid/genesis_token.certified.idl.js +2 -1
  4. package/dist/candid/genesis_token.d.ts +33 -0
  5. package/dist/candid/genesis_token.did +23 -22
  6. package/dist/candid/genesis_token.idl.d.ts +0 -8
  7. package/dist/candid/genesis_token.idl.js +2 -1
  8. package/dist/candid/governance.certified.idl.js +86 -33
  9. package/dist/candid/{governanceTypes.d.ts → governance.d.ts} +28 -1
  10. package/dist/candid/governance.did +26 -5
  11. package/dist/candid/governance.idl.d.ts +0 -3
  12. package/dist/candid/governance.idl.js +86 -33
  13. package/dist/candid/ledger.certified.idl.js +1 -1
  14. package/dist/candid/{ledgerTypes.d.ts → ledger.d.ts} +0 -5
  15. package/dist/candid/ledger.did +2 -2
  16. package/dist/candid/ledger.idl.d.ts +0 -3
  17. package/dist/candid/ledger.idl.js +1 -1
  18. package/dist/candid/sns_wasm.certified.idl.d.ts +2 -0
  19. package/dist/candid/sns_wasm.certified.idl.js +117 -0
  20. package/dist/candid/sns_wasm.d.ts +106 -0
  21. package/dist/candid/sns_wasm.did +76 -0
  22. package/dist/candid/sns_wasm.idl.d.ts +2 -0
  23. package/dist/candid/sns_wasm.idl.js +117 -0
  24. package/dist/cjs/index.cjs.js +32 -32
  25. package/dist/cjs/index.cjs.js.map +3 -3
  26. package/dist/esm/account_identifier.js +1 -1
  27. package/dist/esm/chunk-CKIW7YKS.js +2 -0
  28. package/dist/esm/chunk-CKIW7YKS.js.map +7 -0
  29. package/dist/esm/{chunk-S37GZOMR.js → chunk-FZGMZSQZ.js} +3 -3
  30. package/dist/esm/chunk-FZGMZSQZ.js.map +7 -0
  31. package/dist/esm/chunk-H6I2Z4SN.js +7 -0
  32. package/dist/esm/chunk-H6I2Z4SN.js.map +7 -0
  33. package/dist/esm/{chunk-FL7E4DL3.js → chunk-IPUXUCZB.js} +2 -2
  34. package/dist/esm/chunk-IPUXUCZB.js.map +7 -0
  35. package/dist/esm/chunk-JUIC5FZJ.js +2 -0
  36. package/dist/esm/chunk-JUIC5FZJ.js.map +7 -0
  37. package/dist/esm/chunk-MGC7CRB4.js +11 -0
  38. package/dist/esm/chunk-MGC7CRB4.js.map +7 -0
  39. package/dist/esm/chunk-NN3MUNHF.js +2 -0
  40. package/dist/esm/chunk-NN3MUNHF.js.map +7 -0
  41. package/dist/esm/chunk-NNJFBVJ3.js +831 -0
  42. package/dist/esm/{chunk-EDMSX7GK.js.map → chunk-NNJFBVJ3.js.map} +3 -3
  43. package/dist/esm/{chunk-MTPVFXPH.js → chunk-RHCXRQFK.js} +2 -2
  44. package/dist/esm/{chunk-MTPVFXPH.js.map → chunk-RHCXRQFK.js.map} +1 -1
  45. package/dist/esm/chunk-TLWRX3CX.js +9 -0
  46. package/dist/esm/chunk-TLWRX3CX.js.map +7 -0
  47. package/dist/esm/genesis_token.canister.js +2 -0
  48. package/dist/esm/{genesis_token.js.map → genesis_token.canister.js.map} +0 -0
  49. package/dist/esm/governance.canister.js +2 -0
  50. package/dist/esm/{governance.js.map → governance.canister.js.map} +0 -0
  51. package/dist/esm/icp.js +1 -1
  52. package/dist/esm/index.js +1 -1
  53. package/dist/esm/index.js.map +1 -1
  54. package/dist/esm/ledger.canister.js +2 -0
  55. package/dist/esm/{ledger.js.map → ledger.canister.js.map} +0 -0
  56. package/dist/esm/sns_wasm.canister.js +2 -0
  57. package/dist/esm/sns_wasm.canister.js.map +7 -0
  58. package/dist/proto/governance.proto +2 -0
  59. package/dist/proto/governance_pb.d.ts +7 -0
  60. package/dist/proto/governance_pb.js +57 -2
  61. package/dist/types/account_identifier.d.ts +3 -1
  62. package/dist/types/canisters/governance/request.converters.d.ts +4 -3
  63. package/dist/types/canisters/governance/request.proto.converters.d.ts +2 -2
  64. package/dist/types/canisters/governance/response.converters.d.ts +12 -5
  65. package/dist/types/canisters/governance/services.d.ts +1 -2
  66. package/dist/types/canisters/ledger/ledger.request.converts.d.ts +2 -2
  67. package/dist/types/constants/canister_ids.d.ts +1 -0
  68. package/dist/types/errors/governance.errors.d.ts +2 -2
  69. package/dist/types/errors/ledger.errors.d.ts +2 -2
  70. package/dist/types/genesis_token.canister.d.ts +11 -0
  71. package/dist/types/{governance.d.ts → governance.canister.d.ts} +11 -5
  72. package/dist/types/index.d.ts +8 -5
  73. package/dist/types/{ledger.d.ts → ledger.canister.d.ts} +4 -4
  74. package/dist/types/sns_wasm.canister.d.ts +11 -0
  75. package/dist/types/types/canister.options.d.ts +8 -0
  76. package/dist/types/types/governance.options.d.ts +5 -0
  77. package/dist/types/types/governance_converters.d.ts +22 -5
  78. package/dist/types/types/ledger.options.d.ts +15 -0
  79. package/dist/types/types/ledger_converters.d.ts +3 -3
  80. package/dist/types/types/sns_wasm.options.d.ts +3 -0
  81. package/dist/types/utils/account_identifier.utils.d.ts +2 -2
  82. package/dist/types/utils/actor.utils.d.ts +14 -0
  83. package/dist/types/utils/agent.utils.d.ts +1 -1
  84. package/dist/types/utils/did.utils.d.ts +1 -0
  85. package/dist/types/utils/proto.utils.d.ts +2 -2
  86. package/package.json +10 -36
  87. package/dist/esm/chunk-BDJ6FQPO.js +0 -2
  88. package/dist/esm/chunk-BDJ6FQPO.js.map +0 -7
  89. package/dist/esm/chunk-C2ZTAHQL.js +0 -3
  90. package/dist/esm/chunk-C2ZTAHQL.js.map +0 -7
  91. package/dist/esm/chunk-CVYDMRZA.js +0 -7
  92. package/dist/esm/chunk-CVYDMRZA.js.map +0 -7
  93. package/dist/esm/chunk-EDMSX7GK.js +0 -831
  94. package/dist/esm/chunk-FL7E4DL3.js.map +0 -7
  95. package/dist/esm/chunk-KXYKDST6.js +0 -17
  96. package/dist/esm/chunk-KXYKDST6.js.map +0 -7
  97. package/dist/esm/chunk-S37GZOMR.js.map +0 -7
  98. package/dist/esm/chunk-SOPGOKKH.js +0 -2
  99. package/dist/esm/chunk-SOPGOKKH.js.map +0 -7
  100. package/dist/esm/genesis_token.js +0 -2
  101. package/dist/esm/governance.js +0 -2
  102. package/dist/esm/ledger.js +0 -2
  103. package/dist/types/genesis_token.d.ts +0 -17
  104. package/dist/types/types/governance.d.ts +0 -10
  105. package/dist/types/types/ledger.d.ts +0 -18
@@ -1,2 +1,2 @@
1
- import{c as A}from"./chunk-FL7E4DL3.js";import{c as I}from"./chunk-ONAVPXOT.js";var _=I(A());var p=BigInt(1095062083),E=BigInt(1347768404),T=BigInt(1e4),c=BigInt(1e8);var o=(r=>(r[r.FRACTIONAL_MORE_THAN_8_DECIMALS=0]="FRACTIONAL_MORE_THAN_8_DECIMALS",r[r.INVALID_FORMAT=1]="INVALID_FORMAT",r))(o||{});var i=class{constructor(t){this.e8s=t}static fromE8s(t){return new i(t)}static fromString(t){t=t.trim().replace(/[,']/g,"");let r=t.match(/\d*(\.\d*)?/);if(!r||r[0]!==t)return 1;let[s,e]=t.split("."),n=BigInt(0);if(s)try{n+=BigInt(s)*c}catch{return 1}if(e){if(e.length>8)return 0;try{n+=BigInt(e.padEnd(8,"0"))}catch{return 1}}return new i(n)}toE8s(){return this.e8s}toProto(){let t=new _.ICPTs;return t.setE8s(this.e8s.toString()),t}};export{T as a,c as b,o as c,i as d};
2
- //# sourceMappingURL=chunk-MTPVFXPH.js.map
1
+ import{c as A}from"./chunk-IPUXUCZB.js";import{c as I}from"./chunk-ONAVPXOT.js";var _=I(A());var p=BigInt(1095062083),E=BigInt(1347768404),T=BigInt(1e4),c=BigInt(1e8);var o=(r=>(r[r.FRACTIONAL_MORE_THAN_8_DECIMALS=0]="FRACTIONAL_MORE_THAN_8_DECIMALS",r[r.INVALID_FORMAT=1]="INVALID_FORMAT",r))(o||{});var i=class{constructor(t){this.e8s=t}static fromE8s(t){return new i(t)}static fromString(t){t=t.trim().replace(/[,']/g,"");let r=t.match(/\d*(\.\d*)?/);if(!r||r[0]!==t)return 1;let[s,e]=t.split("."),n=BigInt(0);if(s)try{n+=BigInt(s)*c}catch{return 1}if(e){if(e.length>8)return 0;try{n+=BigInt(e.padEnd(8,"0"))}catch{return 1}}return new i(n)}toE8s(){return this.e8s}toProto(){let t=new _.ICPTs;return t.setE8s(this.e8s.toString()),t}};export{T as a,c as b,o as c,i as d};
2
+ //# sourceMappingURL=chunk-RHCXRQFK.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/icp.ts", "../../src/constants/constants.ts", "../../src/types/icp.ts"],
4
4
  "sourcesContent": ["import { ICPTs } from \"../proto/ledger_pb\";\nimport { E8S_PER_ICP } from \"./constants/constants\";\nimport { FromICPStringError } from \"./types/icp\";\n\nexport class ICP {\n private constructor(private e8s: bigint) {}\n\n public static fromE8s(amount: bigint): ICP {\n return new ICP(amount);\n }\n\n /**\n * Initialize from a string. Accepted formats:\n *\n * 1234567.8901\n * 1'234'567.8901\n * 1,234,567.8901\n */\n public static fromString(amount: string): ICP | FromICPStringError {\n // Remove all instances of \",\" and \"'\".\n amount = amount.trim().replace(/[,']/g, \"\");\n\n // Verify that the string is of the format 1234.5678\n const regexMatch = amount.match(/\\d*(\\.\\d*)?/);\n if (!regexMatch || regexMatch[0] !== amount) {\n return FromICPStringError.INVALID_FORMAT;\n }\n\n const [integral, fractional] = amount.split(\".\");\n\n let e8s = BigInt(0);\n\n if (integral) {\n try {\n e8s += BigInt(integral) * E8S_PER_ICP;\n } catch {\n return FromICPStringError.INVALID_FORMAT;\n }\n }\n\n if (fractional) {\n if (fractional.length > 8) {\n return FromICPStringError.FRACTIONAL_MORE_THAN_8_DECIMALS;\n }\n try {\n e8s += BigInt(fractional.padEnd(8, \"0\"));\n } catch {\n return FromICPStringError.INVALID_FORMAT;\n }\n }\n\n return new ICP(e8s);\n }\n\n public toE8s(): bigint {\n return this.e8s;\n }\n\n public toProto(): ICPTs {\n const proto = new ICPTs();\n proto.setE8s(this.e8s.toString());\n return proto;\n }\n}\n", "export const SUB_ACCOUNT_BYTE_LENGTH = 32;\nexport const CREATE_CANISTER_MEMO = BigInt(0x41455243); // CREA,\nexport const TOP_UP_CANISTER_MEMO = BigInt(0x50555054); // TPUP\n\nexport const TRANSACTION_FEE = BigInt(10_000);\n\n// Note: Canister IDs are not constant, so are not provided here.\n// The same applies to HOST.\nexport const E8S_PER_ICP = BigInt(100000000);\n", "export enum FromICPStringError {\n FRACTIONAL_MORE_THAN_8_DECIMALS,\n INVALID_FORMAT,\n}\n"],
5
- "mappings": "gFAAA,MAAsB,OCCf,GAAM,GAAuB,OAAO,UAAU,EACxC,EAAuB,OAAO,UAAU,EAExC,EAAkB,OAAO,GAAM,EAI/B,EAAc,OAAO,GAAS,ECRpC,GAAK,GAAL,CAAK,GACV,0EACA,uCAFU,WFIL,WAAU,CACP,YAAoB,EAAa,CAAb,UAAc,OAE5B,SAAQ,EAAqB,CACzC,MAAO,IAAI,GAAI,CAAM,CACvB,OASc,YAAW,EAA0C,CAEjE,EAAS,EAAO,KAAK,EAAE,QAAQ,QAAS,EAAE,EAG1C,GAAM,GAAa,EAAO,MAAM,aAAa,EAC7C,GAAI,CAAC,GAAc,EAAW,KAAO,EACnC,MAAO,GAGT,GAAM,CAAC,EAAU,GAAc,EAAO,MAAM,GAAG,EAE3C,EAAM,OAAO,CAAC,EAElB,GAAI,EACF,GAAI,CACF,GAAO,OAAO,CAAQ,EAAI,CAC5B,MAAE,CACA,MAAO,EACT,CAGF,GAAI,EAAY,CACd,GAAI,EAAW,OAAS,EACtB,MAAO,GAET,GAAI,CACF,GAAO,OAAO,EAAW,OAAO,EAAG,GAAG,CAAC,CACzC,MAAE,CACA,MAAO,EACT,CACF,CAEA,MAAO,IAAI,GAAI,CAAG,CACpB,CAEO,OAAgB,CACrB,MAAO,MAAK,GACd,CAEO,SAAiB,CACtB,GAAM,GAAQ,GAAI,SAClB,SAAM,OAAO,KAAK,IAAI,SAAS,CAAC,EACzB,CACT,CACF",
5
+ "mappings": "gFAAA,MAAsB,OCCf,GAAM,GAAuB,OAAO,UAAU,EACxC,EAAuB,OAAO,UAAU,EAExC,EAAkB,OAAO,GAAM,EAI/B,EAAc,OAAO,GAAS,ECRpC,GAAK,GAAL,CAAK,GACV,0EACA,uCAFU,WFIL,GAAM,GAAN,KAAU,CACf,AAAQ,YAAoB,EAAa,CAAb,UAAc,CAE1C,MAAc,SAAQ,EAAqB,CACzC,MAAO,IAAI,GAAI,CAAM,CACvB,CASA,MAAc,YAAW,EAA0C,CAEjE,EAAS,EAAO,KAAK,EAAE,QAAQ,QAAS,EAAE,EAG1C,GAAM,GAAa,EAAO,MAAM,aAAa,EAC7C,GAAI,CAAC,GAAc,EAAW,KAAO,EACnC,MAAO,GAGT,GAAM,CAAC,EAAU,GAAc,EAAO,MAAM,GAAG,EAE3C,EAAM,OAAO,CAAC,EAElB,GAAI,EACF,GAAI,CACF,GAAO,OAAO,CAAQ,EAAI,CAC5B,MAAE,CACA,MAAO,EACT,CAGF,GAAI,EAAY,CACd,GAAI,EAAW,OAAS,EACtB,MAAO,GAET,GAAI,CACF,GAAO,OAAO,EAAW,OAAO,EAAG,GAAG,CAAC,CACzC,MAAE,CACA,MAAO,EACT,CACF,CAEA,MAAO,IAAI,GAAI,CAAG,CACpB,CAEA,AAAO,OAAgB,CACrB,MAAO,MAAK,GACd,CAEA,AAAO,SAAiB,CACtB,GAAM,GAAQ,GAAI,SAClB,SAAM,OAAO,KAAK,IAAI,SAAS,CAAC,EACzB,CACT,CACF",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,9 @@
1
+ import{c as W0}from"./chunk-IPUXUCZB.js";import{a as H0,b as V0,c as X0}from"./chunk-MGC7CRB4.js";import{a as q0,c as T,d as K}from"./chunk-ONAVPXOT.js";var M=q0(I=>{"use strict";var L=V0(),E=X0(),Q=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;I.Buffer=n;I.SlowBuffer=v0;I.INSPECT_MAX_BYTES=50;var R=2147483647;I.kMaxLength=R;n.TYPED_ARRAY_SUPPORT=Z0();!n.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Z0(){try{let r=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(r,x),r.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(!!n.isBuffer(this))return this.buffer}});Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(!!n.isBuffer(this))return this.byteOffset}});function y(r){if(r>R)throw new RangeError('The value "'+r+'" is invalid for option "size"');let x=new Uint8Array(r);return Object.setPrototypeOf(x,n.prototype),x}function n(r,x,e){if(typeof r=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return P(r)}return r0(r,x,e)}n.poolSize=8192;function r0(r,x,e){if(typeof r=="string")return J0(r,x);if(ArrayBuffer.isView(r))return K0(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(s(r,ArrayBuffer)||r&&s(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(s(r,SharedArrayBuffer)||r&&s(r.buffer,SharedArrayBuffer)))return D(r,x,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let t=r.valueOf&&r.valueOf();if(t!=null&&t!==r)return n.from(t,x,e);let c=Q0(r);if(c)return c;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return n.from(r[Symbol.toPrimitive]("string"),x,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}n.from=function(r,x,e){return r0(r,x,e)};Object.setPrototypeOf(n.prototype,Uint8Array.prototype);Object.setPrototypeOf(n,Uint8Array);function t0(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function z0(r,x,e){return t0(r),r<=0?y(r):x!==void 0?typeof e=="string"?y(r).fill(x,e):y(r).fill(x):y(r)}n.alloc=function(r,x,e){return z0(r,x,e)};function P(r){return t0(r),y(r<0?0:N(r)|0)}n.allocUnsafe=function(r){return P(r)};n.allocUnsafeSlow=function(r){return P(r)};function J0(r,x){if((typeof x!="string"||x==="")&&(x="utf8"),!n.isEncoding(x))throw new TypeError("Unknown encoding: "+x);let e=c0(r,x)|0,t=y(e),c=t.write(r,x);return c!==e&&(t=t.slice(0,c)),t}function _(r){let x=r.length<0?0:N(r.length)|0,e=y(x);for(let t=0;t<x;t+=1)e[t]=r[t]&255;return e}function K0(r){if(s(r,Uint8Array)){let x=new Uint8Array(r);return D(x.buffer,x.byteOffset,x.byteLength)}return _(r)}function D(r,x,e){if(x<0||r.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<x+(e||0))throw new RangeError('"length" is outside of buffer bounds');let t;return x===void 0&&e===void 0?t=new Uint8Array(r):e===void 0?t=new Uint8Array(r,x):t=new Uint8Array(r,x,e),Object.setPrototypeOf(t,n.prototype),t}function Q0(r){if(n.isBuffer(r)){let x=N(r.length)|0,e=y(x);return e.length===0||r.copy(e,0,0,x),e}if(r.length!==void 0)return typeof r.length!="number"||O(r.length)?y(0):_(r);if(r.type==="Buffer"&&Array.isArray(r.data))return _(r.data)}function N(r){if(r>=R)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R.toString(16)+" bytes");return r|0}function v0(r){return+r!=r&&(r=0),n.alloc(+r)}n.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==n.prototype};n.compare=function(x,e){if(s(x,Uint8Array)&&(x=n.from(x,x.offset,x.byteLength)),s(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(x)||!n.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===e)return 0;let t=x.length,c=e.length;for(let i=0,f=Math.min(t,c);i<f;++i)if(x[i]!==e[i]){t=x[i],c=e[i];break}return t<c?-1:c<t?1:0};n.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};n.concat=function(x,e){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return n.alloc(0);let t;if(e===void 0)for(e=0,t=0;t<x.length;++t)e+=x[t].length;let c=n.allocUnsafe(e),i=0;for(t=0;t<x.length;++t){let f=x[t];if(s(f,Uint8Array))i+f.length>c.length?(n.isBuffer(f)||(f=n.from(f)),f.copy(c,i)):Uint8Array.prototype.set.call(c,f,i);else if(n.isBuffer(f))f.copy(c,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=f.length}return c};function c0(r,x){if(n.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||s(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,t=arguments.length>2&&arguments[2]===!0;if(!t&&e===0)return 0;let c=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return k(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return p0(r).length;default:if(c)return t?-1:k(r).length;x=(""+x).toLowerCase(),c=!0}}n.byteLength=c0;function xx(r,x,e){let t=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,x>>>=0,e<=x))return"";for(r||(r="utf8");;)switch(r){case"hex":return ox(this,x,e);case"utf8":case"utf-8":return n0(this,x,e);case"ascii":return dx(this,x,e);case"latin1":case"binary":return ax(this,x,e);case"base64":return nx(this,x,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bx(this,x,e);default:if(t)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),t=!0}}n.prototype._isBuffer=!0;function w(r,x,e){let t=r[x];r[x]=r[e],r[e]=t}n.prototype.swap16=function(){let x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<x;e+=2)w(this,e,e+1);return this};n.prototype.swap32=function(){let x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<x;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this};n.prototype.swap64=function(){let x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<x;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this};n.prototype.toString=function(){let x=this.length;return x===0?"":arguments.length===0?n0(this,0,x):xx.apply(this,arguments)};n.prototype.toLocaleString=n.prototype.toString;n.prototype.equals=function(x){if(!n.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:n.compare(this,x)===0};n.prototype.inspect=function(){let x="",e=I.INSPECT_MAX_BYTES;return x=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(x+=" ... "),"<Buffer "+x+">"};Q&&(n.prototype[Q]=n.prototype.inspect);n.prototype.compare=function(x,e,t,c,i){if(s(x,Uint8Array)&&(x=n.from(x,x.offset,x.byteLength)),!n.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(e===void 0&&(e=0),t===void 0&&(t=x?x.length:0),c===void 0&&(c=0),i===void 0&&(i=this.length),e<0||t>x.length||c<0||i>this.length)throw new RangeError("out of range index");if(c>=i&&e>=t)return 0;if(c>=i)return-1;if(e>=t)return 1;if(e>>>=0,t>>>=0,c>>>=0,i>>>=0,this===x)return 0;let f=i-c,d=t-e,u=Math.min(f,d),o=this.slice(c,i),p=x.slice(e,t);for(let a=0;a<u;++a)if(o[a]!==p[a]){f=o[a],d=p[a];break}return f<d?-1:d<f?1:0};function i0(r,x,e,t,c){if(r.length===0)return-1;if(typeof e=="string"?(t=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,O(e)&&(e=c?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(c)return-1;e=r.length-1}else if(e<0)if(c)e=0;else return-1;if(typeof x=="string"&&(x=n.from(x,t)),n.isBuffer(x))return x.length===0?-1:v(r,x,e,t,c);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(r,x,e):Uint8Array.prototype.lastIndexOf.call(r,x,e):v(r,[x],e,t,c);throw new TypeError("val must be string, number or Buffer")}function v(r,x,e,t,c){let i=1,f=r.length,d=x.length;if(t!==void 0&&(t=String(t).toLowerCase(),t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le")){if(r.length<2||x.length<2)return-1;i=2,f/=2,d/=2,e/=2}function u(p,a){return i===1?p[a]:p.readUInt16BE(a*i)}let o;if(c){let p=-1;for(o=e;o<f;o++)if(u(r,o)===u(x,p===-1?0:o-p)){if(p===-1&&(p=o),o-p+1===d)return p*i}else p!==-1&&(o-=o-p),p=-1}else for(e+d>f&&(e=f-d),o=e;o>=0;o--){let p=!0;for(let a=0;a<d;a++)if(u(r,o+a)!==u(x,a)){p=!1;break}if(p)return o}return-1}n.prototype.includes=function(x,e,t){return this.indexOf(x,e,t)!==-1};n.prototype.indexOf=function(x,e,t){return i0(this,x,e,t,!0)};n.prototype.lastIndexOf=function(x,e,t){return i0(this,x,e,t,!1)};function ex(r,x,e,t){e=Number(e)||0;let c=r.length-e;t?(t=Number(t),t>c&&(t=c)):t=c;let i=x.length;t>i/2&&(t=i/2);let f;for(f=0;f<t;++f){let d=parseInt(x.substr(f*2,2),16);if(O(d))return f;r[e+f]=d}return f}function rx(r,x,e,t){return C(k(x,r.length-e),r,e,t)}function tx(r,x,e,t){return C(lx(x),r,e,t)}function cx(r,x,e,t){return C(p0(x),r,e,t)}function ix(r,x,e,t){return C(sx(x,r.length-e),r,e,t)}n.prototype.write=function(x,e,t,c){if(e===void 0)c="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")c=e,t=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(t)?(t=t>>>0,c===void 0&&(c="utf8")):(c=t,t=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-e;if((t===void 0||t>i)&&(t=i),x.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let f=!1;for(;;)switch(c){case"hex":return ex(this,x,e,t);case"utf8":case"utf-8":return rx(this,x,e,t);case"ascii":case"latin1":case"binary":return tx(this,x,e,t);case"base64":return cx(this,x,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ix(this,x,e,t);default:if(f)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),f=!0}};n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function nx(r,x,e){return x===0&&e===r.length?L.fromByteArray(r):L.fromByteArray(r.slice(x,e))}function n0(r,x,e){e=Math.min(r.length,e);let t=[],c=x;for(;c<e;){let i=r[c],f=null,d=i>239?4:i>223?3:i>191?2:1;if(c+d<=e){let u,o,p,a;switch(d){case 1:i<128&&(f=i);break;case 2:u=r[c+1],(u&192)===128&&(a=(i&31)<<6|u&63,a>127&&(f=a));break;case 3:u=r[c+1],o=r[c+2],(u&192)===128&&(o&192)===128&&(a=(i&15)<<12|(u&63)<<6|o&63,a>2047&&(a<55296||a>57343)&&(f=a));break;case 4:u=r[c+1],o=r[c+2],p=r[c+3],(u&192)===128&&(o&192)===128&&(p&192)===128&&(a=(i&15)<<18|(u&63)<<12|(o&63)<<6|p&63,a>65535&&a<1114112&&(f=a))}}f===null?(f=65533,d=1):f>65535&&(f-=65536,t.push(f>>>10&1023|55296),f=56320|f&1023),t.push(f),c+=d}return fx(t)}var x0=4096;function fx(r){let x=r.length;if(x<=x0)return String.fromCharCode.apply(String,r);let e="",t=0;for(;t<x;)e+=String.fromCharCode.apply(String,r.slice(t,t+=x0));return e}function dx(r,x,e){let t="";e=Math.min(r.length,e);for(let c=x;c<e;++c)t+=String.fromCharCode(r[c]&127);return t}function ax(r,x,e){let t="";e=Math.min(r.length,e);for(let c=x;c<e;++c)t+=String.fromCharCode(r[c]);return t}function ox(r,x,e){let t=r.length;(!x||x<0)&&(x=0),(!e||e<0||e>t)&&(e=t);let c="";for(let i=x;i<e;++i)c+=yx[r[i]];return c}function bx(r,x,e){let t=r.slice(x,e),c="";for(let i=0;i<t.length-1;i+=2)c+=String.fromCharCode(t[i]+t[i+1]*256);return c}n.prototype.slice=function(x,e){let t=this.length;x=~~x,e=e===void 0?t:~~e,x<0?(x+=t,x<0&&(x=0)):x>t&&(x=t),e<0?(e+=t,e<0&&(e=0)):e>t&&(e=t),e<x&&(e=x);let c=this.subarray(x,e);return Object.setPrototypeOf(c,n.prototype),c};function h(r,x,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+x>e)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(x,e,t){x=x>>>0,e=e>>>0,t||h(x,e,this.length);let c=this[x],i=1,f=0;for(;++f<e&&(i*=256);)c+=this[x+f]*i;return c};n.prototype.readUintBE=n.prototype.readUIntBE=function(x,e,t){x=x>>>0,e=e>>>0,t||h(x,e,this.length);let c=this[x+--e],i=1;for(;e>0&&(i*=256);)c+=this[x+--e]*i;return c};n.prototype.readUint8=n.prototype.readUInt8=function(x,e){return x=x>>>0,e||h(x,1,this.length),this[x]};n.prototype.readUint16LE=n.prototype.readUInt16LE=function(x,e){return x=x>>>0,e||h(x,2,this.length),this[x]|this[x+1]<<8};n.prototype.readUint16BE=n.prototype.readUInt16BE=function(x,e){return x=x>>>0,e||h(x,2,this.length),this[x]<<8|this[x+1]};n.prototype.readUint32LE=n.prototype.readUInt32LE=function(x,e){return x=x>>>0,e||h(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216};n.prototype.readUint32BE=n.prototype.readUInt32BE=function(x,e){return x=x>>>0,e||h(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])};n.prototype.readBigUInt64LE=m(function(x){x=x>>>0,g(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&U(x,this.length-8);let c=e+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,i=this[++x]+this[++x]*2**8+this[++x]*2**16+t*2**24;return BigInt(c)+(BigInt(i)<<BigInt(32))});n.prototype.readBigUInt64BE=m(function(x){x=x>>>0,g(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&U(x,this.length-8);let c=e*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],i=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+t;return(BigInt(c)<<BigInt(32))+BigInt(i)});n.prototype.readIntLE=function(x,e,t){x=x>>>0,e=e>>>0,t||h(x,e,this.length);let c=this[x],i=1,f=0;for(;++f<e&&(i*=256);)c+=this[x+f]*i;return i*=128,c>=i&&(c-=Math.pow(2,8*e)),c};n.prototype.readIntBE=function(x,e,t){x=x>>>0,e=e>>>0,t||h(x,e,this.length);let c=e,i=1,f=this[x+--c];for(;c>0&&(i*=256);)f+=this[x+--c]*i;return i*=128,f>=i&&(f-=Math.pow(2,8*e)),f};n.prototype.readInt8=function(x,e){return x=x>>>0,e||h(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]};n.prototype.readInt16LE=function(x,e){x=x>>>0,e||h(x,2,this.length);let t=this[x]|this[x+1]<<8;return t&32768?t|4294901760:t};n.prototype.readInt16BE=function(x,e){x=x>>>0,e||h(x,2,this.length);let t=this[x+1]|this[x]<<8;return t&32768?t|4294901760:t};n.prototype.readInt32LE=function(x,e){return x=x>>>0,e||h(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24};n.prototype.readInt32BE=function(x,e){return x=x>>>0,e||h(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]};n.prototype.readBigInt64LE=m(function(x){x=x>>>0,g(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&U(x,this.length-8);let c=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(t<<24);return(BigInt(c)<<BigInt(32))+BigInt(e+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)});n.prototype.readBigInt64BE=m(function(x){x=x>>>0,g(x,"offset");let e=this[x],t=this[x+7];(e===void 0||t===void 0)&&U(x,this.length-8);let c=(e<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(c)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+t)});n.prototype.readFloatLE=function(x,e){return x=x>>>0,e||h(x,4,this.length),E.read(this,x,!0,23,4)};n.prototype.readFloatBE=function(x,e){return x=x>>>0,e||h(x,4,this.length),E.read(this,x,!1,23,4)};n.prototype.readDoubleLE=function(x,e){return x=x>>>0,e||h(x,8,this.length),E.read(this,x,!0,52,8)};n.prototype.readDoubleBE=function(x,e){return x=x>>>0,e||h(x,8,this.length),E.read(this,x,!1,52,8)};function l(r,x,e,t,c,i){if(!n.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>c||x<i)throw new RangeError('"value" argument is out of bounds');if(e+t>r.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(x,e,t,c){if(x=+x,e=e>>>0,t=t>>>0,!c){let d=Math.pow(2,8*t)-1;l(this,x,e,t,d,0)}let i=1,f=0;for(this[e]=x&255;++f<t&&(i*=256);)this[e+f]=x/i&255;return e+t};n.prototype.writeUintBE=n.prototype.writeUIntBE=function(x,e,t,c){if(x=+x,e=e>>>0,t=t>>>0,!c){let d=Math.pow(2,8*t)-1;l(this,x,e,t,d,0)}let i=t-1,f=1;for(this[e+i]=x&255;--i>=0&&(f*=256);)this[e+i]=x/f&255;return e+t};n.prototype.writeUint8=n.prototype.writeUInt8=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,1,255,0),this[e]=x&255,e+1};n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,2,65535,0),this[e]=x&255,this[e+1]=x>>>8,e+2};n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,2,65535,0),this[e]=x>>>8,this[e+1]=x&255,e+2};n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,4,4294967295,0),this[e+3]=x>>>24,this[e+2]=x>>>16,this[e+1]=x>>>8,this[e]=x&255,e+4};n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,4,4294967295,0),this[e]=x>>>24,this[e+1]=x>>>16,this[e+2]=x>>>8,this[e+3]=x&255,e+4};function f0(r,x,e,t,c){u0(x,t,c,r,e,7);let i=Number(x&BigInt(4294967295));r[e++]=i,i=i>>8,r[e++]=i,i=i>>8,r[e++]=i,i=i>>8,r[e++]=i;let f=Number(x>>BigInt(32)&BigInt(4294967295));return r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,f=f>>8,r[e++]=f,e}function d0(r,x,e,t,c){u0(x,t,c,r,e,7);let i=Number(x&BigInt(4294967295));r[e+7]=i,i=i>>8,r[e+6]=i,i=i>>8,r[e+5]=i,i=i>>8,r[e+4]=i;let f=Number(x>>BigInt(32)&BigInt(4294967295));return r[e+3]=f,f=f>>8,r[e+2]=f,f=f>>8,r[e+1]=f,f=f>>8,r[e]=f,e+8}n.prototype.writeBigUInt64LE=m(function(x,e=0){return f0(this,x,e,BigInt(0),BigInt("0xffffffffffffffff"))});n.prototype.writeBigUInt64BE=m(function(x,e=0){return d0(this,x,e,BigInt(0),BigInt("0xffffffffffffffff"))});n.prototype.writeIntLE=function(x,e,t,c){if(x=+x,e=e>>>0,!c){let u=Math.pow(2,8*t-1);l(this,x,e,t,u-1,-u)}let i=0,f=1,d=0;for(this[e]=x&255;++i<t&&(f*=256);)x<0&&d===0&&this[e+i-1]!==0&&(d=1),this[e+i]=(x/f>>0)-d&255;return e+t};n.prototype.writeIntBE=function(x,e,t,c){if(x=+x,e=e>>>0,!c){let u=Math.pow(2,8*t-1);l(this,x,e,t,u-1,-u)}let i=t-1,f=1,d=0;for(this[e+i]=x&255;--i>=0&&(f*=256);)x<0&&d===0&&this[e+i+1]!==0&&(d=1),this[e+i]=(x/f>>0)-d&255;return e+t};n.prototype.writeInt8=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,1,127,-128),x<0&&(x=255+x+1),this[e]=x&255,e+1};n.prototype.writeInt16LE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,2,32767,-32768),this[e]=x&255,this[e+1]=x>>>8,e+2};n.prototype.writeInt16BE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,2,32767,-32768),this[e]=x>>>8,this[e+1]=x&255,e+2};n.prototype.writeInt32LE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,4,2147483647,-2147483648),this[e]=x&255,this[e+1]=x>>>8,this[e+2]=x>>>16,this[e+3]=x>>>24,e+4};n.prototype.writeInt32BE=function(x,e,t){return x=+x,e=e>>>0,t||l(this,x,e,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[e]=x>>>24,this[e+1]=x>>>16,this[e+2]=x>>>8,this[e+3]=x&255,e+4};n.prototype.writeBigInt64LE=m(function(x,e=0){return f0(this,x,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});n.prototype.writeBigInt64BE=m(function(x,e=0){return d0(this,x,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function a0(r,x,e,t,c,i){if(e+t>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function o0(r,x,e,t,c){return x=+x,e=e>>>0,c||a0(r,x,e,4,34028234663852886e22,-34028234663852886e22),E.write(r,x,e,t,23,4),e+4}n.prototype.writeFloatLE=function(x,e,t){return o0(this,x,e,!0,t)};n.prototype.writeFloatBE=function(x,e,t){return o0(this,x,e,!1,t)};function b0(r,x,e,t,c){return x=+x,e=e>>>0,c||a0(r,x,e,8,17976931348623157e292,-17976931348623157e292),E.write(r,x,e,t,52,8),e+8}n.prototype.writeDoubleLE=function(x,e,t){return b0(this,x,e,!0,t)};n.prototype.writeDoubleBE=function(x,e,t){return b0(this,x,e,!1,t)};n.prototype.copy=function(x,e,t,c){if(!n.isBuffer(x))throw new TypeError("argument should be a Buffer");if(t||(t=0),!c&&c!==0&&(c=this.length),e>=x.length&&(e=x.length),e||(e=0),c>0&&c<t&&(c=t),c===t||x.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),x.length-e<c-t&&(c=x.length-e+t);let i=c-t;return this===x&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,t,c):Uint8Array.prototype.set.call(x,this.subarray(t,c),e),i};n.prototype.fill=function(x,e,t,c){if(typeof x=="string"){if(typeof e=="string"?(c=e,e=0,t=this.length):typeof t=="string"&&(c=t,t=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!n.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(x.length===1){let f=x.charCodeAt(0);(c==="utf8"&&f<128||c==="latin1")&&(x=f)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;e=e>>>0,t=t===void 0?this.length:t>>>0,x||(x=0);let i;if(typeof x=="number")for(i=e;i<t;++i)this[i]=x;else{let f=n.isBuffer(x)?x:n.from(x,c),d=f.length;if(d===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(i=0;i<t-e;++i)this[i+e]=f[i%d]}return this};var B={};function $(r,x,e){B[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(c){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:c,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}$("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);$("ERR_INVALID_ARG_TYPE",function(r,x){return`The "${r}" argument must be of type number. Received type ${typeof x}`},TypeError);$("ERR_OUT_OF_RANGE",function(r,x,e){let t=`The value of "${r}" is out of range.`,c=e;return Number.isInteger(e)&&Math.abs(e)>2**32?c=e0(String(e)):typeof e=="bigint"&&(c=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(c=e0(c)),c+="n"),t+=` It must be ${x}. Received ${c}`,t},RangeError);function e0(r){let x="",e=r.length,t=r[0]==="-"?1:0;for(;e>=t+4;e-=3)x=`_${r.slice(e-3,e)}${x}`;return`${r.slice(0,e)}${x}`}function ux(r,x,e){g(x,"offset"),(r[x]===void 0||r[x+e]===void 0)&&U(x,r.length-(e+1))}function u0(r,x,e,t,c,i){if(r>e||r<x){let f=typeof x=="bigint"?"n":"",d;throw i>3?x===0||x===BigInt(0)?d=`>= 0${f} and < 2${f} ** ${(i+1)*8}${f}`:d=`>= -(2${f} ** ${(i+1)*8-1}${f}) and < 2 ** ${(i+1)*8-1}${f}`:d=`>= ${x}${f} and <= ${e}${f}`,new B.ERR_OUT_OF_RANGE("value",d,r)}ux(t,c,i)}function g(r,x){if(typeof r!="number")throw new B.ERR_INVALID_ARG_TYPE(x,"number",r)}function U(r,x,e){throw Math.floor(r)!==r?(g(r,e),new B.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):x<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${x}`,r)}var px=/[^+/0-9A-Za-z-_]/g;function hx(r){if(r=r.split("=")[0],r=r.trim().replace(px,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function k(r,x){x=x||1/0;let e,t=r.length,c=null,i=[];for(let f=0;f<t;++f){if(e=r.charCodeAt(f),e>55295&&e<57344){if(!c){if(e>56319){(x-=3)>-1&&i.push(239,191,189);continue}else if(f+1===t){(x-=3)>-1&&i.push(239,191,189);continue}c=e;continue}if(e<56320){(x-=3)>-1&&i.push(239,191,189),c=e;continue}e=(c-55296<<10|e-56320)+65536}else c&&(x-=3)>-1&&i.push(239,191,189);if(c=null,e<128){if((x-=1)<0)break;i.push(e)}else if(e<2048){if((x-=2)<0)break;i.push(e>>6|192,e&63|128)}else if(e<65536){if((x-=3)<0)break;i.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((x-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return i}function lx(r){let x=[];for(let e=0;e<r.length;++e)x.push(r.charCodeAt(e)&255);return x}function sx(r,x){let e,t,c,i=[];for(let f=0;f<r.length&&!((x-=2)<0);++f)e=r.charCodeAt(f),t=e>>8,c=e%256,i.push(c),i.push(t);return i}function p0(r){return L.toByteArray(hx(r))}function C(r,x,e,t){let c;for(c=0;c<t&&!(c+e>=x.length||c>=r.length);++c)x[c+e]=r[c];return c}function s(r,x){return r instanceof x||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===x.name}function O(r){return r!==r}var yx=function(){let r="0123456789abcdef",x=new Array(256);for(let e=0;e<16;++e){let t=e*16;for(let c=0;c<16;++c)x[t+c]=r[e]+r[c]}return x}();function m(r){return typeof BigInt>"u"?mx:r}function mx(){throw new Error("BigInt not supported")}});var j0=T(H0()),Y0=T(W0());var J=T(M());var wx=(r,x=0)=>{let e=~~x,t=0;for(let c=0;c<r.length;c++)t+=r[c];return e+=t%256,e%256},h0=wx;var l0=T(M(),1),Bx=(r,x)=>l0.Buffer.from(r,x),G=Bx;function b(r,x){let e=(t,c)=>x(G(t),c)>>>0;return e.signed=(t,c)=>x(G(t),c),e.unsigned=e,e.model=r,e}var s0=b("crc1",h0);var j=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];typeof Int32Array<"u"&&(j=new Int32Array(j));var Ex=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=j[(e^r[t])&255]&255;return e},y0=Ex;var m0=b("crc-8",y0);var Y=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];typeof Int32Array<"u"&&(Y=new Int32Array(Y));var gx=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=Y[(e^r[t])&255]&255;return e},w0=gx;var B0=b("dallas-1-wire",w0);var q=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(q=new Int32Array(q));var Ix=(r,x=0)=>{let e=~~x;for(let t=0;t<r.length;t++)e=(q[(e^r[t])&255]^e>>8)&65535;return e},E0=Ix;var g0=b("crc-16",E0);var H=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];typeof Int32Array<"u"&&(H=new Int32Array(H));var Ax=(r,x)=>{let e=typeof x<"u"?~~x:65535;for(let t=0;t<r.length;t++)e=(H[(e>>8^r[t])&255]^e<<8)&65535;return e},I0=Ax;var A0=b("ccitt",I0);var W=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];typeof Int32Array<"u"&&(W=new Int32Array(W));var Ux=(r,x)=>{let e=typeof x<"u"?~~x:65535;for(let t=0;t<r.length;t++)e=(W[(e^r[t])&255]^e>>8)&65535;return e},U0=Ux;var F0=b("crc-16-modbus",U0);var Fx=(r,x)=>{let e=typeof x<"u"?~~x:0;for(let t=0;t<r.length;t++){let c=e>>>8&255;c^=r[t]&255,c^=c>>>4,e=e<<8&65535,e^=c,c=c<<5&65535,e^=c,c=c<<7&65535,e^=c}return e},T0=Fx;var R0=b("xmodem",T0);var V=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];typeof Int32Array<"u"&&(V=new Int32Array(V));var Tx=(r,x)=>{let e=typeof x<"u"?~~x:0;for(let t=0;t<r.length;t++)e=(V[(e^r[t])&255]^e>>8)&65535;return e},C0=Tx;var S0=b("kermit",C0);var X=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];typeof Int32Array<"u"&&(X=new Int32Array(X));var Rx=(r,x)=>{let e=typeof x<"u"?~~x:11994318;for(let t=0;t<r.length;t++)e=(X[(e>>16^r[t])&255]^e<<8)&16777215;return e},L0=Rx;var _0=b("crc-24",L0);var Z=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(Z=new Int32Array(Z));var Cx=(r,x)=>{let e=x===0?0:~~x^-1;for(let t=0;t<r.length;t++)e=Z[(e^r[t])&255]^e>>>8;return e^-1},D0=Cx;var k0=b("crc-32",D0);var z=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(z=new Int32Array(z));var Sx=(r,x=-1)=>{let e=x===0?0:~~x;for(let t=0;t<r.length;t++)e=z[(e^r[t])&255]^e>>>8;return e},P0=Sx;var N0=b("jam",P0);var $0={crc1:s0,crc8:m0,crc81wire:B0,crc16:g0,crc16ccitt:A0,crc16modbus:F0,crc16xmodem:R0,crc16kermit:S0,crc24:_0,crc32:k0,crcjam:N0};var Me=r=>{let x=new DataView(r.buffer,r.byteOffset,r.byteLength);if(typeof x.getBigUint64=="function")return x.getBigUint64(0);{let e=BigInt(x.getUint32(0)),t=BigInt(x.getUint32(4));return(e<<BigInt(32))+t}},Ge=r=>{let x=new Uint8Array(r);return Array.from(x)},je=r=>new Uint8Array(r);var O0=r=>Array.from(r).map(x=>x.charCodeAt(0)),M0=r=>r.reduce((x,e)=>x+e.toString(16).padStart(2,"0"),""),G0=r=>{let x=new ArrayBuffer(4);return new DataView(x).setUint32(0,$0.crc32(J.Buffer.from(r)),!1),J.Buffer.from(x)};var F=class{constructor(x){this.bytes=x}static fromHex(x){return new F(Uint8Array.from(Buffer.from(x,"hex")))}static fromPrincipal({principal:x,subAccount:e=S.ZERO}){let t=O0(`
2
+ account-id`),c=j0.sha224.create();c.update([...t,...x.toUint8Array(),...e.toUint8Array()]);let i=new Uint8Array(c.array()),f=G0(i),d=new Uint8Array([...f,...i]);return new F(d)}toProto(){let x=new Y0.AccountIdentifier;return x.setHash(this.bytes),x}toHex(){return M0(this.bytes)}toUint8Array(){return this.bytes}toNumbers(){return Array.from(this.bytes)}},A=class{constructor(x){this.bytes=x}static fromBytes(x){return x.length!=32?Error("Subaccount length must be 32-bytes"):new A(x)}static fromPrincipal(x){let e=new Uint8Array(32).fill(0),t=x.toUint8Array();e[0]=t.length;for(let c=0;c<t.length;c++)e[1+c]=t[c];return new A(e)}static fromID(x){if(x<0||x>255)throw"Subaccount ID must be >= 0 and <= 255";let e=new Uint8Array(32).fill(0);return e[31]=x,new A(e)}toUint8Array(){return this.bytes}},S=A;K(S,"ZERO",A.fromID(0));export{M as a,Me as b,Ge as c,je as d,O0 as e,M0 as f,G0 as g,F as h,S as i};
3
+ /*!
4
+ * The buffer module from node.js, for the browser.
5
+ *
6
+ * @author Feross Aboukhadijeh <https://feross.org>
7
+ * @license MIT
8
+ */
9
+ //# sourceMappingURL=chunk-TLWRX3CX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/buffer/index.js", "../../src/account_identifier.ts", "../../src/utils/converter.utils.ts", "../../node_modules/crc/mjs/calculators/crc1.js", "../../node_modules/crc/mjs/create_buffer.js", "../../node_modules/crc/mjs/define_crc.js", "../../node_modules/crc/mjs/crc1.js", "../../node_modules/crc/mjs/calculators/crc8.js", "../../node_modules/crc/mjs/crc8.js", "../../node_modules/crc/mjs/calculators/crc81wire.js", "../../node_modules/crc/mjs/crc81wire.js", "../../node_modules/crc/mjs/calculators/crc16.js", "../../node_modules/crc/mjs/crc16.js", "../../node_modules/crc/mjs/calculators/crc16ccitt.js", "../../node_modules/crc/mjs/crc16ccitt.js", "../../node_modules/crc/mjs/calculators/crc16modbus.js", "../../node_modules/crc/mjs/crc16modbus.js", "../../node_modules/crc/mjs/calculators/crc16xmodem.js", "../../node_modules/crc/mjs/crc16xmodem.js", "../../node_modules/crc/mjs/calculators/crc16kermit.js", "../../node_modules/crc/mjs/crc16kermit.js", "../../node_modules/crc/mjs/calculators/crc24.js", "../../node_modules/crc/mjs/crc24.js", "../../node_modules/crc/mjs/calculators/crc32.js", "../../node_modules/crc/mjs/crc32.js", "../../node_modules/crc/mjs/calculators/crcjam.js", "../../node_modules/crc/mjs/crcjam.js", "../../node_modules/crc/mjs/index.js"],
4
+ "sourcesContent": ["/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return '<Buffer ' + str + '>'\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n", "import type { Principal } from \"@dfinity/principal\";\nimport { sha224 } from \"js-sha256\";\nimport { AccountIdentifier as AccountIdentifierPb } from \"../proto/ledger_pb\";\nimport {\n asciiStringToByteArray,\n calculateCrc32,\n toHexString,\n} from \"./utils/converter.utils\";\n\nexport class AccountIdentifier {\n private constructor(private readonly bytes: Uint8Array) {}\n\n public static fromHex(hex: string): AccountIdentifier {\n return new AccountIdentifier(Uint8Array.from(Buffer.from(hex, \"hex\")));\n }\n\n public static fromPrincipal({\n principal,\n subAccount = SubAccount.ZERO,\n }: {\n principal: Principal;\n subAccount?: SubAccount;\n }): AccountIdentifier {\n // Hash (sha224) the principal, the subAccount and some padding\n const padding = asciiStringToByteArray(\"\\x0Aaccount-id\");\n\n const shaObj = sha224.create();\n shaObj.update([\n ...padding,\n ...principal.toUint8Array(),\n ...subAccount.toUint8Array(),\n ]);\n const hash = new Uint8Array(shaObj.array());\n\n // Prepend the checksum of the hash and convert to a hex string\n const checksum = calculateCrc32(hash);\n const bytes = new Uint8Array([...checksum, ...hash]);\n return new AccountIdentifier(bytes);\n }\n\n /**\n * @returns An AccountIdentifier protobuf object.\n */\n public toProto(): AccountIdentifierPb {\n const accountIdentifier = new AccountIdentifierPb();\n accountIdentifier.setHash(this.bytes);\n return accountIdentifier;\n }\n\n public toHex(): string {\n return toHexString(this.bytes);\n }\n\n public toUint8Array(): Uint8Array {\n return this.bytes;\n }\n\n public toNumbers(): number[] {\n return Array.from(this.bytes);\n }\n}\n\nexport class SubAccount {\n private constructor(private readonly bytes: Uint8Array) {}\n\n public static fromBytes(bytes: Uint8Array): SubAccount | Error {\n if (bytes.length != 32) {\n return Error(\"Subaccount length must be 32-bytes\");\n }\n\n return new SubAccount(bytes);\n }\n\n public static fromPrincipal(principal: Principal): SubAccount {\n const bytes = new Uint8Array(32).fill(0);\n\n const principalBytes = principal.toUint8Array();\n bytes[0] = principalBytes.length;\n\n for (let i = 0; i < principalBytes.length; i++) {\n bytes[1 + i] = principalBytes[i];\n }\n\n return new SubAccount(bytes);\n }\n\n public static fromID(id: number): SubAccount {\n if (id < 0 || id > 255) {\n throw \"Subaccount ID must be >= 0 and <= 255\";\n }\n\n const bytes: Uint8Array = new Uint8Array(32).fill(0);\n bytes[31] = id;\n return new SubAccount(bytes);\n }\n\n public static ZERO: SubAccount = this.fromID(0);\n\n public toUint8Array(): Uint8Array {\n return this.bytes;\n }\n}\n", "import { Buffer } from \"buffer\";\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-ignore (no type definitions for crc are available)\nimport crc from \"crc\";\n\nexport const uint8ArrayToBigInt = (array: Uint8Array): bigint => {\n const view = new DataView(array.buffer, array.byteOffset, array.byteLength);\n if (typeof view.getBigUint64 === \"function\") {\n return view.getBigUint64(0);\n } else {\n const high = BigInt(view.getUint32(0));\n const low = BigInt(view.getUint32(4));\n\n return (high << BigInt(32)) + low;\n }\n};\n\nexport const arrayBufferToArrayOfNumber = (\n buffer: ArrayBuffer\n): Array<number> => {\n const typedArray = new Uint8Array(buffer);\n return Array.from(typedArray);\n};\n\nexport const arrayOfNumberToUint8Array = (\n numbers: Array<number>\n): Uint8Array => {\n return new Uint8Array(numbers);\n};\n\nexport const arrayOfNumberToArrayBuffer = (\n numbers: Array<number>\n): ArrayBuffer => {\n return arrayOfNumberToUint8Array(numbers).buffer;\n};\n\nexport const asciiStringToByteArray = (text: string): Array<number> => {\n return Array.from(text).map((c) => c.charCodeAt(0));\n};\n\nexport const toHexString = (bytes: Uint8Array) =>\n bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, \"0\"), \"\");\n\n// 4 bytes\nexport const calculateCrc32 = (bytes: Uint8Array): Uint8Array => {\n const checksumArrayBuf = new ArrayBuffer(4);\n const view = new DataView(checksumArrayBuf);\n view.setUint32(0, crc.crc32(Buffer.from(bytes)), false);\n return Buffer.from(checksumArrayBuf);\n};\n", "const crc1 = (current, previous = 0) => {\n let crc = ~~previous;\n let accum = 0;\n for (let index = 0; index < current.length; index++) {\n accum += current[index];\n }\n crc += accum % 256;\n return crc % 256;\n};\nexport default crc1;\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-prototype-builtins */\nimport { Buffer } from 'buffer';\nconst createBuffer = (value, encoding) => Buffer.from(value, encoding);\nexport default createBuffer;\n", "import createBuffer from './create_buffer.js';\nexport default function defineCrc(model, calculator) {\n const result = (value, previous) => calculator(createBuffer(value), previous) >>> 0;\n result.signed = (value, previous) => calculator(createBuffer(value), previous);\n result.unsigned = result;\n result.model = model;\n return result;\n}\n", "import crc1 from './calculators/crc1.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc1', crc1);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=crc-8 --generate=c`\nlet TABLE = [\n 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d,\n 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d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, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13,\n 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83,\n 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc8 = (current, previous = 0) => {\n let crc = ~~previous;\n for (let index = 0; index < current.length; index++) {\n crc = TABLE[(crc ^ current[index]) & 0xff] & 0xff;\n }\n return crc;\n};\nexport default crc8;\n", "import crc8 from './calculators/crc8.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc-8', crc8);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=dallas-1-wire --generate=c`\nlet TABLE = [\n 0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41,\n 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc,\n 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62,\n 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff,\n 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07,\n 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a,\n 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24,\n 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9,\n 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd,\n 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50,\n 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee,\n 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73,\n 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b,\n 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16,\n 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8,\n 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc81wire = (current, previous = 0) => {\n let crc = ~~previous;\n for (let index = 0; index < current.length; index++) {\n crc = TABLE[(crc ^ current[index]) & 0xff] & 0xff;\n }\n return crc;\n};\nexport default crc81wire;\n", "import crc81wire from './calculators/crc81wire.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('dallas-1-wire', crc81wire);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16 --generate=c`\nlet TABLE = [\n 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741,\n 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40,\n 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941,\n 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41,\n 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341,\n 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240,\n 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40,\n 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840,\n 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41,\n 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640,\n 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141,\n 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441,\n 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41,\n 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41,\n 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541,\n 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041,\n 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741,\n 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40,\n 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941,\n 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41,\n 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341,\n 0x4100, 0x81c1, 0x8081, 0x4040,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc16 = (current, previous = 0) => {\n let crc = ~~previous;\n for (let index = 0; index < current.length; index++) {\n crc = (TABLE[(crc ^ current[index]) & 0xff] ^ (crc >> 8)) & 0xffff;\n }\n return crc;\n};\nexport default crc16;\n", "import crc16 from './calculators/crc16.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc-16', crc16);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=ccitt --generate=c`\nlet TABLE = [\n 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b,\n 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,\n 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401,\n 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,\n 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738,\n 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,\n 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96,\n 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,\n 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd,\n 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,\n 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb,\n 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,\n 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2,\n 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,\n 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8,\n 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,\n 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827,\n 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,\n 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d,\n 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,\n 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74,\n 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc16ccitt = (current, previous) => {\n let crc = typeof previous !== 'undefined' ? ~~previous : 0xffff;\n for (let index = 0; index < current.length; index++) {\n crc = (TABLE[((crc >> 8) ^ current[index]) & 0xff] ^ (crc << 8)) & 0xffff;\n }\n return crc;\n};\nexport default crc16ccitt;\n", "import crc16ccitt from './calculators/crc16ccitt.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('ccitt', crc16ccitt);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=crc-16-modbus --generate=c`\nlet TABLE = [\n 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, 0xc601, 0x06c0, 0x0780, 0xc741,\n 0x0500, 0xc5c1, 0xc481, 0x0440, 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40,\n 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, 0xd801, 0x18c0, 0x1980, 0xd941,\n 0x1b00, 0xdbc1, 0xda81, 0x1a40, 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41,\n 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, 0xd201, 0x12c0, 0x1380, 0xd341,\n 0x1100, 0xd1c1, 0xd081, 0x1040, 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240,\n 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, 0x3c00, 0xfcc1, 0xfd81, 0x3d40,\n 0xff01, 0x3fc0, 0x3e80, 0xfe41, 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840,\n 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, 0xee01, 0x2ec0, 0x2f80, 0xef41,\n 0x2d00, 0xedc1, 0xec81, 0x2c40, 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640,\n 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, 0xa001, 0x60c0, 0x6180, 0xa141,\n 0x6300, 0xa3c1, 0xa281, 0x6240, 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441,\n 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, 0xaa01, 0x6ac0, 0x6b80, 0xab41,\n 0x6900, 0xa9c1, 0xa881, 0x6840, 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41,\n 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, 0xb401, 0x74c0, 0x7580, 0xb541,\n 0x7700, 0xb7c1, 0xb681, 0x7640, 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041,\n 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, 0x9601, 0x56c0, 0x5780, 0x9741,\n 0x5500, 0x95c1, 0x9481, 0x5440, 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40,\n 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, 0x8801, 0x48c0, 0x4980, 0x8941,\n 0x4b00, 0x8bc1, 0x8a81, 0x4a40, 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41,\n 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, 0x8201, 0x42c0, 0x4380, 0x8341,\n 0x4100, 0x81c1, 0x8081, 0x4040,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc16modbus = (current, previous) => {\n let crc = typeof previous !== 'undefined' ? ~~previous : 0xffff;\n for (let index = 0; index < current.length; index++) {\n crc = (TABLE[(crc ^ current[index]) & 0xff] ^ (crc >> 8)) & 0xffff;\n }\n return crc;\n};\nexport default crc16modbus;\n", "import crc16modbus from './calculators/crc16modbus.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc-16-modbus', crc16modbus);\n", "const crc16xmodem = (current, previous) => {\n let crc = typeof previous !== 'undefined' ? ~~previous : 0x0;\n for (let index = 0; index < current.length; index++) {\n let code = (crc >>> 8) & 0xff;\n code ^= current[index] & 0xff;\n code ^= code >>> 4;\n crc = (crc << 8) & 0xffff;\n crc ^= code;\n code = (code << 5) & 0xffff;\n crc ^= code;\n code = (code << 7) & 0xffff;\n crc ^= code;\n }\n return crc;\n};\nexport default crc16xmodem;\n", "import crc16xmodem from './calculators/crc16xmodem.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('xmodem', crc16xmodem);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=kermit --generate=c`\nlet TABLE = [\n 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3,\n 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,\n 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399,\n 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,\n 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50,\n 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,\n 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e,\n 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,\n 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5,\n 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,\n 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693,\n 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,\n 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a,\n 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,\n 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710,\n 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,\n 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df,\n 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,\n 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595,\n 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,\n 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c,\n 0x3de3, 0x2c6a, 0x1ef1, 0x0f78,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc16kermit = (current, previous) => {\n let crc = typeof previous !== 'undefined' ? ~~previous : 0x0000;\n for (let index = 0; index < current.length; index++) {\n crc = (TABLE[(crc ^ current[index]) & 0xff] ^ (crc >> 8)) & 0xffff;\n }\n return crc;\n};\nexport default crc16kermit;\n", "import crc16kermit from './calculators/crc16kermit.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('kermit', crc16kermit);\n", "// Generated by `./pycrc.py --algorithm=table-drive --model=crc-24 --generate=c`\nlet TABLE = [\n 0x000000, 0x864cfb, 0x8ad50d, 0x0c99f6, 0x93e6e1, 0x15aa1a, 0x1933ec, 0x9f7f17, 0xa18139,\n 0x27cdc2, 0x2b5434, 0xad18cf, 0x3267d8, 0xb42b23, 0xb8b2d5, 0x3efe2e, 0xc54e89, 0x430272,\n 0x4f9b84, 0xc9d77f, 0x56a868, 0xd0e493, 0xdc7d65, 0x5a319e, 0x64cfb0, 0xe2834b, 0xee1abd,\n 0x685646, 0xf72951, 0x7165aa, 0x7dfc5c, 0xfbb0a7, 0x0cd1e9, 0x8a9d12, 0x8604e4, 0x00481f,\n 0x9f3708, 0x197bf3, 0x15e205, 0x93aefe, 0xad50d0, 0x2b1c2b, 0x2785dd, 0xa1c926, 0x3eb631,\n 0xb8faca, 0xb4633c, 0x322fc7, 0xc99f60, 0x4fd39b, 0x434a6d, 0xc50696, 0x5a7981, 0xdc357a,\n 0xd0ac8c, 0x56e077, 0x681e59, 0xee52a2, 0xe2cb54, 0x6487af, 0xfbf8b8, 0x7db443, 0x712db5,\n 0xf7614e, 0x19a3d2, 0x9fef29, 0x9376df, 0x153a24, 0x8a4533, 0x0c09c8, 0x00903e, 0x86dcc5,\n 0xb822eb, 0x3e6e10, 0x32f7e6, 0xb4bb1d, 0x2bc40a, 0xad88f1, 0xa11107, 0x275dfc, 0xdced5b,\n 0x5aa1a0, 0x563856, 0xd074ad, 0x4f0bba, 0xc94741, 0xc5deb7, 0x43924c, 0x7d6c62, 0xfb2099,\n 0xf7b96f, 0x71f594, 0xee8a83, 0x68c678, 0x645f8e, 0xe21375, 0x15723b, 0x933ec0, 0x9fa736,\n 0x19ebcd, 0x8694da, 0x00d821, 0x0c41d7, 0x8a0d2c, 0xb4f302, 0x32bff9, 0x3e260f, 0xb86af4,\n 0x2715e3, 0xa15918, 0xadc0ee, 0x2b8c15, 0xd03cb2, 0x567049, 0x5ae9bf, 0xdca544, 0x43da53,\n 0xc596a8, 0xc90f5e, 0x4f43a5, 0x71bd8b, 0xf7f170, 0xfb6886, 0x7d247d, 0xe25b6a, 0x641791,\n 0x688e67, 0xeec29c, 0x3347a4, 0xb50b5f, 0xb992a9, 0x3fde52, 0xa0a145, 0x26edbe, 0x2a7448,\n 0xac38b3, 0x92c69d, 0x148a66, 0x181390, 0x9e5f6b, 0x01207c, 0x876c87, 0x8bf571, 0x0db98a,\n 0xf6092d, 0x7045d6, 0x7cdc20, 0xfa90db, 0x65efcc, 0xe3a337, 0xef3ac1, 0x69763a, 0x578814,\n 0xd1c4ef, 0xdd5d19, 0x5b11e2, 0xc46ef5, 0x42220e, 0x4ebbf8, 0xc8f703, 0x3f964d, 0xb9dab6,\n 0xb54340, 0x330fbb, 0xac70ac, 0x2a3c57, 0x26a5a1, 0xa0e95a, 0x9e1774, 0x185b8f, 0x14c279,\n 0x928e82, 0x0df195, 0x8bbd6e, 0x872498, 0x016863, 0xfad8c4, 0x7c943f, 0x700dc9, 0xf64132,\n 0x693e25, 0xef72de, 0xe3eb28, 0x65a7d3, 0x5b59fd, 0xdd1506, 0xd18cf0, 0x57c00b, 0xc8bf1c,\n 0x4ef3e7, 0x426a11, 0xc426ea, 0x2ae476, 0xaca88d, 0xa0317b, 0x267d80, 0xb90297, 0x3f4e6c,\n 0x33d79a, 0xb59b61, 0x8b654f, 0x0d29b4, 0x01b042, 0x87fcb9, 0x1883ae, 0x9ecf55, 0x9256a3,\n 0x141a58, 0xefaaff, 0x69e604, 0x657ff2, 0xe33309, 0x7c4c1e, 0xfa00e5, 0xf69913, 0x70d5e8,\n 0x4e2bc6, 0xc8673d, 0xc4fecb, 0x42b230, 0xddcd27, 0x5b81dc, 0x57182a, 0xd154d1, 0x26359f,\n 0xa07964, 0xace092, 0x2aac69, 0xb5d37e, 0x339f85, 0x3f0673, 0xb94a88, 0x87b4a6, 0x01f85d,\n 0x0d61ab, 0x8b2d50, 0x145247, 0x921ebc, 0x9e874a, 0x18cbb1, 0xe37b16, 0x6537ed, 0x69ae1b,\n 0xefe2e0, 0x709df7, 0xf6d10c, 0xfa48fa, 0x7c0401, 0x42fa2f, 0xc4b6d4, 0xc82f22, 0x4e63d9,\n 0xd11cce, 0x575035, 0x5bc9c3, 0xdd8538,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc24 = (current, previous) => {\n let crc = typeof previous !== 'undefined' ? ~~previous : 0xb704ce;\n for (let index = 0; index < current.length; index++) {\n crc = (TABLE[((crc >> 16) ^ current[index]) & 0xff] ^ (crc << 8)) & 0xffffff;\n }\n return crc;\n};\nexport default crc24;\n", "import crc24 from './calculators/crc24.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc-24', crc24);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=crc-32 --generate=c`\nlet TABLE = [\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,\n 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,\n 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,\n 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,\n 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,\n 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,\n 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,\n 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,\n 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,\n 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,\n 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,\n 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,\n 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,\n 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,\n 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,\n 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,\n 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,\n 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crc32 = (current, previous) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let crc = previous === 0 ? 0 : ~~previous ^ -1;\n for (let index = 0; index < current.length; index++) {\n crc = TABLE[(crc ^ current[index]) & 0xff] ^ (crc >>> 8);\n }\n return crc ^ -1;\n};\nexport default crc32;\n", "import crc32 from './calculators/crc32.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('crc-32', crc32);\n", "// Generated by `./pycrc.py --algorithm=table-driven --model=jam --generate=c`\nlet TABLE = [\n 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,\n 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,\n 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,\n 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,\n 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,\n 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,\n 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,\n 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,\n 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,\n 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,\n 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,\n 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,\n 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,\n 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,\n 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,\n 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,\n 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,\n 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,\n 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,\n 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,\n 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,\n 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,\n 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,\n 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,\n 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,\n 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,\n 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,\n 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,\n 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,\n 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,\n 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,\n 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,\n];\nif (typeof Int32Array !== 'undefined') {\n TABLE = new Int32Array(TABLE);\n}\nconst crcjam = (current, previous = -1) => {\n let crc = previous === 0 ? 0 : ~~previous;\n for (let index = 0; index < current.length; index++) {\n crc = TABLE[(crc ^ current[index]) & 0xff] ^ (crc >>> 8);\n }\n return crc;\n};\nexport default crcjam;\n", "import crcjam from './calculators/crcjam.js';\nimport defineCrc from './define_crc.js';\nexport default defineCrc('jam', crcjam);\n", "import crc1 from './crc1.js';\nimport crc8 from './crc8.js';\nimport crc81wire from './crc81wire.js';\nimport crc16 from './crc16.js';\nimport crc16ccitt from './crc16ccitt.js';\nimport crc16modbus from './crc16modbus.js';\nimport crc16xmodem from './crc16xmodem.js';\nimport crc16kermit from './crc16kermit.js';\nimport crc24 from './crc24.js';\nimport crc32 from './crc32.js';\nimport crcjam from './crcjam.js';\nexport { crc1 };\nexport { crc8 };\nexport { crc81wire };\nexport { crc16 };\nexport { crc16ccitt };\nexport { crc16modbus };\nexport { crc16xmodem };\nexport { crc16kermit };\nexport { crc24 };\nexport { crc32 };\nexport { crcjam };\nexport default {\n crc1,\n crc8,\n crc81wire,\n crc16,\n crc16ccitt,\n crc16modbus,\n crc16xmodem,\n crc16kermit,\n crc24,\n crc32,\n crcjam,\n};\n"],
5
+ "mappings": "yJAAA,0BAUA,GAAM,GAAS,KACT,EAAU,KACV,EACH,MAAO,SAAW,YAAc,MAAO,QAAO,KAAW,WACtD,OAAO,IAAO,4BAA4B,EAC1C,KAEN,EAAQ,OAAS,EACjB,EAAQ,WAAa,GACrB,EAAQ,k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,EAC9C,EAAM,GAAK,EAAe,OAE1B,OAAS,GAAI,EAAG,EAAI,EAAe,OAAQ,IACzC,EAAM,EAAI,GAAK,EAAe,GAGhC,MAAO,IAAI,GAAW,CAAK,CAC7B,CAEA,MAAc,QAAO,EAAwB,CAC3C,GAAI,EAAK,GAAK,EAAK,IACjB,KAAM,wCAGR,GAAM,GAAoB,GAAI,YAAW,EAAE,EAAE,KAAK,CAAC,EACnD,SAAM,IAAM,EACL,GAAI,GAAW,CAAK,CAC7B,CAIA,AAAO,cAA2B,CAChC,MAAO,MAAK,KACd,CACF,EAvCa,EAAN,EAkCL,EAlCW,EAkCG,OAAmB,EAAK,OAAO,CAAC",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-CKIW7YKS.js";import"./chunk-NNJFBVJ3.js";import"./chunk-MGC7CRB4.js";import"./chunk-ONAVPXOT.js";export{a as GenesisTokenCanister};
2
+ //# sourceMappingURL=genesis_token.canister.js.map
@@ -0,0 +1,2 @@
1
+ import{s as a}from"./chunk-H6I2Z4SN.js";import"./chunk-TLWRX3CX.js";import"./chunk-FZGMZSQZ.js";import"./chunk-RHCXRQFK.js";import"./chunk-IPUXUCZB.js";import"./chunk-NNJFBVJ3.js";import"./chunk-MGC7CRB4.js";import"./chunk-ONAVPXOT.js";export{a as GovernanceCanister};
2
+ //# sourceMappingURL=governance.canister.js.map
package/dist/esm/icp.js CHANGED
@@ -1,2 +1,2 @@
1
- import{d as a}from"./chunk-MTPVFXPH.js";import"./chunk-FL7E4DL3.js";import"./chunk-ONAVPXOT.js";export{a as ICP};
1
+ import{d as a}from"./chunk-RHCXRQFK.js";import"./chunk-IPUXUCZB.js";import"./chunk-ONAVPXOT.js";export{a as ICP};
2
2
  //# sourceMappingURL=icp.js.map
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-SOPGOKKH.js";import{a as N,b as P,c as b,d as v,e as B,f as C,g as S,h as g,i as T,j as y,k as A,l as G,m as V,n as h,o as k,p as F,q as L,r as j,s as c}from"./chunk-CVYDMRZA.js";import{g as a,h as d}from"./chunk-C2ZTAHQL.js";import{a as q,b as w,c as z,d as D,e as E,f as H,g as J,h as K,i as M,j as m}from"./chunk-BDJ6FQPO.js";import"./chunk-S37GZOMR.js";import"./chunk-EDMSX7GK.js";import"./chunk-KXYKDST6.js";import{c as _,d as I}from"./chunk-MTPVFXPH.js";import"./chunk-FL7E4DL3.js";import"./chunk-ONAVPXOT.js";var l=({recentBallots:e,proposalId:o})=>o?e.find(({proposalId:n})=>n===o)?.vote:void 0,x=({neurons:e,proposal:o})=>{let{ballots:r,proposalTimestampSeconds:n}=o;return e.filter(({createdTimestampSeconds:t,neuronId:f})=>{let p=t>n,s=r.find(({neuronId:u})=>u===f)===void 0;return p||s})},O=({neurons:e,proposal:o})=>{let{id:r}=o;return e.filter(({recentBallots:n,neuronId:t})=>l({recentBallots:n,proposalId:r})===void 0&&x({neurons:e,proposal:o}).find(({neuronId:f})=>f===t)===void 0)},Q=({neurons:e,proposal:o})=>{let{id:r}=o;return e.filter(({recentBallots:n})=>l({recentBallots:n,proposalId:r})!==void 0)};export{a as AccountIdentifier,J as BadFeeError,P as CouldNotClaimNeuronError,T as FeatureNotSupportedError,_ as FromICPStringError,i as GenesisTokenCanister,c as GovernanceCanister,B as GovernanceError,I as ICP,b as InsufficientAmountError,z as InsufficientFundsError,S as InvalidAccountIDError,C as InvalidPercentageError,w as InvalidSenderError,m as LedgerCanister,V as NeuronState,h as ProposalRewardStatus,k as ProposalStatus,N as StakeNeuronError,d as SubAccount,L as Topic,q as TransferError,E as TxCreatedInFutureError,H as TxDuplicateError,D as TxTooOldError,v as UnrecognizedTypeError,g as UnsupportedValueError,F as Vote,A as accountIdentifierFromBytes,y as accountIdentifierToBytes,j as checkAccountId,x as ineligibleNeurons,K as mapTransferError,M as mapTransferProtoError,G as principalToAccountIdentifier,O as votableNeurons,Q as votedNeurons};
1
+ import{a as u}from"./chunk-CKIW7YKS.js";import{a as P,b,c as v,d as B,e as S,f as y,g as C,h as g,i as T,j as _,k as w,l as A,m as G,n as V,o as W,p as h,q as k,r as F,s as m}from"./chunk-H6I2Z4SN.js";import{h as d,i}from"./chunk-TLWRX3CX.js";import{a as L,b as O,c as j,d as q,e as z,f as E,g as H,h as J,i as K,j as c}from"./chunk-JUIC5FZJ.js";import"./chunk-FZGMZSQZ.js";import{c as D,d as I}from"./chunk-RHCXRQFK.js";import"./chunk-IPUXUCZB.js";import{a as x}from"./chunk-NN3MUNHF.js";import"./chunk-NNJFBVJ3.js";import"./chunk-MGC7CRB4.js";import"./chunk-ONAVPXOT.js";var f=({recentBallots:e,proposalId:o})=>o?e.find(({proposalId:n})=>n===o)?.vote:void 0,N=({neurons:e,proposal:o})=>{let{ballots:r,proposalTimestampSeconds:n}=o;return e.filter(({createdTimestampSeconds:t,neuronId:s})=>{let p=t>n,l=r.find(({neuronId:a})=>a===s)===void 0;return p||l})},M=({neurons:e,proposal:o})=>{let{id:r}=o;return e.filter(({recentBallots:n,neuronId:t})=>f({recentBallots:n,proposalId:r})===void 0&&N({neurons:e,proposal:o}).find(({neuronId:s})=>s===t)===void 0)},Q=({neurons:e,proposal:o})=>{let{id:r}=o;return e.filter(({recentBallots:n})=>f({recentBallots:n,proposalId:r})!==void 0)};export{d as AccountIdentifier,H as BadFeeError,b as CouldNotClaimNeuronError,T as FeatureNotSupportedError,D as FromICPStringError,u as GenesisTokenCanister,m as GovernanceCanister,S as GovernanceError,I as ICP,v as InsufficientAmountError,j as InsufficientFundsError,C as InvalidAccountIDError,y as InvalidPercentageError,O as InvalidSenderError,c as LedgerCanister,G as NeuronState,V as ProposalRewardStatus,W as ProposalStatus,x as SnsWasmCanister,P as StakeNeuronError,i as SubAccount,k as Topic,L as TransferError,z as TxCreatedInFutureError,E as TxDuplicateError,q as TxTooOldError,B as UnrecognizedTypeError,g as UnsupportedValueError,h as Vote,w as accountIdentifierFromBytes,_ as accountIdentifierToBytes,F as checkAccountId,N as ineligibleNeurons,J as mapTransferError,K as mapTransferProtoError,A as principalToAccountIdentifier,M as votableNeurons,Q as votedNeurons};
2
2
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/neurons.utils.ts"],
4
4
  "sourcesContent": ["import type {\n Ballot,\n BallotInfo,\n NeuronInfo,\n ProposalId,\n ProposalInfo,\n Vote,\n} from \"../types/governance_converters\";\n\nconst voteForProposal = ({\n recentBallots,\n proposalId,\n}: {\n recentBallots: BallotInfo[];\n proposalId: ProposalId | undefined;\n}): Vote | undefined => {\n if (!proposalId) {\n return undefined;\n }\n\n const ballot: BallotInfo | undefined = recentBallots.find(\n ({ proposalId: id }: BallotInfo) => id === proposalId\n );\n return ballot?.vote;\n};\n\nexport const ineligibleNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { ballots, proposalTimestampSeconds } = proposal;\n\n return neurons.filter(({ createdTimestampSeconds, neuronId }: NeuronInfo) => {\n const createdSinceProposal: boolean =\n createdTimestampSeconds > proposalTimestampSeconds;\n\n const dissolveTooShort: boolean =\n ballots.find(\n ({ neuronId: ballotNeuronId }: Ballot) => ballotNeuronId === neuronId\n ) === undefined;\n\n return createdSinceProposal || dissolveTooShort;\n });\n};\n\n/**\n * Neurons that can vote for the proposal (not voted, with voting power)\n */\nexport const votableNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { id: proposalId } = proposal;\n\n return neurons.filter(\n ({ recentBallots, neuronId }: NeuronInfo) =>\n voteForProposal({ recentBallots, proposalId }) === undefined &&\n ineligibleNeurons({ neurons, proposal }).find(\n ({ neuronId: ineligibleNeuronId }: NeuronInfo) =>\n ineligibleNeuronId === neuronId\n ) === undefined\n );\n};\n\nexport const votedNeurons = ({\n neurons,\n proposal,\n}: {\n neurons: NeuronInfo[];\n proposal: ProposalInfo;\n}): NeuronInfo[] => {\n const { id: proposalId } = proposal;\n\n return neurons.filter(\n ({ recentBallots }: NeuronInfo) =>\n voteForProposal({ recentBallots, proposalId }) !== undefined\n );\n};\n"],
5
- "mappings": "+hBASA,GAAM,GAAkB,CAAC,CACvB,gBACA,gBAKK,EAOE,AAHgC,EAAc,KACnD,CAAC,CAAE,WAAY,KAAqB,IAAO,CAC7C,GACe,KANb,OASS,EAAoB,CAAC,CAChC,UACA,cAIkB,CAClB,GAAM,CAAE,UAAS,4BAA6B,EAE9C,MAAO,GAAQ,OAAO,CAAC,CAAE,0BAAyB,cAA2B,CAC3E,GAAM,GACJ,EAA0B,EAEtB,EACJ,EAAQ,KACN,CAAC,CAAE,SAAU,KAA6B,IAAmB,CAC/D,IAAM,OAER,MAAO,IAAwB,CACjC,CAAC,CACH,EAKa,EAAiB,CAAC,CAC7B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,gBAAe,cAChB,EAAgB,CAAE,gBAAe,YAAW,CAAC,IAAM,QACnD,EAAkB,CAAE,UAAS,UAAS,CAAC,EAAE,KACvC,CAAC,CAAE,SAAU,KACX,IAAuB,CAC3B,IAAM,MACV,CACF,EAEa,EAAe,CAAC,CAC3B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,mBACD,EAAgB,CAAE,gBAAe,YAAW,CAAC,IAAM,MACvD,CACF",
5
+ "mappings": "6jBASA,GAAM,GAAkB,CAAC,CACvB,gBACA,gBAKK,EAOE,AAHgC,EAAc,KACnD,CAAC,CAAE,WAAY,KAAqB,IAAO,CAC7C,GACe,KANb,OASS,EAAoB,CAAC,CAChC,UACA,cAIkB,CAClB,GAAM,CAAE,UAAS,4BAA6B,EAE9C,MAAO,GAAQ,OAAO,CAAC,CAAE,0BAAyB,cAA2B,CAC3E,GAAM,GACJ,EAA0B,EAEtB,EACJ,EAAQ,KACN,CAAC,CAAE,SAAU,KAA6B,IAAmB,CAC/D,IAAM,OAER,MAAO,IAAwB,CACjC,CAAC,CACH,EAKa,EAAiB,CAAC,CAC7B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,gBAAe,cAChB,EAAgB,CAAE,gBAAe,YAAW,CAAC,IAAM,QACnD,EAAkB,CAAE,UAAS,UAAS,CAAC,EAAE,KACvC,CAAC,CAAE,SAAU,KACX,IAAuB,CAC3B,IAAM,MACV,CACF,EAEa,EAAe,CAAC,CAC3B,UACA,cAIkB,CAClB,GAAM,CAAE,GAAI,GAAe,EAE3B,MAAO,GAAQ,OACb,CAAC,CAAE,mBACD,EAAgB,CAAE,gBAAe,YAAW,CAAC,IAAM,MACvD,CACF",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,2 @@
1
+ import{j as a}from"./chunk-JUIC5FZJ.js";import"./chunk-FZGMZSQZ.js";import"./chunk-RHCXRQFK.js";import"./chunk-IPUXUCZB.js";import"./chunk-NNJFBVJ3.js";import"./chunk-MGC7CRB4.js";import"./chunk-ONAVPXOT.js";export{a as LedgerCanister};
2
+ //# sourceMappingURL=ledger.canister.js.map
@@ -0,0 +1,2 @@
1
+ import{a}from"./chunk-NN3MUNHF.js";import"./chunk-NNJFBVJ3.js";import"./chunk-MGC7CRB4.js";import"./chunk-ONAVPXOT.js";export{a as SnsWasmCanister};
2
+ //# sourceMappingURL=sns_wasm.canister.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }