@blockcerts/blockcerts-verifier 1.72.4 → 1.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/bundle-stats.html +1 -1
- package/codecov +0 -0
- package/codecov.SHA256SUM +1 -0
- package/codecov.SHA256SUM.sig +16 -0
- package/coverage/lcov.info +475 -472
- package/dist/{DataIntegrityProof-x-pKdBCc-B_YUlE0Z.js → DataIntegrityProof-D8TnXEkl-CGiIg0kn.js} +2 -2
- package/dist/{EcdsaSd2023-CU35O_1w-CISk0lEt.js → EcdsaSd2023-D2eJBmaY-mHNjbn8h.js} +11 -15
- package/dist/EcdsaSecp256k1Signature2019-BRdQnZ0o-D_QN8KrS.js +1 -0
- package/dist/{Ed25519Signature2020-B6yblwC5-BRlzT2Yc.js → Ed25519Signature2020-D2tdrIA4-PSi5TCQH.js} +5 -5
- package/dist/{EddsaRdfc2022-Csk9U_qt-B798omlR.js → EddsaRdfc2022-CpZAUc7W-BJP0532C.js} +3 -3
- package/dist/MerkleProof2017-DW_9FhLr-C0dPtifx.js +1 -0
- package/dist/MerkleProof2019-DJbo7uW--CHlhsnHk.js +5 -0
- package/dist/Suite-BmP2Qu19-D1ucdMDB.js +1 -0
- package/dist/_polyfill-node.path-hKwMKLNw-B7aPtphV.js +1 -0
- package/dist/checkBitStringStatusList-BUPuVWy_-CYedocxJ.js +13 -0
- package/dist/checkCredentialSchemaConformity-CJdGwNcY-CaSak-bD.js +1 -0
- package/dist/{controlVerificationMethod-Cuyek_Vk-C_Uq2iA5.js → controlVerificationMethod-C71lJp3H-n-AbzkO8.js} +1 -1
- package/dist/{downloadPDF-UAsY-nU_.js → downloadPDF-BU6CfP-N.js} +2 -2
- package/dist/{ensureNotRevoked-CNUfpW4F-BheL-ZKZ.js → ensureNotRevoked-BWp1jPEo-DSQMtjrj.js} +1 -1
- package/dist/ensureValidIssuingKey-BYAR3LEF-76kiqVKA.js +1 -0
- package/dist/{index-DNlz8u7B-CYTlxhyY.js → index-BCu3PGuw-Dh4-8Ruv.js} +1 -1
- package/dist/index-CB7VaVsF-G_Mj6xql.js +30 -0
- package/dist/index-Jn9Q6fuB-uChPhl1c.js +56 -0
- package/dist/{index.es-CnYWLNZV.js → index.es-C2GPR7m7.js} +1 -1
- package/dist/jsonld-DqC1oHcn-ruRlORc0.js +88 -0
- package/dist/main.js +85 -85
- package/dist/purify.es-C6IIzwyE.js +2 -0
- package/dist/{retrieveVerificationMethodPublicKey-DcEGtx_h-D1zuvtQB.js → retrieveVerificationMethodPublicKey-Dai7em0K-BqIH8qzD.js} +1 -1
- package/dist/verifyIssuerProfile-zkczSLpC-CTHpISfH.js +1 -0
- package/package.json +9 -9
- package/dist/EcdsaSecp256k1Signature2019-DiXIv8yq-B2kEN_Qo.js +0 -1
- package/dist/MerkleProof2017-BIJKwMk5-CLYAJK4G.js +0 -1
- package/dist/MerkleProof2019-CeAt2OGM-DOuISx_E.js +0 -5
- package/dist/Suite-CBLHluYK-Dmvbh142.js +0 -33
- package/dist/checkCredentialSchemaConformity-CECtM4WI-C1vg05zb.js +0 -1
- package/dist/checkRevocationStatusList2021-B7NFlV-5-C3Zng1tA.js +0 -13
- package/dist/ensureValidIssuingKey-DN2kpCwj-DY8BTObG.js +0 -1
- package/dist/index-DFOHyoZq-BCuOIg2Z.js +0 -29
- package/dist/jsonld-signatures-BtZPa7MV-DTekMXP5.js +0 -56
- package/dist/pako.esm-BGRKTPxS-Bodm4Eha.js +0 -2
- package/dist/purify.es-Om653OSQ.js +0 -2
- package/dist/sha2-JcCWfgvE-By1_saxP.js +0 -2
- package/dist/verifyIssuerProfile-DQji41Fc-l31-7imR.js +0 -1
- /package/dist/{HashlinkVerifier-Bi7nn19S-DMjUYzMR.js → HashlinkVerifier-BcdAFe02-DMjUYzMR.js} +0 -0
- /package/dist/{index-6G1g4ypj-Dgus2xdV.js → index-KzSDgEl9-Dgus2xdV.js} +0 -0
- /package/dist/{index-D7PA_QcD-CyttRwCk.js → index-OtXtCWrq-CyttRwCk.js} +0 -0
- /package/dist/{webcrypto.es-aoUxIxUm-gGk5JRJH.js → webcrypto.es-9hytEjC6-gGk5JRJH.js} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{s as e}from"./index-BCu3PGuw-Dh4-8Ruv.js";import{d as t,b as r,r as n,c as i,l as o,e as s,B as a,f as c,S as u,h,p as f,P as l,j as d,k as p,m as y,n as g,o as E}from"./main.js";import{a as m,j as _}from"./jsonld-DqC1oHcn-ruRlORc0.js";import{e as w,s as b}from"./ensureValidIssuingKey-BYAR3LEF-76kiqVKA.js";import{t as P,a as I}from"./index-CB7VaVsF-G_Mj6xql.js";import"./index-Jn9Q6fuB-uChPhl1c.js";import"./index-KzSDgEl9-Dgus2xdV.js";import{r as A}from"./retrieveVerificationMethodPublicKey-Dai7em0K-BqIH8qzD.js";import{S as T}from"./Suite-BmP2Qu19-D1ucdMDB.js";var O,v,S={type:"object",required:["merkleRoot","targetHash","anchors"],properties:{merkleRoot:{type:"string",minLength:64,maxLength:64},targetHash:{type:"string",minLength:64,maxLength:64},anchors:{type:"array",minItems:1,contains:{type:"string"}}}};e.validator(S);var N,U,R=h(v?O:(v=1,O={root:{merkleRoot:0,targetHash:1,anchors:2,path:3},path:{left:0,right:1},chain:{btc:{id:0,networks:{mainnet:1,testnet:3}},eth:{id:1,networks:{mainnet:1,ropsten:3,rinkeby:4,goerli:5,sepolia:11155111}},mtc:{id:2,networks:{mainnet:137,mumbai:80001}},mocknet:{id:-1,networks:{mocknet:-1}}}})),k={};function B(){if(U)return N;U=1;const e=p,{Buffer:t}=d,r=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});class n extends e.Transform{constructor(e,r,n={}){let i=null,o=null;switch(typeof e){case"object":t.isBuffer(e)?i=e:e&&(n=e);break;case"string":i=e;break;case"undefined":break;default:throw new TypeError("Invalid input")}switch(typeof r){case"object":r&&(n=r);break;case"string":o=r;break;case"undefined":break;default:throw new TypeError("Invalid inputEncoding")}if(!n||"object"!=typeof n)throw new TypeError("Invalid options");null==i&&(i=n.input),null==o&&(o=n.inputEncoding),delete n.input,delete n.inputEncoding;const s=null==n.watchPipe||n.watchPipe;delete n.watchPipe;const a=Boolean(n.readError);delete n.readError,super(n),this.readError=a,s&&this.on("pipe",e=>{const t=e._readableState.objectMode;if(this.length>0&&t!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");this._readableState.objectMode=t,this._writableState.objectMode=t}),null!=i&&this.end(i,o)}static isNoFilter(e){return e instanceof this}static compare(e,t){if(!(e instanceof this))throw new TypeError("Arguments must be NoFilters");return e===t?0:e.compare(t)}static concat(e,r){if(!Array.isArray(e))throw new TypeError("list argument must be an Array of NoFilters");if(0===e.length||0===r)return t.alloc(0);null==r&&(r=e.reduce((e,t)=>{if(!(t instanceof n))throw new TypeError("list argument must be an Array of NoFilters");return e+t.length},0));let i=!0,o=!0;const s=e.map(e=>{if(!(e instanceof n))throw new TypeError("list argument must be an Array of NoFilters");const r=e.slice();return t.isBuffer(r)?o=!1:i=!1,r});if(i)return t.concat(s,r);if(o)return[].concat(...s).slice(0,r);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(e,r,n){this._readableState.objectMode||t.isBuffer(e)||(e=t.from(e,r)),this.push(e),n()}_bufArray(){let e=this._readableState.buffer;if(!Array.isArray(e)){let t=e.head;for(e=[];null!=t;)e.push(t.data),t=t.next}return e}read(e){const t=super.read(e);if(null!=t){if(this.emit("read",t),this.readError&&t.length<e)throw new Error(`Read ${t.length}, wanted ${e}`)}else if(this.readError)throw new Error(`No data available, wanted ${e}`);return t}readFull(e){let t=null,r=null,n=null;return new Promise((i,o)=>{this.length>=e?i(this.read(e)):this.writableFinished?o(new Error(`Stream finished before ${e} bytes were available`)):(t=t=>{this.length>=e&&i(this.read(e))},r=()=>{o(new Error(`Stream finished before ${e} bytes were available`))},n=o,this.on("readable",t),this.on("error",n),this.on("finish",r))}).finally(()=>{t&&(this.removeListener("readable",t),this.removeListener("error",n),this.removeListener("finish",r))})}promise(e){let t=!1;return new Promise((r,n)=>{this.on("finish",()=>{const n=this.read();null==e||t||(t=!0,e(null,n)),r(n)}),this.on("error",r=>{null==e||t||(t=!0,e(r)),n(r)})})}compare(e){if(!(e instanceof n))throw new TypeError("Arguments must be NoFilters");if(this===e)return 0;const r=this.slice(),i=e.slice();if(t.isBuffer(r)&&t.isBuffer(i))return r.compare(i);throw new Error("Cannot compare streams in object mode")}equals(e){return 0===this.compare(e)}slice(e,r){if(this._readableState.objectMode)return this._bufArray().slice(e,r);const n=this._bufArray();switch(n.length){case 0:return t.alloc(0);case 1:return n[0].slice(e,r);default:return t.concat(n).slice(e,r)}}get(e){return this.slice()[e]}toJSON(){const e=this.slice();return t.isBuffer(e)?e.toJSON():e}toString(e,n,i){const o=this.slice(n,i);return t.isBuffer(o)?e&&"utf8"!==e?o.toString(e):r.decode(o):JSON.stringify(o)}[Symbol.for("nodejs.util.inspect.custom")](e,r){const n=this._bufArray().map(e=>t.isBuffer(e)?r.stylize(e.toString("hex"),"string"):JSON.stringify(e)).join(", ");return`${this.constructor.name} [${n}]`}get length(){return this._readableState.length}writeBigInt(e){let r=e.toString(16);if(e<0){const t=BigInt(Math.floor(r.length/2));r=(e=(BigInt(1)<<t*BigInt(8))+e).toString(16)}return r.length%2&&(r=`0${r}`),this.push(t.from(r,"hex"))}readUBigInt(e){const r=this.read(e);return t.isBuffer(r)?BigInt(`0x${r.toString("hex")}`):null}readBigInt(e){const r=this.read(e);if(!t.isBuffer(r))return null;let n=BigInt(`0x${r.toString("hex")}`);if(128&r[0]){n-=BigInt(1)<<BigInt(r.length)*BigInt(8)}return n}writeUInt8(e){const r=t.from([e]);return this.push(r)}writeUInt16LE(e){const r=t.alloc(2);return r.writeUInt16LE(e),this.push(r)}writeUInt16BE(e){const r=t.alloc(2);return r.writeUInt16BE(e),this.push(r)}writeUInt32LE(e){const r=t.alloc(4);return r.writeUInt32LE(e),this.push(r)}writeUInt32BE(e){const r=t.alloc(4);return r.writeUInt32BE(e),this.push(r)}writeInt8(e){const r=t.from([e]);return this.push(r)}writeInt16LE(e){const r=t.alloc(2);return r.writeUInt16LE(e),this.push(r)}writeInt16BE(e){const r=t.alloc(2);return r.writeUInt16BE(e),this.push(r)}writeInt32LE(e){const r=t.alloc(4);return r.writeUInt32LE(e),this.push(r)}writeInt32BE(e){const r=t.alloc(4);return r.writeUInt32BE(e),this.push(r)}writeFloatLE(e){const r=t.alloc(4);return r.writeFloatLE(e),this.push(r)}writeFloatBE(e){const r=t.alloc(4);return r.writeFloatBE(e),this.push(r)}writeDoubleLE(e){const r=t.alloc(8);return r.writeDoubleLE(e),this.push(r)}writeDoubleBE(e){const r=t.alloc(8);return r.writeDoubleBE(e),this.push(r)}writeBigInt64LE(e){const r=t.alloc(8);return r.writeBigInt64LE(e),this.push(r)}writeBigInt64BE(e){const r=t.alloc(8);return r.writeBigInt64BE(e),this.push(r)}writeBigUInt64LE(e){const r=t.alloc(8);return r.writeBigUInt64LE(e),this.push(r)}writeBigUInt64BE(e){const r=t.alloc(8);return r.writeBigUInt64BE(e),this.push(r)}readUInt8(){const e=this.read(1);return t.isBuffer(e)?e.readUInt8():null}readUInt16LE(){const e=this.read(2);return t.isBuffer(e)?e.readUInt16LE():null}readUInt16BE(){const e=this.read(2);return t.isBuffer(e)?e.readUInt16BE():null}readUInt32LE(){const e=this.read(4);return t.isBuffer(e)?e.readUInt32LE():null}readUInt32BE(){const e=this.read(4);return t.isBuffer(e)?e.readUInt32BE():null}readInt8(){const e=this.read(1);return t.isBuffer(e)?e.readInt8():null}readInt16LE(){const e=this.read(2);return t.isBuffer(e)?e.readInt16LE():null}readInt16BE(){const e=this.read(2);return t.isBuffer(e)?e.readInt16BE():null}readInt32LE(){const e=this.read(4);return t.isBuffer(e)?e.readInt32LE():null}readInt32BE(){const e=this.read(4);return t.isBuffer(e)?e.readInt32BE():null}readFloatLE(){const e=this.read(4);return t.isBuffer(e)?e.readFloatLE():null}readFloatBE(){const e=this.read(4);return t.isBuffer(e)?e.readFloatBE():null}readDoubleLE(){const e=this.read(8);return t.isBuffer(e)?e.readDoubleLE():null}readDoubleBE(){const e=this.read(8);return t.isBuffer(e)?e.readDoubleBE():null}readBigInt64LE(){const e=this.read(8);return t.isBuffer(e)?e.readBigInt64LE():null}readBigInt64BE(){const e=this.read(8);return t.isBuffer(e)?e.readBigInt64BE():null}readBigUInt64LE(){const e=this.read(8);return t.isBuffer(e)?e.readBigUInt64LE():null}readBigUInt64BE(){const e=this.read(8);return t.isBuffer(e)?e.readBigUInt64BE():null}}return N=n}var M,L,x,D,C,V,F,H,j,G,K,$,z,Y,W,J,q,X,Q,Z,ee,te,re,ne,ie={};function oe(){return M||(M=1,(e=ie).MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},e.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36,SET:258},e.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},e.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},e.SYMS={NULL:Symbol.for("github.com/hildjj/node-cbor/null"),UNDEFINED:Symbol.for("github.com/hildjj/node-cbor/undef"),PARENT:Symbol.for("github.com/hildjj/node-cbor/parent"),BREAK:Symbol.for("github.com/hildjj/node-cbor/break"),STREAM:Symbol.for("github.com/hildjj/node-cbor/stream")},e.SHIFT32=4294967296,e.BI={MINUS_ONE:BigInt(-1),NEG_MAX:BigInt(-1)-BigInt(Number.MAX_SAFE_INTEGER),MAXINT32:BigInt("0xffffffff"),MAXINT64:BigInt("0xffffffffffffffff"),SHIFT32:BigInt(e.SHIFT32)}),ie;var e}function se(){return L||(L=1,function(e){const{Buffer:t}=d,r=B(),n=p,i=oe(),{NUMBYTES:o,SHIFT32:s,BI:a,SYMS:c}=i,u=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});e.utf8=e=>u.decode(e),e.utf8.checksUTF8=!0,e.isBufferish=function(e){return e&&"object"==typeof e&&(t.isBuffer(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof ArrayBuffer||e instanceof DataView)},e.bufferishToBuffer=function(e){return t.isBuffer(e)?e:ArrayBuffer.isView(e)?t.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?t.from(e):null},e.parseCBORint=function(e,t){switch(e){case o.ONE:return t.readUInt8(0);case o.TWO:return t.readUInt16BE(0);case o.FOUR:return t.readUInt32BE(0);case o.EIGHT:{const e=t.readUInt32BE(0),r=t.readUInt32BE(4);return e>2097151?BigInt(e)*a.SHIFT32+BigInt(r):e*s+r}default:throw new Error(`Invalid additional info for int: ${e}`)}},e.writeHalf=function(e,r){const n=t.allocUnsafe(4);n.writeFloatBE(r,0);const i=n.readUInt32BE(0);if(8191&i)return!1;let o=i>>16&32768;const s=i>>23&255,a=8388607&i;if(s>=113&&s<=142)o+=(s-112<<10)+(a>>13);else{if(!(s>=103&&s<113))return!1;if(a&(1<<126-s)-1)return!1;o+=a+8388608>>126-s}return e.writeUInt16BE(o),!0},e.parseHalf=function(e){const t=128&e[0]?-1:1,r=(124&e[0])>>2,n=(3&e[0])<<8|e[1];return r?31===r?t*(n?NaN:1/0):t*2**(r-25)*(1024+n):5.960464477539063e-8*t*n},e.parseCBORfloat=function(t){switch(t.length){case 2:return e.parseHalf(t);case 4:return t.readFloatBE(0);case 8:return t.readDoubleBE(0);default:throw new Error(`Invalid float size: ${t.length}`)}},e.hex=function(e){return t.from(e.replace(/^0x/,""),"hex")},e.bin=function(e){let r=0,n=(e=e.replace(/\s/g,"")).length%8||8;const i=[];for(;n<=e.length;)i.push(parseInt(e.slice(r,n),2)),r=n,n+=8;return t.from(i)},e.arrayEqual=function(e,t){return null==e&&null==t||null!=e&&null!=t&&(e.length===t.length&&e.every((e,r)=>e===t[r]))},e.bufferToBigInt=function(e){return BigInt(`0x${e.toString("hex")}`)},e.cborValueToString=function(t,r=-1){switch(typeof t){case"symbol":{switch(t){case c.NULL:return"null";case c.UNDEFINED:return"undefined";case c.BREAK:return"BREAK"}if(t.description)return t.description;const e=t.toString().match(/^Symbol\((?<name>.*)\)/);return e&&e.groups.name?e.groups.name:"Symbol"}case"string":return JSON.stringify(t);case"bigint":return t.toString();case"number":{const e=Object.is(t,-0)?"-0":String(t);return r>0?`${e}_${r}`:e}case"object":{if(!t)return"null";const n=e.bufferishToBuffer(t);if(n){const e=n.toString("hex");return r===-1/0?e:`h'${e}'`}return t&&"function"==typeof t[Symbol.for("nodejs.util.inspect.custom")]?t[Symbol.for("nodejs.util.inspect.custom")]():Array.isArray(t)?"[]":"{}"}}return String(t)},e.guessEncoding=function(t,i){if("string"==typeof t)return new r(t,null==i?"hex":i);const o=e.bufferishToBuffer(t);if(o)return new r(o);if((s=t)instanceof n.Readable||["read","on","pipe"].every(e=>"function"==typeof s[e]))return t;var s;throw new Error("Unknown input type")};const h={"=":"","+":"-","/":"_"};e.base64url=function(t){return e.bufferishToBuffer(t).toString("base64").replace(/[=+/]/g,e=>h[e])},e.base64=function(t){return e.bufferishToBuffer(t).toString("base64")},e.isBigEndian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}}(k)),k}function ae(){if(V)return C;V=1;const e=oe(),t=se(),r=Symbol("INTERNAL_JSON");function n(e,r){if(t.isBufferish(e))e.toJSON=r;else if(Array.isArray(e))for(const t of e)n(t,r);else if(e&&"object"==typeof e&&(!(e instanceof f)||e.tag<21||e.tag>23))for(const t of Object.values(e))n(t,r)}function i(){return t.base64(this)}function o(){return t.base64url(this)}function s(){return this.toString("hex")}const a={0:e=>new Date(e),1:e=>new Date(1e3*e),2:e=>t.bufferToBigInt(e),3:r=>e.BI.MINUS_ONE-t.bufferToBigInt(r),21:(e,i)=>(t.isBufferish(e)?i[r]=o:n(e,o),i),22:(e,o)=>(t.isBufferish(e)?o[r]=i:n(e,i),o),23:(e,i)=>(t.isBufferish(e)?i[r]=s:n(e,s),i),32:e=>new URL(e),33:(e,t)=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Invalid base64url characters");const r=e.length%4;if(1===r)throw new Error("Invalid base64url length");if(2===r){if(-1==="AQgw".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding")}else if(3===r&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding");return t},34:(e,t)=>{const r=e.match(/^[a-zA-Z0-9+/]+(?<padding>={0,2})$/);if(!r)throw new Error("Invalid base64 characters");if(e.length%4!=0)throw new Error("Invalid base64 length");if("="===r.groups.padding){if(-1==="AQgw".indexOf(e[e.length-2]))throw new Error("Invalid base64 padding")}else if("=="===r.groups.padding&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-3]))throw new Error("Invalid base64 padding");return t},35:e=>new RegExp(e),258:e=>new Set(e)},c={64:Uint8Array,65:Uint16Array,66:Uint32Array,68:Uint8ClampedArray,69:Uint16Array,70:Uint32Array,72:Int8Array,73:Int16Array,74:Int32Array,77:Int16Array,78:Int32Array,81:Float32Array,82:Float64Array,85:Float32Array,86:Float64Array};function u(e,r){if(!t.isBufferish(e))throw new TypeError("val not a buffer");const{tag:n}=r,i=c[n];if(!i)throw new Error(`Invalid typed array tag: ${n}`);const o=2**(((16&n)>>4)+(3&n));!(4&n)!==t.isBigEndian()&&o>1&&function(e,t,r,n){const i=new DataView(e),[o,s]={2:[i.getUint16,i.setUint16],4:[i.getUint32,i.setUint32],8:[i.getBigUint64,i.setBigUint64]}[t],a=r+n;for(let e=r;e<a;e+=t)s.call(i,e,o.call(i,e,!0))}(e.buffer,o,e.byteOffset,e.byteLength);return new i(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}"undefined"!=typeof BigUint64Array&&(c[67]=BigUint64Array,c[71]=BigUint64Array),"undefined"!=typeof BigInt64Array&&(c[75]=BigInt64Array,c[79]=BigInt64Array);for(const e of Object.keys(c))a[e]=u;let h={};class f{constructor(e,t,r){if(this.tag=e,this.value=t,this.err=r,"number"!=typeof this.tag)throw new Error(`Invalid tag type (${typeof this.tag})`);if(this.tag<0||(0|this.tag)!==this.tag)throw new Error(`Tag must be a positive integer: ${this.tag}`)}toJSON(){if(this[r])return this[r].call(this.value);const e={tag:this.tag,value:this.value};return this.err&&(e.err=this.err),e}toString(){return`${this.tag}(${JSON.stringify(this.value)})`}encodeCBOR(e){return e._pushTag(this.tag),e.pushAny(this.value)}convert(e){let t=null==e?void 0:e[this.tag];if(null===t)return this;if("function"!=typeof t&&(t=f.TAGS[this.tag],"function"!=typeof t))return this;try{return t.call(this,this.value,this)}catch(e){return e&&e.message&&e.message.length>0?this.err=e.message:this.err=e,this}}static get TAGS(){return h}static set TAGS(e){h=e}static reset(){f.TAGS={...a}}}return f.INTERNAL_JSON=r,f.reset(),C=f}function ce(){if(H)return F;H=1;const{MT:e,SIMPLE:t,SYMS:r}=oe();class n{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error(`value must be a small positive integer: ${e}`);this.value=e}toString(){return`simple(${this.value})`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return`simple(${this.value})`}encodeCBOR(t){return t._pushInt(this.value,e.SIMPLE_FLOAT)}static isSimple(e){return e instanceof n}static decode(e,i=!0,o=!1){switch(e){case t.FALSE:return!1;case t.TRUE:return!0;case t.NULL:return i?null:r.NULL;case t.UNDEFINED:if(i)return;return r.UNDEFINED;case-1:if(!i||!o)throw new Error("Invalid BREAK");return r.BREAK;default:return new n(e)}}}return F=n}function ue(){if(G)return j;G=1;const e=function(){if(D)return x;D=1;const e=p,t=B();class r extends e.Transform{constructor(e){super(e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new t,this.__restart()}_transform(e,t,r){for(this.bs.write(e);this.bs.length>=this.__needed;){let e=null;const t=null===this.__needed?void 0:this.bs.read(this.__needed);try{e=this.__parser.next(t)}catch(e){return r(e)}this.__needed&&(this.__fresh=!1),e.done?(this.push(e.value),this.__restart()):this.__needed=e.value||1/0}return r()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(e){e(this.__fresh?null:new Error("unexpected end of input"))}}return x=r}(),t=ae(),r=ce(),n=se(),i=B(),o=oe(),{MT:s,NUMBYTES:a,SYMS:c,BI:u}=o,{Buffer:h}=d,f=Symbol("count"),l=Symbol("major type"),y=Symbol("error"),g=Symbol("not found");function E(e,t,r){const n=[];return n[f]=r,n[c.PARENT]=e,n[l]=t,n}function m(e,t){const r=new i;return r[f]=-1,r[c.PARENT]=e,r[l]=t,r}class _ extends Error{constructor(e,t){super(`Unexpected data: 0x${e.toString(16)}`),this.name="UnexpectedDataError",this.byte=e,this.value=t}}function w(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}class b extends e{constructor(e={}){const{tags:t={},max_depth:r=-1,preferMap:n=!1,preferWeb:o=!1,required:s=!1,encoding:a="hex",extendedResults:c=!1,preventDuplicateKeys:u=!1,...h}=e;super({defaultEncoding:a,...h}),this.running=!0,this.max_depth=r,this.tags=t,this.preferMap=n,this.preferWeb=o,this.extendedResults=c,this.required=s,this.preventDuplicateKeys=u,c&&(this.bs.on("read",this._onRead.bind(this)),this.valueBytes=new i)}static nullcheck(e){switch(e){case c.NULL:return null;case c.UNDEFINED:return;case g:throw new Error("Value not found");default:return e}}static decodeFirstSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...i}=t,o=new b(i),s=n.guessEncoding(e,r),a=o._parse();let c=a.next();for(;!c.done;){const e=s.read(c.value);if(null==e||e.length!==c.value)throw new Error("Insufficient data");o.extendedResults&&o.valueBytes.write(e),c=a.next(e)}let u=null;if(o.extendedResults)u=c.value,u.unused=s.read();else if(u=b.nullcheck(c.value),s.length>0){const e=s.read(1);throw s.unshift(e),new _(e[0],u)}return u}static decodeAllSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...i}=t,o=new b(i),s=n.guessEncoding(e,r),a=[];for(;s.length>0;){const e=o._parse();let t=e.next();for(;!t.done;){const r=s.read(t.value);if(null==r||r.length!==t.value)throw new Error("Insufficient data");o.extendedResults&&o.valueBytes.write(r),t=e.next(r)}a.push(b.nullcheck(t.value))}return a}static decodeFirst(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:i="hex",required:o=!1,...s}=t,a=new b(s);let c=g;const u=n.guessEncoding(e,i),h=new Promise((e,t)=>{a.on("data",e=>{c=b.nullcheck(e),a.close()}),a.once("error",r=>a.extendedResults&&r instanceof _?(c.unused=a.bs.slice(),e(c)):(c!==g&&(r.value=c),c=y,a.close(),t(r))),a.once("end",()=>{switch(c){case g:return o?t(new Error("No CBOR found")):e(c);case y:return;default:return e(c)}})});return"function"==typeof r&&h.then(e=>r(null,e),r),u.pipe(a),h}static decodeAll(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:i="hex",...o}=t,s=new b(o),a=[];s.on("data",e=>a.push(b.nullcheck(e)));const c=new Promise((e,t)=>{s.on("error",t),s.on("end",()=>e(a))});return"function"==typeof r&&c.then(e=>r(void 0,e),e=>r(e,void 0)),n.guessEncoding(e,i).pipe(s),c}close(){this.running=!1,this.__fresh=!0}_onRead(e){this.valueBytes.write(e)}*_parse(){let e=null,o=0,d=null;for(;;){if(this.max_depth>=0&&o>this.max_depth)throw new Error(`Maximum depth ${this.max_depth} exceeded`);const[p]=yield 1;if(!this.running)throw this.bs.unshift(h.from([p])),new _(p);const y=p>>5,g=31&p,w=null==e?void 0:e[l],P=null==e?void 0:e.length;switch(g){case a.ONE:this.emit("more-bytes",y,1,w,P),[d]=yield 1;break;case a.TWO:case a.FOUR:case a.EIGHT:{const e=1<<g-24;this.emit("more-bytes",y,e,w,P);const t=yield e;d=y===s.SIMPLE_FLOAT?t:n.parseCBORint(g,t);break}case 28:case 29:case 30:throw this.running=!1,new Error(`Additional info not implemented: ${g}`);case a.INDEFINITE:switch(y){case s.POS_INT:case s.NEG_INT:case s.TAG:throw new Error(`Invalid indefinite encoding for MT ${y}`)}d=-1;break;default:d=g}switch(y){case s.POS_INT:break;case s.NEG_INT:d=d===Number.MAX_SAFE_INTEGER?u.NEG_MAX:"bigint"==typeof d?u.MINUS_ONE-d:-1-d;break;case s.BYTE_STRING:case s.UTF8_STRING:switch(d){case 0:this.emit("start-string",y,d,w,P),d=y===s.UTF8_STRING?"":this.preferWeb?new Uint8Array(0):h.allocUnsafe(0);break;case-1:this.emit("start",y,c.STREAM,w,P),e=m(e,y),o++;continue;default:this.emit("start-string",y,d,w,P),d=yield d,y===s.UTF8_STRING?d=n.utf8(d):this.preferWeb&&(d=new Uint8Array(d.buffer,d.byteOffset,d.length))}break;case s.ARRAY:case s.MAP:switch(d){case 0:d=y===s.MAP?this.preferMap?new Map:{}:[];break;case-1:this.emit("start",y,c.STREAM,w,P),e=E(e,y,-1),o++;continue;default:this.emit("start",y,d,w,P),e=E(e,y,d*(y-3)),o++;continue}break;case s.TAG:this.emit("start",y,d,w,P),e=E(e,y,1),e.push(d),o++;continue;case s.SIMPLE_FLOAT:if("number"==typeof d){if(g===a.ONE&&d<32)throw new Error(`Invalid two-byte encoding of simple value ${d}`);const t=null!=e;d=r.decode(d,t,t&&e[f]<0)}else d=n.parseCBORfloat(d)}this.emit("value",d,w,P,g);let I=!1;for(;null!=e;){if(d===c.BREAK)e[f]=1;else if(Array.isArray(e))e.push(d);else{const t=e[l];if(null!=t&&t!==y)throw this.running=!1,new Error("Invalid major type in indefinite encoding");e.write(d)}if(0!==--e[f]){I=!0;break}if(--o,delete e[f],Array.isArray(e))switch(e[l]){case s.ARRAY:d=e;break;case s.MAP:{let t=!this.preferMap;if(e.length%2!=0)throw new Error(`Invalid map length: ${e.length}`);for(let r=0,n=e.length;t&&r<n;r+=2)if("string"!=typeof e[r]||"__proto__"===e[r]){t=!1;break}if(t){d={};for(let t=0,r=e.length;t<r;t+=2){if(this.preventDuplicateKeys&&Object.prototype.hasOwnProperty.call(d,e[t]))throw new Error("Duplicate keys in a map");d[e[t]]=e[t+1]}}else{d=new Map;for(let t=0,r=e.length;t<r;t+=2){if(this.preventDuplicateKeys&&d.has(e[t]))throw new Error("Duplicate keys in a map");d.set(e[t],e[t+1])}}break}case s.TAG:d=new t(e[0],e[1]).convert(this.tags);break}else if(e instanceof i)switch(e[l]){case s.BYTE_STRING:d=e.slice(),this.preferWeb&&(d=new Uint8Array(d.buffer,d.byteOffset,d.length));break;case s.UTF8_STRING:d=e.toString("utf-8")}this.emit("stop",e[l]);const r=e;e=e[c.PARENT],delete r[c.PARENT],delete r[l]}if(!I){if(this.extendedResults){const e=this.valueBytes.slice(),t={value:b.nullcheck(d),bytes:e,length:e.length};return this.valueBytes=new i,t}return d}}}}return b.NOT_FOUND=g,j=b}function he(){if($)return K;$=1;const e=p,t=se(),r=ue(),n=B(),{MT:i,NUMBYTES:o,SYMS:s}=oe(),{Buffer:a}=d;function c(e){return e>1?"s":""}class u extends e.Transform{constructor(e={}){const{depth:t=1,max_depth:i=10,no_summary:o=!1,tags:s={},preferWeb:a,encoding:c,...u}=e;super({...u,readableObjectMode:!1,writableObjectMode:!1}),this.depth=t,this.max_depth=i,this.all=new n,s[24]||(s[24]=this._tag_24.bind(this)),this.parser=new r({tags:s,max_depth:i,preferWeb:a,encoding:c}),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),o||this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_tag_24(e){const t=new u({depth:this.depth+1,no_summary:!0});t.on("data",e=>this.push(e)),t.on("error",e=>this.emit("error",e)),t.end(e)}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){return this.parser._flush(e)}static comment(e,r={},i=null){if(null==e)throw new Error("input required");({options:r,cb:i}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"number":return{options:{max_depth:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(r,i));const o=new n,{encoding:s="hex",...a}=r,c=new u(a);let h=null;return"function"==typeof i?(c.on("end",()=>{i(null,o.toString("utf8"))}),c.on("error",i)):h=new Promise((e,t)=>{c.on("end",()=>{e(o.toString("utf8"))}),c.on("error",t)}),c.pipe(o),t.guessEncoding(e,s).pipe(c),h}_on_error(e){this.push("ERROR: "),this.push(e.toString()),this.push("\n")}_on_read(e){this.all.write(e);const t=e.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(t);let r=2*(this.max_depth-this.depth)-t.length;r<1&&(r=1),this.push(new Array(r+1).join(" ")),this.push("-- ")}_on_more(e,t,r,n){let o="";switch(this.depth++,e){case i.POS_INT:o="Positive number,";break;case i.NEG_INT:o="Negative number,";break;case i.ARRAY:o="Array, length";break;case i.MAP:o="Map, count";break;case i.BYTE_STRING:o="Bytes, length";break;case i.UTF8_STRING:o="String, length";break;case i.SIMPLE_FLOAT:o=1===t?"Simple value,":"Float,"}this.push(`${o} next ${t} byte${c(t)}\n`)}_on_start_string(e,t,r,n){let o="";switch(this.depth++,e){case i.BYTE_STRING:o=`Bytes, length: ${t}`;break;case i.UTF8_STRING:o=`String, length: ${t.toString()}`}this.push(`${o}\n`)}_on_start(e,t,r,n){switch(this.depth++,r){case i.ARRAY:this.push(`[${n}], `);break;case i.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}switch(e){case i.TAG:this.push(`Tag #${t}`),24===t&&this.push(" Encoded CBOR data item");break;case i.ARRAY:t===s.STREAM?this.push("Array (streaming)"):this.push(`Array, ${t} item${c(t)}`);break;case i.MAP:t===s.STREAM?this.push("Map (streaming)"):this.push(`Map, ${t} pair${c(t)}`);break;case i.BYTE_STRING:this.push("Bytes (streaming)");break;case i.UTF8_STRING:this.push("String (streaming)")}this.push("\n")}_on_stop(e){this.depth--}_on_value(e,r,n,c){if(e!==s.BREAK)switch(r){case i.ARRAY:this.push(`[${n}], `);break;case i.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}const u=t.cborValueToString(e,-1/0);switch("string"==typeof e||a.isBuffer(e)?(e.length>0&&(this.push(u),this.push("\n")),this.depth--):(this.push(u),this.push("\n")),c){case o.ONE:case o.TWO:case o.FOUR:case o.EIGHT:this.depth--}}_on_data(){this.push("0x"),this.push(this.all.read().toString("hex")),this.push("\n")}}return K=u}function fe(){if(Y)return z;Y=1;const e=p,t=ue(),r=se(),n=B(),{MT:i,SYMS:o}=oe();class s extends e.Transform{constructor(e={}){const{separator:r="\n",stream_errors:n=!1,tags:i,max_depth:o,preferWeb:s,encoding:a,...c}=e;super({...c,readableObjectMode:!1,writableObjectMode:!1}),this.float_bytes=-1,this.separator=r,this.stream_errors=n,this.parser=new t({tags:i,max_depth:o,preferWeb:s,encoding:a}),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.on("error",this._on_error.bind(this))}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){this.parser._flush(t=>this.stream_errors?(t&&this._on_error(t),e()):e(t))}static diagnose(e,t={},i=null){if(null==e)throw new TypeError("input required");({options:t,cb:i}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,i));const{encoding:o="hex",...a}=t,c=new n,u=new s(a);let h=null;return"function"==typeof i?(u.on("end",()=>i(null,c.toString("utf8"))),u.on("error",i)):h=new Promise((e,t)=>{u.on("end",()=>e(c.toString("utf8"))),u.on("error",t)}),u.pipe(c),r.guessEncoding(e,o).pipe(u),h}_on_error(e){this.stream_errors?this.push(e.toString()):this.emit("error",e)}_on_more(e,t,r,n){e===i.SIMPLE_FLOAT&&(this.float_bytes={2:1,4:2,8:3}[t])}_fore(e,t){switch(e){case i.BYTE_STRING:case i.UTF8_STRING:case i.ARRAY:t>0&&this.push(", ");break;case i.MAP:t>0&&(t%2?this.push(": "):this.push(", "))}}_on_value(e,t,n){if(e===o.BREAK)return;this._fore(t,n);const i=this.float_bytes;this.float_bytes=-1,this.push(r.cborValueToString(e,i))}_on_start(e,t,r,n){switch(this._fore(r,n),e){case i.TAG:this.push(`${t}(`);break;case i.ARRAY:this.push("[");break;case i.MAP:this.push("{");break;case i.BYTE_STRING:case i.UTF8_STRING:this.push("(")}t===o.STREAM&&this.push("_ ")}_on_stop(e){switch(e){case i.TAG:this.push(")");break;case i.ARRAY:this.push("]");break;case i.MAP:this.push("}");break;case i.BYTE_STRING:case i.UTF8_STRING:this.push(")")}}_on_data(){this.push(this.separator)}}return z=s}function le(){if(J)return W;J=1;const e=p,t=B(),r=se(),n=oe(),{MT:i,NUMBYTES:o,SHIFT32:s,SIMPLE:a,SYMS:c,TAG:u,BI:h}=n,{Buffer:f}=d,l=i.SIMPLE_FLOAT<<5|o.TWO,y=i.SIMPLE_FLOAT<<5|o.FOUR,g=i.SIMPLE_FLOAT<<5|o.EIGHT,E=i.SIMPLE_FLOAT<<5|a.TRUE,m=i.SIMPLE_FLOAT<<5|a.FALSE,_=i.SIMPLE_FLOAT<<5|a.UNDEFINED,w=i.SIMPLE_FLOAT<<5|a.NULL,b=f.from([255]),P=f.from("f97e00","hex"),I=f.from("f9fc00","hex"),A=f.from("f97c00","hex"),T=f.from("f98000","hex"),O={};let v={};class S extends e.Transform{constructor(e={}){const{canonical:t=!1,encodeUndefined:r,disallowUndefinedKeys:n=!1,dateType:i="number",collapseBigIntegers:o=!1,detectLoops:s=!1,omitUndefinedProperties:a=!1,genTypes:c=[],...u}=e;if(super({...u,readableObjectMode:!1,writableObjectMode:!0}),this.canonical=t,this.encodeUndefined=r,this.disallowUndefinedKeys=n,this.dateType=function(e){if(!e)return"number";switch(e.toLowerCase()){case"number":return"number";case"float":return"float";case"int":case"integer":return"int";case"string":return"string"}throw new TypeError(`dateType invalid, got "${e}"`)}(i),this.collapseBigIntegers=!!this.canonical||o,this.detectLoops=void 0,"boolean"==typeof s)s&&(this.detectLoops=new WeakSet);else{if(!(s instanceof WeakSet))throw new TypeError("detectLoops must be boolean or WeakSet");this.detectLoops=s}if(this.omitUndefinedProperties=a,this.semanticTypes={...S.SEMANTIC_TYPES},Array.isArray(c))for(let e=0,t=c.length;e<t;e+=2)this.addSemanticType(c[e],c[e+1]);else for(const[e,t]of Object.entries(c))this.addSemanticType(e,t)}_transform(e,t,r){r(!1===this.pushAny(e)?new Error("Push Error"):void 0)}_flush(e){e()}_pushUInt8(e){const t=f.allocUnsafe(1);return t.writeUInt8(e,0),this.push(t)}_pushUInt16BE(e){const t=f.allocUnsafe(2);return t.writeUInt16BE(e,0),this.push(t)}_pushUInt32BE(e){const t=f.allocUnsafe(4);return t.writeUInt32BE(e,0),this.push(t)}_pushFloatBE(e){const t=f.allocUnsafe(4);return t.writeFloatBE(e,0),this.push(t)}_pushDoubleBE(e){const t=f.allocUnsafe(8);return t.writeDoubleBE(e,0),this.push(t)}_pushNaN(){return this.push(P)}_pushInfinity(e){const t=e<0?I:A;return this.push(t)}_pushFloat(e){if(this.canonical){const t=f.allocUnsafe(2);if(r.writeHalf(t,e))return this._pushUInt8(l)&&this.push(t)}return Math.fround(e)===e?this._pushUInt8(y)&&this._pushFloatBE(e):this._pushUInt8(g)&&this._pushDoubleBE(e)}_pushInt(e,t,r){const n=t<<5;if(e<24)return this._pushUInt8(n|e);if(e<=255)return this._pushUInt8(n|o.ONE)&&this._pushUInt8(e);if(e<=65535)return this._pushUInt8(n|o.TWO)&&this._pushUInt16BE(e);if(e<=4294967295)return this._pushUInt8(n|o.FOUR)&&this._pushUInt32BE(e);let a=Number.MAX_SAFE_INTEGER;return t===i.NEG_INT&&a--,e<=a?this._pushUInt8(n|o.EIGHT)&&this._pushUInt32BE(Math.floor(e/s))&&this._pushUInt32BE(e%s):t===i.NEG_INT?this._pushFloat(r):this._pushFloat(e)}_pushIntNum(e){return Object.is(e,-0)?this.push(T):e<0?this._pushInt(-e-1,i.NEG_INT,e):this._pushInt(e,i.POS_INT)}_pushNumber(e){return isNaN(e)?this._pushNaN():isFinite(e)?Math.round(e)===e?this._pushIntNum(e):this._pushFloat(e):this._pushInfinity(e)}_pushString(e){const t=f.byteLength(e,"utf8");return this._pushInt(t,i.UTF8_STRING)&&this.push(e,"utf8")}_pushBoolean(e){return this._pushUInt8(e?E:m)}_pushUndefined(e){switch(typeof this.encodeUndefined){case"undefined":return this._pushUInt8(_);case"function":return this.pushAny(this.encodeUndefined(e));case"object":{const e=r.bufferishToBuffer(this.encodeUndefined);if(e)return this.push(e)}}return this.pushAny(this.encodeUndefined)}_pushNull(e){return this._pushUInt8(w)}_pushTag(e){return this._pushInt(e,i.TAG)}_pushJSBigint(e){let t=i.POS_INT,r=u.POS_BIGINT;if(e<0&&(e=-e+h.MINUS_ONE,t=i.NEG_INT,r=u.NEG_BIGINT),this.collapseBigIntegers&&e<=h.MAXINT64)return e<=4294967295?this._pushInt(Number(e),t):this._pushUInt8(t<<5|o.EIGHT)&&this._pushUInt32BE(Number(e/h.SHIFT32))&&this._pushUInt32BE(Number(e%h.SHIFT32));let n=e.toString(16);n.length%2&&(n=`0${n}`);const s=f.from(n,"hex");return this._pushTag(r)&&S._pushBuffer(this,s)}_pushObject(e,t){if(!e)return this._pushNull(e);if(!(t={indefinite:!1,skipTypes:!1,...t}).indefinite&&this.detectLoops){if(this.detectLoops.has(e))throw new Error("Loop detected while CBOR encoding.\nCall removeLoopDetectors before resuming.");this.detectLoops.add(e)}if(!t.skipTypes){const t=e.encodeCBOR;if("function"==typeof t)return t.call(e,this);const r=this.semanticTypes[e.constructor.name];if(r)return r.call(e,this,e)}const r=Object.keys(e).filter(t=>{const r=typeof e[t];return"function"!==r&&(!this.omitUndefinedProperties||"undefined"!==r)}),n={};if(this.canonical&&r.sort((e,t)=>{const r=n[e]||(n[e]=S.encode(e)),i=n[t]||(n[t]=S.encode(t));return r.compare(i)}),t.indefinite){if(!this._pushUInt8(i.MAP<<5|o.INDEFINITE))return!1}else if(!this._pushInt(r.length,i.MAP))return!1;let s=null;for(let t=0,i=r.length;t<i;t++){const i=r[t];if(this.canonical&&(s=n[i])){if(!this.push(s))return!1}else if(!this._pushString(i))return!1;if(!this.pushAny(e[i]))return!1}if(t.indefinite){if(!this.push(b))return!1}else this.detectLoops&&this.detectLoops.delete(e);return!0}_encodeAll(e){const r=new t({highWaterMark:this.readableHighWaterMark});this.pipe(r);for(const t of e)this.pushAny(t);return this.end(),r.read()}addSemanticType(e,t){const r="string"==typeof e?e:e.name,n=this.semanticTypes[r];if(t){if("function"!=typeof t)throw new TypeError("fun must be of type function");this.semanticTypes[r]=t}else n&&delete this.semanticTypes[r];return n}pushAny(e){switch(typeof e){case"number":return this._pushNumber(e);case"bigint":return this._pushJSBigint(e);case"string":return this._pushString(e);case"boolean":return this._pushBoolean(e);case"undefined":return this._pushUndefined(e);case"object":return this._pushObject(e);case"symbol":switch(e){case c.NULL:return this._pushNull(null);case c.UNDEFINED:return this._pushUndefined(void 0);default:throw new TypeError(`Unknown symbol: ${e.toString()}`)}default:throw new TypeError(`Unknown type: ${typeof e}, ${"function"==typeof e.toString?e.toString():""}`)}}static pushArray(e,t,r){r={indefinite:!1,...r};const n=t.length;if(r.indefinite){if(!e._pushUInt8(i.ARRAY<<5|o.INDEFINITE))return!1}else if(!e._pushInt(n,i.ARRAY))return!1;for(let r=0;r<n;r++)if(!e.pushAny(t[r]))return!1;return!(r.indefinite&&!e.push(b))}removeLoopDetectors(){return!!this.detectLoops&&(this.detectLoops=new WeakSet,!0)}static _pushDate(e,t){switch(e.dateType){case"string":return e._pushTag(u.DATE_STRING)&&e._pushString(t.toISOString());case"int":return e._pushTag(u.DATE_EPOCH)&&e._pushIntNum(Math.round(t.getTime()/1e3));case"float":return e._pushTag(u.DATE_EPOCH)&&e._pushFloat(t.getTime()/1e3);default:return e._pushTag(u.DATE_EPOCH)&&e.pushAny(t.getTime()/1e3)}}static _pushBuffer(e,t){return e._pushInt(t.length,i.BYTE_STRING)&&e.push(t)}static _pushNoFilter(e,t){return S._pushBuffer(e,t.slice())}static _pushRegexp(e,t){return e._pushTag(u.REGEXP)&&e.pushAny(t.source)}static _pushSet(e,t){if(!e._pushTag(u.SET))return!1;if(!e._pushInt(t.size,i.ARRAY))return!1;for(const r of t)if(!e.pushAny(r))return!1;return!0}static _pushURL(e,t){return e._pushTag(u.URI)&&e.pushAny(t.toString())}static _pushBoxed(e,t){return e.pushAny(t.valueOf())}static _pushMap(e,r,n){n={indefinite:!1,...n};let s=[...r.entries()];if(e.omitUndefinedProperties&&(s=s.filter(([e,t])=>void 0!==t)),n.indefinite){if(!e._pushUInt8(i.MAP<<5|o.INDEFINITE))return!1}else if(!e._pushInt(s.length,i.MAP))return!1;if(e.canonical){const r=new S({genTypes:e.semanticTypes,canonical:e.canonical,detectLoops:Boolean(e.detectLoops),dateType:e.dateType,disallowUndefinedKeys:e.disallowUndefinedKeys,collapseBigIntegers:e.collapseBigIntegers}),n=new t({highWaterMark:e.readableHighWaterMark});r.pipe(n),s.sort(([e],[t])=>{r.pushAny(e);const i=n.read();r.pushAny(t);const o=n.read();return i.compare(o)});for(const[t,r]of s){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}}else for(const[t,r]of s){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}return!(n.indefinite&&!e.push(b))}static _pushTypedArray(e,t){let n=64,i=t.BYTES_PER_ELEMENT;const{name:o}=t.constructor;return o.startsWith("Float")?(n|=16,i/=2):o.includes("U")||(n|=8),(o.includes("Clamped")||1!==i&&!r.isBigEndian())&&(n|=4),n|={1:0,2:1,4:2,8:3}[i],!!e._pushTag(n)&&S._pushBuffer(e,f.from(t.buffer,t.byteOffset,t.byteLength))}static _pushArrayBuffer(e,t){return S._pushBuffer(e,f.from(t))}static encodeIndefinite(e,t,n={}){if(null==t){if(null==this)throw new Error("No object to encode");t=this}const{chunkSize:s=4096}=n;let a=!0;const c=typeof t;let u=null;if("string"===c){a=a&&e._pushUInt8(i.UTF8_STRING<<5|o.INDEFINITE);let r=0;for(;r<t.length;){const n=r+s;a=a&&e._pushString(t.slice(r,n)),r=n}a=a&&e.push(b)}else if(u=r.bufferishToBuffer(t)){a=a&&e._pushUInt8(i.BYTE_STRING<<5|o.INDEFINITE);let t=0;for(;t<u.length;){const r=t+s;a=a&&S._pushBuffer(e,u.slice(t,r)),t=r}a=a&&e.push(b)}else if(Array.isArray(t))a=a&&S.pushArray(e,t,{indefinite:!0});else if(t instanceof Map)a=a&&S._pushMap(e,t,{indefinite:!0});else{if("object"!==c)throw new Error("Invalid indefinite encoding");a=a&&e._pushObject(t,{indefinite:!0,skipTypes:!0})}return a}static encode(...e){return(new S)._encodeAll(e)}static encodeCanonical(...e){return new S({canonical:!0})._encodeAll(e)}static encodeOne(e,t){return new S(t)._encodeAll([e])}static encodeAsync(e,t){return new Promise((r,n)=>{const i=[],o=new S(t);o.on("data",e=>i.push(e)),o.on("error",n),o.on("finish",()=>r(f.concat(i))),o.pushAny(e),o.end()})}static get SEMANTIC_TYPES(){return v}static set SEMANTIC_TYPES(e){v=e}static reset(){S.SEMANTIC_TYPES={...O}}}return Object.assign(O,{Array:S.pushArray,Date:S._pushDate,Buffer:S._pushBuffer,[f.name]:S._pushBuffer,Map:S._pushMap,NoFilter:S._pushNoFilter,[t.name]:S._pushNoFilter,RegExp:S._pushRegexp,Set:S._pushSet,ArrayBuffer:S._pushArrayBuffer,Uint8ClampedArray:S._pushTypedArray,Uint8Array:S._pushTypedArray,Uint16Array:S._pushTypedArray,Uint32Array:S._pushTypedArray,Int8Array:S._pushTypedArray,Int16Array:S._pushTypedArray,Int32Array:S._pushTypedArray,Float32Array:S._pushTypedArray,Float64Array:S._pushTypedArray,URL:S._pushURL,Boolean:S._pushBoxed,Number:S._pushBoxed,String:S._pushBoxed}),"undefined"!=typeof BigUint64Array&&(O[BigUint64Array.name]=S._pushTypedArray),"undefined"!=typeof BigInt64Array&&(O[BigInt64Array.name]=S._pushTypedArray),S.reset(),W=S}function de(){if(X)return q;X=1;const{Buffer:e}=d,t=le(),r=ue(),{MT:n}=oe();class i extends Map{constructor(e){super(e)}static _encode(e){return t.encodeCanonical(e).toString("base64")}static _decode(e){return r.decodeFirstSync(e,"base64")}get(e){return super.get(i._encode(e))}set(e,t){return super.set(i._encode(e),t)}delete(e){return super.delete(i._encode(e))}has(e){return super.has(i._encode(e))}*keys(){for(const e of super.keys())yield i._decode(e)}*entries(){for(const e of super.entries())yield[i._decode(e[0]),e[1]]}[Symbol.iterator](){return this.entries()}forEach(e,t=this){if("function"!=typeof e)throw new TypeError("Must be function");for(const r of super.entries())e.call(t,r[1],i._decode(r[0]),this)}encodeCBOR(t){if(!t._pushInt(this.size,n.MAP))return!1;if(t.canonical){const r=Array.from(super.entries()).map(t=>[e.from(t[0],"base64"),t[1]]);r.sort((e,t)=>e[0].compare(t[0]));for(const e of r)if(!t.push(e[0])||!t.pushAny(e[1]))return!1}else for(const r of super.entries())if(!t.push(e.from(r[0],"base64"))||!t.pushAny(r[1]))return!1;return!0}}return q=i}function pe(){if(te)return ee;te=1;const e=le(),t=function(){if(Z)return Q;Z=1;class e{constructor(){this.clear()}clear(){this.map=new WeakMap,this.count=0,this.recording=!0}stop(){this.recording=!1}check(t){const r=this.map.get(t);if(r)return r.length>1?r[0]||this.recording?r[1]:(r[0]=!0,e.FIRST):this.recording?(r.push(this.count++),r[1]):e.NEVER;if(!this.recording)throw new Error("New object detected when not recording");return this.map.set(t,[!1]),e.NEVER}}return e.NEVER=-1,e.FIRST=-2,Q=e}(),{Buffer:r}=d;class n extends e{constructor(e){super(e),this.valueSharing=new t}_pushObject(e,r){if(null!==e){const r=this.valueSharing.check(e);switch(r){case t.FIRST:this._pushTag(28);break;case t.NEVER:break;default:return this._pushTag(29)&&this._pushIntNum(r)}}return super._pushObject(e,r)}stopRecording(){this.valueSharing.stop()}clearRecording(){this.valueSharing.clear()}static encode(...e){const t=new n;t.on("data",()=>{});for(const r of e)t.pushAny(r);return t.stopRecording(),t.removeAllListeners("data"),t._encodeAll(e)}static encodeCanonical(...e){throw new Error("Cannot encode canonically in a SharedValueEncoder, which serializes objects multiple times.")}static encodeOne(e,t){const r=new n(t);return r.on("data",()=>{}),r.pushAny(e),r.stopRecording(),r.removeAllListeners("data"),r._encodeAll([e])}static encodeAsync(e,t){return new Promise((i,o)=>{const s=[],a=new n(t);a.on("data",()=>{}),a.on("error",o),a.on("finish",()=>i(r.concat(s))),a.pushAny(e),a.stopRecording(),a.removeAllListeners("data"),a.on("data",e=>s.push(e)),a.pushAny(e),a.end()})}}return ee=n}var ye=function(){if(ne)return re;ne=1;const e=he(),t=fe(),r=ue(),n=le(),i=ce(),o=ae(),s=de(),a=pe();return re={Commented:e,Diagnose:t,Decoder:r,Encoder:n,Simple:i,Tagged:o,Map:s,SharedValueEncoder:a,comment:e.comment,decodeAll:r.decodeAll,decodeFirst:r.decodeFirst,decodeAllSync:r.decodeAllSync,decodeFirstSync:r.decodeFirstSync,diagnose:t.diagnose,encode:n.encode,encodeCanonical:n.encodeCanonical,encodeOne:n.encodeOne,encodeAsync:n.encodeAsync,decode:r.decodeFirstSync,leveldb:{decode:r.decodeFirstSync,encode:n.encode,buffer:!0,name:"cbor"},reset(){n.reset(),o.reset()}}}(),ge=h(ye);function Ee(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e]))}class me{constructor(e){if(!function(e){if("string"!=typeof e)return!1;if(e.length<=1)return!1;if("z"!==e[0])return!1;const t=e.slice(1);return/^[1-9A-HJ-NP-Za-km-z]+$/.test(t)}(e))throw new Error("Base58 string is invalid. Cannot construct Decoder.");this.base58=e}constructRootJSON(e){const t=Ee(R.root);return e.reduce((e,r)=>{const n=t[r[0]];let i=r[1];return i instanceof Array&&("anchors"===n&&(i=this.constructAnchorsJSON(i)),"path"===n&&(i=this.constructPathJSON(i))),(i instanceof a||i instanceof Uint8Array)&&(i=ge.decode(i).toString("hex")),e[n]=i,e},{})}constructAnchorsJSON(e){const t=(r=R.chain,n=e=>e.id,Object.entries(r).reduce((e,[t,r])=>{const i=n(r);return(e[i]||=[]).push(t),e},{}));var r,n;return e.map(e=>e.reduce((e,r)=>{if(0===r[0])return`${e}:${t[r[1]]}`;if(1===r[0]){const t=e.split(":").pop();return`${e}:${Ee(R.chain[t].networks)[r[1]]}`}return`${e}:${ge.decode(r[1]).toString("hex")}`},"blink"))}constructPathJSON(e){const t=Ee(R.path);return e.map(e=>({[t[e[0]]]:ge.decode(e[1]).toString("hex")}))}decode(){const e=c(this.base58.slice(1)),t=ge.decode(a.from(e));return this.constructRootJSON(t)}}function _e(e){return Object.keys(s).map(e=>s[e]).find(t=>t.signatureValue===e)}function we(e=null){if(e?.anchors){const{anchors:t}=e,r=t[0];if("string"==typeof r)return function(e){const t=e.split(":");let r;switch(t[1]){case s.mocknet.blinkCode:return _e(s.mocknet.signatureValue);case s.bitcoin.blinkCode:r=s.bitcoin.name;break;case s.ethmain.blinkCode:r=s.ethmain.name;break;default:throw new Error("Could not retrieve chain.")}const n=t[2],i=r.toLowerCase()+function(e){const t=e.substr(0,1),r=e.substr(1,e.length-1);return t.toUpperCase()+r.toLowerCase()}(n);return _e(i)}(r)}return null}function be(e,t){const r=e.findIndex(e=>e===t);r>-1&&e.splice(r,1)}class Pe extends Error{stepCode;constructor(e,t){super(t),this.stepCode=e}}var Ie="en-US",Ae={"en-US":{errors:{assertProofValidityPurposeVerifier:"Invalid proof purpose. Expected ${expectedProofPurpose} but received ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"The verification method ${proof.verificationMethod} is not allowed for the proof purpose ${expectedProofPurpose}",assertProofValidityDomainVerifier:"The proof is not authorized for this domain",assertProofValidityInvalidChallenge:"The proof's challenge does not match the verifier's challenge",assertProofValidityNoProofPurpose:"`proofPurpose` property is missing from proof",assertProofValidityNoCreated:"`created` property is missing from proof",ensureHashesEqual:"Computed hash does not match remote hash",ensureMerkleRootEqual:"Merkle root does not match remote hash.",ensureValidReceipt:"The receipt is malformed. There was a problem navigating the merkle tree in the receipt.",failedJsonLdNormalization:"Failed JSON-LD normalization",foundUnmappedFields:"Found unmapped fields during JSON-LD normalization",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Cannot verify this certificate without a transaction ID to compare against.",invalidMerkleReceipt:"Invalid Merkle Receipt. Proof hash did not match Merkle root",isTransactionIdValid:"Cannot verify this certificate without a transaction ID to compare against.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},fr:{errors:{assertProofValidityPurposeVerifier:"Objectif de la signature invalide. Attendu: ${expectedProofPurpose} mais la signature a un objectif de ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"La méthode de vérification ${proof.verificationMethod} n'est pas autorisée pour l'objectif de verification: ${expectedProofPurpose}",assertProofValidityDomainVerifier:"La signature n'est pas autorisée pour ce domaine",assertProofValidityInvalidChallenge:"Le challenge de la signature ne correspond pas au challenge de vérification",assertProofValidityNoProofPurpose:"La propriété `proofPurpose` est manquante dans la signature",assertProofValidityNoCreated:"La propriété `created` est manquante dans la signature",ensureHashesEqual:"Calcul du hash local différent du hash distant",ensureMerkleRootEqual:"Le Merkle root ne correspond pas au hash distant",ensureValidReceipt:"Erreur d'écriture du reçu. Un problème est survenu lors de la navigation de l'arbre Merkle du reçu.",failedJsonLdNormalization:"Erreur de normalisation JSON-LD",foundUnmappedFields:"Champs non liés découverts durant la normalisation JSON-LD",identityErrorBaseMessage:"Identité de l'émetteur invalide",deriveIssuingAddressFromPublicKey:"Cette blockchain n'est pas supportée pour la vérification de l'identité décentralisée.",compareIssuingAddress:"La méthode de vérification n'a pas permis d'établir l'identité de l'émetteur.",getTransactionId:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",invalidMerkleReceipt:"Reçu Merkle invalide. Hash de preuve différent du Merkle root",isTransactionIdValid:"Impossible de vérifier ce certificat sans un identifiant de transaction valide",noProofSpecified:"La propriété 'proof' du document est un tableau mais aucune preuve n'a été passée pour savoir ce qu'il faut vérifier"}},es:{errors:{assertProofValidityPurposeVerifier:"Objectivo de verificación invalido. Se esperaba ${expectedProofPurpose} pero recibió ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"El método de verificación ${proof.verificationMethod} no está permitido para el objectivo de verificación ${expectedProofPurpose}",assertProofValidityDomainVerifier:"La prueba no está autorizada para este dominio",assertProofValidityInvalidChallenge:"El reto de la prueba no coincide con el reto de verificación",assertProofValidityNoProofPurpose:"Falta propiedad `proofPurpose` en la prueba",assertProofValidityNoCreated:"Falta propiedad `created` en la prueba",ensureHashesEqual:"La cadena binaria calculada no corresponde con la cadena binaria remota",ensureMerkleRootEqual:"La raíz Merkle no corresponde con la cadena binaria remota",ensureValidReceipt:"El recibo está malformado. Hubo un problema navegando el árbol Merkle en el recibo",failedJsonLdNormalization:"La normalización del JSON-LD ha fallado",foundUnmappedFields:"Se han encontrado campos no mapeados durante la normalización de JSON-LD",identityErrorBaseMessage:"Identitad del emisor inválida",deriveIssuingAddressFromPublicKey:"No se puede validar la identitad decentalisada con esta cadena binaria.",compareIssuingAddress:"El metodo de verificación no corresponde a la identitad del emisor.",getTransactionId:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",invalidMerkleReceipt:"Recibo Merkle inválido. La cadena binaria de prueba no corresponde con la raíz Merkle",isTransactionIdValid:"No se puede verificar este certificado sin una identificación de transacción que sirva como comparación",noProofSpecified:"La propiedad 'proof' del documento es una lista, pero no prueba especifica ha sido declarada para conocer el punto de verificación"}},mt:{errors:{assertProofValidityPurposeVerifier:"Invalid proof purpose. Expected ${expectedProofPurpose} but received ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"The verification method ${proof.verificationMethod} is not allowed for the proof purpose ${expectedProofPurpose}",assertProofValidityDomainVerifier:"The proof is not authorized for this domain",assertProofValidityInvalidChallenge:"The proof's challenge does not match the verifier's challenge",assertProofValidityNoProofPurpose:"`proofPurpose` property is missing from proof",assertProofValidityNoCreated:"`created` property is missing from proof",ensureHashesEqual:"Il-hash ikkalkulat ma jikkorrispondix mar-remote hash",ensureMerkleRootEqual:"Merkle root ma taqbilx mar-remote hash",ensureValidReceipt:"L-irċevuta hija malformata. Kien hemm problema fin-navigazzjoni tal-merkle tree fl-irċevuta",failedJsonLdNormalization:"In-normalizzazzjoni ta' JSON-LD ma rnexxietx",foundUnmappedFields:"Instabu unmapped fields matul in-normalizzazzjoni JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",invalidMerkleReceipt:"Irċevuta Merkle invalida. Il-proof hash ma kienx jaqbel mal-Merkle root",isTransactionIdValid:"Dan iċ-ċertifikat ma jistax jiġi vverifikat mingħajr ID ta' tranżazzjoni mqabbla miegħu",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},"it-IT":{errors:{assertProofValidityPurposeVerifier:"Invalid proof purpose. Expected ${expectedProofPurpose} but received ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"The verification method ${proof.verificationMethod} is not allowed for the proof purpose ${expectedProofPurpose}",assertProofValidityDomainVerifier:"The proof is not authorized for this domain",assertProofValidityInvalidChallenge:"The proof's challenge does not match the verifier's challenge",assertProofValidityNoProofPurpose:"`proofPurpose` property is missing from proof",assertProofValidityNoCreated:"`created` property is missing from proof",ensureHashesEqual:"L'hash calcolato non corrisponde all'hash remoto",ensureMerkleRootEqual:"La radice di Merkle non corrisponde all'hash remoto.",ensureValidReceipt:"La ricevuta è malformata. C'è stato un problema nella navigazione dell'albero di Merkle nella ricevuta.",failedJsonLdNormalization:"Normalizzazione JSON-LD fallita",foundUnmappedFields:"Campi non mappati trovati durante la normalizzazione JSON-LD",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",invalidMerkleReceipt:"Ricevuta Merkle non valida. L'hash di prova non corrisponde alla radice di Merkle",isTransactionIdValid:"Impossibile verificare questo certificato senza un ID transazione da confrontare.",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}},ja:{errors:{assertProofValidityPurposeVerifier:"Invalid proof purpose. Expected ${expectedProofPurpose} but received ${proof.proofPurpose}",assertProofValidityPurposeIssuerKey:"The verification method ${proof.verificationMethod} is not allowed for the proof purpose ${expectedProofPurpose}",assertProofValidityDomainVerifier:"The proof is not authorized for this domain",assertProofValidityInvalidChallenge:"The proof's challenge does not match the verifier's challenge",assertProofValidityNoProofPurpose:"`proofPurpose` property is missing from proof",assertProofValidityNoCreated:"`created` property is missing from proof",ensureHashesEqual:"算出されたハッシュがリモートハッシュと一致しませんでした",ensureMerkleRootEqual:"Merkle rootがリモートハッシュと一致しませんでした",ensureValidReceipt:"レシートが異常です。レシート内のMerkle treeを辿る際に問題が発生しました。",failedJsonLdNormalization:"JSON-LDの正規化に失敗しました",foundUnmappedFields:"JSON-LDの正規化時にマップされていないフィールドを検出しました",identityErrorBaseMessage:"Issuer identity mismatch",deriveIssuingAddressFromPublicKey:"Unsupported blockchain for DID verification",compareIssuingAddress:"The provided verification method does not match the issuer identity",getTransactionId:"照合のための取引IDがないため、この証明書を認証できません。",invalidMerkleReceipt:"Merkleレシートが無効です。証明ハッシュがMerkle rootと一致しませんでした。",isTransactionIdValid:"照合するための取引IDがないため、この証明書を認証できません。",noProofSpecified:"Document proof is an array but no target proof was specified to know what to verify."}}};function Te(e,t){return t?Ae[Ie]?Ae[Ie][e]?Ae[Ie][e][t]?Ae[Ie][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]":""}function Oe({expectedProofPurpose:e,expectedDomain:t,expectedChallenge:r,proof:n,issuer:i}){if(!n.proofPurpose)throw new Pe("assertProofValidity",Te("errors","assertProofValidityNoProofPurpose"));if(!n.created)throw new Pe("assertProofValidity",Te("errors","assertProofValidityNoCreated"));return n.proofPurpose&&function({expectedProofPurpose:e,proof:t,issuer:r}){if(t.proofPurpose!==e)throw new Pe("assertProofValidity",Te("errors","assertProofValidityPurposeVerifier").replace("${expectedProofPurpose}",e).replace("${proof.proofPurpose}",t.proofPurpose));if(r&&!r[e]?.includes(t.verificationMethod))throw new Pe("assertProofValidity",Te("errors","assertProofValidityPurposeIssuerKey").replace("${proof.verificationMethod}",t.verificationMethod).replace("${expectedProofPurpose}",e));"authentication"!==e||t.domain||console.warn("No domain found in proof, but it is recommended for authentication purposes")}({expectedProofPurpose:e,proof:n,issuer:i}),n.domain&&function({expectedDomain:e,proof:t,expectedChallenge:r}){if(!e.includes(t.domain))throw new Pe("assertProofValidity",Te("errors","assertProofValidityDomainVerifier").replace("${expectedDomain}",e.join(", ")).replace("${proof.domain}",t.domain));if(t.domain&&!t.challenge&&console.warn("No challenge found in proof, but it is recommended for domain verification"),t.challenge&&t.challenge!==r)throw new Pe("assertProofValidity",Te("errors","assertProofValidityInvalidChallenge"))}({expectedDomain:t,proof:n,expectedChallenge:r}),!0}var ve={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",obi:"https://w3id.org/openbadges#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2017:"sec:MerkleProof2017",RecipientProfile:"bc:RecipientProfile",SignatureLine:"bc:SignatureLine",MerkleProofVerification2017:"bc:MerkleProofVerification2017",recipientProfile:"bc:recipientProfile",signatureLines:"bc:signatureLines",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},subtitle:"bc:subtitle",jobTitle:"schema:jobTitle",creator:{"@id":"dc:creator","@type":"@id"},expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},revoked:{"@id":"sec:expiration","@type":"xsd:dateTime"},CryptographicKey:"sec:Key",signature:"sec:signature",verification:"bc:verification",publicKeys:"bc:publicKeys",ChainpointSHA256v2:"cp:ChainpointSHA256v2",BTCOpReturn:"cp:BTCOpReturn",targetHash:"cp:targetHash",merkleRoot:"cp:merkleRoot",proof:"cp:proof",anchors:"cp:anchors",sourceId:"cp:sourceId",right:"cp:right",left:"cp:left"},"obi:validation":[{"obi:validatesType":"RecipientProfile","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/recipientSchema.json"},{"obi:validatesType":"SignatureLine","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/signatureLineSchema.json"},{"obi:validatesType":"MerkleProof2017","obi:validationSchema":"https://w3id.org/blockcerts/schema/2.0-alpha/merkleProof2017Schema.json"}]},Se={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",schema:"http://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"bc:created","@type":"xsd:dateTime"},name:{"@id":"schema:name"}}},Ne={"@context":{id:"@id",type:"@type",bc:"https://w3id.org/blockcerts#",cp:"https://w3id.org/chainpoint#",vc:"https://www.w3.org/2018/credentials/v1",schema:"https://schema.org/",sec:"https://w3id.org/security#",xsd:"http://www.w3.org/2001/XMLSchema#",MerkleProof2019:"sec:MerkleProof2019",BlockcertsCredential:"bc:BlockcertsCredential",introductionUrl:{"@id":"bc:introductionUrl","@type":"@id"},metadata:"bc:metadata",display:{"@id":"bc:display","@context":{id:"@id",type:"@type",contentMediaType:{"@id":"bc:contentMediaType","@type":"@id"},contentEncoding:{"@id":"bc:contentEncoding","@type":"@id"},content:{"@id":"bc:content","@type":"@id"}}},CryptographicKey:"sec:Key",domain:"sec:domain",nonce:"sec:nonce",proofValue:"sec:proofValue",assertionMethod:{"@id":"sec:assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"sec:authenticationMethod","@type":"@id","@container":"@set"},proofPurpose:{"@id":"sec:proofPurpose","@type":"@vocab"},verificationMethod:{"@id":"sec:verificationMethod","@type":"@id"},created:{"@id":"https://purl.org/dc/terms/created","@type":"xsd:dateTime"},challenge:"sec:challenge",expires:{"@id":"sec:expiration","@type":"xsd:dateTime"},name:{"@id":"schema:name"},description:{"@id":"schema:description"},email:{"@id":"schema:email"},publicKey:{"@id":"sec:publicKey","@type":"@id"},url:{"@id":"schema:url","@type":"@id"},image:{"@id":"schema:image","@type":"@id"}}},Ue={"@context":{id:"@id",type:"@type","@protected":!0,proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},Ed25519VerificationKey2020:{"@id":"https://w3id.org/security#Ed25519VerificationKey2020","@context":{"@protected":!0,id:"@id",type:"@type",controller:{"@id":"https://w3id.org/security#controller","@type":"@id"},revoked:{"@id":"https://w3id.org/security#revoked","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},publicKeyMultibase:{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},Ed25519Signature2020:{"@id":"https://w3id.org/security#Ed25519Signature2020","@context":{"@protected":!0,id:"@id",type:"@type",challenge:"https://w3id.org/security#challenge",created:{"@id":"http://purl.org/dc/terms/created","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},domain:"https://w3id.org/security#domain",expires:{"@id":"https://w3id.org/security#expiration","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},nonce:"https://w3id.org/security#nonce",proofPurpose:{"@id":"https://w3id.org/security#proofPurpose","@type":"@vocab","@context":{"@protected":!0,id:"@id",type:"@type",assertionMethod:{"@id":"https://w3id.org/security#assertionMethod","@type":"@id","@container":"@set"},authentication:{"@id":"https://w3id.org/security#authenticationMethod","@type":"@id","@container":"@set"},capabilityInvocation:{"@id":"https://w3id.org/security#capabilityInvocationMethod","@type":"@id","@container":"@set"},capabilityDelegation:{"@id":"https://w3id.org/security#capabilityDelegationMethod","@type":"@id","@container":"@set"},keyAgreement:{"@id":"https://w3id.org/security#keyAgreementMethod","@type":"@id","@container":"@set"}}},proofValue:{"@id":"https://w3id.org/security#proofValue","@type":"https://w3id.org/security#multibase"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}};function Re(e){e=e.trim();const t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t}async function ke(e,t=null,r=async e=>Promise){e["@context"].find(e=>{return(t=e)===Object(t)&&"@vocab"in e;var t})||e["@context"].push({"@vocab":"http://fallback.org/"});const n=JSON.parse(JSON.stringify(e));if(Array.isArray(n.proof)){if(!t)throw new Pe("computeLocalHash",Te("errors","noProofSpecified"));const e=n.proof.findIndex(e=>e.proofValue===t.proofValue);n.proof=n.proof.slice(0,e)}else delete n.proof;const i={algorithm:"URDNA2015",format:"application/nquads",documentLoader:async function(e){return null!=r&&await r(e),e in f?{contextUrl:null,document:f[e],documentUrl:e}:_.documentLoader(e)},safe:!1};let o;try{o=await _.normalize(n,i)}catch(e){throw console.error(e),new Pe("computeLocalHash",Te("errors","failedJsonLdNormalization"))}const s=function(e){const t=e.split("\n"),r=/<http:\/\/fallback\.org\/(.*)>/,n=t.map(e=>r.exec(e)).filter(e=>null!=e);if(n.length>0){const e=n.map(e=>e[1]).sort();return Array.from(new Set(e))}return null}(o);if(s)throw new Pe("computeLocalHash",`${Te("errors","foundUnmappedFields")}: ${s.join(", ")}`);return a.from(b(Uint8Array.from(function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(o)))).toString("hex")}f["https://w3id.org/blockcerts/schema/2.0-alpha/context.json"]=ve,f["https://www.blockcerts.org/schema/2.0-alpha/context.json"]=ve,f["https://www.blockcerts.org/schema/3.0-alpha/context.json"]=Se,f["https://w3id.org/blockcerts/schema/3.0-alpha/context.json"]=Se,f["https://w3id.org/blockcerts/v3.0-alpha"]=Se,f["https://www.blockcerts.org/schema/3.0-beta/context.json"]=Ne,f["https://w3id.org/blockcerts/schema/3.0-beta/context.json"]=Ne,f["https://w3id.org/blockcerts/v3.0-beta"]=Ne,f["https://w3id.org/security/suites/ed25519-2020/v1"]=Ue;const Be=a,Me=e=>{const t=(e=>{e={...e,crv:"K-256"};const t=I({jwk:e});return Be.from(t).toString("hex")})(e);let r=Be.from(t,"hex"),n=32-r.length;for(;n>0;)r=Be.concat([Be.from("00","hex"),r]),n--;return r},Le={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128};var xe,De=Object.freeze({__proto__:null,bitcoin:Le,regtest:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}});!function(e){e[e.OP_FALSE=0]="OP_FALSE",e[e.OP_0=0]="OP_0",e[e.OP_PUSHDATA1=76]="OP_PUSHDATA1",e[e.OP_PUSHDATA2=77]="OP_PUSHDATA2",e[e.OP_PUSHDATA4=78]="OP_PUSHDATA4",e[e.OP_1NEGATE=79]="OP_1NEGATE",e[e.OP_RESERVED=80]="OP_RESERVED",e[e.OP_TRUE=81]="OP_TRUE",e[e.OP_1=81]="OP_1",e[e.OP_2=82]="OP_2",e[e.OP_3=83]="OP_3",e[e.OP_4=84]="OP_4",e[e.OP_5=85]="OP_5",e[e.OP_6=86]="OP_6",e[e.OP_7=87]="OP_7",e[e.OP_8=88]="OP_8",e[e.OP_9=89]="OP_9",e[e.OP_10=90]="OP_10",e[e.OP_11=91]="OP_11",e[e.OP_12=92]="OP_12",e[e.OP_13=93]="OP_13",e[e.OP_14=94]="OP_14",e[e.OP_15=95]="OP_15",e[e.OP_16=96]="OP_16",e[e.OP_NOP=97]="OP_NOP",e[e.OP_VER=98]="OP_VER",e[e.OP_IF=99]="OP_IF",e[e.OP_NOTIF=100]="OP_NOTIF",e[e.OP_VERIF=101]="OP_VERIF",e[e.OP_VERNOTIF=102]="OP_VERNOTIF",e[e.OP_ELSE=103]="OP_ELSE",e[e.OP_ENDIF=104]="OP_ENDIF",e[e.OP_VERIFY=105]="OP_VERIFY",e[e.OP_RETURN=106]="OP_RETURN",e[e.OP_TOALTSTACK=107]="OP_TOALTSTACK",e[e.OP_FROMALTSTACK=108]="OP_FROMALTSTACK",e[e.OP_2DROP=109]="OP_2DROP",e[e.OP_2DUP=110]="OP_2DUP",e[e.OP_3DUP=111]="OP_3DUP",e[e.OP_2OVER=112]="OP_2OVER",e[e.OP_2ROT=113]="OP_2ROT",e[e.OP_2SWAP=114]="OP_2SWAP",e[e.OP_IFDUP=115]="OP_IFDUP",e[e.OP_DEPTH=116]="OP_DEPTH",e[e.OP_DROP=117]="OP_DROP",e[e.OP_DUP=118]="OP_DUP",e[e.OP_NIP=119]="OP_NIP",e[e.OP_OVER=120]="OP_OVER",e[e.OP_PICK=121]="OP_PICK",e[e.OP_ROLL=122]="OP_ROLL",e[e.OP_ROT=123]="OP_ROT",e[e.OP_SWAP=124]="OP_SWAP",e[e.OP_TUCK=125]="OP_TUCK",e[e.OP_CAT=126]="OP_CAT",e[e.OP_SUBSTR=127]="OP_SUBSTR",e[e.OP_LEFT=128]="OP_LEFT",e[e.OP_RIGHT=129]="OP_RIGHT",e[e.OP_SIZE=130]="OP_SIZE",e[e.OP_INVERT=131]="OP_INVERT",e[e.OP_AND=132]="OP_AND",e[e.OP_OR=133]="OP_OR",e[e.OP_XOR=134]="OP_XOR",e[e.OP_EQUAL=135]="OP_EQUAL",e[e.OP_EQUALVERIFY=136]="OP_EQUALVERIFY",e[e.OP_RESERVED1=137]="OP_RESERVED1",e[e.OP_RESERVED2=138]="OP_RESERVED2",e[e.OP_1ADD=139]="OP_1ADD",e[e.OP_1SUB=140]="OP_1SUB",e[e.OP_2MUL=141]="OP_2MUL",e[e.OP_2DIV=142]="OP_2DIV",e[e.OP_NEGATE=143]="OP_NEGATE",e[e.OP_ABS=144]="OP_ABS",e[e.OP_NOT=145]="OP_NOT",e[e.OP_0NOTEQUAL=146]="OP_0NOTEQUAL",e[e.OP_ADD=147]="OP_ADD",e[e.OP_SUB=148]="OP_SUB",e[e.OP_MUL=149]="OP_MUL",e[e.OP_DIV=150]="OP_DIV",e[e.OP_MOD=151]="OP_MOD",e[e.OP_LSHIFT=152]="OP_LSHIFT",e[e.OP_RSHIFT=153]="OP_RSHIFT",e[e.OP_BOOLAND=154]="OP_BOOLAND",e[e.OP_BOOLOR=155]="OP_BOOLOR",e[e.OP_NUMEQUAL=156]="OP_NUMEQUAL",e[e.OP_NUMEQUALVERIFY=157]="OP_NUMEQUALVERIFY",e[e.OP_NUMNOTEQUAL=158]="OP_NUMNOTEQUAL",e[e.OP_LESSTHAN=159]="OP_LESSTHAN",e[e.OP_GREATERTHAN=160]="OP_GREATERTHAN",e[e.OP_LESSTHANOREQUAL=161]="OP_LESSTHANOREQUAL",e[e.OP_GREATERTHANOREQUAL=162]="OP_GREATERTHANOREQUAL",e[e.OP_MIN=163]="OP_MIN",e[e.OP_MAX=164]="OP_MAX",e[e.OP_WITHIN=165]="OP_WITHIN",e[e.OP_RIPEMD160=166]="OP_RIPEMD160",e[e.OP_SHA1=167]="OP_SHA1",e[e.OP_SHA256=168]="OP_SHA256",e[e.OP_HASH160=169]="OP_HASH160",e[e.OP_HASH256=170]="OP_HASH256",e[e.OP_CODESEPARATOR=171]="OP_CODESEPARATOR",e[e.OP_CHECKSIG=172]="OP_CHECKSIG",e[e.OP_CHECKSIGVERIFY=173]="OP_CHECKSIGVERIFY",e[e.OP_CHECKMULTISIG=174]="OP_CHECKMULTISIG",e[e.OP_CHECKMULTISIGVERIFY=175]="OP_CHECKMULTISIGVERIFY",e[e.OP_NOP1=176]="OP_NOP1",e[e.OP_CHECKLOCKTIMEVERIFY=177]="OP_CHECKLOCKTIMEVERIFY",e[e.OP_NOP2=177]="OP_NOP2",e[e.OP_CHECKSEQUENCEVERIFY=178]="OP_CHECKSEQUENCEVERIFY",e[e.OP_NOP3=178]="OP_NOP3",e[e.OP_NOP4=179]="OP_NOP4",e[e.OP_NOP5=180]="OP_NOP5",e[e.OP_NOP6=181]="OP_NOP6",e[e.OP_NOP7=182]="OP_NOP7",e[e.OP_NOP8=183]="OP_NOP8",e[e.OP_NOP9=184]="OP_NOP9",e[e.OP_NOP10=185]="OP_NOP10",e[e.OP_CHECKSIGADD=186]="OP_CHECKSIGADD",e[e.OP_PUBKEYHASH=253]="OP_PUBKEYHASH",e[e.OP_PUBKEY=254]="OP_PUBKEY",e[e.OP_INVALIDOPCODE=255]="OP_INVALIDOPCODE"}(xe||(xe={}));const Ce="0123456789abcdefABCDEF",Ve=Ce.split("").map(e=>e.codePointAt(0)),Fe=Array(256).fill(!0).map((e,t)=>{const r=String.fromCodePoint(t),n=Ce.indexOf(r);return n<0?void 0:n<16?n:n-6}),He=new TextEncoder,je=new TextDecoder;function Ge(e){const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function Ke(e){const t=e||new Uint8Array;return t.length>512?function(e){const t=new Uint8Array(2*e.length);for(let r=0;r<e.length;++r)t[2*r]=Ve[e[r]>>4],t[2*r+1]=Ve[15&e[r]];return je.decode(t)}(t):function(e){let t="";for(let r=0;r<e.length;++r)t+=Ce[Fe[Ve[e[r]>>4]]],t+=Ce[Fe[Ve[15&e[r]]]];return t}(t)}function $e(e){const t=He.encode(e||""),r=new Uint8Array(Math.floor(t.length/2));let n;for(n=0;n<r.length;n++){const e=Fe[t[2*n]],i=Fe[t[2*n+1]];if(void 0===e||void 0===i)break;r[n]=e<<4|i}return n===r.length?r:r.slice(0,n)}function ze(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return e.length===t.length?0:e.length>t.length?1:-1}function Ye(e,t,r){if(t+1>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(r>255)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 255. Received ${r}`);return e[t]=r,t+1}function We(e,t,r,n){if(t+4>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(n=n.toUpperCase(),r>4294967295)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received ${r}`);return"LE"===n?(e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255):(e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r),t+4}function Je(e,t){if(t+1>e.length)throw new Error("Offset is outside the bounds of Uint8Array");return e[t]}function qe(e,t,r){if(t+4>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if("LE"===(r=r.toUpperCase())){let r=0;return r=(r<<8)+e[t+3]>>>0,r=(r<<8)+e[t+2]>>>0,r=(r<<8)+e[t+1]>>>0,r=(r<<8)+e[t]>>>0,r}{let r=0;return r=(r<<8)+e[t]>>>0,r=(r<<8)+e[t+1]>>>0,r=(r<<8)+e[t+2]>>>0,r=(r<<8)+e[t+3]>>>0,r}}function Xe(e){return e<xe.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}function Qe(e,t,r){const n=Xe(t);return 1===n?Ye(e,r,t):2===n?(Ye(e,r,xe.OP_PUSHDATA1),Ye(e,r+1,t)):3===n?(Ye(e,r,xe.OP_PUSHDATA2),function(e,t,r,n){if(t+2>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(n=n.toUpperCase(),r>65535)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 65535. Received ${r}`);"LE"===n?(e[t]=255&r,e[t+1]=r>>8&255):(e[t]=r>>8&255,e[t+1]=255&r)}(e,r+1,t,"LE")):(Ye(e,r,xe.OP_PUSHDATA4),We(e,r+1,t,"LE")),n}function Ze(e,t){const r=Je(e,t);let n,i;if(r<xe.OP_PUSHDATA1)n=r,i=1;else if(r===xe.OP_PUSHDATA1){if(t+2>e.length)return null;n=Je(e,t+1),i=2}else if(r===xe.OP_PUSHDATA2){if(t+3>e.length)return null;n=function(e,t,r){if(t+2>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if("LE"===(r=r.toUpperCase())){let r=0;return r=(r<<8)+e[t+1],r=(r<<8)+e[t],r}{let r=0;return r=(r<<8)+e[t],r=(r<<8)+e[t+1],r}}(e,t+1,"LE"),i=3}else{if(t+5>e.length)return null;if(r!==xe.OP_PUSHDATA4)throw new Error("Unexpected opcode");n=qe(e,t+1,"LE"),i=5}return{opcode:r,number:n,size:i}}const et={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function tt(e){return et}function rt(e){const t=typeof e;return"string"===t?`"${e}"`:"number"===t||"bigint"===t||"boolean"===t?`${e}`:"object"===t||"function"===t?(e&&Object.getPrototypeOf(e)?.constructor?.name)??"null":t}function nt(e,t,r,n,i){const o=i&&"input"in i?i.input:r.value,s=i?.expected??e.expects??null,a=i?.received??rt(o),c={kind:e.kind,type:e.type,input:o,expected:s,received:a,message:`Invalid ${t}: ${s?`Expected ${s} but r`:"R"}eceived ${a}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},u="schema"===e.kind,h=i?.message??e.message??(e.reference,void c.lang)??(u?void c.lang:null)??n.message??void c.lang;void 0!==h&&(c.message="function"==typeof h?h(c):h),u&&(r.typed=!1),r.issues?r.issues.push(c):r.issues=[c]}const it=new WeakMap;function ot(e){let t=it.get(e);return t||(t={version:1,vendor:"valibot",validate:t=>e["~run"]({value:t},tt())},it.set(e,t)),t}function st(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}var at=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function ct(e,t){return{kind:"validation",type:"length",reference:ct,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&nt(this,"length",e,t,{received:`${e.value.length}`}),e}}}const ut={abortEarly:!0};function ht(e,t,r){return"function"==typeof e.fallback?e.fallback(t,r):e.fallback}function ft(e,t,r){return"function"==typeof e.default?e.default(t,r):e.default}function lt(e,t){return{kind:"schema",type:"custom",reference:lt,expects:"unknown",async:!1,check:e,message:t,get"~standard"(){return ot(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:nt(this,"type",e,t),e}}}function dt(e,t){return{kind:"schema",type:"instance",reference:dt,expects:e.name,async:!1,class:e,message:t,get"~standard"(){return ot(this)},"~run"(e,t){return e.value instanceof this.class?e.typed=!0:nt(this,"type",e,t),e}}}function pt(e,t){return{kind:"schema",type:"object",reference:pt,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return ot(this)},"~run"(e,t){const r=e.value;if(r&&"object"==typeof r){e.typed=!0,e.value={};for(const n in this.entries){const i=this.entries[n];if(n in r||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){const o=n in r?r[n]:ft(i),s=i["~run"]({value:o},t);if(s.issues){const i={type:"object",origin:"value",input:r,key:n,value:o};for(const t of s.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[n]=s.value}else if(void 0!==i.fallback)e.value[n]=ht(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(nt(this,"key",e,t,{input:void 0,expected:`"${n}"`,path:[{type:"object",origin:"key",input:r,key:n,value:r[n]}]}),t.abortEarly))break}}else nt(this,"type",e,t);return e}}}function yt(e,t){return{kind:"schema",type:"optional",reference:yt,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return ot(this)},"~run"(e,t){return void 0===e.value&&(void 0!==this.default&&(e.value=ft(this,e,t)),void 0===e.value)?(e.typed=!0,e):this.wrapped["~run"](e,t)}}}function gt(e){return{kind:"schema",type:"string",reference:gt,expects:"string",async:!1,message:e,get"~standard"(){return ot(this)},"~run"(e,t){return"string"==typeof e.value?e.typed=!0:nt(this,"type",e,t),e}}}function Et(e){let t;if(e)for(const r of e)if(t)for(const e of r.issues)t.push(e);else t=r.issues;return t}function mt(e,t,r){const n=e["~run"]({value:t},tt());if(n.issues)throw new at(n.issues);return n.value}const _t=new Uint8Array(32),wt=$e("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),bt=e=>function(...e){return{...e[0],pipe:e,get"~standard"(){return ot(this)},"~run"(t,r){for(const n of e)if("metadata"!==n.kind){if(t.issues&&("schema"===n.kind||"transformation"===n.kind)){t.typed=!1;break}t.issues&&(r.abortEarly||r.abortPipeEarly)||(t=n["~run"](t,r))}return t}}}(dt(Uint8Array),ct(e));function Pt(e){if(!(e instanceof Uint8Array))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===ze(_t,r))return!1;if(ze(r,wt)>=0)return!1;if((2===t||3===t)&&33===e.length)return!0;const n=e.slice(33);return 0!==ze(_t,n)&&(!(ze(n,wt)>=0)&&(4===t&&65===e.length))}const It=bt(20),At=dt(Uint8Array),Tt=xe.OP_RESERVED,Ot=function e(t,r){return{kind:"schema",type:"array",reference:e,expects:"Array",async:!1,item:t,message:r,get"~standard"(){return ot(this)},"~run"(e,t){const r=e.value;if(Array.isArray(r)){e.typed=!0,e.value=[];for(let n=0;n<r.length;n++){const i=r[n],o=this.item["~run"]({value:i},t);if(o.issues){const s={type:"array",origin:"value",input:r,key:n,value:i};for(const t of o.issues)t.path?t.path.unshift(s):t.path=[s],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else nt(this,"type",e,t);return e}}}(function e(t,r){return{kind:"schema",type:"union",reference:e,expects:st(t.map(e=>e.expects),"|"),async:!1,options:t,message:r,get"~standard"(){return ot(this)},"~run"(e,t){let r,n,i;for(const o of this.options){const s=o["~run"]({value:e.value},t);if(s.typed){if(!s.issues){r=s;break}n?n.push(s):n=[s]}else i?i.push(s):i=[s]}if(r)return r;if(n){if(1===n.length)return n[0];nt(this,"type",e,t,{issues:Et(n)}),e.typed=!0}else{if(1===i?.length)return i[0];nt(this,"type",e,t,{issues:Et(i)})}return e}}}([dt(Uint8Array),function e(t){return{kind:"schema",type:"number",reference:e,expects:"number",async:!1,message:t,get"~standard"(){return ot(this)},"~run"(e,t){return"number"!=typeof e.value||isNaN(e.value)?nt(this,"type",e,t):e.typed=!0,e}}}()]));function vt(e){return 0===e.length?xe.OP_0:1===e.length?e[0]>=1&&e[0]<=16?Tt+e[0]:129===e[0]?xe.OP_1NEGATE:void 0:void 0}function St(e){return function(e,t){return!e["~run"]({value:t},ut).issues}(Ot,e)}function Nt(e){return e instanceof Uint8Array}function Ut(e){if(e instanceof Uint8Array)return e;mt(Ot,e);const t=e.reduce((e,t)=>Nt(t)?1===t.length&&void 0!==vt(t)?e+1:e+Xe(t.length)+t.length:e+1,0),r=new Uint8Array(t);let n=0;if(e.forEach(e=>{if(Nt(e)){const t=vt(e);if(void 0!==t)return Ye(r,n,t),void(n+=1);n+=Qe(r,e.length,n),r.set(e,n),n+=e.length}else Ye(r,n,e),n+=1}),n!==r.length)throw new Error("Could not decode chunks");return r}function Rt(e){return e instanceof Uint8Array&&(!!function(e){const t=-129&e;return t>0&&t<4}(e[e.length-1])&&function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;const t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;const r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))}(e.slice(0,-1)))}function kt(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})}function Bt(e){let t;return()=>(void 0!==t||(t=e()),t)}function Mt(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
2
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
|
+
var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Lt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function xt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Dt(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ct(e,t){return e<<32-t|e>>>t}function Vt(e,t){return e<<t|e>>>32-t>>>0}function Ft(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),Mt(e),e}xe.OP_RESERVED;let Ht=class{};function jt(e){const t=t=>e().update(Ft(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Gt(e,t,r){return e&t^~e&r}function Kt(e,t,r){return e&t^e&r^t&r}let $t=class extends Ht{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Dt(this.buffer)}update(e){Lt(this),Mt(e=Ft(e));const{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s===n){const t=Dt(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Lt(this),function(e,t){Mt(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,xt(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=Dt(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}};const zt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Yt=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Wt=(()=>Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)))(),Jt=(()=>Wt.map(e=>(9*e+5)%16))(),qt=(()=>{const e=[[Wt],[Jt]];for(let t=0;t<4;t++)for(let r of e)r.push(r[t].map(e=>Yt[e]));return e})(),Xt=(()=>qt[0])(),Qt=(()=>qt[1])(),Zt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),er=Xt.map((e,t)=>e.map(e=>Zt[t][e])),tr=Qt.map((e,t)=>e.map(e=>Zt[t][e])),rr=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),nr=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function ir(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const or=new Uint32Array(16);class sr extends $t{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)or[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,s=0|this.h2,a=s,c=0|this.h3,u=c,h=0|this.h4,f=h;for(let e=0;e<5;e++){const t=4-e,l=rr[e],d=nr[e],p=Xt[e],y=Qt[e],g=er[e],E=tr[e];for(let t=0;t<16;t++){const n=Vt(r+ir(e,i,s,c)+or[p[t]]+l,g[t])+h|0;r=h,h=c,c=0|Vt(s,10),s=i,i=n}for(let e=0;e<16;e++){const r=Vt(n+ir(t,o,a,u)+or[y[e]]+d,E[e])+f|0;n=f,f=u,u=0|Vt(a,10),a=o,o=r}}this.set(this.h1+s+u|0,this.h2+c+f|0,this.h3+h+n|0,this.h4+r+o|0,this.h0+i+a|0)}roundClean(){xt(or)}destroy(){this.destroyed=!0,xt(this.buffer),this.set(0,0,0,0,0)}}const ar=jt(()=>new sr),cr=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]),ur=new Uint32Array(64);let hr=class extends $t{constructor(e=32){super(64,e,8,!1),this.A=0|zt[0],this.B=0|zt[1],this.C=0|zt[2],this.D=0|zt[3],this.E=0|zt[4],this.F=0|zt[5],this.G=0|zt[6],this.H=0|zt[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)ur[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=ur[e-15],r=ur[e-2],n=Ct(t,7)^Ct(t,18)^t>>>3,i=Ct(r,17)^Ct(r,19)^r>>>10;ur[e]=i+ur[e-7]+n+ur[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Ct(s,6)^Ct(s,11)^Ct(s,25))+Gt(s,a,c)+cr[e]+ur[e]|0,h=(Ct(r,2)^Ct(r,13)^Ct(r,22))+Kt(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+h|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){xt(ur)}destroy(){this.set(0,0,0,0,0,0,0,0),xt(this.buffer)}};const fr=jt(()=>new hr);function lr(e){return ar(fr(e))}function dr(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
4
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
+
var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function pr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function yr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function gr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Er(e,t){return e<<32-t|e>>>t}function mr(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),dr(e),e}Uint8Array.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),Uint8Array.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),Uint8Array.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),Uint8Array.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),Uint8Array.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),Uint8Array.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),Uint8Array.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),Uint8Array.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),Uint8Array.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129]);class _r{}function wr(e){const t=t=>e().update(mr(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function br(e,t,r){return e&t^~e&r}function Pr(e,t,r){return e&t^e&r^t&r}class Ir extends _r{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=gr(this.buffer)}update(e){pr(this),dr(e=mr(e));const{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s===n){const t=gr(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){pr(this),function(e,t){dr(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,yr(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=gr(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Ar=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Tr=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]),Or=new Uint32Array(64);class vr extends Ir{constructor(e=32){super(64,e,8,!1),this.A=0|Ar[0],this.B=0|Ar[1],this.C=0|Ar[2],this.D=0|Ar[3],this.E=0|Ar[4],this.F=0|Ar[5],this.G=0|Ar[6],this.H=0|Ar[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)Or[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Or[e-15],r=Or[e-2],n=Er(t,7)^Er(t,18)^t>>>3,i=Er(r,17)^Er(r,19)^r>>>10;Or[e]=i+Or[e-7]+n+Or[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Er(s,6)^Er(s,11)^Er(s,25))+br(s,a,c)+Tr[e]+Or[e]|0,h=(Er(r,2)^Er(r,13)^Er(r,22))+Pr(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+h|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){yr(Or)}destroy(){this.set(0,0,0,0,0,0,0,0),yr(this.buffer)}}const Sr=wr(()=>new vr);var Nr=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),n=e(r),i=r.length+4,o=new Uint8Array(i);return o.set(r,0),o.set(n.subarray(0,4),r.length),E.encode(o)},decode:function(e){var r=t(E.decode(e));if(null==r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=E.decodeUnsafe(e);if(null!=r)return t(r)}}}(function(e){return Sr(Sr(e))});const Ur=xe;function Rr(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),mt(function(e){const t={};for(const r in e.entries)t[r]=yt(e.entries[r]);return{...e,entries:t,get"~standard"(){return ot(this)}}}(pt({network:pt({}),address:gt(),hash:It,output:bt(25),pubkey:lt(Pt),signature:lt(Rt),input:At})),e);const r=Bt(()=>{const t=Nr.decode(e.address);return{version:Je(t,0),hash:t.slice(1)}}),n=Bt(()=>function(e){if(St(e))return e;mt(At,e);const t=[];let r=0;for(;r<e.length;){const n=e[r];if(n>xe.OP_0&&n<=xe.OP_PUSHDATA4){const n=Ze(e,r);if(null===n)return null;if(r+=n.size,r+n.number>e.length)return null;const i=e.slice(r,r+n.number);r+=n.number;const o=vt(i);void 0!==o?t.push(o):t.push(i)}else t.push(n),r+=1}return t}(e.input)),i=e.network||Le,o={name:"p2pkh",network:i};if(kt(o,"address",()=>{if(!o.hash)return;const e=new Uint8Array(21);return Ye(e,0,i.pubKeyHash),e.set(o.hash,1),Nr.encode(e)}),kt(o,"hash",()=>e.output?e.output.slice(3,23):e.address?r().hash:e.pubkey||o.pubkey?lr(e.pubkey||o.pubkey):void 0),kt(o,"output",()=>{if(o.hash)return Ut([Ur.OP_DUP,Ur.OP_HASH160,o.hash,Ur.OP_EQUALVERIFY,Ur.OP_CHECKSIG])}),kt(o,"pubkey",()=>{if(e.input)return n()[1]}),kt(o,"signature",()=>{if(e.input)return n()[0]}),kt(o,"input",()=>{if(e.pubkey&&e.signature)return Ut([e.signature,e.pubkey])}),kt(o,"witness",()=>{if(o.input)return[]}),t.validate){let t=Uint8Array.from([]);if(e.address){if(r().version!==i.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==r().hash.length)throw new TypeError("Invalid address");t=r().hash}if(e.hash){if(t.length>0&&0!==ze(t,e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==Ur.OP_DUP||e.output[1]!==Ur.OP_HASH160||20!==e.output[2]||e.output[23]!==Ur.OP_EQUALVERIFY||e.output[24]!==Ur.OP_CHECKSIG)throw new TypeError("Output is invalid");const r=e.output.slice(3,23);if(t.length>0&&0!==ze(t,r))throw new TypeError("Hash mismatch");t=r}if(e.pubkey){const r=lr(e.pubkey);if(t.length>0&&0!==ze(t,r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=n();if(2!==r.length)throw new TypeError("Input is invalid");if(!Rt(r[0]))throw new TypeError("Input has invalid signature");if(!Pt(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&0!==ze(e.signature,r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&0!==ze(e.pubkey,r[1]))throw new TypeError("Pubkey mismatch");const i=lr(r[1]);if(t.length>0&&0!==ze(t,i))throw new TypeError("Hash mismatch")}}return Object.assign(o,e)}var kr,Br={};!function(){if(kr)return Br;kr=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.bech32m=Br.bech32=void 0;const e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",t={};for(let r=0;r<32;r++){const n=e.charAt(r);t[n]=r}function r(e){const t=e>>25;return(33554431&e)<<5^996825010&-(1&t)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function n(e){let t=1;for(let n=0;n<e.length;++n){const i=e.charCodeAt(n);if(i<33||i>126)return"Invalid prefix ("+e+")";t=r(t)^i>>5}t=r(t);for(let n=0;n<e.length;++n){const i=e.charCodeAt(n);t=r(t)^31&i}return t}function i(e,t,r,n){let i=0,o=0;const s=(1<<r)-1,a=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],o+=t;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=t)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}function o(e){return i(e,8,5,!0)}function s(e){const t=i(e,5,8,!1);if(Array.isArray(t))return t}function a(e){const t=i(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function c(i){let c;function u(e,i){if(i=i||90,e.length<8)return e+" too short";if(e.length>i)return"Exceeds length limit";const o=e.toLowerCase(),s=e.toUpperCase();if(e!==o&&e!==s)return"Mixed-case string "+e;const a=(e=o).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;const u=e.slice(0,a),h=e.slice(a+1);if(h.length<6)return"Data too short";let f=n(u);if("string"==typeof f)return f;const l=[];for(let e=0;e<h.length;++e){const n=h.charAt(e),i=t[n];if(void 0===i)return"Unknown character "+n;f=r(f)^i,e+6>=h.length||l.push(i)}return f!==c?"Invalid checksum for "+e:{prefix:u,words:l}}return c="bech32"===i?1:734539939,{decodeUnsafe:function(e,t){const r=u(e,t);if("object"==typeof r)return r},decode:function(e,t){const r=u(e,t);if("object"==typeof r)return r;throw new Error(r)},encode:function(t,i,o){if(o=o||90,t.length+7+i.length>o)throw new TypeError("Exceeds length limit");let s=n(t=t.toLowerCase());if("string"==typeof s)throw new Error(s);let a=t+"1";for(let t=0;t<i.length;++t){const n=i[t];if(n>>5)throw new Error("Non 5-bit word");s=r(s)^n,a+=e.charAt(n)}for(let e=0;e<6;++e)s=r(s);s^=c;for(let t=0;t<6;++t){a+=e.charAt(s>>5*(5-t)&31)}return a},toWords:o,fromWordsUnsafe:s,fromWords:a}}Br.bech32=c("bech32"),Br.bech32m=c("bech32m")}();const Mr="0123456789abcdefABCDEF";Mr.split("").map(e=>e.codePointAt(0)),Array(256).fill(!0).map((e,t)=>{const r=String.fromCodePoint(t),n=Mr.indexOf(r);return n<0?void 0:n<16?n:n-6}),new TextEncoder,new TextDecoder;function Lr(e){"number"==typeof e?function(e){if(e<0||e>Number.MAX_SAFE_INTEGER||e%1!=0)throw new RangeError("value out of range")}(e):(e=>{if(e<0||e>0xffffffffffffffffn)throw new RangeError("value out of range")})(e)}function xr(e,t,r){Lr(e),void 0===r&&(r=0),void 0===t&&(t=new Uint8Array(Cr(e)));let n=0;return e<253?(t.set([Number(e)],r),n=1):e<=65535?(t.set([253],r),function(e,t,r,n){if(t+2>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(n=n.toUpperCase(),r>65535)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 65535. Received ${r}`);"LE"===n?(e[t]=255&r,e[t+1]=r>>8&255):(e[t]=r>>8&255,e[t+1]=255&r)}(t,r+1,Number(e),"LE"),n=3):e<=4294967295?(t.set([254],r),function(e,t,r,n){if(t+4>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(n=n.toUpperCase(),r>4294967295)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received ${r}`);"LE"===n?(e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255):(e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r)}(t,r+1,Number(e),"LE"),n=5):(t.set([255],r),function(e,t,r,n){if(t+8>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if(n=n.toUpperCase(),r>0xffffffffffffffffn)throw new Error(`The value of "value" is out of range. It must be >= 0 and <= 18446744073709551615. Received ${r}`);"LE"===n?(e[t]=Number(0xffn&r),e[t+1]=Number(r>>8n&0xffn),e[t+2]=Number(r>>16n&0xffn),e[t+3]=Number(r>>24n&0xffn),e[t+4]=Number(r>>32n&0xffn),e[t+5]=Number(r>>40n&0xffn),e[t+6]=Number(r>>48n&0xffn),e[t+7]=Number(r>>56n&0xffn)):(e[t]=Number(r>>56n&0xffn),e[t+1]=Number(r>>48n&0xffn),e[t+2]=Number(r>>40n&0xffn),e[t+3]=Number(r>>32n&0xffn),e[t+4]=Number(r>>24n&0xffn),e[t+5]=Number(r>>16n&0xffn),e[t+6]=Number(r>>8n&0xffn),e[t+7]=Number(0xffn&r))}(t,r+1,BigInt(e),"LE"),n=9),{buffer:t,bytes:n}}function Dr(e,t){void 0===t&&(t=0);const r=e.at(t);if(void 0===r)throw new Error("buffer too small");if(r<253)return{numberValue:r,bigintValue:BigInt(r),bytes:1};if(253===r){const r=function(e,t,r){if(t+2>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if("LE"===(r=r.toUpperCase())){let r=0;return r=(r<<8)+e[t+1],r=(r<<8)+e[t],r}{let r=0;return r=(r<<8)+e[t],r=(r<<8)+e[t+1],r}}(e,t+1,"LE");return{numberValue:r,bigintValue:BigInt(r),bytes:3}}if(254===r){const r=function(e,t,r){if(t+4>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if("LE"===(r=r.toUpperCase())){let r=0;return r=(r<<8)+e[t+3]>>>0,r=(r<<8)+e[t+2]>>>0,r=(r<<8)+e[t+1]>>>0,r=(r<<8)+e[t]>>>0,r}{let r=0;return r=(r<<8)+e[t]>>>0,r=(r<<8)+e[t+1]>>>0,r=(r<<8)+e[t+2]>>>0,r=(r<<8)+e[t+3]>>>0,r}}(e,t+1,"LE");return{numberValue:r,bigintValue:BigInt(r),bytes:5}}{const r=function(e,t,r){if(t+8>e.length)throw new Error("Offset is outside the bounds of Uint8Array");if("LE"===(r=r.toUpperCase())){let r=0n;return r=(r<<8n)+BigInt(e[t+7]),r=(r<<8n)+BigInt(e[t+6]),r=(r<<8n)+BigInt(e[t+5]),r=(r<<8n)+BigInt(e[t+4]),r=(r<<8n)+BigInt(e[t+3]),r=(r<<8n)+BigInt(e[t+2]),r=(r<<8n)+BigInt(e[t+1]),r=(r<<8n)+BigInt(e[t]),r}{let r=0n;return r=(r<<8n)+BigInt(e[t]),r=(r<<8n)+BigInt(e[t+1]),r=(r<<8n)+BigInt(e[t+2]),r=(r<<8n)+BigInt(e[t+3]),r=(r<<8n)+BigInt(e[t+4]),r=(r<<8n)+BigInt(e[t+5]),r=(r<<8n)+BigInt(e[t+6]),r=(r<<8n)+BigInt(e[t+7]),r}}(e,t+1,"LE");return{numberValue:r<=Number.MAX_SAFE_INTEGER?Number(r):null,bigintValue:r,bytes:9}}}function Cr(e){return Lr(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var Vr,Fr,Hr;$e("0000000000000000000000000000000000000000000000000000000000000000"),$e("0000000000000000000000000000000000000000000000000000000000000001"),$e("ffffffffffffffff"),function(e){e[e.UNSIGNED_TX=0]="UNSIGNED_TX",e[e.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(Vr||(Vr={})),function(e){e[e.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",e[e.WITNESS_UTXO=1]="WITNESS_UTXO",e[e.PARTIAL_SIG=2]="PARTIAL_SIG",e[e.SIGHASH_TYPE=3]="SIGHASH_TYPE",e[e.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=6]="BIP32_DERIVATION",e[e.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",e[e.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",e[e.POR_COMMITMENT=9]="POR_COMMITMENT",e[e.TAP_KEY_SIG=19]="TAP_KEY_SIG",e[e.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",e[e.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",e[e.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",e[e.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",e[e.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT"}(Fr||(Fr={})),function(e){e[e.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=2]="BIP32_DERIVATION",e[e.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",e[e.TAP_TREE=6]="TAP_TREE",e[e.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION"}(Hr||(Hr={}));const jr=e=>33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0];function Gr(e,t=jr){return{decode:function(r){if(r.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+Ke(r.key));const n=r.key.slice(1);if(!t(n))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+Ke(r.key));if(r.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const i={masterFingerprint:r.value.slice(0,4),pubkey:n,path:"m"};for(const e of(o=r.value.length/4-1,[...Array(o).keys()])){const t=qe(r.value,4*e+4,"LE"),n=!!(2147483648&t),o=2147483647&t;i.path+="/"+o.toString(10)+(n?"'":"")}var o;return i},encode:function(t){const r=Ge([Uint8Array.from([e]),t.pubkey]),n=t.path.split("/"),i=new Uint8Array(4*n.length);i.set(t.masterFingerprint,0);let o=4;return n.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),We(i,o,r,"LE"),o+=4}),{key:r,value:i}},check:function(e){return e.pubkey instanceof Uint8Array&&e.masterFingerprint instanceof Uint8Array&&"string"==typeof e.path&&t(e.pubkey)&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Uint8Array; pubkey: Uint8Array; path: string; }",canAddToArray:function(e,t,r){const n=Ke(t.pubkey);return!r.has(n)&&(r.add(n),0===e.filter(e=>0===ze(e.pubkey,t.pubkey)).length)}}}function Kr(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+Ke(t.key));return r}}function $r(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+Ke(t.key));return t.value},encode:function(t){return{key:Uint8Array.from([e]),value:t}},check:function(e){return e instanceof Uint8Array},expected:"Uint8Array",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}const zr=e=>32===e.length;function Yr(e){const t=Gr(e,zr);return{decode:function(e){const{numberValue:r,bytes:n}=Dr(e.value),i=t.decode({key:e.key,value:e.value.slice(n+32*Number(r))}),o=new Array(Number(r));for(let t=0,i=n;t<r;t++,i+=32)o[t]=e.value.slice(i,i+32);return{...i,leafHashes:o}},encode:function(e){const r=t.encode(e),n=Cr(e.leafHashes.length),i=new Uint8Array(n);xr(e.leafHashes.length,i);const o=Ge([i,...e.leafHashes,r.value]);return{...r,value:o}},check:function(e){return Array.isArray(e.leafHashes)&&e.leafHashes.every(e=>e instanceof Uint8Array&&32===e.length)&&t.check(e)},expected:"{ masterFingerprint: Uint8Array; pubkey: Uint8Array; path: string; leafHashes: Uint8Array[]; }",canAddToArray:t.canAddToArray}}function Wr(e){return{decode:function(t){if(t.key[0]!==e||1!==t.key.length)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+Ke(t.key));if(32!==t.value.length)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return t.value},encode:function(t){return{key:Uint8Array.from([e]),value:t}},check:function(e){return e instanceof Uint8Array&&32===e.length},expected:"Uint8Array",canAdd:function(e,t){return!!e&&!!t&&void 0===e.tapInternalKey}}}function Jr(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+Ke(t.key));return t.value},encode:function(t){return{key:Uint8Array.from([e]),value:t}},check:function(e){return e instanceof Uint8Array},expected:"Uint8Array",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}Gr(Fr.BIP32_DERIVATION),$r(Fr.REDEEM_SCRIPT),Jr(Fr.WITNESS_SCRIPT),Kr([Fr.PARTIAL_SIG,Fr.BIP32_DERIVATION]),Yr(Fr.TAP_BIP32_DERIVATION),Wr(Fr.TAP_INTERNAL_KEY),Gr(Hr.BIP32_DERIVATION),$r(Hr.REDEEM_SCRIPT),Jr(Hr.WITNESS_SCRIPT),Kr([Hr.BIP32_DERIVATION]),Yr(Hr.TAP_BIP32_DERIVATION),Wr(Hr.TAP_INTERNAL_KEY);var qr,Xr={exports:{}};var Qr,Zr=(qr||(qr=1,Qr=Xr,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA3_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof y&&y.versions&&y.versions.node?r=g:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&Qr.exports,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),a=[4,1024,262144,67108864],c=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],f=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!o||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var p=function(e,t,r){return function(n){return new R(e,t,e).update(n)[r]()}},E=function(e,t,r){return function(n,i){return new R(e,t,i).update(n)[r]()}},m=function(e,t,r){return function(t,n,i,o){return I["cshake"+e].update(t,n,i,o)[r]()}},_=function(e,t,r){return function(t,n,i,o){return I["kmac"+e].update(t,n,i,o)[r]()}},w=function(e,t,r,n){for(var i=0;i<l.length;++i){var o=l[i];e[o]=t(r,n,o)}return e},b=function(e,t){var r=p(e,t,"hex");return r.create=function(){return new R(e,t,e)},r.update=function(e){return r.create().update(e)},w(r,p,e,t)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(e,t){var r=E(e,t,"hex");return r.create=function(r){return new R(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},w(r,E,e,t)}},{name:"cshake",padding:a,bits:f,createMethod:function(e,t){var r=d[e],n=m(e,0,"hex");return n.create=function(n,i,o){return i||o?new R(e,t,n).bytepad([i,o],r):I["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},w(n,m,e,t)}},{name:"kmac",padding:a,bits:f,createMethod:function(e,t){var r=d[e],n=_(e,0,"hex");return n.create=function(n,i,o){return new k(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},w(n,_,e,t)}}],I={},A=[],T=0;T<P.length;++T)for(var O=P[T],v=O.bits,S=0;S<v.length;++S){var N=O.name+"_"+v[S];if(A.push(N),I[N]=O.createMethod(v[S],O.padding),"sha3"!==O.name){var U=O.name+v[S];A.push(U),I[U]=I[N]}}function R(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function k(e,t,r){R.call(this,e,t,r)}R.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,s,a=this.blocks,u=this.byteCount,h=t.length,f=this.blockCount,l=0,d=this.s;l<h;){if(this.reset)for(this.reset=!1,a[0]=this.block,i=1;i<f+1;++i)a[i]=0;if(r)for(i=this.start;l<h&&i<u;++l)a[i>>2]|=t[l]<<c[3&i++];else for(i=this.start;l<h&&i<u;++l)(s=t.charCodeAt(l))<128?a[i>>2]|=s<<c[3&i++]:s<2048?(a[i>>2]|=(192|s>>6)<<c[3&i++],a[i>>2]|=(128|63&s)<<c[3&i++]):s<55296||s>=57344?(a[i>>2]|=(224|s>>12)<<c[3&i++],a[i>>2]|=(128|s>>6&63)<<c[3&i++],a[i>>2]|=(128|63&s)<<c[3&i++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++l)),a[i>>2]|=(240|s>>18)<<c[3&i++],a[i>>2]|=(128|s>>12&63)<<c[3&i++],a[i>>2]|=(128|s>>6&63)<<c[3&i++],a[i>>2]|=(128|63&s)<<c[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=a[f],i=0;i<f;++i)d[i]^=a[i];B(d),this.reset=!0}else this.start=i}return this},R.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,s=t.length;if(r)i=s;else for(var a=0;a<t.length;++a){var c=t.charCodeAt(a);c<128?i+=1:c<2048?i+=2:c<55296||c>=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++a)),i+=4)}return i+=this.encode(8*i),this.update(t),i},R.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},R.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];B(n)}},R.prototype.toString=R.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,c="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],c+=s[e>>4&15]+s[15&e]+s[e>>12&15]+s[e>>8&15]+s[e>>20&15]+s[e>>16&15]+s[e>>28&15]+s[e>>24&15];a%t===0&&(B(r),o=0)}return i&&(e=r[o],c+=s[e>>4&15]+s[15&e],i>1&&(c+=s[e>>12&15]+s[e>>8&15]),i>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},R.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)c[s]=r[o];s%t===0&&B(r)}return i&&(c[o]=r[o],e=e.slice(0,a)),e},R.prototype.buffer=R.prototype.arrayBuffer,R.prototype.digest=R.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,c=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r===0&&B(n)}return o&&(e=a<<2,t=n[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},k.prototype=new R,k.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var B=function(e){var t,r,n,i,o,s,a,c,h,f,l,d,p,y,g,E,m,_,w,b,P,I,A,T,O,v,S,N,U,R,k,B,M,L,x,D,C,V,F,H,j,G,K,$,z,Y,W,J,q,X,Q,Z,ee,te,re,ne,ie,oe,se,ae,ce,ue,he;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],h=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|h>>>31),r=o^(h<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(f<<1|l>>>31),r=a^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(d<<1|p>>>31),r=h^(p<<1|d>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,y=e[0],g=e[1],Y=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,N=e[20]<<3|e[21]>>>29,U=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,x=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,k=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,he=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,C=e[15]<<6|e[14]>>>26,_=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,B=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,T=e[6]<<28|e[7]>>>4,O=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,V=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,b=e[36]<<21|e[37]>>>11,P=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,$=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,v=e[18]<<20|e[19]>>>12,S=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,j=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=y^~E&_,e[1]=g^~m&w,e[10]=T^~v&N,e[11]=O^~S&U,e[20]=L^~D&V,e[21]=x^~C&F,e[30]=$^~Y&J,e[31]=z^~W&q,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~_&b,e[3]=m^~w&P,e[12]=v^~N&R,e[13]=S^~U&k,e[22]=D^~V&H,e[23]=C^~F&j,e[32]=Y^~J&X,e[33]=W^~q&Q,e[42]=ne^~oe&ae,e[43]=ie^~se&ce,e[4]=_^~b&I,e[5]=w^~P&A,e[14]=N^~R&B,e[15]=U^~k&M,e[24]=V^~H&G,e[25]=F^~j&K,e[34]=J^~X&Z,e[35]=q^~Q&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&he,e[6]=b^~I&y,e[7]=P^~A&g,e[16]=R^~B&T,e[17]=k^~M&O,e[26]=H^~G&L,e[27]=j^~K&x,e[36]=X^~Z&$,e[37]=Q^~ee&z,e[46]=ae^~ue&te,e[47]=ce^~he&re,e[8]=I^~y&E,e[9]=A^~g&m,e[18]=B^~T&v,e[19]=M^~O&S,e[28]=G^~L&D,e[29]=K^~x&C,e[38]=Z^~$&Y,e[39]=ee^~z&W,e[48]=ue^~te&ne,e[49]=he^~re&ie,e[0]^=u[n],e[1]^=u[n+1]};if(i)Qr.exports=I;else for(T=0;T<A.length;++T)r[A[T]]=I[A[T]]}()),Xr.exports),en=h(Zr);let tn=!1,rn=!1;const nn={debug:1,default:2,info:2,warning:3,error:4,off:5};let on=nn.default,sn=null;const an=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var cn,un;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(cn||(cn={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(un||(un={}));const hn="0123456789abcdef";class fn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==nn[r]&&this.throwArgumentError("invalid log level name","logLevel",e),on>nn[r]||console.log.apply(console,t)}debug(...e){this._log(fn.levels.DEBUG,e)}info(...e){this._log(fn.levels.INFO,e)}warn(...e){this._log(fn.levels.WARNING,e)}makeError(e,t,r){if(rn)return this.makeError("censored error",t,{});t||(t=fn.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach(e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=hn[t[e]>>4],r+=hn[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case un.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case un.CALL_EXCEPTION:case un.INSUFFICIENT_FUNDS:case un.MISSING_NEW:case un.NONCE_EXPIRED:case un.REPLACEMENT_UNDERPRICED:case un.TRANSACTION_REPLACED:case un.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,fn.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){an&&this.throwError("platform missing String.prototype.normalize",fn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:an})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,fn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,fn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,fn.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,fn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",fn.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",fn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",fn.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return sn||(sn=new fn("logger/5.8.0")),sn}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",fn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),tn){if(!e)return;this.globalLogger().throwError("error censorship permanent",fn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}rn=!!e,tn=!!t}static setLogLevel(e){const t=nn[e.toLowerCase()];null!=t?on=t:fn.globalLogger().warn("invalid log level - "+e)}static from(e){return new fn(e)}}fn.errors=un,fn.levels=cn;const ln=new fn("bytes/5.8.0");function dn(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return dn(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function pn(e){return"number"==typeof e&&e==e&&e%1==0}function yn(e,t){if(t||(t={}),"number"==typeof e){ln.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),dn(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e){if("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))return!1;return!0}(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":ln.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return dn(new Uint8Array(n))}return function(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!pn(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!pn(r)||r<0||r>=256)return!1}return!0}(e)?dn(new Uint8Array(e)):ln.throwArgumentError("invalid arrayify value","value",e)}function gn(e,t){const r=a,n=e.toString("hex"),i=r.from(l.fromHex(n).toBytes(!1)).toString("hex").slice(2);var o;return`0x${(o=r.from(i,"hex"),"0x"+en.keccak_256(yn(o))).slice(26).toString()}`}async function En(e,t){let r;"publicKeyJwk"in e?r=Me(e.publicKeyJwk):void 0!==e.publicKeyMultibase&&(r=await(async({publicKeyMultibase:e})=>{const t=await P({keyPair:{publicKeyMultibase:e}});return Me(t)})(e));const n=Te("errors","identityErrorBaseMessage");let i="";switch(t.code){case u.Bitcoin:case u.Mocknet:case u.Testnet:i=function(e,t){return Rr({pubkey:e,network:De[t.code]}).address}(r,t);break;case u.Ethmain:case u.Ethropst:case u.Ethrinkeby:case u.Ethgoerli:case u.Ethsepolia:i=gn(r);break;default:throw new Pe("deriveIssuingAddressFromPublicKey",`${n} - ${Te("errors","deriveIssuingAddressFromPublicKey")}`)}return i}function mn(e){if(e){const t="string"==typeof e?e:e.code;return!!Object.keys(s).some(e=>e===t)&&!!s[t].test}return!1}const{LinkedDataProof:_n}=m.suites;class wn extends _n{challenge;domain;type="MerkleProof2019";issuer=null;issuerEndpoint="";verificationMethod=null;externalProof=null;proof=null;proofValue=null;proofPurpose;document=null;explorerAPIs=[];chain;txData;localDocumentHash;derivedIssuingAddress;documentLoader=null;proofVerificationProcess=["assertProofValidity","getTransactionId","computeLocalHash","fetchRemoteHash","compareHashes","checkMerkleRoot","checkReceipt"];identityVerificationProcess=["deriveIssuingAddressFromPublicKey","ensureVerificationMethodValidity","compareIssuingAddress"];transactionId="";constructor({issuer:e=null,verificationMethod:t=null,document:r=null,proof:n=null,options:i={},proofPurpose:o="assertionMethod",domain:s=[],challenge:a=""}){super({type:"MerkleProof2019"}),this.issuer=e,this.verificationMethod=t,this.document=r,this.proofPurpose=o,this.domain=Array.isArray(s)?s:[s],this.challenge=a,this.externalProof=n,this.setOptions(i),(this.externalProof||this.document)&&(this.setProof(this.externalProof),this.getChain(),mn(this.chain)&&(this.adaptProofVerificationProcessToMocknet(),this.adaptIdentityVerificationProcessToMocknet()))}static decodeMerkleProof2019(e){return new me(e.proofValue).decode()}createVerifier(){}createVerifyData(){}setProof(e=null){const t=e??this.document.proof;if(!t)throw new Error("The passed document is not signed.");this.proof=t,this.proofValue=wn.decodeMerkleProof2019(this.proof)}async verifyProof({documentLoader:e,verifyIdentity:t,document:r,proof:n}={documentLoader:e=>{},verifyIdentity:!0}){let i;this.documentLoader=e;let o="";if(r&&(this.document=r),n&&this.setProof(n),this.getChain(),mn(this.chain)&&(this.adaptProofVerificationProcessToMocknet(),this.adaptIdentityVerificationProcessToMocknet()),!this.document)throw new Error("A document signed by MerkleProof2019 is required for the verification process.");try{await this.verifyProcess(this.proofVerificationProcess),t&&await this.verifyIdentity(),i=!0}catch(e){console.error(e),i=!1,o=e.message}return{verificationMethod:this.verificationMethod,verified:i,error:o}}async createProof({document:e,purpose:t="assertionMethod"}){if(!this.issuerEndpoint)throw new Error("No issuer endpoint provided. Please set the issuerEndpoint option when instantiating the suite.");const r=await fetch(this.issuerEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:e})}).then(e=>e.json()).catch(e=>{console.error(e)});if(r.verifiableCredential)return r.verifiableCredential.proof;console.error("An error occurred while creating the proof:",r)}async createProofValue({document:e}){const t=await this.createProof({document:e});return t?t.proofValue:"error creating proof"}ensureSuiteContext(){}async verifyIdentity(){if(null!=this.verificationMethod)try{await this.verifyProcess(this.identityVerificationProcess)}catch(e){throw new Error(e)}}getProofVerificationProcess(){return this.proofVerificationProcess}getIdentityVerificationProcess(){return this.identityVerificationProcess}getIssuerPublicKey(){return mn(this.chain)?"This mock chain does not support issuing addresses":this.getTxData()?.issuingAddress??""}getIssuanceTime(){return this.getTxData()?.time??""}getChain(){return this.chain||(this.chain=we(this.proofValue)),this.chain}getTxData(){return this.txData?this.txData:(console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?"),null)}adaptProofVerificationProcessToMocknet(){be(this.proofVerificationProcess,"getTransactionId"),be(this.proofVerificationProcess,"fetchRemoteHash"),be(this.proofVerificationProcess,"checkMerkleRoot")}adaptIdentityVerificationProcessToMocknet(){this.identityVerificationProcess=["ensureVerificationMethodValidity"]}setOptions(e){this.explorerAPIs=e.explorerAPIs??[],e.executeStepMethod&&"function"==typeof e.executeStepMethod&&(this.executeStep=e.executeStepMethod),this.issuerEndpoint=e.issuerEndpoint??""}async executeStep(e,t,r=""){return await t()}async verifyProcess(e){for(const t of e){if(!this[t])return void console.error("verification logic for",t,"not implemented");await this[t]()}}async assertProofValidity(){await this.executeStep("assertProofValidity",()=>Oe({expectedProofPurpose:this.proofPurpose,expectedDomain:this.domain,expectedChallenge:this.challenge,proof:this.proof,issuer:this.issuer}),this.type)}async checkMerkleRoot(){await this.executeStep("checkMerkleRoot",()=>function(e,t){if(e!==t)throw new Pe("checkMerkleRoot",Te("errors","ensureMerkleRootEqual"));return!0}(this.proofValue.merkleRoot,this.txData.remoteHash),this.type)}async compareHashes(){await this.executeStep("compareHashes",()=>function(e,t){if(e!==t)throw new Pe("compareHashes",Te("errors","ensureHashesEqual"));return!0}(this.localDocumentHash,this.proofValue.targetHash),this.type)}async computeLocalHash(){this.localDocumentHash=await this.executeStep("computeLocalHash",async()=>await ke(this.document,this.proof,this.documentLoader),this.type)}async checkReceipt(){await this.executeStep("checkReceipt",()=>{!function(e){let t=e.targetHash;const r=e.merkleRoot;try{const r=e.path;if(r&&t)for(const e in r){const n=r[e];let i;if(void 0!==n.left)i=Re(`${n.left}${t}`),t=a.from(b(Uint8Array.from(i))).toString("hex");else{if(void 0===n.right)throw new Pe("checkReceipt","Trigger catch error.");i=Re(`${t}${n.right}`),t=a.from(b(Uint8Array.from(i))).toString("hex")}}}catch(e){throw new Pe("checkReceipt",Te("errors","ensureValidReceipt"))}if(t!==r)throw new Pe("checkReceipt",Te("errors","invalidMerkleReceipt"))}(this.proofValue)},this.type)}async getTransactionId(){this.transactionId=function(e=null){if(!e)throw new Error("DecodedProof is not set");const{anchors:t}=e,r=t[0];if("string"==typeof r)return r.split(":").pop();throw new Error("Could not retrieve transaction id as was provided an unexpected format")}(this.proofValue);return await this.executeStep("getTransactionId",()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new Pe("getTransactionId",Te("errors","isTransactionIdValid"))}(this.transactionId),this.type)}async fetchRemoteHash(){this.txData=await this.executeStep("fetchRemoteHash",async()=>await o({transactionId:this.transactionId,chain:this.chain?.code,explorerAPIs:this.explorerAPIs}),this.type)}async deriveIssuingAddressFromPublicKey(){this.derivedIssuingAddress=await this.executeStep("deriveIssuingAddressFromPublicKey",async()=>await En(this.verificationMethod,this.chain),this.type)}async ensureVerificationMethodValidity(){await this.executeStep("ensureVerificationMethodValidity",async()=>{if(this.verificationMethod.expires){if(new Date(this.verificationMethod.expires).getTime()<Date.now())throw new Pe("ensureVerificationMethodValidity","The verification key has expired")}if(this.verificationMethod.revoked)throw new Pe("ensureVerificationMethodValidity","The verification key has been revoked")},this.type)}async compareIssuingAddress(){await this.executeStep("compareIssuingAddress",()=>{!function(e,t){const r=Te("errors","identityErrorBaseMessage");if(e.toLowerCase()!==t.toLowerCase())throw new Pe("compareIssuingAddress",`${r} - ${Te("errors","compareIssuingAddress")}`)}(this.getIssuerPublicKey(),this.derivedIssuingAddress)},this.type)}}var bn;function Pn(e){return wn.decodeMerkleProof2019(e)}!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkImagesIntegrity="checkImagesIntegrity",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",e.ensureVerificationMethodValidity="ensureVerificationMethodValidity",e.deriveIssuingAddressFromPublicKey="deriveIssuingAddressFromPublicKey",e.compareIssuingAddress="compareIssuingAddress",e.checkAuthenticity="checkAuthenticity"}(bn||(bn={}));class In extends T{proofVerificationProcess=[bn.parseIssuerKeys,bn.checkAuthenticity];transactionId;localHash;documentToVerify;txData;chain;explorerAPIs;receipt;issuerPublicKeyList;issuer;verificationMethod;derivedIssuingAddress;hasDid;proof;type="MerkleProof2019";cryptosuite="merkle-proof-2019";suite;proofPurpose;proofDomain;proofChallenge;constructor(e){super(e),this.executeStep=e.executeStep,this.documentToVerify=e.document,this.explorerAPIs=e.explorerAPIs,this.proof=e.proof,this.issuer=e.issuer,this.proofPurpose=e.proofPurpose,this.proofDomain=e.proofDomain,this.proofChallenge=e.proofChallenge,this.validateProofType(),this.receipt=Pn(this.proof),this.transactionId=t.certificates.getTransactionId(this.receipt),this.setHasDid()}async init(){await this.setVerificationSuite(),this.chain=this.suite.getChain(),this.adaptVerificationProcessToChain()}async verifyProof(){await this.suite.verifyProof({verifyIdentity:!1}),await this.verifyProcess(this.proofVerificationProcess)}async verifyIdentity(){await this.suite.verifyIdentity()}getProofVerificationSteps(e){return[...this.suite.getProofVerificationProcess(),...this.proofVerificationProcess].map(r=>t.verifier.convertToVerificationSubsteps(e,r))}getIdentityVerificationSteps(e){return this.hasDid?this.suite.getIdentityVerificationProcess().map(r=>t.verifier.convertToVerificationSubsteps(e,r)):[]}getIssuerPublicKey(){return this.suite.getIssuerPublicKey()}getIssuanceTime(){return this.suite.getIssuanceTime()}getIssuerName(){return this.issuer.name}getIssuerProfileDomain(){const e=new URL(this.getIssuerProfileUrl());return e?.hostname}getIssuerProfileUrl(){return this.issuer.id}getSigningDate(){return this.proof.created}getChain(){return this.suite.getChain()}getReceipt(){return this.receipt}getTransactionIdString(){return t.certificates.getTransactionId(this.getReceipt())}getTransactionLink(){return t.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}getRawTransactionLink(){return t.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}async executeStep(e,t,r){throw new Error("executeStep method needs to be overwritten by injecting from Verifier")}async setVerificationSuite(){await this.setIssuerFromProofVerificationMethod(),this.verificationMethod=A(this.getTargetVerificationMethodContainer(),r(this.proof)),this.suite=new wn({document:this.documentToVerify,proof:this.proof,verificationMethod:this.verificationMethod,proofPurpose:this.proofPurpose,domain:this.proofDomain,challenge:this.proofChallenge,options:{explorerAPIs:this.explorerAPIs,executeStepMethod:this.executeStep}})}adaptVerificationProcessToChain(){t.chains.isMockChain(this.chain)&&(n(this.proofVerificationProcess,bn.parseIssuerKeys),n(this.proofVerificationProcess,bn.checkAuthenticity))}getTargetVerificationMethodContainer(){if(this.issuer.didDocument)return this.issuer.didDocument;const e={...this.issuer};return delete e.didDocument,e}findVerificationMethod(e,t){return e?.find(e=>e.id===this.proof.verificationMethod||t+e.id===this.proof.verificationMethod)??null}isProofChain(){return"ChainedProof2021"===this.proof.type}isMultipleProof(){return Array.isArray(this.documentToVerify.proof)}getProofIndex(){return this.isMultipleProof()?this.documentToVerify.proof.findIndex(e=>e.proofValue===this.proof.proofValue):-1}async setIssuerFromProofVerificationMethod(){if(this.getProofIndex()>0){const e=this.proof.verificationMethod.split("#")[0];this.issuer=await t.verifier.getIssuerProfile(e)}}setHasDid(){if(this.getProofIndex()>0){const e=this.proof.verificationMethod.split("#")[0];return void(this.hasDid=i(e))}this.hasDid=!!this.issuer.didDocument}validateProofType(){const e=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if("DataIntegrityProof"===e){const e=this.proof.cryptosuite;if(!e)throw new Error(`Malformed proof passed. With DataIntegrityProof a cryptosuite must be defined. Expected: ${this.cryptosuite}`);if(e!==this.cryptosuite)throw new Error(`Incompatible proof cryptosuite passed. Expected: ${this.cryptosuite}, Got: ${e}`);return}if(e!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${e}`)}async verifyProcess(e){for(const t of e){if(!this[t])return void console.error("verification logic for",t,"not implemented");await this[t]()}}async parseIssuerKeys(){this.issuerPublicKeyList=await this.executeStep(bn.parseIssuerKeys,()=>t.verifier.parseIssuerKeys(this.issuer),this.type)}async checkAuthenticity(){await this.executeStep(bn.checkAuthenticity,()=>{w(this.issuerPublicKeyList,this.getIssuerPublicKey(),this.getIssuanceTime())},this.type)}}export{In as default,Pn as parseReceipt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class s{constructor(s){}}export{s as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(r,t){for(var n=0,e=r.length-1;e>=0;e--){var i=r[e];"."===i?r.splice(e,1):".."===i?(r.splice(e,1),n++):n&&(r.splice(e,1),n--)}if(t)for(;n--;n)r.unshift("..");return r}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,n=function(r){return t.exec(r).slice(1)};function e(){for(var t="",n=!1,e=arguments.length-1;e>=-1&&!n;e--){var i=e>=0?arguments[e]:"/";if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(t=i+"/"+t,n="/"===i.charAt(0))}return(n?"/":"")+(t=r(p(t.split("/"),function(r){return!!r}),!n).join("/"))||"."}function i(t){var n=u(t),e="/"===v(t,-1);return(t=r(p(t.split("/"),function(r){return!!r}),!n).join("/"))||n||(t="."),t&&e&&(t+="/"),(n?"/":"")+t}function u(r){return"/"===r.charAt(0)}function s(){return i(p(Array.prototype.slice.call(arguments,0),function(r,t){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))}function o(r,t){function n(r){for(var t=0;t<r.length&&""===r[t];t++);for(var n=r.length-1;n>=0&&""===r[n];n--);return t>n?[]:r.slice(t,n-t+1)}r=e(r).substr(1),t=e(t).substr(1);for(var i=n(r.split("/")),u=n(t.split("/")),s=Math.min(i.length,u.length),o=s,f=0;f<s;f++)if(i[f]!==u[f]){o=f;break}var l=[];for(f=o;f<i.length;f++)l.push("..");return(l=l.concat(u.slice(o))).join("/")}var f="/",l=":";function a(r){var t=n(r),e=t[0],i=t[1];return e||i?(i&&(i=i.substr(0,i.length-1)),e+i):"."}function c(r,t){var e=n(r)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e}function h(r){return n(r)[3]}var g={extname:h,basename:c,dirname:a,sep:"/",delimiter:":",relative:o,join:s,isAbsolute:u,normalize:i,resolve:e};function p(r,t){if(r.filter)return r.filter(t);for(var n=[],e=0;e<r.length;e++)t(r[e],e,r)&&n.push(r[e]);return n}var v="b"==="ab".substr(-1)?function(r,t,n){return r.substr(t,n)}:function(r,t,n){return t<0&&(t=r.length+t),r.substr(t,n)};export{c as basename,g as default,l as delimiter,a as dirname,h as extname,u as isAbsolute,s as join,i as normalize,o as relative,e as resolve,f as sep};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{V as t,y as e,d as n,C as i,z as o,A as r,D as s,u as a,t as c}from"./main.js";import{g as u,u as f}from"./index-Jn9Q6fuB-uChPhl1c.js";import"./jsonld-DqC1oHcn-ruRlORc0.js";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
|
|
4
|
+
*/function d(t,e){if("number"!=typeof t)throw new TypeError(`"${e}" must be number.`)}function h(t,e){if(!(Number.isInteger(t)&&t>0))throw new TypeError(`"${e}" must be a positive integer.`)}function l(t,e){if("boolean"!=typeof t)throw new TypeError(`"${e}" must be a boolean.`)}function w(t,e){if(!(t instanceof Uint8Array))throw new TypeError(`"${e}" must be a Uint8Array.`)}
|
|
5
|
+
/*!
|
|
6
|
+
* Copyright (c) 2020-2023 Digital Bazaar, Inc. All rights reserved.
|
|
7
|
+
*/class y{constructor({length:t,buffer:e,leftToRightIndexing:n,littleEndianBits:i}={}){if(t&&e)throw new Error('Only one of "length" or "buffer" must be given.');if(void 0!==t?h(t,"length"):w(e,"buffer"),void 0!==i){if(void 0!==n)throw new Error('Using both "littleEndianBits" and "leftToRightIndexing" is not allowed.');l(i,"littleEndianBits"),n=i}void 0===n?n=!0:l(n,"leftToRightIndexing"),t?(this.bits=new Uint8Array(Math.ceil(t/8)),this.length=t):(this.bits=new Uint8Array(e.buffer),this.length=8*e.length),this.leftToRightIndexing=n}set(t,e){d(t,"position"),l(e,"on");const{length:n,leftToRightIndexing:i}=this,{index:o,bit:r}=g(t,n,i);e?this.bits[o]|=r:this.bits[o]&=255^r}get(t){d(t,"position");const{length:e,leftToRightIndexing:n}=this,{index:i,bit:o}=g(t,e,n);return!!(this.bits[i]&o)}async encodeBits(){return a(u(this.bits))}static async decodeBits({encoded:t}){return function(t,e){if("string"!=typeof t)throw new TypeError(`"${e}" must be a string.`)}(t,"encoded"),f(c(t))}async compressBits(){return u(this.bits)}static async uncompressBits({compressed:t}){return w(t,"compressed"),f(t)}}function g(t,e,n){if(function(t,e){if(!(Number.isInteger(t)&&t>=0))throw new TypeError(`"${e}" must be a non-negative integer.`)}(t,"position"),h(e,"length"),l(n,"leftToRightIndexing"),t>=e)throw new Error(`Position "${t}" is out of range "0-${e-1}".`);const i=t%8;return{index:Math.floor(t/8),bit:1<<(n?7-i:i)}}
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
|
|
10
|
+
*/class p{constructor({length:t,buffer:e}={}){this.bitstring=new y({length:t,buffer:e}),this.length=this.bitstring.length}setRevoked(t,e){if("boolean"!=typeof e)throw new TypeError('"revoked" must be a boolean.');return this.bitstring.set(t,e)}isRevoked(t){return this.bitstring.get(t)}async encode(){return this.bitstring.encodeBits()}static async decode({encodedList:t}){const e=await y.decodeBits({encoded:t});return new p({buffer:e})}}
|
|
11
|
+
/*!
|
|
12
|
+
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
|
|
13
|
+
*/async function b({encodedList:t}){return p.decode({encodedList:t})}function v(t){const e=t?.credentialSubject?.ttl;return"number"==typeof e?e:void 0}function m(t){return/^https?:\/\//i.test(t)}function R(i){if("undefined"==typeof process||!process.versions?.node)throw new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","filesystemCacheUnsupported")} ${i}.`)}function S(t){if(!m(t))return t;try{const e=new URL(t);return`${e.origin}${e.pathname}`}catch(e){return t}}function k(i,o){if(!i||"object"!=typeof i||!i.credential||"number"!=typeof i.cachedAt)throw new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","invalidStatusListCacheResponse")} ${S(o)}.`);return i}function T(t,e){const n=new URL(t);return n.searchParams.set("url",e),n.toString()}async function $(i){R(i);const{readFile:o}=await import("fs/promises");let r;try{r=await o(i,"utf-8")}catch(t){if("ENOENT"===t?.code)return{};throw t}try{return JSON.parse(r)}catch(o){throw console.error(o),new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","invalidStatusListCacheResponse")} ${i}.`)}}async function x(i,r){return m(i)?await async function(i,r){let s,a;try{s=await o({url:T(i,r)})}catch(t){return void console.error(t)}if(s){try{a=JSON.parse(s)}catch(o){throw console.error(o),new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","invalidStatusListCacheResponse")} ${S(i)}.`)}return k(a,i)}}(i,r):await async function(e,n){let i;try{i=await $(e)}catch(e){if(e instanceof t)throw e;return void console.error(e)}const o=i[n];if(void 0!==o)return k(o,e)}(i,r)}async function L(e,n,i){m(e)?await async function(t,e,n){try{await o({url:t,method:"POST",body:JSON.stringify({url:e,credential:n,cachedAt:Date.now()})})}catch(t){console.error(t)}}(e,n,i):await async function(e,n,i){R(e);try{const{mkdir:o,writeFile:r}=await import("fs/promises"),{dirname:s}=await import("./_polyfill-node.path-hKwMKLNw-B7aPtphV.js"),a=await $(e).catch(e=>{if(e instanceof t)throw e;return{}});a[n]={credential:i,cachedAt:Date.now()},await o(s(e),{recursive:!0}),await r(e,JSON.stringify(a),"utf-8")}catch(e){if(e instanceof t)throw e;console.error(e)}}(e,n,i)}async function E(i,r){if(r){const t=await x(r,i);if(t&&function(t){const e=v(t.credential);return"number"==typeof e&&Date.now()-t.cachedAt<e}(t))return t.credential}const s=await o({url:i}).catch(o=>{throw console.error(o),new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","noRevocationStatusList2021Found")} ${i}.`)});if(s){let o;try{o=JSON.parse(s)}catch(o){throw console.error(o),new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","noRevocationStatusList2021Found")} ${i}.`)}return r&&"number"==typeof v(o)&&await L(r,i,o),o}return s}async function A(i){const o=new r(i);await o.init();if((await o.verify()).status===s.FAILURE)throw new t(e.checkRevokedStatus,n.i18n.getText("revocation","revocationListAuthenticityFailure"))}async function C(o,r={}){const{statusListCredentialCacheUrl:s}=r;s&&!m(s)&&await async function(t){let e;R(t);try{e=await $(t)}catch(t){return void console.error(t)}let n=!1;const i={};for(const[t,o]of Object.entries(e)){const e=!!o&&"number"==typeof o.cachedAt&&!!o.credential,r=e?v(o.credential):void 0;!e||"number"!=typeof r||Date.now()-o.cachedAt<r?i[t]=o:n=!0}if(n)try{const{writeFile:e}=await import("fs/promises");await e(t,JSON.stringify(i),"utf-8")}catch(t){console.error(t)}}(s),Array.isArray(o)||(o=[o]),o=[...o].sort((t,e)=>"revocation"===t.statusPurpose?-1:"revocation"===e.statusPurpose?1:0);for(const s of o){const o=parseInt(s.statusListIndex,10),a=await E(s.statusListCredential,r.statusListCredentialCacheUrl);if(!a)throw new t(e.checkRevokedStatus,`${n.i18n.getText("revocation","noRevocationStatusList2021Found")} ${s.statusListCredential}.`);await A(a);const{encodedList:c}=a.credentialSubject;if((await b({encodedList:c})).isRevoked(o)){const o="revocation"===s.statusPurpose?i.REVOKED:i.SUSPENDED;throw new t(e.checkRevokedStatus,n.certificates.generateRevocationReason("",o))}}}export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r}from"./index-BCu3PGuw-Dh4-8Ruv.js";import{z as o,V as a,y as e,g as t}from"./main.js";async function s(s,c){Array.isArray(c)||(c=[c]),Array.isArray(s)||(s=[s]);for(const i of c){const c=await o({url:i.id});let n;try{n=JSON.parse(c)}catch(r){throw console.error(r),new Error(`Specified schema at url: ${i.id} could not be parsed`)}const f=r.validator(n);for(const r of s){if(!f(r))throw new a(e.checkCredentialSchemaConformity,t("errors","checkCredentialSchemaConformity"))}}}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as o,
|
|
1
|
+
import{V as o,y as t,d as i}from"./main.js";import{b as r}from"./index-KzSDgEl9-Dgus2xdV.js";function n(n,e=""){const s=function(o){return o.id}(n);if(s!==e.split("#")[0])throw new o(t.controlVerificationMethod,`${r} - ${i.i18n.getText("errors","controlVerificationMethod")}`)}export{n as default};
|
|
@@ -224,7 +224,7 @@ function(A){var t=function(A){var t,e,r,n,i,s,o,a,c,u;for(e=[],r=0,n=(A+=t="\0\0
|
|
|
224
224
|
* Licensed under the MIT License.
|
|
225
225
|
* http://opensource.org/licenses/mit-license
|
|
226
226
|
*/
|
|
227
|
-
function(A){A.loadFile=function(A,t,e){return function(A,t,e){t=!1!==t,e="function"==typeof e?e:function(){};var r=void 0;try{r=function(A,t,e){var r=new XMLHttpRequest,n=0,i=function(A){var t=A.length,e=[],r=String.fromCharCode;for(n=0;n<t;n+=1)e.push(r(255&A.charCodeAt(n)));return e.join("")};if(r.open("GET",A,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?e(i(this.responseText)):e(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(A,t,e)}catch(A){}return r}(A,t,e)},A.allowFsRead=void 0,A.loadImageFile=A.loadFile}(Oe.API),function(A){function t(){return(se.html2canvas?Promise.resolve(se.html2canvas):Promise.resolve().then(function(){return Kn})).catch(function(A){return Promise.reject(new Error("Could not load html2canvas: "+A))}).then(function(A){return A.default?A.default:A})}function e(){return(se.DOMPurify?Promise.resolve(se.DOMPurify):import("./purify.es-Om653OSQ.js")).catch(function(A){return Promise.reject(new Error("Could not load dompurify: "+A))}).then(function(A){return A.default?A.default:A})}var r=function(A){var t=o(A);return"undefined"===t?"undefined":"string"===t||A instanceof String?"string":"number"===t||A instanceof Number?"number":"function"===t||A instanceof Function?"function":A&&A.constructor===Array?"array":A&&1===A.nodeType?"element":"object"===t?"object":"unknown"},n=function(A,t){var e=document.createElement(A);for(var r in t.className&&(e.className=t.className),t.innerHTML&&t.dompurify&&(e.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)e.style[r]=t.style[r];return e},i=function A(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;n=n.nextSibling)!0!==e&&1===n.nodeType&&"SCRIPT"===n.nodeName||r.appendChild(A(n,e));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},s=function A(t){var e=Object.assign(A.convert(Promise.resolve()),JSON.parse(JSON.stringify(A.template))),r=A.convert(Promise.resolve(),e);return(r=r.setProgress(1,A,1,[A])).set(t)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(A,t){return A.__proto__=t||s.prototype,A},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(A,t){return this.then(function(){switch(t=t||function(A){switch(r(A)){case"string":return"string";case"element":return"canvas"===A.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(A),t){case"string":return this.then(e).then(function(t){return this.set({src:n("div",{innerHTML:A,dompurify:t})})});case"element":return this.set({src:A});case"canvas":return this.set({canvas:A});case"img":return this.set({img:A});default:return this.error("Unknown source type.")}})},s.prototype.to=function(A){switch(A){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var A={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(A.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:A}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then(function(A){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,A(this.prop.container,t)}).then(function(A){(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then(function(A){var t=this.opt.jsPDF,e=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,n=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete n.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=e,e)for(var i=0;i<e.length;++i){var s=e[i],o=s.src.find(function(A){return"truetype"===A.format});o&&t.addFont(o.url,s.ref.name,s.ref.style)}return n.windowHeight=n.windowHeight||0,n.windowHeight=0==n.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):n.windowHeight,t.context2d.save(!0),A(this.prop.container,n)}).then(function(A){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var A=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=A})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(A,t,e){return"img"===(e=e||"pdf").toLowerCase()||"image"===e.toLowerCase()?this.outputImg(A,t):this.outputPdf(A,t)},s.prototype.outputPdf=function(A,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(A,t)})},s.prototype.outputImg=function(A){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(A){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+A+'" is not supported.'}})},s.prototype.save=function(A){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(A?{filename:A}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(A){if("object"!==r(A))return this;var t=Object.keys(A||{}).map(function(t){if(t in s.template.prop)return function(){this.prop[t]=A[t]};switch(t){case"margin":return this.setMargin.bind(this,A.margin);case"jsPDF":return function(){return this.opt.jsPDF=A.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,A.pageSize);default:return function(){this.opt[t]=A[t]}}},this);return this.then(function(){return this.thenList(t)})},s.prototype.get=function(A,t){return this.then(function(){var e=A in s.template.prop?this.prop[A]:this.opt[A];return t?t(e):e})},s.prototype.setMargin=function(A){return this.then(function(){switch(r(A)){case"number":A=[A,A,A,A];case"array":if(2===A.length&&(A=[A[0],A[1],A[0],A[1]]),4===A.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=A}).then(this.setPageSize)},s.prototype.setPageSize=function(A){function t(A,t){return Math.floor(A*t/72*96)}return this.then(function(){(A=A||Oe.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(A.inner={width:A.width-this.opt.margin[1]-this.opt.margin[3],height:A.height-this.opt.margin[0]-this.opt.margin[2]},A.inner.px={width:t(A.inner.width,A.k),height:t(A.inner.height,A.k)},A.inner.ratio=A.inner.height/A.inner.width),this.prop.pageSize=A})},s.prototype.setProgress=function(A,t,e,r){return null!=A&&(this.progress.val=A),null!=t&&(this.progress.state=t),null!=e&&(this.progress.n=e),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(A,t,e,r){return this.setProgress(A?this.progress.val+A:null,t||null,e?this.progress.n+e:null,r?this.progress.stack.concat(r):null)},s.prototype.then=function(A,t){var e=this;return this.thenCore(A,t,function(A,t){return e.updateProgress(null,null,1,[A]),Promise.prototype.then.call(this,function(t){return e.updateProgress(null,A),t}).then(A,t).then(function(A){return e.updateProgress(1),A})})},s.prototype.thenCore=function(A,t,e){e=e||Promise.prototype.then;var r=this;A&&(A=A.bind(r)),t&&(t=t.bind(r));var n=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:s.convert(Object.assign({},r),Promise.prototype),i=e.call(n,A,t);return s.convert(i,r.__proto__)},s.prototype.thenExternal=function(A,t){return Promise.prototype.then.call(this,A,t)},s.prototype.thenList=function(A){var t=this;return A.forEach(function(A){t=t.thenCore(A)}),t},s.prototype.catch=function(A){A&&(A=A.bind(this));var t=Promise.prototype.catch.call(this,A);return s.convert(t,this)},s.prototype.catchExternal=function(A){return Promise.prototype.catch.call(this,A)},s.prototype.error=function(A){return this.then(function(){throw new Error(A)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,Oe.getPageSize=function(A,t,e){if("object"===o(A)){var r=A;A=r.orientation,t=r.unit||t,e=r.format||e}t=t||"mm",e=e||"a4",A=(""+(A||"P")).toLowerCase();var n,i=(""+e).toLowerCase(),s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":n=1;break;case"mm":n=72/25.4;break;case"cm":n=72/2.54;break;case"in":n=72;break;case"px":n=.75;break;case"pc":case"em":n=12;break;case"ex":n=6;break;default:throw"Invalid unit: "+t}var a,c=0,u=0;if(s.hasOwnProperty(i))c=s[i][1]/n,u=s[i][0]/n;else try{c=e[1],u=e[0]}catch(A){throw new Error("Invalid format: "+e)}if("p"===A||"portrait"===A)A="p",u>c&&(a=u,u=c,c=a);else{if("l"!==A&&"landscape"!==A)throw"Invalid orientation: "+A;A="l",c>u&&(a=u,u=c,c=a)}return{width:u,height:c,unit:t,k:n,orientation:A}},A.html=function(A,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(kr):null;var e=new s(t);return t.worker?e:e.from(A).doCallback()}}(Oe.API),Oe.API.addJS=function(A){var t,e,r=function(A){for(var t="",e=0;e<A.length;e++){var r=A[e];if("("===r||")"===r){for(var n=0,i=e-1;i>=0&&"\\"===A[i];i--)n++;t+=n%2==0?"\\"+r:r}else t+=r}return t}(A);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==t&&void 0!==e&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this
|
|
227
|
+
function(A){A.loadFile=function(A,t,e){return function(A,t,e){t=!1!==t,e="function"==typeof e?e:function(){};var r=void 0;try{r=function(A,t,e){var r=new XMLHttpRequest,n=0,i=function(A){var t=A.length,e=[],r=String.fromCharCode;for(n=0;n<t;n+=1)e.push(r(255&A.charCodeAt(n)));return e.join("")};if(r.open("GET",A,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?e(i(this.responseText)):e(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(A,t,e)}catch(A){}return r}(A,t,e)},A.allowFsRead=void 0,A.loadImageFile=A.loadFile}(Oe.API),function(A){function t(){return(se.html2canvas?Promise.resolve(se.html2canvas):Promise.resolve().then(function(){return Kn})).catch(function(A){return Promise.reject(new Error("Could not load html2canvas: "+A))}).then(function(A){return A.default?A.default:A})}function e(){return(se.DOMPurify?Promise.resolve(se.DOMPurify):import("./purify.es-C6IIzwyE.js")).catch(function(A){return Promise.reject(new Error("Could not load dompurify: "+A))}).then(function(A){return A.default?A.default:A})}var r=function(A){var t=o(A);return"undefined"===t?"undefined":"string"===t||A instanceof String?"string":"number"===t||A instanceof Number?"number":"function"===t||A instanceof Function?"function":A&&A.constructor===Array?"array":A&&1===A.nodeType?"element":"object"===t?"object":"unknown"},n=function(A,t){var e=document.createElement(A);for(var r in t.className&&(e.className=t.className),t.innerHTML&&t.dompurify&&(e.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)e.style[r]=t.style[r];return e},i=function A(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;n=n.nextSibling)!0!==e&&1===n.nodeType&&"SCRIPT"===n.nodeName||r.appendChild(A(n,e));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft},!0)),r},s=function A(t){var e=Object.assign(A.convert(Promise.resolve()),JSON.parse(JSON.stringify(A.template))),r=A.convert(Promise.resolve(),e);return(r=r.setProgress(1,A,1,[A])).set(t)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(A,t){return A.__proto__=t||s.prototype,A},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(A,t){return this.then(function(){switch(t=t||function(A){switch(r(A)){case"string":return"string";case"element":return"canvas"===A.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(A),t){case"string":return this.then(e).then(function(t){return this.set({src:n("div",{innerHTML:A,dompurify:t})})});case"element":return this.set({src:A});case"canvas":return this.set({canvas:A});case"img":return this.set({img:A});default:return this.error("Unknown source type.")}})},s.prototype.to=function(A){switch(A){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var A={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(A.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:A}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then(function(A){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,A(this.prop.container,t)}).then(function(A){(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then(function(A){var t=this.opt.jsPDF,e=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,n=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete n.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=e,e)for(var i=0;i<e.length;++i){var s=e[i],o=s.src.find(function(A){return"truetype"===A.format});o&&t.addFont(o.url,s.ref.name,s.ref.style)}return n.windowHeight=n.windowHeight||0,n.windowHeight=0==n.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):n.windowHeight,t.context2d.save(!0),A(this.prop.container,n)}).then(function(A){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var A=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=A})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(A,t,e){return"img"===(e=e||"pdf").toLowerCase()||"image"===e.toLowerCase()?this.outputImg(A,t):this.outputPdf(A,t)},s.prototype.outputPdf=function(A,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(A,t)})},s.prototype.outputImg=function(A){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(A){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+A+'" is not supported.'}})},s.prototype.save=function(A){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(A?{filename:A}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(A){if("object"!==r(A))return this;var t=Object.keys(A||{}).map(function(t){if(t in s.template.prop)return function(){this.prop[t]=A[t]};switch(t){case"margin":return this.setMargin.bind(this,A.margin);case"jsPDF":return function(){return this.opt.jsPDF=A.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,A.pageSize);default:return function(){this.opt[t]=A[t]}}},this);return this.then(function(){return this.thenList(t)})},s.prototype.get=function(A,t){return this.then(function(){var e=A in s.template.prop?this.prop[A]:this.opt[A];return t?t(e):e})},s.prototype.setMargin=function(A){return this.then(function(){switch(r(A)){case"number":A=[A,A,A,A];case"array":if(2===A.length&&(A=[A[0],A[1],A[0],A[1]]),4===A.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=A}).then(this.setPageSize)},s.prototype.setPageSize=function(A){function t(A,t){return Math.floor(A*t/72*96)}return this.then(function(){(A=A||Oe.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(A.inner={width:A.width-this.opt.margin[1]-this.opt.margin[3],height:A.height-this.opt.margin[0]-this.opt.margin[2]},A.inner.px={width:t(A.inner.width,A.k),height:t(A.inner.height,A.k)},A.inner.ratio=A.inner.height/A.inner.width),this.prop.pageSize=A})},s.prototype.setProgress=function(A,t,e,r){return null!=A&&(this.progress.val=A),null!=t&&(this.progress.state=t),null!=e&&(this.progress.n=e),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(A,t,e,r){return this.setProgress(A?this.progress.val+A:null,t||null,e?this.progress.n+e:null,r?this.progress.stack.concat(r):null)},s.prototype.then=function(A,t){var e=this;return this.thenCore(A,t,function(A,t){return e.updateProgress(null,null,1,[A]),Promise.prototype.then.call(this,function(t){return e.updateProgress(null,A),t}).then(A,t).then(function(A){return e.updateProgress(1),A})})},s.prototype.thenCore=function(A,t,e){e=e||Promise.prototype.then;var r=this;A&&(A=A.bind(r)),t&&(t=t.bind(r));var n=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?r:s.convert(Object.assign({},r),Promise.prototype),i=e.call(n,A,t);return s.convert(i,r.__proto__)},s.prototype.thenExternal=function(A,t){return Promise.prototype.then.call(this,A,t)},s.prototype.thenList=function(A){var t=this;return A.forEach(function(A){t=t.thenCore(A)}),t},s.prototype.catch=function(A){A&&(A=A.bind(this));var t=Promise.prototype.catch.call(this,A);return s.convert(t,this)},s.prototype.catchExternal=function(A){return Promise.prototype.catch.call(this,A)},s.prototype.error=function(A){return this.then(function(){throw new Error(A)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,Oe.getPageSize=function(A,t,e){if("object"===o(A)){var r=A;A=r.orientation,t=r.unit||t,e=r.format||e}t=t||"mm",e=e||"a4",A=(""+(A||"P")).toLowerCase();var n,i=(""+e).toLowerCase(),s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":n=1;break;case"mm":n=72/25.4;break;case"cm":n=72/2.54;break;case"in":n=72;break;case"px":n=.75;break;case"pc":case"em":n=12;break;case"ex":n=6;break;default:throw"Invalid unit: "+t}var a,c=0,u=0;if(s.hasOwnProperty(i))c=s[i][1]/n,u=s[i][0]/n;else try{c=e[1],u=e[0]}catch(A){throw new Error("Invalid format: "+e)}if("p"===A||"portrait"===A)A="p",u>c&&(a=u,u=c,c=a);else{if("l"!==A&&"landscape"!==A)throw"Invalid orientation: "+A;A="l",c>u&&(a=u,u=c,c=a)}return{width:u,height:c,unit:t,k:n,orientation:A}},A.html=function(A,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(kr):null;var e=new s(t);return t.worker?e:e.from(A).doCallback()}}(Oe.API),Oe.API.addJS=function(A){var t,e,r=function(A){for(var t="",e=0;e<A.length;e++){var r=A[e];if("("===r||")"===r){for(var n=0,i=e-1;i>=0&&"\\"===A[i];i--)n++;t+=n%2==0?"\\"+r:r}else t+=r}return t}(A);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==t&&void 0!==e&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this
|
|
228
228
|
/**
|
|
229
229
|
* @license
|
|
230
230
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
@@ -260,7 +260,7 @@ function(A){A.processWEBP=function(t,e,r,n){var i=new ln(t),s=i.width,o=i.height
|
|
|
260
260
|
* Licensed under the MIT License.
|
|
261
261
|
* http://opensource.org/licenses/mit-license
|
|
262
262
|
*/
|
|
263
|
-
function(A){var t=function(A){for(var t=A.length,e=new Uint8Array(t),r=0;r<t;r++)e[r]=A.charCodeAt(r);return e};A.API.events.push(["addFont",function(e){var r=void 0,n=e.font,i=e.instance;if(!n.isStandardFont){if(void 0===i)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");if("string"!=typeof(r=!1===i.existsFileInVFS(n.postScriptName)?i.loadFile(n.postScriptName):i.getFileFromVFS(n.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");!function(e,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(de(r)),e.metadata=A.API.TTFFont.open(r),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}(n,r)}}])}(Oe),Oe.API.addSvgAsImage=function(A,t,e,r,n,i,s,o){if(isNaN(t)||isNaN(e))throw ae.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(n))throw ae.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var a=document.createElement("canvas");a.width=r,a.height=n;var c=a.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,a.width,a.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return(se.canvg?Promise.resolve(se.canvg):import("./index.es-CnYWLNZV.js")).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(t){return t.fromString(c,A,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(u)}).then(function(){l.addImage(a.toDataURL("image/jpeg",1),t,e,r,n,s,o)})},Oe.API.putTotalPages=function(A){var t,e=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(A,"g"),e=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(A,this.internal.getFont()),"g"),e=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var n=0;n<this.internal.pages[r].length;n++)this.internal.pages[r][n]=this.internal.pages[r][n].replace(t,e);return this},Oe.API.viewerPreferences=function(A,t){var e;A=A||{},t=t||!1;var r,n,i,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(s),c=[],u=0,l=0,h=0;function f(A,t){var e,r=!1;for(e=0;e<A.length;e+=1)A[e]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),e=this.internal.viewerpreferences.configuration,"reset"===A||!0===t){var d=a.length;for(h=0;h<d;h+=1)e[a[h]].value=e[a[h]].defaultValue,e[a[h]].explicitSet=!1}if("object"===o(A))for(n in A)if(i=A[n],f(a,n)&&void 0!==i){if("boolean"===e[n].type&&"boolean"==typeof i)e[n].value=i;else if("name"===e[n].type&&f(e[n].valueSet,i))e[n].value=i;else if("integer"===e[n].type&&Number.isInteger(i))e[n].value=i;else if("array"===e[n].type){for(u=0;u<i.length;u+=1)if(r=!0,1===i[u].length&&"number"==typeof i[u][0])c.push(String(i[u]-1));else if(i[u].length>1){for(l=0;l<i[u].length;l+=1)"number"!=typeof i[u][l]&&(r=!1);!0===r&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}e[n].value="["+c.join(" ")+"]"}else e[n].value=e[n].defaultValue;e[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var A,t=[];for(A in e)!0===e[A].explicitSet&&("name"===e[A].type?t.push("/"+A+" /"+e[A].value):t.push("/"+A+" "+e[A].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=e,this},Oe.API.addMetadata=function(A,t){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:A,namespaceUri:null!=t?t:"http://jspdf.default.namespaceuri/",rawXml:"boolean"==typeof t&&t},this.internal.events.subscribe("putCatalog",fn),this.internal.events.subscribe("postPutResources",hn)),this},function(A){var t=A.API,e=t.pdfEscape16=function(A,t){for(var e,r=t.metadata.Unicode.widths,n=["","0","00","000","0000"],i=[""],s=0,o=A.length;s<o;++s){if(e=t.metadata.characterToGlyph(A.charCodeAt(s)),t.metadata.glyIdsUsed.push(e),t.metadata.toUnicode[e]=A.charCodeAt(s),-1==r.indexOf(e)&&(r.push(e),r.push([parseInt(t.metadata.widthOfGlyph(e),10)])),"0"==e)return i.join("");e=e.toString(16),i.push(n[4-e.length],e)}return i.join("")},r=function(A){var t,e,r,n,i,s,o;for(i="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],s=0,o=(e=Object.keys(A).sort(function(A,t){return A-t})).length;s<o;s++)t=e[s],r.length>=100&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==A[t]&&null!==A[t]&&"function"==typeof A[t].toString&&(n=("0000"+A[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+n+">"));return r.length&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),i+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"Identity-H"===e.encoding){for(var o=e.metadata.Unicode.widths,a=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),c="",u=0;u<a.length;u++)c+=String.fromCharCode(a[u]);var l=i();s({data:c,addLength1:!0,objectId:l}),n("endobj");var h=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:h}),n("endobj");var f=i();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+Se(e.fontName)),n("/FontFile2 "+l+" 0 R"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/Flags "+e.metadata.flags),n("/StemV "+e.metadata.stemV),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n(">>"),n("endobj");var d=i();n("<<"),n("/Type /Font"),n("/BaseFont /"+Se(e.fontName)),n("/FontDescriptor "+f+" 0 R"),n("/W "+A.API.PDFObject.convert(o)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=i(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+Se(e.fontName)),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+d+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"WinAnsiEncoding"===e.encoding){for(var o=e.metadata.rawData,a="",c=0;c<o.length;c++)a+=String.fromCharCode(o[c]);var u=i();s({data:a,addLength1:!0,objectId:u}),n("endobj");var l=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:l}),n("endobj");var h=i();n("<<"),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n("/StemV "+e.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+u+" 0 R"),n("/Flags 96"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/FontName /"+Se(e.fontName)),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n(">>"),n("endobj"),e.objectNumber=i();for(var f=0;f<e.metadata.hmtx.widths.length;f++)e.metadata.hmtx.widths[f]=parseInt(e.metadata.hmtx.widths[f]*(1e3/e.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+Se(e.fontName)+"/FontDescriptor "+h+" 0 R/Encoding/"+e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+A.API.PDFObject.convert(e.metadata.hmtx.widths)+">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]);var n=function(A){var t,r=A.text||"",n=A.x,i=A.y,s=A.options||{},o=A.mutex||{},a=o.pdfEscape,c=o.activeFontKey,u=o.fonts,l=c,h="",f=0,d="",g=u[l].encoding;if("Identity-H"!==u[l].encoding)return{text:r,x:n,y:i,options:s,mutex:o};for(d=r,l=c,Array.isArray(r)&&(d=r[0]),f=0;f<d.length;f+=1)u[l].metadata.hasOwnProperty("cmap")&&(t=u[l].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]),t||d[f].charCodeAt(0)<256&&u[l].metadata.hasOwnProperty("Unicode")?h+=d[f]:h+="";var B="";return parseInt(l.slice(1))<14||"WinAnsiEncoding"===g?B=a(h,l).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):"Identity-H"===g&&(B=e(h,u[l])),o.isHex=!0,{text:B,x:n,y:i,options:s,mutex:o}};t.events.push(["postProcessText",function(A){var t=A.text||"",e=[],r={text:t,x:A.x,y:A.y,options:A.options,mutex:A.mutex};if(Array.isArray(t)){var i=0;for(i=0;i<t.length;i+=1)Array.isArray(t[i])&&3===t[i].length?e.push([n(Object.assign({},r,{text:t[i][0]})).text,t[i][1],t[i][2]]):e.push(n(Object.assign({},r,{text:t[i]})).text);A.text=e}else A.text=n(Object.assign({},r,{text:t})).text}])}(Oe),
|
|
263
|
+
function(A){var t=function(A){for(var t=A.length,e=new Uint8Array(t),r=0;r<t;r++)e[r]=A.charCodeAt(r);return e};A.API.events.push(["addFont",function(e){var r=void 0,n=e.font,i=e.instance;if(!n.isStandardFont){if(void 0===i)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");if("string"!=typeof(r=!1===i.existsFileInVFS(n.postScriptName)?i.loadFile(n.postScriptName):i.getFileFromVFS(n.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");!function(e,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(de(r)),e.metadata=A.API.TTFFont.open(r),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}(n,r)}}])}(Oe),Oe.API.addSvgAsImage=function(A,t,e,r,n,i,s,o){if(isNaN(t)||isNaN(e))throw ae.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(n))throw ae.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var a=document.createElement("canvas");a.width=r,a.height=n;var c=a.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,a.width,a.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return(se.canvg?Promise.resolve(se.canvg):import("./index.es-C2GPR7m7.js")).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(t){return t.fromString(c,A,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(u)}).then(function(){l.addImage(a.toDataURL("image/jpeg",1),t,e,r,n,s,o)})},Oe.API.putTotalPages=function(A){var t,e=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(A,"g"),e=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(A,this.internal.getFont()),"g"),e=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var n=0;n<this.internal.pages[r].length;n++)this.internal.pages[r][n]=this.internal.pages[r][n].replace(t,e);return this},Oe.API.viewerPreferences=function(A,t){var e;A=A||{},t=t||!1;var r,n,i,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(s),c=[],u=0,l=0,h=0;function f(A,t){var e,r=!1;for(e=0;e<A.length;e+=1)A[e]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),e=this.internal.viewerpreferences.configuration,"reset"===A||!0===t){var d=a.length;for(h=0;h<d;h+=1)e[a[h]].value=e[a[h]].defaultValue,e[a[h]].explicitSet=!1}if("object"===o(A))for(n in A)if(i=A[n],f(a,n)&&void 0!==i){if("boolean"===e[n].type&&"boolean"==typeof i)e[n].value=i;else if("name"===e[n].type&&f(e[n].valueSet,i))e[n].value=i;else if("integer"===e[n].type&&Number.isInteger(i))e[n].value=i;else if("array"===e[n].type){for(u=0;u<i.length;u+=1)if(r=!0,1===i[u].length&&"number"==typeof i[u][0])c.push(String(i[u]-1));else if(i[u].length>1){for(l=0;l<i[u].length;l+=1)"number"!=typeof i[u][l]&&(r=!1);!0===r&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}e[n].value="["+c.join(" ")+"]"}else e[n].value=e[n].defaultValue;e[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var A,t=[];for(A in e)!0===e[A].explicitSet&&("name"===e[A].type?t.push("/"+A+" /"+e[A].value):t.push("/"+A+" "+e[A].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=e,this},Oe.API.addMetadata=function(A,t){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:A,namespaceUri:null!=t?t:"http://jspdf.default.namespaceuri/",rawXml:"boolean"==typeof t&&t},this.internal.events.subscribe("putCatalog",fn),this.internal.events.subscribe("postPutResources",hn)),this},function(A){var t=A.API,e=t.pdfEscape16=function(A,t){for(var e,r=t.metadata.Unicode.widths,n=["","0","00","000","0000"],i=[""],s=0,o=A.length;s<o;++s){if(e=t.metadata.characterToGlyph(A.charCodeAt(s)),t.metadata.glyIdsUsed.push(e),t.metadata.toUnicode[e]=A.charCodeAt(s),-1==r.indexOf(e)&&(r.push(e),r.push([parseInt(t.metadata.widthOfGlyph(e),10)])),"0"==e)return i.join("");e=e.toString(16),i.push(n[4-e.length],e)}return i.join("")},r=function(A){var t,e,r,n,i,s,o;for(i="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],s=0,o=(e=Object.keys(A).sort(function(A,t){return A-t})).length;s<o;s++)t=e[s],r.length>=100&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==A[t]&&null!==A[t]&&"function"==typeof A[t].toString&&(n=("0000"+A[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+n+">"));return r.length&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),i+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"Identity-H"===e.encoding){for(var o=e.metadata.Unicode.widths,a=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),c="",u=0;u<a.length;u++)c+=String.fromCharCode(a[u]);var l=i();s({data:c,addLength1:!0,objectId:l}),n("endobj");var h=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:h}),n("endobj");var f=i();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+Se(e.fontName)),n("/FontFile2 "+l+" 0 R"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/Flags "+e.metadata.flags),n("/StemV "+e.metadata.stemV),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n(">>"),n("endobj");var d=i();n("<<"),n("/Type /Font"),n("/BaseFont /"+Se(e.fontName)),n("/FontDescriptor "+f+" 0 R"),n("/W "+A.API.PDFObject.convert(o)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=i(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+Se(e.fontName)),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+d+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"WinAnsiEncoding"===e.encoding){for(var o=e.metadata.rawData,a="",c=0;c<o.length;c++)a+=String.fromCharCode(o[c]);var u=i();s({data:a,addLength1:!0,objectId:u}),n("endobj");var l=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:l}),n("endobj");var h=i();n("<<"),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n("/StemV "+e.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+u+" 0 R"),n("/Flags 96"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/FontName /"+Se(e.fontName)),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n(">>"),n("endobj"),e.objectNumber=i();for(var f=0;f<e.metadata.hmtx.widths.length;f++)e.metadata.hmtx.widths[f]=parseInt(e.metadata.hmtx.widths[f]*(1e3/e.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+Se(e.fontName)+"/FontDescriptor "+h+" 0 R/Encoding/"+e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+A.API.PDFObject.convert(e.metadata.hmtx.widths)+">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]);var n=function(A){var t,r=A.text||"",n=A.x,i=A.y,s=A.options||{},o=A.mutex||{},a=o.pdfEscape,c=o.activeFontKey,u=o.fonts,l=c,h="",f=0,d="",g=u[l].encoding;if("Identity-H"!==u[l].encoding)return{text:r,x:n,y:i,options:s,mutex:o};for(d=r,l=c,Array.isArray(r)&&(d=r[0]),f=0;f<d.length;f+=1)u[l].metadata.hasOwnProperty("cmap")&&(t=u[l].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]),t||d[f].charCodeAt(0)<256&&u[l].metadata.hasOwnProperty("Unicode")?h+=d[f]:h+="";var B="";return parseInt(l.slice(1))<14||"WinAnsiEncoding"===g?B=a(h,l).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):"Identity-H"===g&&(B=e(h,u[l])),o.isHex=!0,{text:B,x:n,y:i,options:s,mutex:o}};t.events.push(["postProcessText",function(A){var t=A.text||"",e=[],r={text:t,x:A.x,y:A.y,options:A.options,mutex:A.mutex};if(Array.isArray(t)){var i=0;for(i=0;i<t.length;i+=1)Array.isArray(t[i])&&3===t[i].length?e.push([n(Object.assign({},r,{text:t[i][0]})).text,t[i][1],t[i][2]]):e.push(n(Object.assign({},r,{text:t[i]})).text);A.text=e}else A.text=n(Object.assign({},r,{text:t})).text}])}(Oe),
|
|
264
264
|
/**
|
|
265
265
|
* @license
|
|
266
266
|
* jsPDF virtual FileSystem functionality
|
package/dist/{ensureNotRevoked-CNUfpW4F-BheL-ZKZ.js → ensureNotRevoked-BWp1jPEo-DSQMtjrj.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,V as a,
|
|
1
|
+
import{G as e,V as a,y as t,d as n}from"./main.js";function i(i,o){if(!i||!o)return;Array.isArray(o)||(o=[o]),o=o.filter(e=>null!=e);const r=e(o,i.map(e=>e.id));if(r.length>0){const e=i.findIndex(e=>e.id===r[0]);if(e>-1)throw new a(t.checkRevokedStatus,n.certificates.generateRevocationReason(i[e].revocationReason))}}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as t,V as e,g as s}from"./main.js";function n(t,e,s=""){const n=(i=t)instanceof Uint8Array||ArrayBuffer.isView(i)&&"Uint8Array"===i.constructor.name&&"BYTES_PER_ELEMENT"in i&&1===i.BYTES_PER_ELEMENT;var i;const r=t?.length;if(!n||void 0!==e){const e=(s&&`"${s}" `)+"expected Uint8Array"+""+", got "+(n?`length=${r}`:"type="+typeof t);if(!n)throw new TypeError(e);throw new RangeError(e)}return t}function i(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 r(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function o(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function h(t,e){return t<<32-e|t>>>e}function c(t,e={}){const s=(e,s)=>t(s).update(e).digest(),n=t(void 0);return s.outputLen=n.outputLen,s.blockLen=n.blockLen,s.canXOF=n.canXOF,s.create=e=>t(e),Object.assign(s,e),Object.freeze(s)}const u=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function f(t,e,s){return t&e^~t&s}function a(t,e,s){return t&e^t&s^e&s}class d{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,s,n){this.blockLen=t,this.outputLen=e,this.padOffset=s,this.isLE=n,this.buffer=new Uint8Array(t),this.view=o(this.buffer)}update(t){i(this),n(t);const{view:e,buffer:s,blockLen:r}=this,h=t.length;for(let n=0;n<h;){const i=Math.min(r-this.pos,h-n);if(i===r){const e=o(t);for(;r<=h-n;n+=r)this.process(e,n);continue}s.set(t.subarray(n,n+i),this.pos),this.pos+=i,n+=i,this.pos===r&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){i(this),function(t,e){n(t,void 0,"digestInto() output");const s=e.outputLen;if(t.length<s)throw new RangeError('"digestInto() output" expected to be of length >='+s)}(t,this),this.finished=!0;const{buffer:e,view:s,blockLen:h,isLE:c}=this;let{pos:u}=this;e[u++]=128,r(this.buffer.subarray(u)),this.padOffset>h-u&&(this.process(s,0),u=0);for(let t=u;t<h;t++)e[t]=0;s.setBigUint64(h-8,BigInt(8*this.length),c),this.process(s,0);const f=o(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const d=a/4,l=this.get();if(d>l.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)f.setUint32(4*t,l[t],c)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const s=t.slice(0,e);return this.destroy(),s}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:s,length:n,finished:i,destroyed:r,pos:o}=this;return t.destroyed=r,t.finished=i,t.length=n,t.pos=o,n%e&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const l=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),p=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]),g=new Uint32Array(64);class b extends d{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:s,D:n,E:i,F:r,G:o,H:h}=this;return[t,e,s,n,i,r,o,h]}set(t,e,s,n,i,r,o,h){this.A=0|t,this.B=0|e,this.C=0|s,this.D=0|n,this.E=0|i,this.F=0|r,this.G=0|o,this.H=0|h}process(t,e){for(let s=0;s<16;s++,e+=4)g[s]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=g[t-15],s=g[t-2],n=h(e,7)^h(e,18)^e>>>3,i=h(s,17)^h(s,19)^s>>>10;g[t]=i+g[t-7]+n+g[t-16]|0}let{A:s,B:n,C:i,D:r,E:o,F:c,G:u,H:d}=this;for(let t=0;t<64;t++){const e=d+(h(o,6)^h(o,11)^h(o,25))+f(o,c,u)+p[t]+g[t]|0,l=(h(s,2)^h(s,13)^h(s,22))+a(s,n,i)|0;d=u,u=c,c=o,o=r+e|0,r=i,i=n,n=s,s=e+l|0}s=s+this.A|0,n=n+this.B|0,i=i+this.C|0,r=r+this.D|0,o=o+this.E|0,c=c+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(s,n,i,r,o,c,u,d)}roundClean(){r(g)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),r(this.buffer)}}class w extends b{A=0|l[0];B=0|l[1];C=0|l[2];D=0|l[3];E=0|l[4];F=0|l[5];G=0|l[6];H=0|l[7];constructor(){super(32)}}const y=c(()=>new w,u(1));function E(n,i,r){let o="";const h=function(t,e){let s=null;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&n.toLowerCase()===e.toLowerCase()&&(s=n);return t[s]}(n,i),c=t(r);if(h?(h.created&&c<=h.created&&(o="invalidIssuingAddressCreationTime"),h.revoked&&c>=h.revoked&&(o="invalidIssuingAddressRevoked"),h.expires&&c>=h.expires&&(o="invalidIssuingAddressExpired")):o="invalidIssuingAddressUnknown",o)throw new e("checkAuthenticity",s("errors",o))}export{E as e,y as s};
|