nostr-crypto-utils 0.5.1 → 0.5.2

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 (41) hide show
  1. package/dist/browser/crypto.nostr-crypto-utils.min.js +15 -1
  2. package/dist/browser/crypto.nostr-crypto-utils.min.js.map +7 -0
  3. package/dist/browser/main.nostr-crypto-utils.min.js +32 -0
  4. package/dist/browser/main.nostr-crypto-utils.min.js.map +7 -0
  5. package/dist/browser/nip-44.nostr-crypto-utils.min.js +21 -2
  6. package/dist/browser/nip-44.nostr-crypto-utils.min.js.map +7 -0
  7. package/dist/browser/nip-46.nostr-crypto-utils.min.js +21 -2
  8. package/dist/browser/nip-46.nostr-crypto-utils.min.js.map +7 -0
  9. package/dist/browser/nip-49.nostr-crypto-utils.min.js +13 -1
  10. package/dist/browser/nip-49.nostr-crypto-utils.min.js.map +7 -0
  11. package/dist/browser/protocol.nostr-crypto-utils.min.js +2 -1
  12. package/dist/browser/protocol.nostr-crypto-utils.min.js.map +7 -0
  13. package/dist/browser/validation.nostr-crypto-utils.min.js +15 -1
  14. package/dist/browser/validation.nostr-crypto-utils.min.js.map +7 -0
  15. package/package.json +4 -7
  16. package/dist/browser/116.nostr-crypto-utils.min.js +0 -2
  17. package/dist/browser/116.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  18. package/dist/browser/126.nostr-crypto-utils.min.js +0 -2
  19. package/dist/browser/126.nostr-crypto-utils.min.js.LICENSE.txt +0 -3
  20. package/dist/browser/287.nostr-crypto-utils.min.js +0 -2
  21. package/dist/browser/287.nostr-crypto-utils.min.js.LICENSE.txt +0 -6
  22. package/dist/browser/343.nostr-crypto-utils.min.js +0 -1
  23. package/dist/browser/348.nostr-crypto-utils.min.js +0 -2
  24. package/dist/browser/348.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  25. package/dist/browser/524.nostr-crypto-utils.min.js +0 -1
  26. package/dist/browser/575.nostr-crypto-utils.min.js +0 -2
  27. package/dist/browser/575.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  28. package/dist/browser/615.nostr-crypto-utils.min.js +0 -2
  29. package/dist/browser/615.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  30. package/dist/browser/668.nostr-crypto-utils.min.js +0 -2
  31. package/dist/browser/668.nostr-crypto-utils.min.js.LICENSE.txt +0 -6
  32. package/dist/browser/705.nostr-crypto-utils.min.js +0 -2
  33. package/dist/browser/705.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  34. package/dist/browser/732.nostr-crypto-utils.min.js +0 -1
  35. package/dist/browser/843.nostr-crypto-utils.min.js +0 -2
  36. package/dist/browser/843.nostr-crypto-utils.min.js.LICENSE.txt +0 -3
  37. package/dist/browser/main-31743c5a.nostr-crypto-utils.min.js +0 -1
  38. package/dist/browser/main-96d4916e.nostr-crypto-utils.min.js +0 -1
  39. package/dist/browser/main-9fdc67c2.nostr-crypto-utils.min.js +0 -1
  40. package/dist/browser/nip-44.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
  41. package/dist/browser/nip-46.nostr-crypto-utils.min.js.LICENSE.txt +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nostr-crypto-utils",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Core cryptographic utilities for Nostr protocol",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/cjs/index.js",
@@ -44,7 +44,7 @@
44
44
  "build:types": "tsc -p tsconfig.types.json",
45
45
  "build:cjs": "tsc -p tsconfig.cjs.json",
46
46
  "build:esm": "tsc -p tsconfig.esm.json",
47
- "build:browser": "webpack --config webpack.config.cjs",
47
+ "build:browser": "node esbuild.browser.mjs",
48
48
  "test": "vitest run",
49
49
  "test:watch": "vitest",
50
50
  "test:coverage": "vitest run --coverage",
@@ -91,13 +91,10 @@
91
91
  "@typescript-eslint/eslint-plugin": "^8.56.0",
92
92
  "@typescript-eslint/parser": "^8.56.0",
93
93
  "@vitest/coverage-v8": "^3.2.4",
94
+ "esbuild": "^0.27.3",
94
95
  "eslint": "^10.0.0",
95
- "ts-loader": "^9.5.4",
96
96
  "typescript": "^5.9.3",
97
- "vitest": "^3.2.4",
98
- "webpack": "^5.105.2",
99
- "webpack-cli": "^5.1.4",
100
- "webpack-node-externals": "^3.0.0"
97
+ "vitest": "^3.2.4"
101
98
  },
102
99
  "engines": {
103
100
  "node": ">=18.0.0"
@@ -1,2 +0,0 @@
1
- /*! For license information please see 116.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[116],{116(r,e,n){function o(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name}function t(r){if(!o(r))throw new Error("Uint8Array expected")}function i(r,e){return!!Array.isArray(e)&&(0===e.length||(r?e.every(r=>"string"==typeof r):e.every(r=>Number.isSafeInteger(r))))}function c(r){if("function"!=typeof r)throw new Error("function expected");return!0}function d(r,e){if("string"!=typeof e)throw new Error(`${r}: string expected`);return!0}function a(r){if(!Number.isSafeInteger(r))throw new Error(`invalid integer: ${r}`)}function f(r){if(!Array.isArray(r))throw new Error("array expected")}function s(r,e){if(!i(!0,e))throw new Error(`${r}: array of strings expected`)}function u(r,e){if(!i(!1,e))throw new Error(`${r}: array of numbers expected`)}function h(...r){const e=r=>r,n=(r,e)=>n=>r(e(n));return{encode:r.map(r=>r.encode).reduceRight(n,e),decode:r.map(r=>r.decode).reduce(n,e)}}function w(r){const e="string"==typeof r?r.split(""):r,n=e.length;s("alphabet",e);const o=new Map(e.map((r,e)=>[r,e]));return{encode:o=>(f(o),o.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${r}`);return e[o]})),decode:e=>(f(e),e.map(e=>{d("alphabet.decode",e);const n=o.get(e);if(void 0===n)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n}))}}function l(r=""){return d("join",r),{encode:e=>(s("join.decode",e),e.join(r)),decode:e=>(d("join.decode",e),e.split(r))}}function p(r,e="="){return a(r),d("padding",e),{encode(n){for(s("padding.encode",n);n.length*r%8;)n.push(e);return n},decode(n){s("padding.decode",n);let o=n.length;if(o*r%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;o>0&&n[o-1]===e;o--)if((o-1)*r%8==0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,o)}}}function g(r){return c(r),{encode:r=>r,decode:e=>r(e)}}function y(r,e,n){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(f(r),!r.length)return[];let o=0;const t=[],i=Array.from(r,r=>{if(a(r),r<0||r>=e)throw new Error(`invalid integer: ${r}`);return r}),c=i.length;for(;;){let r=0,d=!0;for(let t=o;t<c;t++){const c=i[t],a=e*r,f=a+c;if(!Number.isSafeInteger(f)||a/e!==r||f-c!==a)throw new Error("convertRadix: carry overflow");const s=f/n;r=f%n;const u=Math.floor(s);if(i[t]=u,!Number.isSafeInteger(u)||u*n+r!==f)throw new Error("convertRadix: carry overflow");d&&(u?d=!1:o=t)}if(t.push(r),d)break}for(let e=0;e<r.length-1&&0===r[e];e++)t.push(0);return t.reverse()}n.d(e,{K3:()=>C});const E=(r,e)=>0===e?r:E(e,r%e),b=(r,e)=>r+(e-E(r,e)),m=(()=>{let r=[];for(let e=0;e<40;e++)r.push(2**e);return r})();function x(r,e,n,o){if(f(r),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(b(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${b(e,n)}`);let t=0,i=0;const c=m[e],d=m[n]-1,s=[];for(const o of r){if(a(o),o>=c)throw new Error(`convertRadix2: invalid data word=${o} from=${e}`);if(t=t<<e|o,i+e>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);for(i+=e;i>=n;i-=n)s.push((t>>i-n&d)>>>0);const r=m[i];if(void 0===r)throw new Error("invalid carry");t&=r-1}if(t=t<<n-i&d,!o&&i>=e)throw new Error("Excess padding");if(!o&&t>0)throw new Error(`Non-zero padding: ${t}`);return o&&i>0&&s.push(t>>>0),s}function v(r,e=!1){if(a(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(b(8,r)>32||b(r,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!o(n))throw new Error("radix2.encode input should be Uint8Array");return x(Array.from(n),8,r,!e)},decode:n=>(u("radix2.decode",n),Uint8Array.from(x(n,r,8,e)))}}function A(r){return c(r),function(...e){try{return r.apply(null,e)}catch(r){}}}h(v(4),w("0123456789ABCDEF"),l("")),h(v(5),w("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),p(5),l(""));const $=(h(v(5),w("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),l("")),h(v(5),w("0123456789ABCDEFGHIJKLMNOPQRSTUV"),p(5),l("")),h(v(5),w("0123456789ABCDEFGHIJKLMNOPQRSTUV"),l("")),h(v(5),w("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),l(""),g(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)()),U=(r,e)=>{d("base64",r);const n=e?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,o=e?"base64url":"base64";if(r.length>0&&!n.test(r))throw new Error("invalid base64");return Uint8Array.fromBase64(r,{alphabet:o,lastChunkHandling:"strict"})},C=$?{encode:r=>(t(r),r.toBase64()),decode:r=>U(r,!1)}:h(v(6),w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),p(6),l("")),R=(h(v(6),w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),l("")),$||h(v(6),w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),p(6),l("")),h(v(6),w("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),l("")),r=>{return h((a(e=58),{encode:r=>{if(!o(r))throw new Error("radix.encode input should be Uint8Array");return y(Array.from(r),256,e)},decode:r=>(u("radix.decode",r),Uint8Array.from(y(r,e,256)))}),w(r),l(""));var e}),B=(R("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),R("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),R("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),h(w("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),l(""))),N=[996825010,642813549,513874426,1027748829,705979059];function I(r){const e=r>>25;let n=(33554431&r)<<5;for(let r=0;r<N.length;r++)1==(e>>r&1)&&(n^=N[r]);return n}function S(r,e,n=1){const o=r.length;let t=1;for(let e=0;e<o;e++){const n=r.charCodeAt(e);if(n<33||n>126)throw new Error(`Invalid prefix (${r})`);t=I(t)^n>>5}t=I(t);for(let e=0;e<o;e++)t=I(t)^31&r.charCodeAt(e);for(let r of e)t=I(t)^r;for(let r=0;r<6;r++)t=I(t);return t^=n,B.encode(x([t%m[30]],30,5,!1))}function L(r){const e="bech32"===r?1:734539939,n=v(5),t=n.decode,i=n.encode,c=A(t);function a(r,n,t=90){d("bech32.encode prefix",r),o(n)&&(n=Array.from(n)),u("bech32.encode",n);const i=r.length;if(0===i)throw new TypeError(`Invalid prefix length ${i}`);const c=i+7+n.length;if(!1!==t&&c>t)throw new TypeError(`Length ${c} exceeds limit ${t}`);const a=r.toLowerCase(),f=S(a,n,e);return`${a}1${B.encode(n)}${f}`}function f(r,n=90){d("bech32.decode input",r);const o=r.length;if(o<8||!1!==n&&o>n)throw new TypeError(`invalid string length: ${o} (${r}). Expected (8..${n})`);const t=r.toLowerCase();if(r!==t&&r!==r.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=t.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const c=t.slice(0,i),a=t.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const f=B.decode(a).slice(0,-6),s=S(c,f,e);if(!a.endsWith(s))throw new Error(`Invalid checksum in ${r}: expected "${s}"`);return{prefix:c,words:f}}return{encode:a,decode:f,encodeFromBytes:function(r,e){return a(r,i(e))},decodeToBytes:function(r){const{prefix:e,words:n}=f(r,!1);return{prefix:e,words:n,bytes:t(n)}},decodeUnsafe:A(f),fromWords:t,fromWordsUnsafe:c,toWords:i}}L("bech32"),L("bech32m");(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)()||h(v(4),w("0123456789abcdef"),l(""),g(r=>{if("string"!=typeof r||r.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}))}}]);
@@ -1 +0,0 @@
1
- /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1,2 +0,0 @@
1
- /*! For license information please see 126.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[126,615],{139(t,e,n){e.o6=function(t,e,n){return(0,o.ahash)(t),void 0===n&&(n=new Uint8Array(t.outputLen)),(0,r.hmac)(t,(0,o.toBytes)(n),(0,o.toBytes)(e))},e.fT=function(t,e,n,c=32){(0,o.ahash)(t),(0,o.anumber)(c);const a=t.outputLen;if(c>255*a)throw new Error("Length should be <= 255*HashLen");const u=Math.ceil(c/a);void 0===n&&(n=s);const h=new Uint8Array(u*a),f=r.hmac.create(t,e),d=f._cloneInto(),p=new Uint8Array(f.outputLen);for(let t=0;t<u;t++)i[0]=t+1,d.update(0===t?s:p).update(n).update(i).digestInto(p),h.set(p,a*t),f._cloneInto(d);return f.destroy(),d.destroy(),(0,o.clean)(p,i),h.slice(0,c)};const r=n(615),o=n(175);const i=Uint8Array.from([0]),s=Uint8Array.of()},615(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const r=n(175);class o extends r.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(t);const n=(0,r.toBytes)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),(0,r.clean)(i)}update(t){return(0,r.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,r.aexists)(this),(0,r.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:s}=this;return t.finished=r,t.destroyed=o,t.blockLen=i,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o,e.hmac=(t,e,n)=>new o(t,e).update(n).digest(),e.hmac.create=(t,e)=>new o(t,e)},623(t,e,n){e.sc=void 0;const r=n(76);r.SHA256,e.sc=r.sha256,r.SHA224,r.sha224},175(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=o,e.anumber=i,e.abytes=s,e.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");i(t.outputLen),i(t.blockLen)},e.aexists=function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},e.aoutput=function(t,e){s(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},e.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},e.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},e.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},e.createView=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},e.rotr=function(t,e){return t<<32-e|t>>>e},e.rotl=function(t,e){return t<<e|t>>>32-e>>>0},e.byteSwap=c,e.byteSwap32=a,e.bytesToHex=function(t){if(s(t),u)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=h[t[n]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(u)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=f(t.charCodeAt(o)),i=f(t.charCodeAt(o+1));if(void 0===n||void 0===i){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+i}return r},e.asyncLoop=async function(t,n,r){let o=Date.now();for(let i=0;i<t;i++){r(i);const t=Date.now()-o;t>=0&&t<n||(await(0,e.nextTick)(),o+=t)}},e.utf8ToBytes=d,e.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},e.toBytes=p,e.kdfInputToBytes=function(t){return"string"==typeof t&&(t=d(t)),s(t),t},e.concatBytes=function(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];s(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n},e.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)},e.createHasher=y,e.createOptHasher=l,e.createXOFer=w,e.randomBytes=function(t=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(t));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")};const r=n(145);function o(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function i(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function s(t,...e){if(!o(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function c(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function a(t){for(let e=0;e<t.length;e++)t[e]=c(t[e]);return t}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.swap8IfBE=e.isLE?t=>t:t=>c(t),e.byteSwapIfBE=e.swap8IfBE,e.swap32IfBE=e.isLE?t=>t:a;const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),h=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function f(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function d(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function p(t){return"string"==typeof t&&(t=d(t)),s(t),t}function y(t){const e=e=>t().update(p(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function l(t){const e=(e,n)=>t(n).update(p(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}function w(t){const e=(e,n)=>t(n).update(p(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}e.nextTick=async()=>{},e.Hash=class{},e.wrapConstructor=y,e.wrapConstructorWithOpts=l,e.wrapXOFConstructorWithOpts=w},246(t,e,n){function r(t){if("boolean"!=typeof t)throw new Error(`boolean expected, not ${t}`)}function o(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function i(t,e,n=""){const r=(o=t)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name;var o;const i=t?.length,s=void 0!==e;if(!r||s&&i!==e)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(r?`length=${i}`:"type="+typeof t));return t}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function c(t,e){i(t,void 0,"output");const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function a(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function u(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}n.d(e,{CC:()=>s,DH:()=>a,DO:()=>i,Fe:()=>o,Ht:()=>c,N$:()=>y,Pg:()=>l,e8:()=>r,ex:()=>d,nC:()=>w,qn:()=>p,tY:()=>f,uH:()=>u});const h=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function f(t,e){if(null==e||"object"!=typeof e)throw new Error("options must be defined");return Object.assign(t,e)}function d(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}const p=(t,e)=>{function n(n,...r){if(i(n,void 0,"key"),!h)throw new Error("Non little-endian hardware is not yet supported");void 0!==t.nonceLength&&i(r[0],t.varSizeNonce?void 0:t.nonceLength,"nonce");const o=t.tagLength;o&&void 0!==r[1]&&i(r[1],void 0,"AAD");const s=e(n,...r),c=(t,e)=>{if(void 0!==e){if(2!==t)throw new Error("cipher output not supported");i(e,void 0,"output")}};let a=!1;return{encrypt(t,e){if(a)throw new Error("cannot encrypt() twice with same key + nonce");return a=!0,i(t),c(s.encrypt.length,e),s.encrypt(t,e)},decrypt(t,e){if(i(t),o&&t.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return c(s.decrypt.length,e),s.decrypt(t,e)}}}return Object.assign(n,t),n};function y(t,e,n=!0){if(void 0===e)return new Uint8Array(t);if(e.length!==t)throw new Error('"output" expected Uint8Array of length '+t+", got: "+e.length);if(n&&e.byteOffset%4!=0)throw new Error("invalid output, must be aligned");return e}function l(t,e,n){r(n);const o=new Uint8Array(16),i=(s=o,new DataView(s.buffer,s.byteOffset,s.byteLength));var s;return i.setBigUint64(0,BigInt(e),n),i.setBigUint64(8,BigInt(t),n),o}function w(t){return Uint8Array.from(t)}}}]);
@@ -1,3 +0,0 @@
1
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
2
-
3
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1,2 +0,0 @@
1
- /*! For license information please see 287.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[287,668],{287(t,e,r){const n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;const f=2147483647;function s(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|y(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||H(t.length)?s(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return c(t),s(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function y(t){if(t>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){let o,f=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function h(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){let n=-1;for(o=r;o<s;o++)if(h(t,o)===h(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*f}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(h(t,o+n)!==h(e,n)){r=!1;break}if(r)return o}return-1}function E(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let f;for(n>o/2&&(n=o/2),f=0;f<n;++f){const n=parseInt(e.substr(2*f,2),16);if(H(n))return f;t[r+f]=n}return f}function m(t,e,r,n){return J(q(e,t.length-r),t,r,n)}function I(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function U(t,e,r,n){return J(W(e),t,r,n)}function A(t,e,r,n){return J(function(t,e){let r,n,i;const o=[];for(let f=0;f<t.length&&!((e-=2)<0);++f)r=t.charCodeAt(f),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function v(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,f=e>239?4:e>223?3:e>191?2:1;if(i+f<=r){let r,n,s,u;switch(f){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=f}return function(t){const e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},u.allocUnsafe=function(t){return a(t)},u.allocUnsafeSlow=function(t){return a(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Z(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)d(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?R(this,0,t):w.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),f=(r>>>=0)-(e>>>=0);const s=Math.min(o,f),h=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<s;++t)if(h[t]!==c[t]){o=h[t],f=c[t];break}return o<f?-1:f<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return U(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function T(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function S(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=K[t[n]];return i}function _(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function $(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function k(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||$(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||$(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),u.prototype.readBigInt64BE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||$(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||$(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||$(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||$(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q(function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Q(function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=0,o=1,f=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===f&&0!==this[e+i-1]&&(f=1),this[e+i]=(t/o|0)-f&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=r-1,o=1,f=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/o|0)-f&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q(function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Q(function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),f=o.length;if(0===f)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%f]}return this};const j={};function M(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function D(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||Y(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function Y(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),M("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let f=0;f<n;++f){if(r=t.charCodeAt(f),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}}}]);
@@ -1,6 +0,0 @@
1
- /*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[343],{343(t,r){const e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let t=0;t<32;t++){const r=e.charAt(t);n[r]=t}function o(t){const r=t>>25;return(33554431&t)<<5^996825010&-(1&r)^642813549&-(r>>1&1)^513874426&-(r>>2&1)^1027748829&-(r>>3&1)^705979059&-(r>>4&1)}function i(t){let r=1;for(let e=0;e<t.length;++e){const n=t.charCodeAt(e);if(n<33||n>126)return"Invalid prefix ("+t+")";r=o(r)^n>>5}r=o(r);for(let e=0;e<t.length;++e){const n=t.charCodeAt(e);r=o(r)^31&n}return r}function s(t,r,e,n){let o=0,i=0;const s=(1<<e)-1,c=[];for(let n=0;n<t.length;++n)for(o=o<<r|t[n],i+=r;i>=e;)i-=e,c.push(o>>i&s);if(n)i>0&&c.push(o<<e-i&s);else{if(i>=r)return"Excess padding";if(o<<e-i&s)return"Non-zero padding"}return c}function c(t){return s(t,8,5,!0)}function f(t){const r=s(t,5,8,!1);if(Array.isArray(r))return r}function u(t){const r=s(t,5,8,!1);if(Array.isArray(r))return r;throw new Error(r)}function h(t){let r;function s(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";const s=t.toLowerCase(),c=t.toUpperCase();if(t!==s&&t!==c)return"Mixed-case string "+t;const f=(t=s).lastIndexOf("1");if(-1===f)return"No separator character for "+t;if(0===f)return"Missing prefix for "+t;const u=t.slice(0,f),h=t.slice(f+1);if(h.length<6)return"Data too short";let l=i(u);if("string"==typeof l)return l;const a=[];for(let t=0;t<h.length;++t){const r=h.charAt(t),e=n[r];if(void 0===e)return"Unknown character "+r;l=o(l)^e,t+6>=h.length||a.push(e)}return l!==r?"Invalid checksum for "+t:{prefix:u,words:a}}return r="bech32"===t?1:734539939,{decodeUnsafe:function(t,r){const e=s(t,r);if("object"==typeof e)return e},decode:function(t,r){const e=s(t,r);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,n,s){if(s=s||90,t.length+7+n.length>s)throw new TypeError("Exceeds length limit");let c=i(t=t.toLowerCase());if("string"==typeof c)throw new Error(c);let f=t+"1";for(let t=0;t<n.length;++t){const r=n[t];if(r>>5)throw new Error("Non 5-bit word");c=o(c)^r,f+=e.charAt(r)}for(let t=0;t<6;++t)c=o(c);c^=r;for(let t=0;t<6;++t)f+=e.charAt(c>>5*(5-t)&31);return f},toWords:c,fromWordsUnsafe:f,fromWords:u}}h("bech32"),h("bech32m")}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 348.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[348],{967(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeLE=void 0,t.mod=b,t.pow=function(e,t,n){return v(x(n),e,t)},t.pow2=function(e,t,n){let r=e;for(;t-- >o;)r*=r,r%=n;return r},t.invert=g,t.tonelliShanks=w,t.FpSqrt=E,t.validateField=function(e){const t=B.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,r._validateObject)(e,t),e},t.FpPow=v,t.FpInvertBatch=O,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?g(n,e.ORDER):e.inv(n))},t.FpLegendre=T,t.FpIsSquare=function(e,t){return 1===T(e,t)},t.nLength=q,t.Field=x,t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},t.hashToPrivateScalar=function(e,t,n=!1){const o=(e=(0,r.ensureBytes)("privateHash",e)).length,s=q(t).nByteLength+8;if(s<24||o<s||o>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+o);return b(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-i)+i},t.getFieldBytesLength=N,t.getMinHashLength=I,t.mapHashToField=function(e,t,n=!1){const o=e.length,s=N(t),u=I(t);if(o<16||o<u||o>1024)throw new Error("expected "+u+"-1024 bytes of input, got "+o);const f=b(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-i)+i;return n?(0,r.numberToBytesLE)(f,s):(0,r.numberToBytesBE)(f,s)};const r=n(627),o=BigInt(0),i=BigInt(1),s=BigInt(2),u=BigInt(3),f=BigInt(4),c=BigInt(5),l=BigInt(7),a=BigInt(8),d=BigInt(9),y=BigInt(16);function b(e,t){const n=e%t;return n>=o?n:t+n}function g(e,t){if(e===o)throw new Error("invert: expected non-zero number");if(t<=o)throw new Error("invert: expected positive modulus, got "+t);let n=b(e,t),r=t,s=o,u=i,f=i,c=o;for(;n!==o;){const e=r/n,t=r%n,o=s-f*e,i=u-c*e;r=n,n=t,s=f,u=c,f=o,c=i}if(r!==i)throw new Error("invert: does not exist");return b(s,t)}function h(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function p(e,t){const n=(e.ORDER+i)/f,r=e.pow(t,n);return h(e,r,t),r}function m(e,t){const n=(e.ORDER-c)/a,r=e.mul(t,s),o=e.pow(r,n),i=e.mul(t,o),u=e.mul(e.mul(i,s),o),f=e.mul(i,e.sub(u,e.ONE));return h(e,f,t),f}function w(e){if(e<u)throw new Error("sqrt is not defined for small field");let t=e-i,n=0;for(;t%s===o;)t/=s,n++;let r=s;const f=x(e);for(;1===T(f,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return p;let c=f.pow(r,t);const l=(t+i)/s;return function(e,r){if(e.is0(r))return r;if(1!==T(e,r))throw new Error("Cannot find square root");let o=n,s=e.mul(e.ONE,c),u=e.pow(r,t),f=e.pow(r,l);for(;!e.eql(u,e.ONE);){if(e.is0(u))return e.ZERO;let t=1,n=e.sqr(u);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error("Cannot find square root");const r=i<<BigInt(o-t-1),c=e.pow(s,r);o=t,s=e.sqr(c),u=e.mul(u,s),f=e.mul(f,c)}return f}}function E(e){return e%f===u?p:e%a===c?m:e%y===d?function(e){const t=x(e),n=w(e),r=n(t,t.neg(t.ONE)),o=n(t,r),i=n(t,t.neg(r)),s=(e+l)/y;return(e,t)=>{let n=e.pow(t,s),u=e.mul(n,r);const f=e.mul(n,o),c=e.mul(n,i),l=e.eql(e.sqr(u),t),a=e.eql(e.sqr(f),t);n=e.cmov(n,u,l),u=e.cmov(c,f,a);const d=e.eql(e.sqr(u),t),y=e.cmov(n,u,d);return h(e,y,t),y}}(e):w(e)}t.isNegativeLE=(e,t)=>(b(e,t)&i)===i;const B=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function v(e,t,n){if(n<o)throw new Error("invalid exponent, negatives unsupported");if(n===o)return e.ONE;if(n===i)return t;let r=e.ONE,s=t;for(;n>o;)n&i&&(r=e.mul(r,s)),s=e.sqr(s),n>>=i;return r}function O(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n)),e.ONE),i=e.inv(o);return t.reduceRight((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n)),i),r}function T(e,t){const n=(e.ORDER-i)/s,r=e.pow(t,n),o=e.eql(r,e.ONE),u=e.eql(r,e.ZERO),f=e.eql(r,e.neg(e.ONE));if(!o&&!u&&!f)throw new Error("invalid Legendre symbol result");return o?1:u?0:-1}function q(e,t){void 0!==t&&(0,r.anumber)(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function x(e,t,n=!1,s={}){if(e<=o)throw new Error("invalid field: expected ORDER > 0, got "+e);let u,f,c,l=!1;if("object"==typeof t&&null!=t){if(s.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(u=e.BITS),e.sqrt&&(f=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(l=e.modFromBytes),c=e.allowedLengths}else"number"==typeof t&&(u=t),s.sqrt&&(f=s.sqrt);const{nBitLength:a,nByteLength:d}=q(e,u);if(d>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let y;const h=Object.freeze({ORDER:e,isLE:n,BITS:a,BYTES:d,MASK:(0,r.bitMask)(a),ZERO:o,ONE:i,allowedLengths:c,create:t=>b(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return o<=t&&t<e},is0:e=>e===o,isValidNot0:e=>!h.is0(e)&&h.isValid(e),isOdd:e=>(e&i)===i,neg:t=>b(-t,e),eql:(e,t)=>e===t,sqr:t=>b(t*t,e),add:(t,n)=>b(t+n,e),sub:(t,n)=>b(t-n,e),mul:(t,n)=>b(t*n,e),pow:(e,t)=>v(h,e,t),div:(t,n)=>b(t*g(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>g(t,e),sqrt:f||(t=>(y||(y=E(e)),y(h,t))),toBytes:e=>n?(0,r.numberToBytesLE)(e,d):(0,r.numberToBytesBE)(e,d),fromBytes:(t,o=!0)=>{if(c){if(!c.includes(t.length)||t.length>d)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+t.length);const e=new Uint8Array(d);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==d)throw new Error("Field.fromBytes: expected "+d+" bytes, got "+t.length);let i=n?(0,r.bytesToNumberLE)(t):(0,r.bytesToNumberBE)(t);if(l&&(i=b(i,e)),!o&&!h.isValid(i))throw new Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:e=>O(h,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(h)}function N(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function I(e){const t=N(e);return t+Math.ceil(t/2)}},627(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t._abool2=function(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e},t._abytes2=function(e,t,n=""){const o=(0,r.isBytes)(e),i=e?.length,s=void 0!==t;if(!o||s&&i!==t)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(o?`length=${i}`:"type="+typeof e));return e},t.numberToHexUnpadded=u,t.hexToNumber=f,t.bytesToNumberBE=function(e){return f((0,r.bytesToHex)(e))},t.bytesToNumberLE=function(e){return(0,r.abytes)(e),f((0,r.bytesToHex)(Uint8Array.from(e).reverse()))},t.numberToBytesBE=c,t.numberToBytesLE=function(e,t){return c(e,t).reverse()},t.numberToVarBytesBE=function(e){return(0,r.hexToBytes)(u(e))},t.ensureBytes=function(e,t,n){let o;if("string"==typeof t)try{o=(0,r.hexToBytes)(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!(0,r.isBytes)(t))throw new Error(e+" must be hex string or Uint8Array");o=Uint8Array.from(t)}const i=o.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return o},t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},t.copyBytes=function(e){return Uint8Array.from(e)},t.asciiToBytes=function(e){return Uint8Array.from(e,(t,n)=>{const r=t.charCodeAt(0);if(1!==t.length||r>127)throw new Error(`string contains non-ASCII character "${e[n]}" with code ${r} at position ${n}`);return r})},t.inRange=a,t.aInRange=function(e,t,n,r){if(!a(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>i;e>>=s,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&s},t.bitSet=function(e,t,n){return e|(n?s:i)<<BigInt(t)},t.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const o=e=>new Uint8Array(e),i=e=>Uint8Array.of(e);let s=o(e),u=o(e),f=0;const c=()=>{s.fill(1),u.fill(0),f=0},l=(...e)=>n(u,s,...e),a=(e=o(0))=>{u=l(i(0),e),s=l(),0!==e.length&&(u=l(i(1),e),s=l())},d=()=>{if(f++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){s=l();const t=s.slice();n.push(t),e+=s.length}return(0,r.concatBytes)(...n)};return(e,t)=>{let n;for(c(),a(e);!(n=t(d()));)a();return c(),n}},t.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const o=d[n];if("function"!=typeof o)throw new Error("invalid validator function");const i=e[t];if(!(r&&void 0===i||o(i,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+i)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},t.isHash=function(e){return"function"==typeof e&&Number.isSafeInteger(e.outputLen)},t._validateObject=function(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const i=typeof o;if(i!==n||null===o)throw new Error(`param "${t}" is invalid: expected ${n}, got ${i}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))},t.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const i=e(n,...r);return t.set(n,i),i}};const r=n(175);var o=n(175);Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return o.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return o.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return o.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return o.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return o.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return o.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});const i=BigInt(0),s=BigInt(1);function u(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function f(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?i:BigInt("0x"+e)}function c(e,t){return(0,r.hexToBytes)(e.toString(16).padStart(2*t,"0"))}const l=e=>"bigint"==typeof e&&i<=e;function a(e,t,n){return l(e)&&l(t)&&l(n)&&t<=e&&e<n}t.bitMask=e=>(s<<BigInt(e))-s;const d={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||(0,r.isBytes)(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.notImplemented=()=>{throw new Error("not implemented")}}}]);
@@ -1 +0,0 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[524],{202(t,s,h){Object.defineProperty(s,"__esModule",{value:!0}),s.SHA512_IV=s.SHA384_IV=s.SHA224_IV=s.SHA256_IV=s.HashMD=void 0,s.setBigUint64=r,s.Chi=function(t,s,h){return t&s^~t&h},s.Maj=function(t,s,h){return t&s^t&h^s&h};const e=h(175);function r(t,s,h,e){if("function"==typeof t.setBigUint64)return t.setBigUint64(s,h,e);const r=BigInt(32),i=BigInt(4294967295),o=Number(h>>r&i),c=Number(h&i),a=e?4:0,n=e?0:4;t.setUint32(s+a,o,e),t.setUint32(s+n,c,e)}class i extends e.Hash{constructor(t,s,h,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=s,this.padOffset=h,this.isLE=r,this.buffer=new Uint8Array(t),this.view=(0,e.createView)(this.buffer)}update(t){(0,e.aexists)(this),t=(0,e.toBytes)(t),(0,e.abytes)(t);const{view:s,buffer:h,blockLen:r}=this,i=t.length;for(let o=0;o<i;){const c=Math.min(r-this.pos,i-o);if(c===r){const s=(0,e.createView)(t);for(;r<=i-o;o+=r)this.process(s,o);continue}h.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,e.aexists)(this),(0,e.aoutput)(t,this),this.finished=!0;const{buffer:s,view:h,blockLen:i,isLE:o}=this;let{pos:c}=this;s[c++]=128,(0,e.clean)(this.buffer.subarray(c)),this.padOffset>i-c&&(this.process(h,0),c=0);for(let t=c;t<i;t++)s[t]=0;r(h,i-8,BigInt(8*this.length),o),this.process(h,0);const a=(0,e.createView)(t),n=this.outputLen;if(n%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=n/4,l=this.get();if(d>l.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)a.setUint32(4*t,l[t],o)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const h=t.slice(0,s);return this.destroy(),h}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:s,buffer:h,length:e,finished:r,destroyed:i,pos:o}=this;return t.destroyed=i,t.finished=r,t.length=e,t.pos=o,e%s&&t.buffer.set(h),t}clone(){return this._cloneInto()}}s.HashMD=i,s.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),s.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),s.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},318(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.toBig=s.shrSL=s.shrSH=s.rotrSL=s.rotrSH=s.rotrBL=s.rotrBH=s.rotr32L=s.rotr32H=s.rotlSL=s.rotlSH=s.rotlBL=s.rotlBH=s.add5L=s.add5H=s.add4L=s.add4H=s.add3L=s.add3H=void 0,s.add=_,s.fromBig=r,s.split=i;const h=BigInt(2**32-1),e=BigInt(32);function r(t,s=!1){return s?{h:Number(t&h),l:Number(t>>e&h)}:{h:0|Number(t>>e&h),l:0|Number(t&h)}}function i(t,s=!1){const h=t.length;let e=new Uint32Array(h),i=new Uint32Array(h);for(let o=0;o<h;o++){const{h,l:c}=r(t[o],s);[e[o],i[o]]=[h,c]}return[e,i]}const o=(t,s)=>BigInt(t>>>0)<<e|BigInt(s>>>0);s.toBig=o;const c=(t,s,h)=>t>>>h;s.shrSH=c;const a=(t,s,h)=>t<<32-h|s>>>h;s.shrSL=a;const n=(t,s,h)=>t>>>h|s<<32-h;s.rotrSH=n;const d=(t,s,h)=>t<<32-h|s>>>h;s.rotrSL=d;const l=(t,s,h)=>t<<64-h|s>>>h-32;s.rotrBH=l;const H=(t,s,h)=>t>>>h-32|s<<64-h;s.rotrBL=H;const f=(t,s)=>s;s.rotr32H=f;const b=(t,s)=>t;s.rotr32L=b;const A=(t,s,h)=>t<<h|s>>>32-h;s.rotlSH=A;const S=(t,s,h)=>s<<h|t>>>32-h;s.rotlSL=S;const x=(t,s,h)=>s<<h-32|t>>>64-h;s.rotlBH=x;const u=(t,s,h)=>t<<h-32|s>>>64-h;function _(t,s,h,e){const r=(s>>>0)+(e>>>0);return{h:t+h+(r/2**32|0)|0,l:0|r}}s.rotlBL=u;const I=(t,s,h)=>(t>>>0)+(s>>>0)+(h>>>0);s.add3L=I;const B=(t,s,h,e)=>s+h+e+(t/2**32|0)|0;s.add3H=B;const V=(t,s,h,e)=>(t>>>0)+(s>>>0)+(h>>>0)+(e>>>0);s.add4L=V;const L=(t,s,h,e,r)=>s+h+e+r+(t/2**32|0)|0;s.add4H=L;const p=(t,s,h,e,r)=>(t>>>0)+(s>>>0)+(h>>>0)+(e>>>0)+(r>>>0);s.add5L=p;const g=(t,s,h,e,r,i)=>s+h+e+r+i+(t/2**32|0)|0;s.add5H=g;const y={fromBig:r,split:i,toBig:o,shrSH:c,shrSL:a,rotrSH:n,rotrSL:d,rotrBH:l,rotrBL:H,rotr32H:f,rotr32L:b,rotlSH:A,rotlSL:S,rotlBH:x,rotlBL:u,add:_,add3L:I,add3H:B,add4L:V,add4H:L,add5H:g,add5L:p};s.default=y},145(t,s){Object.defineProperty(s,"__esModule",{value:!0}),s.crypto=void 0,s.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},76(t,s,h){Object.defineProperty(s,"__esModule",{value:!0}),s.sha512_224=s.sha512_256=s.sha384=s.sha512=s.sha224=s.sha256=s.SHA512_256=s.SHA512_224=s.SHA384=s.SHA512=s.SHA224=s.SHA256=void 0;const e=h(202),r=h(318),i=h(175),o=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array(64);class a extends e.HashMD{constructor(t=32){super(64,t,8,!1),this.A=0|e.SHA256_IV[0],this.B=0|e.SHA256_IV[1],this.C=0|e.SHA256_IV[2],this.D=0|e.SHA256_IV[3],this.E=0|e.SHA256_IV[4],this.F=0|e.SHA256_IV[5],this.G=0|e.SHA256_IV[6],this.H=0|e.SHA256_IV[7]}get(){const{A:t,B:s,C:h,D:e,E:r,F:i,G:o,H:c}=this;return[t,s,h,e,r,i,o,c]}set(t,s,h,e,r,i,o,c){this.A=0|t,this.B=0|s,this.C=0|h,this.D=0|e,this.E=0|r,this.F=0|i,this.G=0|o,this.H=0|c}process(t,s){for(let h=0;h<16;h++,s+=4)c[h]=t.getUint32(s,!1);for(let t=16;t<64;t++){const s=c[t-15],h=c[t-2],e=(0,i.rotr)(s,7)^(0,i.rotr)(s,18)^s>>>3,r=(0,i.rotr)(h,17)^(0,i.rotr)(h,19)^h>>>10;c[t]=r+c[t-7]+e+c[t-16]|0}let{A:h,B:r,C:a,D:n,E:d,F:l,G:H,H:f}=this;for(let t=0;t<64;t++){const s=f+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+(0,e.Chi)(d,l,H)+o[t]+c[t]|0,b=((0,i.rotr)(h,2)^(0,i.rotr)(h,13)^(0,i.rotr)(h,22))+(0,e.Maj)(h,r,a)|0;f=H,H=l,l=d,d=n+s|0,n=a,a=r,r=h,h=s+b|0}h=h+this.A|0,r=r+this.B|0,a=a+this.C|0,n=n+this.D|0,d=d+this.E|0,l=l+this.F|0,H=H+this.G|0,f=f+this.H|0,this.set(h,r,a,n,d,l,H,f)}roundClean(){(0,i.clean)(c)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,i.clean)(this.buffer)}}s.SHA256=a;class n extends a{constructor(){super(28),this.A=0|e.SHA224_IV[0],this.B=0|e.SHA224_IV[1],this.C=0|e.SHA224_IV[2],this.D=0|e.SHA224_IV[3],this.E=0|e.SHA224_IV[4],this.F=0|e.SHA224_IV[5],this.G=0|e.SHA224_IV[6],this.H=0|e.SHA224_IV[7]}}s.SHA224=n;const d=(()=>r.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),l=(()=>d[0])(),H=(()=>d[1])(),f=new Uint32Array(80),b=new Uint32Array(80);class A extends e.HashMD{constructor(t=64){super(128,t,16,!1),this.Ah=0|e.SHA512_IV[0],this.Al=0|e.SHA512_IV[1],this.Bh=0|e.SHA512_IV[2],this.Bl=0|e.SHA512_IV[3],this.Ch=0|e.SHA512_IV[4],this.Cl=0|e.SHA512_IV[5],this.Dh=0|e.SHA512_IV[6],this.Dl=0|e.SHA512_IV[7],this.Eh=0|e.SHA512_IV[8],this.El=0|e.SHA512_IV[9],this.Fh=0|e.SHA512_IV[10],this.Fl=0|e.SHA512_IV[11],this.Gh=0|e.SHA512_IV[12],this.Gl=0|e.SHA512_IV[13],this.Hh=0|e.SHA512_IV[14],this.Hl=0|e.SHA512_IV[15]}get(){const{Ah:t,Al:s,Bh:h,Bl:e,Ch:r,Cl:i,Dh:o,Dl:c,Eh:a,El:n,Fh:d,Fl:l,Gh:H,Gl:f,Hh:b,Hl:A}=this;return[t,s,h,e,r,i,o,c,a,n,d,l,H,f,b,A]}set(t,s,h,e,r,i,o,c,a,n,d,l,H,f,b,A){this.Ah=0|t,this.Al=0|s,this.Bh=0|h,this.Bl=0|e,this.Ch=0|r,this.Cl=0|i,this.Dh=0|o,this.Dl=0|c,this.Eh=0|a,this.El=0|n,this.Fh=0|d,this.Fl=0|l,this.Gh=0|H,this.Gl=0|f,this.Hh=0|b,this.Hl=0|A}process(t,s){for(let h=0;h<16;h++,s+=4)f[h]=t.getUint32(s),b[h]=t.getUint32(s+=4);for(let t=16;t<80;t++){const s=0|f[t-15],h=0|b[t-15],e=r.rotrSH(s,h,1)^r.rotrSH(s,h,8)^r.shrSH(s,h,7),i=r.rotrSL(s,h,1)^r.rotrSL(s,h,8)^r.shrSL(s,h,7),o=0|f[t-2],c=0|b[t-2],a=r.rotrSH(o,c,19)^r.rotrBH(o,c,61)^r.shrSH(o,c,6),n=r.rotrSL(o,c,19)^r.rotrBL(o,c,61)^r.shrSL(o,c,6),d=r.add4L(i,n,b[t-7],b[t-16]),l=r.add4H(d,e,a,f[t-7],f[t-16]);f[t]=0|l,b[t]=0|d}let{Ah:h,Al:e,Bh:i,Bl:o,Ch:c,Cl:a,Dh:n,Dl:d,Eh:A,El:S,Fh:x,Fl:u,Gh:_,Gl:I,Hh:B,Hl:V}=this;for(let t=0;t<80;t++){const s=r.rotrSH(A,S,14)^r.rotrSH(A,S,18)^r.rotrBH(A,S,41),L=r.rotrSL(A,S,14)^r.rotrSL(A,S,18)^r.rotrBL(A,S,41),p=A&x^~A&_,g=S&u^~S&I,y=r.add5L(V,L,g,H[t],b[t]),C=r.add5H(y,B,s,p,l[t],f[t]),D=0|y,E=r.rotrSH(h,e,28)^r.rotrBH(h,e,34)^r.rotrBH(h,e,39),w=r.rotrSL(h,e,28)^r.rotrBL(h,e,34)^r.rotrBL(h,e,39),U=h&i^h&c^i&c,F=e&o^e&a^o&a;B=0|_,V=0|I,_=0|x,I=0|u,x=0|A,u=0|S,({h:A,l:S}=r.add(0|n,0|d,0|C,0|D)),n=0|c,d=0|a,c=0|i,a=0|o,i=0|h,o=0|e;const G=r.add3L(D,w,F);h=r.add3H(G,C,E,U),e=0|G}({h,l:e}=r.add(0|this.Ah,0|this.Al,0|h,0|e)),({h:i,l:o}=r.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:c,l:a}=r.add(0|this.Ch,0|this.Cl,0|c,0|a)),({h:n,l:d}=r.add(0|this.Dh,0|this.Dl,0|n,0|d)),({h:A,l:S}=r.add(0|this.Eh,0|this.El,0|A,0|S)),({h:x,l:u}=r.add(0|this.Fh,0|this.Fl,0|x,0|u)),({h:_,l:I}=r.add(0|this.Gh,0|this.Gl,0|_,0|I)),({h:B,l:V}=r.add(0|this.Hh,0|this.Hl,0|B,0|V)),this.set(h,e,i,o,c,a,n,d,A,S,x,u,_,I,B,V)}roundClean(){(0,i.clean)(f,b)}destroy(){(0,i.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}s.SHA512=A;class S extends A{constructor(){super(48),this.Ah=0|e.SHA384_IV[0],this.Al=0|e.SHA384_IV[1],this.Bh=0|e.SHA384_IV[2],this.Bl=0|e.SHA384_IV[3],this.Ch=0|e.SHA384_IV[4],this.Cl=0|e.SHA384_IV[5],this.Dh=0|e.SHA384_IV[6],this.Dl=0|e.SHA384_IV[7],this.Eh=0|e.SHA384_IV[8],this.El=0|e.SHA384_IV[9],this.Fh=0|e.SHA384_IV[10],this.Fl=0|e.SHA384_IV[11],this.Gh=0|e.SHA384_IV[12],this.Gl=0|e.SHA384_IV[13],this.Hh=0|e.SHA384_IV[14],this.Hl=0|e.SHA384_IV[15]}}s.SHA384=S;const x=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),u=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class _ extends A{constructor(){super(28),this.Ah=0|x[0],this.Al=0|x[1],this.Bh=0|x[2],this.Bl=0|x[3],this.Ch=0|x[4],this.Cl=0|x[5],this.Dh=0|x[6],this.Dl=0|x[7],this.Eh=0|x[8],this.El=0|x[9],this.Fh=0|x[10],this.Fl=0|x[11],this.Gh=0|x[12],this.Gl=0|x[13],this.Hh=0|x[14],this.Hl=0|x[15]}}s.SHA512_224=_;class I extends A{constructor(){super(32),this.Ah=0|u[0],this.Al=0|u[1],this.Bh=0|u[2],this.Bl=0|u[3],this.Ch=0|u[4],this.Cl=0|u[5],this.Dh=0|u[6],this.Dl=0|u[7],this.Eh=0|u[8],this.El=0|u[9],this.Fh=0|u[10],this.Fl=0|u[11],this.Gh=0|u[12],this.Gl=0|u[13],this.Hh=0|u[14],this.Hl=0|u[15]}}s.SHA512_256=I,s.sha256=(0,i.createHasher)(()=>new a),s.sha224=(0,i.createHasher)(()=>new n),s.sha512=(0,i.createHasher)(()=>new A),s.sha384=(0,i.createHasher)(()=>new S),s.sha512_256=(0,i.createHasher)(()=>new I),s.sha512_224=(0,i.createHasher)(()=>new _)}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 575.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[575],{562(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=function(e){return{hash:e}},t.createCurve=function(e,t){const r=t=>(0,n.weierstrass)({...e,hash:t});return{...r(t),create:r}};const n=r(705)},422(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.wNAF=void 0,t.negateCt=a,t.normalizeZ=function(e,t){const r=(0,o.FpInvertBatch)(e.Fp,t.map(e=>e.Z));return t.map((t,n)=>e.fromAffine(t.toAffine(r[n])))},t.mulEndoUnsafe=function(e,t,r,n){let o=t,a=e.ZERO,c=e.ZERO;for(;r>i||n>i;)r&s&&(a=a.add(o)),n&s&&(c=c.add(o)),o=o.double(),r>>=s,n>>=s;return{p1:a,p2:c}},t.pippenger=function(e,t,r,o){d(r,e),l(o,t);const i=r.length,s=o.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,c=(0,n.bitLen)(BigInt(i));let f=1;c>12?f=c-3:c>4?f=c-2:c>0&&(f=2);const u=(0,n.bitMask)(f),h=new Array(Number(u)+1).fill(a);let p=a;for(let e=Math.floor((t.BITS-1)/f)*f;e>=0;e-=f){h.fill(a);for(let t=0;t<s;t++){const n=o[t],i=Number(n>>BigInt(e)&u);h[i]=h[i].add(r[t])}let t=a;for(let e=h.length-1,r=a;e>0;e--)r=r.add(h[e]),t=t.add(r);if(p=p.add(t),0!==e)for(let e=0;e<f;e++)p=p.double()}return p},t.precomputeMSMUnsafe=function(e,t,r,o){c(o,t.BITS),d(r,e);const i=e.ZERO,s=2**o-1,a=Math.ceil(t.BITS/o),f=(0,n.bitMask)(o),u=r.map(e=>{const t=[];for(let r=0,n=e;r<s;r++)t.push(n),n=n.add(e);return t});return e=>{if(l(e,t),e.length>r.length)throw new Error("array of scalars must be smaller than array of points");let n=i;for(let t=0;t<a;t++){if(n!==i)for(let e=0;e<o;e++)n=n.double();const r=BigInt(a*o-(t+1)*o);for(let t=0;t<e.length;t++){const o=e[t],i=Number(o>>r&f);i&&(n=n.add(u[t][i-1]))}}return n}},t.validateBasic=function(e){return(0,o.validateField)(e.Fp),(0,n.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,o.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})},t._createCurveFields=function(e,t,r={},n){if(void 0===n&&(n="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>i))throw new Error(`CURVE.${e} must be positive bigint`)}const o=b(t.p,r.Fp,n),s=b(t.n,r.Fn,n),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:s}};const n=r(627),o=r(967),i=BigInt(0),s=BigInt(1);function a(e,t){const r=t.negate();return e?r:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function f(e,t){c(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:(0,n.bitMask)(e),maxNumber:r,shiftBy:BigInt(e)}}function u(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:a}=r;let c=Number(e&o),f=e>>a;c>n&&(c-=i,f+=s);const u=t*n;return{nextN:f,offset:u+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:t%2!=0,offsetF:u}}function d(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}function l(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}const h=new WeakMap,p=new WeakMap;function w(e){return p.get(e)||1}function g(e){if(e!==i)throw new Error("invalid wNAF")}function b(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,o.validateField)(t),t}return(0,o.Field)(e,{isLE:r})}t.wNAF=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let n=e;for(;t>i;)t&s&&(r=r.add(n)),n=n.double(),t>>=s;return r}precomputeWindow(e,t){const{windows:r,windowSize:n}=f(t,this.bits),o=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,o.push(s);for(let e=1;e<n;e++)s=s.add(i),o.push(s);i=s.double()}return o}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let n=this.ZERO,o=this.BASE;const i=f(e,this.bits);for(let e=0;e<i.windows;e++){const{nextN:s,offset:c,isZero:f,isNeg:d,isNegF:l,offsetF:h}=u(r,e,i);r=s,f?o=o.add(a(l,t[h])):n=n.add(a(d,t[c]))}return g(r),{p:n,f:o}}wNAFUnsafe(e,t,r,n=this.ZERO){const o=f(e,this.bits);for(let e=0;e<o.windows&&r!==i;e++){const{nextN:i,offset:s,isZero:a,isNeg:c}=u(r,e,o);if(r=i,!a){const e=t[s];n=n.add(c?e.negate():e)}}return g(r),n}getPrecomputes(e,t,r){let n=h.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),h.set(t,n))),n}cached(e,t,r){const n=w(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)}unsafe(e,t,r,n){const o=w(e);return 1===o?this._unsafeLadder(e,t,n):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),t,n)}createCache(e,t){c(t,this.bits),p.set(e,t),h.delete(e)}hasCache(e){return 1!==w(e)}}},761(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=u,t.expand_message_xof=d,t.hash_to_field=l,t.isogenyMap=function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[i,s,a,c]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n))),[f,u]=(0,o.FpInvertBatch)(e,[s,c],!0);return t=e.mul(i,f),n=e.mul(n,e.mul(a,u)),{x:t,y:n}}},t.createHasher=function(e,r,n){if("function"!=typeof r)throw new Error("mapToCurve() must be defined");function o(t){return e.fromAffine(r(t))}function i(t){const r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}return{defaults:n,hashToCurve(e,t){const r=l(e,2,Object.assign({},n,t)),s=o(r[0]),a=o(r[1]);return i(s.add(a))},encodeToCurve(e,t){const r=n.encodeDST?{DST:n.encodeDST}:{};return i(o(l(e,1,Object.assign({},n,r,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw new Error("expected array of bigints");for(const t of e)if("bigint"!=typeof t)throw new Error("expected array of bigints");return i(o(e))},hashToScalar(r,o){const i=e.Fn.ORDER;return l(r,1,Object.assign({},n,{p:i,m:1,DST:t._DST_scalar},o))[0][0]}}};const n=r(627),o=r(967),i=n.bytesToNumberBE;function s(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function a(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function f(e){if(!(0,n.isBytes)(e)&&"string"!=typeof e)throw new Error("DST must be Uint8Array or string");return"string"==typeof e?(0,n.utf8ToBytes)(e):e}function u(e,t,r,o){(0,n.abytes)(e),c(r),(t=f(t)).length>255&&(t=o((0,n.concatBytes)((0,n.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:u}=o,d=Math.ceil(r/i);if(r>65535||d>255)throw new Error("expand_message_xmd: invalid lenInBytes");const l=(0,n.concatBytes)(t,s(t.length,1)),h=s(0,u),p=s(r,2),w=new Array(d),g=o((0,n.concatBytes)(h,e,p,s(0,1),l));w[0]=o((0,n.concatBytes)(g,s(1,1),l));for(let e=1;e<=d;e++){const t=[a(g,w[e-1]),s(e+1,1),l];w[e]=o((0,n.concatBytes)(...t))}return(0,n.concatBytes)(...w).slice(0,r)}function d(e,t,r,o,i){if((0,n.abytes)(e),c(r),(t=f(t)).length>255){const e=Math.ceil(2*o/8);t=i.create({dkLen:e}).update((0,n.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(s(r,2)).update(t).update(s(t.length,1)).digest()}function l(e,t,r){(0,n._validateObject)(r,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:s,k:a,m:f,hash:l,expand:h,DST:p}=r;if(!(0,n.isHash)(r.hash))throw new Error("expected valid hash");(0,n.abytes)(e),c(t);const w=s.toString(2).length,g=Math.ceil((w+a)/8),b=t*f*g;let m;if("xmd"===h)m=u(e,p,b,l);else if("xof"===h)m=d(e,p,b,a,l);else{if("_internal_pass"!==h)throw new Error('expand must be "xmd" or "xof"');m=e}const y=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let r=0;r<f;r++){const n=g*(r+e*f),a=m.subarray(n,n+g);t[r]=(0,o.mod)(i(a),s)}y[e]=t}return y}t._DST_scalar=(0,n.utf8ToBytes)("HashToScalar-")}}]);
@@ -1 +0,0 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1,2 +0,0 @@
1
- /*! For license information please see 615.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[615],{615(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const r=n(175);class o extends r.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(t);const n=(0,r.toBytes)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),(0,r.clean)(s)}update(t){return(0,r.aexists)(this),this.iHash.update(t),this}digestInto(t){(0,r.aexists)(this),(0,r.abytes)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:s,outputLen:i}=this;return t.finished=r,t.destroyed=o,t.blockLen=s,t.outputLen=i,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o,e.hmac=(t,e,n)=>new o(t,e).update(n).digest(),e.hmac.create=(t,e)=>new o(t,e)},175(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=o,e.anumber=s,e.abytes=i,e.ahash=function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.createHasher");s(t.outputLen),s(t.blockLen)},e.aexists=function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},e.aoutput=function(t,e){i(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},e.u8=function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},e.u32=function(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))},e.clean=function(...t){for(let e=0;e<t.length;e++)t[e].fill(0)},e.createView=function(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)},e.rotr=function(t,e){return t<<32-e|t>>>e},e.rotl=function(t,e){return t<<e|t>>>32-e>>>0},e.byteSwap=a,e.byteSwap32=c,e.bytesToHex=function(t){if(i(t),u)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=h[t[n]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);if(u)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=f(t.charCodeAt(o)),s=f(t.charCodeAt(o+1));if(void 0===n||void 0===s){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+s}return r},e.asyncLoop=async function(t,n,r){let o=Date.now();for(let s=0;s<t;s++){r(s);const t=Date.now()-o;t>=0&&t<n||(await(0,e.nextTick)(),o+=t)}},e.utf8ToBytes=d,e.bytesToUtf8=function(t){return(new TextDecoder).decode(t)},e.toBytes=p,e.kdfInputToBytes=function(t){return"string"==typeof t&&(t=d(t)),i(t),t},e.concatBytes=function(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];i(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n},e.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!=={}.toString.call(e))throw new Error("options should be object or undefined");return Object.assign(t,e)},e.createHasher=y,e.createOptHasher=l,e.createXOFer=w,e.randomBytes=function(t=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(t));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")};const r=n(145);function o(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function s(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function i(t,...e){if(!o(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function a(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function c(t){for(let e=0;e<t.length;e++)t[e]=a(t[e]);return t}e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],e.swap8IfBE=e.isLE?t=>t:t=>a(t),e.byteSwapIfBE=e.swap8IfBE,e.swap32IfBE=e.isLE?t=>t:c;const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),h=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function f(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function d(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function p(t){return"string"==typeof t&&(t=d(t)),i(t),t}function y(t){const e=e=>t().update(p(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function l(t){const e=(e,n)=>t(n).update(p(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}function w(t){const e=(e,n)=>t(n).update(p(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}e.nextTick=async()=>{},e.Hash=class{},e.wrapConstructor=y,e.wrapConstructorWithOpts=l,e.wrapXOFConstructorWithOpts=w}}]);
@@ -1 +0,0 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1,2 +0,0 @@
1
- /*! For license information please see 668.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[287,668],{287(t,e,r){const n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;const f=2147483647;function s(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Z(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Z(t,ArrayBuffer)||t&&Z(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(t,SharedArrayBuffer)||t&&Z(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|y(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||H(t.length)?s(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return c(t),s(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function y(t){if(t>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Z(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return v(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:B(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):B(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function B(t,e,r,n,i){let o,f=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function h(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){let n=-1;for(o=r;o<s;o++)if(h(t,o)===h(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*f}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(h(t,o+n)!==h(e,n)){r=!1;break}if(r)return o}return-1}function E(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let f;for(n>o/2&&(n=o/2),f=0;f<n;++f){const n=parseInt(e.substr(2*f,2),16);if(H(n))return f;t[r+f]=n}return f}function m(t,e,r,n){return J(q(e,t.length-r),t,r,n)}function I(t,e,r,n){return J(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function U(t,e,r,n){return J(W(e),t,r,n)}function A(t,e,r,n){return J(function(t,e){let r,n,i;const o=[];for(let f=0;f<t.length&&!((e-=2)<0);++f)r=t.charCodeAt(f),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function v(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,f=e>239?4:e>223?3:e>191?2:1;if(i+f<=r){let r,n,s,u;switch(f){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,f=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=f}return function(t){const e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=O));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},u.allocUnsafe=function(t){return a(t)},u.allocUnsafeSlow=function(t){return a(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Z(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)d(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?R(this,0,t):w.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),f=(r>>>=0)-(e>>>=0);const s=Math.min(o,f),h=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<s;++t)if(h[t]!==c[t]){o=h[t],f=c[t];break}return o<f?-1:f<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":case"latin1":case"binary":return I(this,t,e,r);case"base64":return U(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function T(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function S(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=K[t[n]];return i}function _(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function $(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,f>>=8,t[r++]=f,r}function k(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let f=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=f,f>>=8,t[r+2]=f,f>>=8,t[r+1]=f,f>>=8,t[r]=f,r+8}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||$(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||$(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||$(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||$(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||$(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||$(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),u.prototype.readBigInt64BE=Q(function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Y(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||$(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||$(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||$(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||$(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||x(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Q(function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Q(function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=0,o=1,f=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===f&&0!==this[e+i-1]&&(f=1),this[e+i]=(t/o|0)-f&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,t,e,r,n-1,-n)}let i=r-1,o=1,f=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===f&&0!==this[e+i+1]&&(f=1),this[e+i]=(t/o|0)-f&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Q(function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Q(function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),f=o.length;if(0===f)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%f]}return this};const j={};function M(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function D(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||Y(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function Y(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),M("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function q(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let f=0;f<n;++f){if(r=t.charCodeAt(f),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Z(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function H(t){return t!=t}const K=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?X:t}function X(){throw new Error("BigInt not supported")}}}]);
@@ -1,6 +0,0 @@
1
- /*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
@@ -1,2 +0,0 @@
1
- /*! For license information please see 705.nostr-crypto-utils.min.js.LICENSE.txt */
2
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[705],{705(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=u,t._normFnElement=g,t.weierstrassN=b,t.SWUFpSqrtRatio=v,t.mapToCurveSimpleSWU=function(e,t){(0,a.validateField)(e);const{A:r,B:n,Z:o}=t;if(!e.isValid(r)||!e.isValid(n)||!e.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=v(e,o);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return t=>{let i,c,u,l,d,f,m,y;i=e.sqr(t),i=e.mul(i,o),c=e.sqr(i),c=e.add(c,i),u=e.add(c,e.ONE),u=e.mul(u,n),l=e.cmov(o,e.neg(c),!e.eql(c,e.ZERO)),l=e.mul(l,r),c=e.sqr(u),f=e.sqr(l),d=e.mul(f,r),c=e.add(c,d),c=e.mul(c,u),f=e.mul(f,l),d=e.mul(f,n),c=e.add(c,d),m=e.mul(i,u);const{isValid:h,value:p}=s(c,f);y=e.mul(i,t),y=e.mul(y,p),m=e.cmov(m,u,h),y=e.cmov(y,p,h);const w=e.isOdd(t)===e.isOdd(y);y=e.cmov(e.neg(y),y,w);const g=(0,a.FpInvertBatch)(e,[l],!0)[0];return m=e.mul(m,g),{x:m,y}}},t.ecdh=R,t.ecdsa=O,t.weierstrassPoints=function(e){const{CURVE:t,curveOpts:r}=S(e);return function(e,t){const{Fp:r,Fn:n}=t;const o=x(r,e.a,e.b);return Object.assign({},{CURVE:e,Point:t,ProjectivePoint:t,normPrivateKeyToScalar:e=>g(n,e),weierstrassEquation:o,isWithinCurveOrder:function(e){return(0,s.inRange)(e,y,n.ORDER)}})}(e,b(t,r))},t._legacyHelperEquat=x,t.weierstrass=function(e){const{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:r}=S(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}(e);return function(e,t){const r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,(0,a.nLength)(r.Fn.ORDER,r.Fn.BITS))})}(e,O(b(t,r),n,o))};const n=r(615),o=r(175),s=r(627),i=r(422),a=r(967),c=(e,t)=>(e+(e>=0?t:-t)/h)/t;function u(e,t,r){const[[n,o],[i,a]]=t,u=c(a*e,r),l=c(-o*e,r);let d=e-u*n-l*i,f=-u*o-l*a;const h=d<m,p=f<m;h&&(d=-d),p&&(f=-f);const w=(0,s.bitMask)(Math.ceil((0,s.bitLen)(r)/2))+y;if(d<m||d>=w||f<m||f>=w)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:h,k1:d,k2neg:p,k2:f}}function l(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function d(e,t){const r={};for(let n of Object.keys(t))r[n]=void 0===e[n]?t[n]:e[n];return(0,s._abool2)(r.lowS,"lowS"),(0,s._abool2)(r.prehash,"prehash"),void 0!==r.format&&l(r.format),r}class f extends Error{constructor(e=""){super(e)}}t.DERErr=f,t.DER={Err:f,_tlv:{encode:(e,r)=>{const{Err:n}=t.DER;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&r.length)throw new n("tlv.encode: unpadded data");const o=r.length/2,i=(0,s.numberToHexUnpadded)(o);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const a=o>127?(0,s.numberToHexUnpadded)(i.length/2|128):"";return(0,s.numberToHexUnpadded)(e)+a+i+r},decode(e,r){const{Err:n}=t.DER;let o=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(r.length<2||r[o++]!==e)throw new n("tlv.decode: wrong tlv");const s=r[o++];let i=0;if(128&s){const e=127&s;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const t=r.subarray(o,o+e);if(t.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===t[0])throw new n("tlv.decode(long): zero leftmost byte");for(const e of t)i=i<<8|e;if(o+=e,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=s;const a=r.subarray(o,o+i);if(a.length!==i)throw new n("tlv.decode: wrong value length");return{v:a,l:r.subarray(o+i)}}},_int:{encode(e){const{Err:r}=t.DER;if(e<m)throw new r("integer: negative integers are not allowed");let n=(0,s.numberToHexUnpadded)(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new r("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:r}=t.DER;if(128&e[0])throw new r("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new r("invalid signature integer: unnecessary leading zero");return(0,s.bytesToNumberBE)(e)}},toSig(e){const{Err:r,_int:n,_tlv:o}=t.DER,i=(0,s.ensureBytes)("signature",e),{v:a,l:c}=o.decode(48,i);if(c.length)throw new r("invalid signature: left bytes after parsing");const{v:u,l}=o.decode(2,a),{v:d,l:f}=o.decode(2,l);if(f.length)throw new r("invalid signature: left bytes after parsing");return{r:n.decode(u),s:n.decode(d)}},hexFromSig(e){const{_tlv:r,_int:n}=t.DER,o=r.encode(2,n.encode(e.r))+r.encode(2,n.encode(e.s));return r.encode(48,o)}};const m=BigInt(0),y=BigInt(1),h=BigInt(2),p=BigInt(3),w=BigInt(4);function g(e,t){const{BYTES:r}=e;let n;if("bigint"==typeof t)n=t;else{let o=(0,s.ensureBytes)("private key",t);try{n=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function b(e,t={}){const r=(0,i._createCurveFields)("weierstrass",e,t),{Fp:n,Fn:o}=r;let a=r.CURVE;const{h:c,n:l}=a;(0,s._validateObject)(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:d}=t;if(d&&(!n.is0(a.a)||"bigint"!=typeof d.beta||!Array.isArray(d.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const f=B(n,o);function h(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const b=t.toBytes||function(e,t,r){const{x:o,y:i}=t.toAffine(),a=n.toBytes(o);if((0,s._abool2)(r,"isCompressed"),r){h();const e=!n.isOdd(i);return(0,s.concatBytes)(E(e),a)}return(0,s.concatBytes)(Uint8Array.of(4),a,n.toBytes(i))},v=t.fromBytes||function(e){(0,s._abytes2)(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=f,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===r&&4===i){const e=n.BYTES,t=n.fromBytes(a.subarray(0,e)),r=n.fromBytes(a.subarray(e,2*e));if(!O(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${r}`)}{const e=n.fromBytes(a);if(!n.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=R(e);let r;try{r=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}return h(),!(1&~i)!==n.isOdd(r)&&(r=n.neg(r)),{x:e,y:r}}};function R(e){const t=n.sqr(e),r=n.mul(t,e);return n.add(n.add(r,n.mul(e,a.a)),a.b)}function O(e,t){const r=n.sqr(t),o=R(e);return n.eql(r,o)}if(!O(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const S=n.mul(n.pow(a.a,p),w),x=n.mul(n.sqr(a.b),BigInt(27));if(n.is0(n.add(S,x)))throw new Error("bad curve params: a or b");function F(e,t,r=!1){if(!n.isValid(t)||r&&n.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function U(e){if(!(e instanceof Z))throw new Error("ProjectivePoint expected")}function P(e){if(!d||!d.basises)throw new Error("no endo");return u(e,d.basises,o.ORDER)}const T=(0,s.memoized)((e,t)=>{const{X:r,Y:o,Z:s}=e;if(n.eql(s,n.ONE))return{x:r,y:o};const i=e.is0();null==t&&(t=i?n.ONE:n.inv(s));const a=n.mul(r,t),c=n.mul(o,t),u=n.mul(s,t);if(i)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:a,y:c}}),V=(0,s.memoized)(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not field elements");if(!O(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function K(e,t,r,o,s){return r=new Z(n.mul(r.X,e),r.Y,r.Z),t=(0,i.negateCt)(o,t),r=(0,i.negateCt)(s,r),t.add(r)}class Z{constructor(e,t,r){this.X=F("x",e),this.Y=F("y",t,!0),this.Z=F("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof Z)throw new Error("projective point not allowed");return n.is0(t)&&n.is0(r)?Z.ZERO:new Z(t,r,n.ONE)}static fromBytes(e){const t=Z.fromAffine(v((0,s._abytes2)(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return Z.fromBytes((0,s.ensureBytes)("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return C.createCache(this,e),t||this.multiply(p),this}assertValidity(){V(this)}hasEvenY(){const{y:e}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(e)}equals(e){U(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:i,Z:a}=e,c=n.eql(n.mul(t,a),n.mul(s,o)),u=n.eql(n.mul(r,a),n.mul(i,o));return c&&u}negate(){return new Z(this.X,n.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,r=n.mul(t,p),{X:o,Y:s,Z:i}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,d=n.mul(o,o),f=n.mul(s,s),m=n.mul(i,i),y=n.mul(o,s);return y=n.add(y,y),l=n.mul(o,i),l=n.add(l,l),c=n.mul(e,l),u=n.mul(r,m),u=n.add(c,u),c=n.sub(f,u),u=n.add(f,u),u=n.mul(c,u),c=n.mul(y,c),l=n.mul(r,l),m=n.mul(e,m),y=n.sub(d,m),y=n.mul(e,y),y=n.add(y,l),l=n.add(d,d),d=n.add(l,d),d=n.add(d,m),d=n.mul(d,y),u=n.add(u,d),m=n.mul(s,i),m=n.add(m,m),d=n.mul(m,y),c=n.sub(c,d),l=n.mul(m,f),l=n.add(l,l),l=n.add(l,l),new Z(c,u,l)}add(e){U(e);const{X:t,Y:r,Z:o}=this,{X:s,Y:i,Z:c}=e;let u=n.ZERO,l=n.ZERO,d=n.ZERO;const f=a.a,m=n.mul(a.b,p);let y=n.mul(t,s),h=n.mul(r,i),w=n.mul(o,c),g=n.add(t,r),b=n.add(s,i);g=n.mul(g,b),b=n.add(y,h),g=n.sub(g,b),b=n.add(t,o);let E=n.add(s,c);return b=n.mul(b,E),E=n.add(y,w),b=n.sub(b,E),E=n.add(r,o),u=n.add(i,c),E=n.mul(E,u),u=n.add(h,w),E=n.sub(E,u),d=n.mul(f,b),u=n.mul(m,w),d=n.add(u,d),u=n.sub(h,d),d=n.add(h,d),l=n.mul(u,d),h=n.add(y,y),h=n.add(h,y),w=n.mul(f,w),b=n.mul(m,b),h=n.add(h,w),w=n.sub(y,w),w=n.mul(f,w),b=n.add(b,w),y=n.mul(h,b),l=n.add(l,y),y=n.mul(E,b),u=n.mul(g,u),u=n.sub(u,y),y=n.mul(g,h),d=n.mul(E,d),d=n.add(d,y),new Z(u,l,d)}subtract(e){return this.add(e.negate())}is0(){return this.equals(Z.ZERO)}multiply(e){const{endo:r}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let n,s;const a=e=>C.cached(this,e,e=>(0,i.normalizeZ)(Z,e));if(r){const{k1neg:t,k1:o,k2neg:i,k2:c}=P(e),{p:u,f:l}=a(o),{p:d,f}=a(c);s=l.add(f),n=K(r.beta,u,d,t,i)}else{const{p:t,f:r}=a(e);n=t,s=r}return(0,i.normalizeZ)(Z,[n,s])[0]}multiplyUnsafe(e){const{endo:r}=t,n=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===m||n.is0())return Z.ZERO;if(e===y)return n;if(C.hasCache(this))return this.multiply(e);if(r){const{k1neg:t,k1:o,k2neg:s,k2:a}=P(e),{p1:c,p2:u}=(0,i.mulEndoUnsafe)(Z,n,o,a);return K(r.beta,c,u,t,s)}return C.unsafe(n,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return T(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return c===y||(e?e(Z,this):C.unsafe(this,l).is0())}clearCofactor(){const{clearCofactor:e}=t;return c===y?this:e?e(Z,this):this.multiplyUnsafe(c)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}toBytes(e=!0){return(0,s._abool2)(e,"isCompressed"),this.assertValidity(),b(Z,this,e)}toHex(e=!0){return(0,s.bytesToHex)(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return(0,i.normalizeZ)(Z,e)}static msm(e,t){return(0,i.pippenger)(Z,o,e,t)}static fromPrivateKey(e){return Z.BASE.multiply(g(o,e))}}Z.BASE=new Z(a.Gx,a.Gy,n.ONE),Z.ZERO=new Z(n.ZERO,n.ONE,n.ZERO),Z.Fp=n,Z.Fn=o;const k=o.BITS,C=new i.wNAF(Z,t.endo?Math.ceil(k/2):k);return Z.BASE.precompute(8),Z}function E(e){return Uint8Array.of(e?2:3)}function v(e,t){const r=e.ORDER;let n=m;for(let e=r-y;e%h===m;e/=h)n+=y;const o=n,s=h<<o-y-y,i=s*h,a=(r-y)/i,c=(a-y)/h,u=i-y,l=s,d=e.pow(t,a),f=e.pow(t,(a+y)/h);let g=(t,r)=>{let n=d,s=e.pow(r,u),i=e.sqr(s);i=e.mul(i,r);let a=e.mul(t,i);a=e.pow(a,c),a=e.mul(a,s),s=e.mul(a,r),i=e.mul(a,t);let m=e.mul(i,s);a=e.pow(m,l);let p=e.eql(a,e.ONE);s=e.mul(i,f),a=e.mul(m,n),i=e.cmov(s,i,p),m=e.cmov(a,m,p);for(let t=o;t>y;t--){let r=t-h;r=h<<r-y;let o=e.pow(m,r);const a=e.eql(o,e.ONE);s=e.mul(i,n),n=e.mul(n,n),o=e.mul(m,n),i=e.cmov(s,i,a),m=e.cmov(o,m,a)}return{isValid:p,value:i}};if(e.ORDER%w===p){const r=(e.ORDER-p)/w,n=e.sqrt(e.neg(t));g=(t,o)=>{let s=e.sqr(o);const i=e.mul(t,o);s=e.mul(s,i);let a=e.pow(s,r);a=e.mul(a,i);const c=e.mul(a,n),u=e.mul(e.sqr(a),o),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,a,l)}}}return g}function B(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function R(e,t={}){const{Fn:r}=e,n=t.randomBytes||s.randomBytes,o=Object.assign(B(e.Fp,r),{seed:(0,a.getMinHashLength)(r.ORDER)});function i(e){try{return!!g(r,e)}catch(e){return!1}}function c(e=n(o.seed)){return(0,a.mapHashToField)((0,s._abytes2)(e,o.seed,"seed"),r.ORDER)}function u(t,n=!0){return e.BASE.multiply(g(r,t)).toBytes(n)}function l(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:n,publicKey:i,publicKeyUncompressed:a}=o;if(r.allowedLengths||n===i)return;const c=(0,s.ensureBytes)("key",t).length;return c===i||c===a}const d={isValidSecretKey:i,isValidPublicKey:function(t,r){const{publicKey:n,publicKeyUncompressed:s}=o;try{const o=t.length;return!(!0===r&&o!==n||!1===r&&o!==s||!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:c,isValidPrivateKey:i,randomPrivateKey:c,normPrivateKeyToScalar:e=>g(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};return Object.freeze({getPublicKey:u,getSharedSecret:function(t,n,o=!0){if(!0===l(t))throw new Error("first arg must be private key");if(!1===l(n))throw new Error("second arg must be public key");const s=g(r,t);return e.fromHex(n).multiply(s).toBytes(o)},keygen:function(e){const t=c(e);return{secretKey:t,publicKey:u(t)}},Point:e,utils:d,lengths:o})}function O(e,r,i={}){(0,o.ahash)(r),(0,s._validateObject)(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=i.randomBytes||s.randomBytes,c=i.hmac||((e,...t)=>(0,n.hmac)(r,e,(0,s.concatBytes)(...t))),{Fp:u,Fn:f}=e,{ORDER:p,BITS:w}=f,{keygen:b,getPublicKey:v,getSharedSecret:B,utils:O,lengths:S}=R(e,i),x={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},F="compact";function U(e){return e>p>>y}function P(e,t){if(!f.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class T{constructor(e,t,r){this.r=P("r",e),this.s=P("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,r=F){let n;if(function(e,t){l(t);const r=S.signature,n="compact"===t?r:"recovered"===t?r+1:void 0;(0,s._abytes2)(e,n,`${t} signature`)}(e,r),"der"===r){const{r,s:n}=t.DER.toSig((0,s._abytes2)(e));return new T(r,n)}"recovered"===r&&(n=e[0],r="compact",e=e.subarray(1));const o=f.BYTES,i=e.subarray(0,o),a=e.subarray(o,2*o);return new T(f.fromBytes(i),f.fromBytes(a),n)}static fromHex(e,t){return this.fromBytes((0,s.hexToBytes)(e),t)}addRecoveryBit(e){return new T(this.r,this.s,e)}recoverPublicKey(t){const r=u.ORDER,{r:n,s:o,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(p*h<r&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const a=2===i||3===i?n+p:n;if(!u.isValid(a))throw new Error("recovery id 2 or 3 invalid");const c=u.toBytes(a),l=e.fromBytes((0,s.concatBytes)(E(!(1&i)),c)),d=f.inv(a),m=K((0,s.ensureBytes)("msgHash",t)),y=f.create(-m*d),w=f.create(o*d),g=e.BASE.multiplyUnsafe(y).add(l.multiplyUnsafe(w));if(g.is0())throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return U(this.s)}toBytes(e=F){if(l(e),"der"===e)return(0,s.hexToBytes)(t.DER.hexFromSig(this));const r=f.toBytes(this.r),n=f.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,s.concatBytes)(Uint8Array.of(this.recovery),r,n)}return(0,s.concatBytes)(r,n)}toHex(e){return(0,s.bytesToHex)(this.toBytes(e))}assertValidity(){}static fromCompact(e){return T.fromBytes((0,s.ensureBytes)("sig",e),"compact")}static fromDER(e){return T.fromBytes((0,s.ensureBytes)("sig",e),"der")}normalizeS(){return this.hasHighS()?new T(this.r,f.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,s.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,s.bytesToHex)(this.toBytes("compact"))}}const V=i.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=(0,s.bytesToNumberBE)(e),r=8*e.length-w;return r>0?t>>BigInt(r):t},K=i.bits2int_modN||function(e){return f.create(V(e))},Z=(0,s.bitMask)(w);function k(e){return(0,s.aInRange)("num < 2^"+w,e,m,Z),f.toBytes(e)}function C(e,t){return(0,s._abytes2)(e,void 0,"message"),t?(0,s._abytes2)(r(e),void 0,"prehashed message"):e}return Object.freeze({keygen:b,getPublicKey:v,getSharedSecret:B,utils:O,lengths:S,Point:e,sign:function(t,n,o={}){t=(0,s.ensureBytes)("message",t);const{seed:i,k2sig:u}=function(t,r,n){if(["recovered","canonical"].some(e=>e in n))throw new Error("sign() legacy options not supported");const{lowS:o,prehash:i,extraEntropy:c}=d(n,x);t=C(t,i);const u=K(t),l=g(f,r),h=[k(l),k(u)];if(null!=c&&!1!==c){const e=!0===c?a(S.secretKey):c;h.push((0,s.ensureBytes)("extraEntropy",e))}const p=(0,s.concatBytes)(...h),w=u;return{seed:p,k2sig:function(t){const r=V(t);if(!f.isValidNot0(r))return;const n=f.inv(r),s=e.BASE.multiply(r).toAffine(),i=f.create(s.x);if(i===m)return;const a=f.create(n*f.create(w+i*l));if(a===m)return;let c=(s.x===i?0:2)|Number(s.y&y),u=a;return o&&U(a)&&(u=f.neg(a),c^=1),new T(i,u,c)}}}(t,n,o);return(0,s.createHmacDrbg)(r.outputLen,f.BYTES,c)(i,u)},verify:function(r,n,o,i={}){const{lowS:a,prehash:c,format:u}=d(i,x);if(o=(0,s.ensureBytes)("publicKey",o),n=C((0,s.ensureBytes)("message",n),c),"strict"in i)throw new Error("options.strict was renamed to lowS");const l=void 0===u?function(e){let r;const n="string"==typeof e||(0,s.isBytes)(e),o=!n&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!n&&!o)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(o)r=new T(e.r,e.s);else if(n){try{r=T.fromBytes((0,s.ensureBytes)("sig",e),"der")}catch(e){if(!(e instanceof t.DER.Err))throw e}if(!r)try{r=T.fromBytes((0,s.ensureBytes)("sig",e),"compact")}catch(e){return!1}}return r||!1}(r):T.fromBytes((0,s.ensureBytes)("sig",r),u);if(!1===l)return!1;try{const t=e.fromBytes(o);if(a&&l.hasHighS())return!1;const{r,s}=l,i=K(n),c=f.inv(s),u=f.create(i*c),d=f.create(r*c),m=e.BASE.multiplyUnsafe(u).add(t.multiplyUnsafe(d));return!m.is0()&&f.create(m.x)===r}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:n}=d(r,x);return t=C(t,n),T.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:T,hash:r})}function S(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp;let n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0;return{CURVE:t,curveOpts:{Fp:r,Fn:(0,a.Field)(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function x(e,t,r){return function(n){const o=e.sqr(n),s=e.mul(o,n);return e.add(e.add(s,e.mul(n,t)),r)}}}}]);
@@ -1 +0,0 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[732],{732(t,e,r){r.d(e,{vK:()=>b});var n=r(246);const o=t=>Uint8Array.from(t.split(""),t=>t.charCodeAt(0)),s=o("expand 16-byte k"),i=o("expand 32-byte k"),h=(0,n.DH)(s),u=(0,n.DH)(i);function c(t,e){return t<<e|t>>>32-e}function l(t){return t.byteOffset%4==0}const a=2**32-1,f=Uint32Array.of();function p(t,e){const{allowShortKeys:r,extendNonceFn:o,counterLength:s,counterRight:i,rounds:c}=(0,n.tY)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return(0,n.Fe)(s),(0,n.Fe)(c),(0,n.e8)(i),(0,n.e8)(r),(e,p,y,d,w=0)=>{(0,n.DO)(e,void 0,"key"),(0,n.DO)(p,void 0,"nonce"),(0,n.DO)(y,void 0,"data");const g=y.length;if(void 0===d&&(d=new Uint8Array(g)),(0,n.DO)(d,void 0,"output"),(0,n.Fe)(w),w<0||w>=a)throw new Error("arx: counter overflow");if(d.length<g)throw new Error(`arx: output (${d.length}) is shorter than data (${g})`);const b=[];let A,D,U=e.length;if(32===U)b.push(A=(0,n.nC)(e)),D=u;else{if(16!==U||!r)throw(0,n.DO)(e,32,"arx key"),new Error("invalid key size");A=new Uint8Array(32),A.set(e),A.set(e,16),D=h,b.push(A)}l(p)||b.push(p=(0,n.nC)(p));const k=(0,n.DH)(A);if(o){if(24!==p.length)throw new Error("arx: extended nonce must be 24 bytes");o(D,k,(0,n.DH)(p.subarray(0,16)),k),p=p.subarray(16)}const H=16-s;if(H!==p.length)throw new Error(`arx: nonce must be ${H} or 16 bytes`);if(12!==H){const t=new Uint8Array(12);t.set(p,i?0:12-p.length),p=t,b.push(p)}const v=(0,n.DH)(p);return function(t,e,r,o,s,i,h,u){const c=s.length,p=new Uint8Array(64),y=(0,n.DH)(p),d=l(s)&&l(i),w=d?(0,n.DH)(s):f,g=d?(0,n.DH)(i):f;for(let n=0;n<c;h++){if(t(e,r,o,y,h,u),h>=a)throw new Error("arx: counter overflow");const l=Math.min(64,c-n);if(d&&64===l){const t=n/4;if(n%4!=0)throw new Error("arx: invalid block position");for(let e,r=0;r<16;r++)e=t+r,g[e]=w[e]^y[r];n+=64;continue}for(let t,e=0;e<l;e++)t=n+e,i[t]=s[t]^p[e];n+=l}}(t,D,k,v,y,d,w,c),(0,n.uH)(...b),d}}function y(t,e){return 255&t[e++]|(255&t[e++])<<8}class d{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;constructor(t){const e=y(t=(0,n.nC)((0,n.DO)(t,32,"key")),0),r=y(t,2),o=y(t,4),s=y(t,6),i=y(t,8),h=y(t,10),u=y(t,12),c=y(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|r<<3),this.r[2]=7939&(r>>>10|o<<6),this.r[3]=8191&(o>>>7|s<<9),this.r[4]=255&(s>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|h<<2),this.r[7]=8065&(h>>>11|u<<5),this.r[8]=8191&(u>>>8|c<<8),this.r[9]=c>>>5&127;for(let e=0;e<8;e++)this.pad[e]=y(t,16+2*e)}process(t,e,r=!1){const n=r?0:2048,{h:o,r:s}=this,i=s[0],h=s[1],u=s[2],c=s[3],l=s[4],a=s[5],f=s[6],p=s[7],d=s[8],w=s[9],g=y(t,e+0),b=y(t,e+2),A=y(t,e+4),D=y(t,e+6),U=y(t,e+8),k=y(t,e+10),H=y(t,e+12),v=y(t,e+14);let x=o[0]+(8191&g),C=o[1]+(8191&(g>>>13|b<<3)),L=o[2]+(8191&(b>>>10|A<<6)),E=o[3]+(8191&(A>>>7|D<<9)),O=o[4]+(8191&(D>>>4|U<<12)),m=o[5]+(U>>>1&8191),N=o[6]+(8191&(U>>>14|k<<2)),F=o[7]+(8191&(k>>>11|H<<5)),K=o[8]+(8191&(H>>>8|v<<8)),$=o[9]+(v>>>5|n),R=0,S=R+x*i+C*(5*w)+L*(5*d)+E*(5*p)+O*(5*f);R=S>>>13,S&=8191,S+=m*(5*a)+N*(5*l)+F*(5*c)+K*(5*u)+$*(5*h),R+=S>>>13,S&=8191;let z=R+x*h+C*i+L*(5*w)+E*(5*d)+O*(5*p);R=z>>>13,z&=8191,z+=m*(5*f)+N*(5*a)+F*(5*l)+K*(5*c)+$*(5*u),R+=z>>>13,z&=8191;let I=R+x*u+C*h+L*i+E*(5*w)+O*(5*d);R=I>>>13,I&=8191,I+=m*(5*p)+N*(5*f)+F*(5*a)+K*(5*l)+$*(5*c),R+=I>>>13,I&=8191;let M=R+x*c+C*u+L*h+E*i+O*(5*w);R=M>>>13,M&=8191,M+=m*(5*d)+N*(5*p)+F*(5*f)+K*(5*a)+$*(5*l),R+=M>>>13,M&=8191;let P=R+x*l+C*c+L*u+E*h+O*i;R=P>>>13,P&=8191,P+=m*(5*w)+N*(5*d)+F*(5*p)+K*(5*f)+$*(5*a),R+=P>>>13,P&=8191;let Y=R+x*a+C*l+L*c+E*u+O*h;R=Y>>>13,Y&=8191,Y+=m*i+N*(5*w)+F*(5*d)+K*(5*p)+$*(5*f),R+=Y>>>13,Y&=8191;let j=R+x*f+C*a+L*l+E*c+O*u;R=j>>>13,j&=8191,j+=m*h+N*i+F*(5*w)+K*(5*d)+$*(5*p),R+=j>>>13,j&=8191;let q=R+x*p+C*f+L*a+E*l+O*c;R=q>>>13,q&=8191,q+=m*u+N*h+F*i+K*(5*w)+$*(5*d),R+=q>>>13,q&=8191;let B=R+x*d+C*p+L*f+E*a+O*l;R=B>>>13,B&=8191,B+=m*c+N*u+F*h+K*i+$*(5*w),R+=B>>>13,B&=8191;let G=R+x*w+C*d+L*p+E*f+O*a;R=G>>>13,G&=8191,G+=m*l+N*c+F*u+K*h+$*i,R+=G>>>13,G&=8191,R=(R<<2)+R|0,R=R+S|0,S=8191&R,R>>>=13,z+=R,o[0]=S,o[1]=z,o[2]=I,o[3]=M,o[4]=P,o[5]=Y,o[6]=j,o[7]=q,o[8]=B,o[9]=G}finalize(){const{h:t,pad:e}=this,r=new Uint16Array(10);let o=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=o,o=t[e]>>>13,t[e]&=8191;t[0]+=5*o,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,r[0]=t[0]+5,o=r[0]>>>13,r[0]&=8191;for(let e=1;e<10;e++)r[e]=t[e]+o,o=r[e]>>>13,r[e]&=8191;r[9]-=8192;let s=(1^o)-1;for(let t=0;t<10;t++)r[t]&=s;s=~s;for(let e=0;e<10;e++)t[e]=t[e]&s|r[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let i=t[0]+e[0];t[0]=65535&i;for(let r=1;r<8;r++)i=(t[r]+e[r]|0)+(i>>>16)|0,t[r]=65535&i;(0,n.uH)(r)}update(t){(0,n.CC)(this),(0,n.DO)(t),t=(0,n.nC)(t);const{buffer:e,blockLen:r}=this,o=t.length;for(let n=0;n<o;){const s=Math.min(r-this.pos,o-n);if(s!==r)e.set(t.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===r&&(this.process(e,0,!1),this.pos=0);else for(;r<=o-n;n+=r)this.process(t,n)}return this}destroy(){(0,n.uH)(this.h,this.r,this.buffer,this.pad)}digestInto(t){(0,n.CC)(this),(0,n.Ht)(t,this),this.finished=!0;const{buffer:e,h:r}=this;let{pos:o}=this;if(o){for(e[o++]=1;o<16;o++)e[o]=0;this.process(e,0,!0)}this.finalize();let s=0;for(let e=0;e<8;e++)t[s++]=r[e]>>>0,t[s++]=r[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}}const w=(()=>function(t){const e=(e,r)=>t(r).update(e).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}(t=>new d(t)))();function g(t,e,r,n,o,s=20){let i=t[0],h=t[1],u=t[2],l=t[3],a=e[0],f=e[1],p=e[2],y=e[3],d=e[4],w=e[5],g=e[6],b=e[7],A=o,D=r[0],U=r[1],k=r[2],H=i,v=h,x=u,C=l,L=a,E=f,O=p,m=y,N=d,F=w,K=g,$=b,R=A,S=D,z=U,I=k;for(let t=0;t<s;t+=2)H=H+L|0,R=c(R^H,16),N=N+R|0,L=c(L^N,12),H=H+L|0,R=c(R^H,8),N=N+R|0,L=c(L^N,7),v=v+E|0,S=c(S^v,16),F=F+S|0,E=c(E^F,12),v=v+E|0,S=c(S^v,8),F=F+S|0,E=c(E^F,7),x=x+O|0,z=c(z^x,16),K=K+z|0,O=c(O^K,12),x=x+O|0,z=c(z^x,8),K=K+z|0,O=c(O^K,7),C=C+m|0,I=c(I^C,16),$=$+I|0,m=c(m^$,12),C=C+m|0,I=c(I^C,8),$=$+I|0,m=c(m^$,7),H=H+E|0,I=c(I^H,16),K=K+I|0,E=c(E^K,12),H=H+E|0,I=c(I^H,8),K=K+I|0,E=c(E^K,7),v=v+O|0,R=c(R^v,16),$=$+R|0,O=c(O^$,12),v=v+O|0,R=c(R^v,8),$=$+R|0,O=c(O^$,7),x=x+m|0,S=c(S^x,16),N=N+S|0,m=c(m^N,12),x=x+m|0,S=c(S^x,8),N=N+S|0,m=c(m^N,7),C=C+L|0,z=c(z^C,16),F=F+z|0,L=c(L^F,12),C=C+L|0,z=c(z^C,8),F=F+z|0,L=c(L^F,7);let M=0;n[M++]=i+H|0,n[M++]=h+v|0,n[M++]=u+x|0,n[M++]=l+C|0,n[M++]=a+L|0,n[M++]=f+E|0,n[M++]=p+O|0,n[M++]=y+m|0,n[M++]=d+N|0,n[M++]=w+F|0,n[M++]=g+K|0,n[M++]=b+$|0,n[M++]=A+R|0,n[M++]=D+S|0,n[M++]=U+z|0,n[M++]=k+I|0}const b=p(g,{counterRight:!1,counterLength:4,allowShortKeys:!1}),A=p(g,{counterRight:!1,counterLength:8,extendNonceFn:function(t,e,r,n){let o=t[0],s=t[1],i=t[2],h=t[3],u=e[0],l=e[1],a=e[2],f=e[3],p=e[4],y=e[5],d=e[6],w=e[7],g=r[0],b=r[1],A=r[2],D=r[3];for(let t=0;t<20;t+=2)o=o+u|0,g=c(g^o,16),p=p+g|0,u=c(u^p,12),o=o+u|0,g=c(g^o,8),p=p+g|0,u=c(u^p,7),s=s+l|0,b=c(b^s,16),y=y+b|0,l=c(l^y,12),s=s+l|0,b=c(b^s,8),y=y+b|0,l=c(l^y,7),i=i+a|0,A=c(A^i,16),d=d+A|0,a=c(a^d,12),i=i+a|0,A=c(A^i,8),d=d+A|0,a=c(a^d,7),h=h+f|0,D=c(D^h,16),w=w+D|0,f=c(f^w,12),h=h+f|0,D=c(D^h,8),w=w+D|0,f=c(f^w,7),o=o+l|0,D=c(D^o,16),d=d+D|0,l=c(l^d,12),o=o+l|0,D=c(D^o,8),d=d+D|0,l=c(l^d,7),s=s+a|0,g=c(g^s,16),w=w+g|0,a=c(a^w,12),s=s+a|0,g=c(g^s,8),w=w+g|0,a=c(a^w,7),i=i+f|0,b=c(b^i,16),p=p+b|0,f=c(f^p,12),i=i+f|0,b=c(b^i,8),p=p+b|0,f=c(f^p,7),h=h+u|0,A=c(A^h,16),y=y+A|0,u=c(u^y,12),h=h+u|0,A=c(A^h,8),y=y+A|0,u=c(u^y,7);let U=0;n[U++]=o,n[U++]=s,n[U++]=i,n[U++]=h,n[U++]=g,n[U++]=b,n[U++]=A,n[U++]=D},allowShortKeys:!1}),D=new Uint8Array(16),U=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(D.subarray(r))},k=new Uint8Array(32);function H(t,e,r,o,s){void 0!==s&&(0,n.DO)(s,void 0,"AAD");const i=t(e,r,k),h=(0,n.Pg)(o.length,s?s.length:0,!0),u=w.create(i);s&&U(u,s),U(u,o),u.update(h);const c=u.digest();return(0,n.uH)(i,h),c}const v=t=>(e,r,o)=>({encrypt(s,i){const h=s.length;(i=(0,n.N$)(h+16,i,!1)).set(s);const u=i.subarray(0,-16);t(e,r,u,u,1);const c=H(t,e,r,u,o);return i.set(c,h),(0,n.uH)(c),i},decrypt(s,i){i=(0,n.N$)(s.length-16,i,!1);const h=s.subarray(0,-16),u=s.subarray(-16),c=H(t,e,r,h,o);if(!(0,n.ex)(u,c))throw new Error("invalid tag");return i.set(s.subarray(0,-16)),t(e,r,i,i,1),(0,n.uH)(c),i}});v(b),v(A)}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 843.nostr-crypto-utils.min.js.LICENSE.txt */
2
- (this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[843],{510(e,t,r){"use strict";t.ND=t.ko=t.bI=void 0;const n=r(76),i=r(175),s=r(562),o=r(761),f=r(967),a=r(705),c=r(627),l={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},u={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},d=BigInt(0),b=BigInt(1),h=BigInt(2),g=(0,f.Field)(l.p,{sqrt:function(e){const t=l.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,d=u*u*e%t,b=(0,f.pow2)(d,r,t)*d%t,p=(0,f.pow2)(b,r,t)*d%t,v=(0,f.pow2)(p,h,t)*u%t,y=(0,f.pow2)(v,i,t)*v%t,m=(0,f.pow2)(y,s,t)*y%t,w=(0,f.pow2)(m,a,t)*m%t,B=(0,f.pow2)(w,c,t)*w%t,x=(0,f.pow2)(B,a,t)*m%t,E=(0,f.pow2)(x,r,t)*d%t,T=(0,f.pow2)(E,o,t)*y%t,_=(0,f.pow2)(T,n,t)*u%t,z=(0,f.pow2)(_,h,t);if(!g.eql(g.sqr(z),e))throw new Error("Cannot find square root");return z}});t.bI=(0,s.createCurve)({...l,Fp:g,lowS:!0,endo:u},n.sha256);const p={};function v(e,...t){let r=p[e];if(void 0===r){const t=(0,n.sha256)((0,c.utf8ToBytes)(e));r=(0,c.concatBytes)(t,t),p[e]=r}return(0,n.sha256)((0,c.concatBytes)(r,...t))}const y=e=>e.toBytes(!0).slice(1),m=(()=>t.bI.Point)(),w=e=>e%h===d;function B(e){const{Fn:t,BASE:r}=m,n=(0,a._normFnElement)(t,e),i=r.multiply(n);return{scalar:w(i.y)?n:t.neg(n),bytes:y(i)}}function x(e){const t=g;if(!t.isValidNot0(e))throw new Error("invalid x: Fail if x ≥ p");const r=t.create(e*e),n=t.create(r*e+BigInt(7));let i=t.sqrt(n);w(i)||(i=t.neg(i));const s=m.fromAffine({x:e,y:i});return s.assertValidity(),s}const E=c.bytesToNumberBE;function T(...e){return m.Fn.create(E(v("BIP0340/challenge",...e)))}function _(e){return B(e).bytes}function z(e,t,r=(0,i.randomBytes)(32)){const{Fn:n}=m,s=(0,c.ensureBytes)("message",e),{bytes:o,scalar:f}=B(t),a=(0,c.ensureBytes)("auxRand",r,32),l=n.toBytes(f^E(v("BIP0340/aux",a))),u=v("BIP0340/nonce",l,o,s),{bytes:d,scalar:b}=B(u),h=T(d,o,s),g=new Uint8Array(64);if(g.set(d,0),g.set(n.toBytes(n.create(b+h*f)),32),!A(g,s,o))throw new Error("sign: Invalid signature produced");return g}function A(e,t,r){const{Fn:n,BASE:i}=m,s=(0,c.ensureBytes)("signature",e,64),o=(0,c.ensureBytes)("message",t),f=(0,c.ensureBytes)("publicKey",r,32);try{const e=x(E(f)),t=E(s.subarray(0,32));if(!(0,c.inRange)(t,b,l.p))return!1;const r=E(s.subarray(32,64));if(!(0,c.inRange)(r,b,l.n))return!1;const a=T(n.toBytes(t),y(e),o),u=i.multiplyUnsafe(r).add(e.multiplyUnsafe(n.neg(a))),{x:d,y:h}=u.toAffine();return!(u.is0()||!w(h)||d!==t)}catch(e){return!1}}t.ko=(()=>{const e=(e=(0,i.randomBytes)(48))=>(0,f.mapHashToField)(e,l.n);return t.bI.utils.randomSecretKey,{keygen:function(t){const r=e(t);return{secretKey:r,publicKey:_(r)}},getPublicKey:_,sign:z,verify:A,Point:m,utils:{randomSecretKey:e,randomPrivateKey:e,taggedHash:v,lift_x:x,pointToBytes:y,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,mod:f.mod},lengths:{secretKey:32,publicKey:32,publicKeyHasPrefix:!1,signature:64,seed:48}}})();const I=(()=>(0,o.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))))(),O=(()=>(0,a.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}))();t.ND=(0,o.createHasher)(t.bI.Point,e=>{const{x:t,y:r}=O(g.create(e[0]));return I(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256}),t.ND.hashToCurve,t.ND.encodeToCurve},526(e,t){"use strict";t.byteLength=function(e){var t=f(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=f(e),o=s[0],a=s[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,a)),l=0,u=a>0?o-4:o;for(r=0;r<u;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=16383,f=0,a=n-i;f<a;f+=o)s.push(c(e,f,f+o>a?a:f+o));return 1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],n[s.charCodeAt(o)]=o;function f(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function a(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(a(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},251(e,t){t.read=function(e,t,r,n,i){var s,o,f=8*i-n-1,a=(1<<f)-1,c=a>>1,l=-7,u=r?i-1:0,d=r?-1:1,b=e[t+u];for(u+=d,s=b&(1<<-l)-1,b>>=-l,l+=f;l>0;s=256*s+e[t+u],u+=d,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+u],u+=d,l-=8);if(0===s)s=1-c;else{if(s===a)return o?NaN:1/0*(b?-1:1);o+=Math.pow(2,n),s-=c}return(b?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,f,a,c=8*s-i-1,l=(1<<c)-1,u=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:s-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-o))<1&&(o--,a*=2),(t+=o+u>=1?d/a:d*Math.pow(2,1-u))*a>=2&&(o++,a/=2),o+u>=l?(f=0,o=l):o+u>=1?(f=(t*a-1)*Math.pow(2,i),o+=u):(f=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+b]=255&f,b+=h,f/=256,i-=8);for(o=o<<i|f,c+=i;c>0;e[r+b]=255&o,b+=h,o/=256,c-=8);e[r+b-h]|=128*g}},606(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var f,a=[],c=!1,l=-1;function u(){c&&f&&(c=!1,f.length?a=f.concat(a):l=-1,a.length&&d())}function d(){if(!c){var e=o(u);c=!0;for(var t=a.length;t;){for(f=a,a=[];++l<t;)f&&f[l].run();l=-1,t=a.length}f=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];a.push(new b(e,t)),1!==a.length||c||o(d)},b.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},793(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=new Array(s);o[0]=i(e);for(var f=1;f<s;f++)o[f]=i(r[f]);return o.join(" ")}if("string"!=typeof e)return e;var a=r.length;if(0===a)return e;for(var c="",l=0,u=-1,d=e&&e.length||0,b=0;b<d;){if(37===e.charCodeAt(b)&&b+1<d){switch(u=u>-1?u:0,e.charCodeAt(b+1)){case 100:case 102:if(l>=a)break;if(null==r[l])break;u<b&&(c+=e.slice(u,b)),c+=Number(r[l]),u=b+2,b++;break;case 105:if(l>=a)break;if(null==r[l])break;u<b&&(c+=e.slice(u,b)),c+=Math.floor(Number(r[l])),u=b+2,b++;break;case 79:case 111:case 106:if(l>=a)break;if(void 0===r[l])break;u<b&&(c+=e.slice(u,b));var h=typeof r[l];if("string"===h){c+="'"+r[l]+"'",u=b+2,b++;break}if("function"===h){c+=r[l].name||"<anonymous>",u=b+2,b++;break}c+=i(r[l]),u=b+2,b++;break;case 115:if(l>=a)break;u<b&&(c+=e.slice(u,b)),c+=String(r[l]),u=b+2,b++;break;case 37:u<b&&(c+=e.slice(u,b)),c+="%",u=b+2,b++,l--}++l}++b}return-1===u?e:(u<d&&(c+=e.slice(u)),c)}},874(e,t,r){"use strict";const n=r(793);e.exports=u;const i=function(){function e(e){return void 0!==e&&e}try{return"undefined"!=typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{},s={mapHttpRequest:v,mapHttpResponse:v,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:v,res:v,err:g,errWithCause:g};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}const f=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),c={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(e,t){const r={logger:t,parent:e[a]};t[a]=r}function u(e){(e=e||{}).browser=e.browser||{};const t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");const r=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},s=function(e,t){return Array.isArray(e)?e.filter(function(e){return"!stdSerializers.err"!==e}):!0===e&&Object.keys(t)}(e.browser.serialize,n);let a=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(a=!1);const g=Object.keys(e.customLevels||{}),v=["error","fatal","warn","info","debug","trace"].concat(g);"function"==typeof r&&v.forEach(function(e){r[e]=r}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");const y=e.level||"info",w=Object.create(r);w.log||(w.log=m),function(e,t,r){const n={};t.forEach(e=>{n[e]=r[e]?r[e]:i[e]||i[c[e]||"log"]||m}),e[f]=n}(w,v,r),l({},w),Object.defineProperty(w,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(w,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,d(this,B,w,"error"),d(this,B,w,"fatal"),d(this,B,w,"warn"),d(this,B,w,"info"),d(this,B,w,"debug"),d(this,B,w,"trace"),g.forEach(e=>{d(this,B,w,e)})}});const B={transmit:t,serialize:s,asObject:e.browser.asObject,formatters:e.browser.formatters,levels:v,timestamp:p(e)};return w.levels=function(e){const t=e.customLevels||{};return{values:Object.assign({},u.levels.values,t),labels:Object.assign({},u.levels.labels,function(e){const t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}(t))}}(e),w.level=y,w.setMaxListeners=w.getMaxListeners=w.emit=w.addListener=w.on=w.prependListener=w.once=w.prependOnceListener=w.removeListener=w.removeAllListeners=w.listeners=w.listenerCount=w.eventNames=w.write=w.flush=m,w.serializers=n,w._serialize=s,w._stdErrSerialize=a,w.child=function(r,i){if(!r)throw new Error("missing bindings for child Pino");i=i||{},s&&r.serializers&&(i.serializers=r.serializers);const o=i.serializers;if(s&&o){var f=Object.assign({},n,o),a=!0===e.browser.serialize?Object.keys(f):s;delete r.serializers,b([r],a,f,this._stdErrSerialize)}function c(e){this._childLevel=1+(0|e._childLevel),this.bindings=r,f&&(this.serializers=f,this._serialize=a),t&&(this._logEvent=h([].concat(e._logEvent.bindings,r)))}c.prototype=this;const u=new c(this);return l(this,u),u.level=this.level,u},t&&(w._logEvent=h()),w}function d(e,t,r,s){if(Object.defineProperty(e,s,{value:o(e.level,r)>o(s,r)?m:r[f][s],writable:!0,enumerable:!0,configurable:!0}),!t.transmit&&e[s]===m)return;e[s]=function(e,t,r,s){return a=e[f][s],function(){const f=t.timestamp(),c=new Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var u=0;u<c.length;u++)c[u]=arguments[u];if(t.serialize&&!t.asObject&&b(c,this._serialize,this.serializers,this._stdErrSerialize),t.asObject||t.formatters?a.call(l,function(e,t,r,i,s={}){const{level:o=()=>e.levels.values[t],log:f=e=>e}=s;e._serialize&&b(r,e._serialize,e.serializers,e._stdErrSerialize);const a=r.slice();let c=a[0];const l={};i&&(l.time=i),l.level=o(t,e.levels.values[t]);let u=1+(0|e._childLevel);if(u<1&&(u=1),null!==c&&"object"==typeof c){for(;u--&&"object"==typeof a[0];)Object.assign(l,a.shift());c=a.length?n(a.shift(),a):void 0}else"string"==typeof c&&(c=n(a.shift(),a));return void 0!==c&&(l.msg=c),f(l)}(this,s,c,f,t.formatters)):a.apply(l,c),t.transmit){const n=t.transmit.level||e._level,i=r.levels.values[n],a=r.levels.values[s];if(a<i)return;!function(e,t,r){const n=t.send,i=t.ts,s=t.methodLevel,o=t.methodValue,f=t.val,a=e._logEvent.bindings;b(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(e){return-1===a.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=o,n(s,e._logEvent,f),e._logEvent=h(a)}(this,{ts:f,methodLevel:s,methodValue:a,transmitLevel:n,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:o(e._level,r)},c)}};var a}(e,t,r,s);const c=function(e){const t=[];e.bindings&&t.push(e.bindings);let r=e[a];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==c.length&&(e[s]=function(e,t){return function(){return t.apply(this,[...e,...arguments])}}(c,e[s]))}function b(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=u.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(const n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function h(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:B}function v(){return{}}function y(e){return e}function m(){}function w(){return!1}function B(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers=s,u.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:B,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),e.exports.default=u,e.exports.pino=u}}]);
@@ -1,3 +0,0 @@
1
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
2
-
3
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[428],{300(t,i,e){var n=e(510),r=e(39);e(268),new class{constructor(){this.cryptoInstance=null,this.initPromise=this.initialize()}async initialize(){this.cryptoInstance=await(async()=>{if("undefined"!=typeof window)return{};if(void 0!==e.g)return{};try{const t=await Promise.resolve().then(e.bind(e,300));if(t.webcrypto)return t.webcrypto}catch{r.vF.debug("Node crypto not available")}throw new Error("No WebCrypto implementation available")})()}async ensureInitialized(){if(await this.initPromise,!this.cryptoInstance)throw new Error("Crypto implementation not initialized");return this.cryptoInstance}async getSubtle(){return(await this.ensureInitialized()).subtle}async getRandomValues(t){return(await this.ensureInitialized()).getRandomValues(t)}},n.ko.sign,n.ko.verify},268(t,i,e){e(287).hp},146(t,i,e){e(247),e(300),e(965);var n=e(39);e(268),new class{constructor(){this.cryptoInstance=null,this.initPromise=this.initialize()}async initialize(){this.cryptoInstance=await(async()=>{if("undefined"!=typeof window)return{};if(void 0!==e.g)return{};try{const t=await Promise.resolve().then(e.bind(e,300));if(t.webcrypto)return t.webcrypto}catch{n.vF.debug("Node crypto not available")}throw new Error("No WebCrypto implementation available")})()}async ensureInitialized(){if(await this.initPromise,!this.cryptoInstance)throw new Error("Crypto implementation not initialized");return this.cryptoInstance}async getSubtle(){return(await this.ensureInitialized()).subtle}async getRandomValues(t){return(await this.ensureInitialized()).getRandomValues(t)}},e(916),e(38),e(298),e(696)}}]);
@@ -1 +0,0 @@
1
- !function(E,T){"object"==typeof exports&&"object"==typeof module?module.exports=T():"function"==typeof define&&define.amd?define([],T):"object"==typeof exports?exports.NostrCryptoUtils=T():(E.NostrCryptoUtils=E.NostrCryptoUtils||{},E.NostrCryptoUtils["main-96d4916e"]=T())}(this,()=>(()=>{"use strict";var E,T={247(){var E,T,N,A;!function(E){E[E.SET_METADATA=0]="SET_METADATA",E[E.TEXT_NOTE=1]="TEXT_NOTE",E[E.RECOMMEND_SERVER=2]="RECOMMEND_SERVER",E[E.CONTACTS=3]="CONTACTS",E[E.ENCRYPTED_DIRECT_MESSAGE=4]="ENCRYPTED_DIRECT_MESSAGE",E[E.EVENT_DELETION=5]="EVENT_DELETION",E[E.REPOST=6]="REPOST",E[E.REACTION=7]="REACTION",E[E.CHANNEL_CREATION=40]="CHANNEL_CREATION",E[E.CHANNEL_METADATA=41]="CHANNEL_METADATA",E[E.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",E[E.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",E[E.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",E[E.AUTH=22242]="AUTH",E[E.AUTH_RESPONSE=22243]="AUTH_RESPONSE"}(E||(E={})),function(E){E.EVENT="EVENT",E.NOTICE="NOTICE",E.OK="OK",E.EOSE="EOSE",E.REQ="REQ",E.CLOSE="CLOSE",E.AUTH="AUTH"}(T||(T={})),function(E){E.CONNECT="connect",E.PING="ping",E.GET_PUBLIC_KEY="get_public_key",E.SIGN_EVENT="sign_event",E.NIP04_ENCRYPT="nip04_encrypt",E.NIP04_DECRYPT="nip04_decrypt",E.NIP44_ENCRYPT="nip44_encrypt",E.NIP44_DECRYPT="nip44_decrypt",E.GET_RELAYS="get_relays"}(N||(N={})),function(E){E[E.SET_METADATA=0]="SET_METADATA",E[E.TEXT_NOTE=1]="TEXT_NOTE",E[E.RECOMMEND_SERVER=2]="RECOMMEND_SERVER",E[E.CONTACT_LIST=3]="CONTACT_LIST",E[E.ENCRYPTED_DIRECT_MESSAGE=4]="ENCRYPTED_DIRECT_MESSAGE",E[E.DELETE=5]="DELETE",E[E.REPOST=6]="REPOST",E[E.REACTION=7]="REACTION",E[E.BADGE_AWARD=8]="BADGE_AWARD",E[E.CHANNEL_CREATE=40]="CHANNEL_CREATE",E[E.CHANNEL_METADATA=41]="CHANNEL_METADATA",E[E.CHANNEL_MESSAGE=42]="CHANNEL_MESSAGE",E[E.CHANNEL_HIDE_MESSAGE=43]="CHANNEL_HIDE_MESSAGE",E[E.CHANNEL_MUTE_USER=44]="CHANNEL_MUTE_USER",E[E.CHANNEL_RESERVE=45]="CHANNEL_RESERVE",E[E.REPORTING=1984]="REPORTING",E[E.ZAP_REQUEST=9734]="ZAP_REQUEST",E[E.ZAP=9735]="ZAP",E[E.MUTE_LIST=1e4]="MUTE_LIST",E[E.PIN_LIST=10001]="PIN_LIST",E[E.RELAY_LIST_METADATA=10002]="RELAY_LIST_METADATA",E[E.CLIENT_AUTH=22242]="CLIENT_AUTH",E[E.AUTH_RESPONSE=22243]="AUTH_RESPONSE",E[E.NOSTR_CONNECT=24133]="NOSTR_CONNECT",E[E.CATEGORIZED_PEOPLE=3e4]="CATEGORIZED_PEOPLE",E[E.CATEGORIZED_BOOKMARKS=30001]="CATEGORIZED_BOOKMARKS",E[E.PROFILE_BADGES=30008]="PROFILE_BADGES",E[E.BADGE_DEFINITION=30009]="BADGE_DEFINITION",E[E.LONG_FORM=30023]="LONG_FORM",E[E.APPLICATION_SPECIFIC=30078]="APPLICATION_SPECIFIC"}(A||(A={}))},39(E,T,N){N.d(T,{vF:()=>r});var A,e=N(874),t=N.n(e),_=N(606);!function(E){E[E.DEBUG=0]="DEBUG",E[E.INFO=1]="INFO",E[E.WARN=2]="WARN",E[E.ERROR=3]="ERROR"}(A||(A={}));const r=t()({name:"nostr-crypto-utils",level:_.env.LOG_LEVEL||"info",transport:void 0,formatters:{level:E=>({level:E.toUpperCase()}),log:E=>{if(E&&"object"==typeof E&&"err"in E){const T={...E};if(T.err instanceof Error){const E=T.err;T.err={message:E.message,stack:E.stack,name:E.name}}return T}return E}}})},965(E,T,N){N(247),N(39)}},N={};function A(E){var e=N[E];if(void 0!==e)return e.exports;var t=N[E]={exports:{}};return T[E](t,t.exports,A),t.exports}A.m=T,E=[],A.O=(T,N,e,t)=>{if(!N){var _=1/0;for(n=0;n<E.length;n++){for(var[N,e,t]=E[n],r=!0,C=0;C<N.length;C++)(!1&t||_>=t)&&Object.keys(A.O).every(E=>A.O[E](N[C]))?N.splice(C--,1):(r=!1,t<_&&(_=t));if(r){E.splice(n--,1);var o=e();void 0!==o&&(T=o)}}return T}t=t||0;for(var n=E.length;n>0&&E[n-1][2]>t;n--)E[n]=E[n-1];E[n]=[N,e,t]},A.n=E=>{var T=E&&E.__esModule?()=>E.default:()=>E;return A.d(T,{a:T}),T},A.d=(E,T)=>{for(var N in T)A.o(T,N)&&!A.o(E,N)&&Object.defineProperty(E,N,{enumerable:!0,get:T[N]})},A.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(E){if("object"==typeof window)return window}}(),A.o=(E,T)=>Object.prototype.hasOwnProperty.call(E,T),(()=>{var E={105:0};A.O.j=T=>0===E[T];var T=(T,N)=>{var e,t,[_,r,C]=N,o=0;if(_.some(T=>0!==E[T])){for(e in r)A.o(r,e)&&(A.m[e]=r[e]);if(C)var n=C(A)}for(T&&T(N);o<_.length;o++)t=_[o],A.o(E,t)&&E[t]&&E[t][0](),E[t]=0;return A.O(n)},N=this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[];N.forEach(T.bind(null,0)),N.push=T.bind(null,N.push.bind(N))})();var e=A.O(void 0,[575,348,705,524,732,126,116,843,343,668,428,597],()=>A(146));return(e=A.O(e)).default})());
@@ -1 +0,0 @@
1
- "use strict";(this.webpackChunkNostrCryptoUtils=this.webpackChunkNostrCryptoUtils||[]).push([[597],{916(t,e,s){s(343),s(287)},38(t,e,s){s(300)},298(t,e,s){s(732),s(246),s(510),s(139),s(615),s(623),s(175),s(116),new TextEncoder,new TextDecoder},696(t,e,s){s(298),s(247)}}]);
@@ -1 +0,0 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -1 +0,0 @@
1
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */