@blockcerts/blockcerts-verifier 1.72.1 → 1.72.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/bundle-stats.html +33 -32
  2. package/coverage/lcov.info +2161 -1489
  3. package/dist/{DataIntegrityProof-CsicZNrL-BkSRjzkI.js → DataIntegrityProof-BhL7Kkhm-affsdujn.js} +2 -2
  4. package/dist/EcdsaSd2023-CUjrjGzC-Cx7ejHu-.js +30 -0
  5. package/dist/EcdsaSecp256k1Signature2019-D90cAynb-Bf5kILPF.js +1 -0
  6. package/dist/{Ed25519Signature2020-CglkQLKN-CQ6lMzyG.js → Ed25519Signature2020-fJGvlbIp-B6XhFwr4.js} +4 -4
  7. package/dist/EddsaRdfc2022-XufziFi3-D5IoKiRE.js +14 -0
  8. package/dist/HashlinkVerifier-udsj5z09-BTqOkVoD.js +8 -0
  9. package/dist/MerkleProof2017-C0RhRNNx-zjQMRSQY.js +1 -0
  10. package/dist/MerkleProof2017-C499XBV8-l50m9izr.js +74 -0
  11. package/dist/MerkleProof2019-B7f1hhem-CjLDyx6Q.js +5 -0
  12. package/dist/Suite-Bu3gszvt-Dmvbh142.js +33 -0
  13. package/dist/_polyfill-node.crypto-DGISCHrB-C5-OOGc0.js +1 -0
  14. package/dist/checkCredentialSchemaConformity-CgpOS3eC-AjSPoJub.js +1 -0
  15. package/dist/{checkRevocationStatusList2021-BDBFhnz6-BEBD8TO8.js → checkRevocationStatusList2021-D4VNDRlW-DgNfOAoI.js} +2 -2
  16. package/dist/controlVerificationMethod-CSwPoUL8-CvUADmjg.js +1 -0
  17. package/dist/downloadPDF-UAsY-nU_.js +297 -0
  18. package/dist/ed25519-key-pair.esm-DxoBwwVJ-D8j8wFfG.js +1 -0
  19. package/dist/ensureNotRevoked-ByWaYoog-BheL-ZKZ.js +1 -0
  20. package/dist/ensureNotRevoked-C1kT3A6R-oFUZltl3.js +1 -0
  21. package/dist/{ensureValidIssuingKey-wTUvNuDH-BdV46XBb.js → ensureValidIssuingKey-DEV9E0Ph-DY8BTObG.js} +1 -1
  22. package/dist/index-DZ7aUhT_-D0G2DVsh.js +29 -0
  23. package/dist/index-DjD0A6uJ-BdFUkPCF.js +33 -0
  24. package/dist/index-RfFwckcH.js +1 -0
  25. package/dist/index-tlZQQ_rg-CYTlxhyY.js +1 -0
  26. package/dist/index.es-CnYWLNZV.js +56 -0
  27. package/dist/jsonld-signatures-D4X_Irzi-D_wBqxSl.js +56 -0
  28. package/dist/main.js +143 -134
  29. package/dist/pako.esm-BGRKTPxS-Bodm4Eha.js +2 -0
  30. package/dist/purify.es-Om653OSQ.js +2 -0
  31. package/dist/retrieveVerificationMethodPublicKey-D_autuwE-DGbK-RPm.js +1 -0
  32. package/dist/sha2-JcCWfgvE-By1_saxP.js +2 -0
  33. package/dist/verifyIssuerProfile-2PhdMtQZ-CfqcAkBL.js +1 -0
  34. package/dist/webcrypto.es-BOyMRPOj-CAxP3jJR.js +40 -0
  35. package/package.json +11 -11
  36. package/dist/EcdsaSd2023-DN9HBdgh-Bc0hVwTd.js +0 -30
  37. package/dist/EcdsaSecp256k1Signature2019-C3F03t_M-DAJeMTpu.js +0 -1
  38. package/dist/EddsaRdfc2022-CfoLi-PP-l7ITLQQT.js +0 -14
  39. package/dist/HashlinkVerifier-CTG-OS14-B4Niv2-b.js +0 -8
  40. package/dist/MerkleProof2017-B_EJmYja-CYd4dJc1.js +0 -1
  41. package/dist/MerkleProof2017-k2qjvxCH-DrRpsLHG.js +0 -75
  42. package/dist/MerkleProof2019-B7t13hOo-D8n9YrUw.js +0 -13
  43. package/dist/Suite-BmP2Qu19-D1ucdMDB.js +0 -1
  44. package/dist/_commonjs-dynamic-modules-COweQ1RR-BHR_E30J.js +0 -1
  45. package/dist/base64url-Cy03LJLt-vkTPfQOh.js +0 -4
  46. package/dist/checkCredentialSchemaConformity-BiggGGMP-Dx992E4t.js +0 -1
  47. package/dist/controlVerificationMethod-Bh_-e0Fd-BUCC8ctY.js +0 -1
  48. package/dist/did-key-common.esm-BELyYVSE-Cqrpf7cy.js +0 -9
  49. package/dist/did-key-ed25519.esm-C3GUddDp-BJdBgNDg.js +0 -1
  50. package/dist/did-key-secp256k1.esm-D-R266jM-BTxlD5VW.js +0 -1
  51. package/dist/downloadPDF-D2qwT_DJ.js +0 -297
  52. package/dist/ed25519-key-pair.esm-DQF2kkXh-XX5BXBcl.js +0 -25
  53. package/dist/elliptic-6I21PEnR-CsYseRX1.js +0 -1
  54. package/dist/elliptic-mDX7fQQx-BpaNaVm0.js +0 -1
  55. package/dist/ensureNotRevoked-DGZuNktg-B4uNuqLX.js +0 -1
  56. package/dist/ensureNotRevoked-Dc6VA2bO-DvMIgM4L.js +0 -1
  57. package/dist/index-BrurC4Vt-C0eXpZGn.js +0 -1
  58. package/dist/index-CK9Z4pAC.js +0 -2
  59. package/dist/index-DXh-XAic-B2gT500V.js +0 -22
  60. package/dist/index-DZLKRa_V-D_IQzjvG.js +0 -5
  61. package/dist/index-fQcSLZgh-DpptYyN8.js +0 -1
  62. package/dist/index.es-BIiEi3w5.js +0 -56
  63. package/dist/jsonld-BAMY2WqE-BJ5uVeOU.js +0 -36
  64. package/dist/jsonld-signatures-BbHr1fSN-BSospRuX.js +0 -74
  65. package/dist/keyUtils-ue8EY3Op-DoHdKWgN.js +0 -1
  66. package/dist/pako.esm-BGRKTPxS-UdHShO7y.js +0 -2
  67. package/dist/purify.es-CkKsfeyH.js +0 -2
  68. package/dist/retrieveVerificationMethodPublicKey-CLBY4G8P-CagFGnNt.js +0 -1
  69. package/dist/sha256-Bwge_vjI-C1PUWFZm.js +0 -1
  70. package/dist/verifyIssuerProfile-BaiZaU2c-Zcu1X0PY.js +0 -1
  71. package/dist/webcrypto.es-DptGOl2T-BnVhHKeM.js +0 -40
  72. package/dist/x25519-hG3WOzPe-Dh8L0KYb.js +0 -1
  73. /package/dist/{index-Gr4i_Ned-Dgus2xdV.js → index-CyNtT_1q-Dgus2xdV.js} +0 -0
@@ -1 +0,0 @@
1
- import{d as t,f as e,e as r,V as n,g as i,B as o,m as a,q as s,s as u,t as f,p as c,u as h}from"./main.js";import{j as l}from"./jsonld-signatures-BbHr1fSN-BSospRuX.js";import{j as d}from"./jsonld-BAMY2WqE-BJ5uVeOU.js";import{c as p,b as y,r as b,a as g}from"./index-fQcSLZgh-DpptYyN8.js";import{b as _,a as w}from"./elliptic-mDX7fQQx-BpaNaVm0.js";import{e as v}from"./elliptic-6I21PEnR-CsYseRX1.js";import{d as m,e as S}from"./index-DZLKRa_V-D_IQzjvG.js";import{S as E}from"./Suite-BmP2Qu19-D1ucdMDB.js";import{p as A,a as k}from"./keyUtils-ue8EY3Op-DoHdKWgN.js";import"./pako.esm-BGRKTPxS-UdHShO7y.js";import"./sha256-Bwge_vjI-C1PUWFZm.js";import"./index-Gr4i_Ned-Dgus2xdV.js";import{r as R}from"./retrieveVerificationMethodPublicKey-CLBY4G8P-CagFGnNt.js";import"./base64url-Cy03LJLt-vkTPfQOh.js";var P,M,T,O,j,x,I={exports:{}},B=s(h);function L(){return M?P:(M=1,P=B.EventEmitter)}function D(){if(O)return T;function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}O=1;var o=w.Buffer,a=g.inspect,s=a&&a.custom||"inspect";return T=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return n(t,[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,r,n,i=o.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=i,n=s,o.prototype.copy.call(e,r,n),s+=a.data.length,a=a.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,a=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,a),0===(t-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,e}},{key:s,value:function(t,r){return a(this,e(e({},r),{},{depth:0,customInspect:!1}))}}]),t}()}function C(){if(x)return j;function t(t,n){r(t,n),e(t)}function e(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}return x=1,j={destroy:function(n,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(i?i(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,f(r,this,n)):f(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!i&&r?o._writableState?o._writableState.errorEmitted?f(e,o):(o._writableState.errorEmitted=!0,f(t,o,r)):f(t,o,r):i?(f(e,o),i(r)):f(e,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}var U,N,K,F,V,W,q,H,G,$={};function z(){if(U)return $;U=1;var t={};function e(e,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function r(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}return e("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),e("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,o,a;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(r(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(r(e,"type"))}return a+=". Received type ".concat(typeof n)}),TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$.codes=t,$}function J(){if(K)return N;K=1;var t=z().codes.ERR_INVALID_OPT_VALUE;return N={getHighWaterMark:function(e,r,n,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(r,i,n);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new t(i?n:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}}function Y(){if(V)return F;function t(t){try{if(!a.localStorage)return!1}catch(t){return!1}var e=a.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}return V=1,F=function(e,r){if(t("noDeprecation"))return e;var n=!1;return function(){if(!n){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return e.apply(this,arguments)}},F}function X(){if(q)return W;function t(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var e;q=1,W=k,k.WritableState=A;var r={deprecate:Y()},n=L(),i=w.Buffer,o=(void 0!==a?a:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,u=C(),c=J().getHighWaterMark,h=z().codes,l=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,p=h.ERR_MULTIPLE_CALLBACK,y=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,g=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,m=h.ERR_UNKNOWN_ENCODING,S=u.errorOrDestroy;function E(){}function A(r,n,i){e=e||Q(),r=r||{},"boolean"!=typeof i&&(i=n instanceof e),this.objectMode=!!r.objectMode,i&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=c(this,r,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===r.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new p;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(f(i,n),f(j,t,e),t._writableState.errorEmitted=!0,S(t,n)):(i(n),t._writableState.errorEmitted=!0,S(t,n),j(t,e))}(t,r,n,e,i);else{var o=T(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||M(t,r),n?f(P,t,r,o,i):P(t,r,o,i)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function k(t){var r=this instanceof(e=e||Q());if(!r&&!s.call(k,this))return new k(t);this._writableState=new A(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),n.call(this)}function R(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function P(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),j(t,e)}function M(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,o=new Array(i),a=r.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,R(e,r,!0,r.length,o,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var f=n.chunk,c=n.encoding,h=n.callback;if(R(e,r,!1,r.objectMode?1:f.length,f,c,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final((function(r){e.pendingcb--,r&&S(t,r),e.prefinished=!0,t.emit("prefinish"),j(t,e)}))}function j(t,e){var r=T(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,f(O,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}return _()(k,n),A.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(A.prototype,"buffer",{get:r.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===k&&(t&&t._writableState instanceof A)}})):s=function(t){return t instanceof this},k.prototype.pipe=function(){S(this,new y)},k.prototype.write=function(t,e,r){var n,a=this._writableState,s=!1,u=!a.objectMode&&(n=t,i.isBuffer(n)||n instanceof o);return u&&!i.isBuffer(t)&&(t=function(t){return i.from(t)}(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=a.defaultEncoding),"function"!=typeof r&&(r=E),a.ending?function(t,e){var r=new v;S(t,r),f(e,r)}(this,r):(u||function(t,e,r,n){var i;return null===r?i=new g:"string"==typeof r||e.objectMode||(i=new l("chunk",["string","Buffer"],r)),!i||(S(t,i),f(n,i),!1)}(this,a,t,r))&&(a.pendingcb++,s=function(t,e,r,n,o,a){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=i.from(e,r));return e}(e,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=e.objectMode?1:n.length;e.length+=u;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else R(t,e,!1,u,n,o,a);return f}(this,a,u,t,e,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||M(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new m(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new d("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,j(t,e),r&&(e.finished?f(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=u.destroy,k.prototype._undestroy=u.undestroy,k.prototype._destroy=function(t,e){e(t)},W}function Q(){if(G)return H;G=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};H=a;var e=kt(),r=X();_()(a,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var o=n[i];a.prototype[o]||(a.prototype[o]=r.prototype[o])}function a(t){if(!(this instanceof a))return new a(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||f(u,this)}function u(t){t.end()}return Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),H}var Z,tt,et,rt,nt,it,ot,at,st,ut,ft,ct,ht,lt,dt,pt,yt,bt,gt,_t,wt,vt,mt={};function St(){if(Z)return mt;Z=1;var t=y().Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=o,this.end=a,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=s,this.end=u,n=3;break;default:return this.write=f,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function o(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function s(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):""}return mt.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var o=n(e[i]);if(o>=0)return o>0&&(t.lastNeed=o-1),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(t.lastNeed=o-2),o;if(--i<r||-2===o)return 0;if(o=n(e[i]),o>=0)return o>0&&(2===o?o=0:t.lastNeed=o-3),o;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},mt}function Et(){if(et)return tt;et=1;var t=z().codes.ERR_STREAM_PREMATURE_CLOSE;function e(){}return tt=function r(n,i,o){if("function"==typeof i)return r(n,null,i);i||(i={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||e);var a=i.readable||!1!==i.readable&&n.readable,s=i.writable||!1!==i.writable&&n.writable,u=function(){n.writable||c()},f=n._writableState&&n._writableState.finished,c=function(){s=!1,f=!0,a||o.call(n)},h=n._readableState&&n._readableState.endEmitted,l=function(){a=!1,h=!0,s||o.call(n)},d=function(t){o.call(n,t)},p=function(){var e;return a&&!h?(n._readableState&&n._readableState.ended||(e=new t),o.call(n,e)):s&&!f?(n._writableState&&n._writableState.ended||(e=new t),o.call(n,e)):void 0},y=function(){n.req.on("finish",c)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(n)?s&&!n._writableState&&(n.on("end",u),n.on("close",u)):(n.on("complete",c),n.on("abort",p),n.req?y():n.on("request",y)),n.on("end",l),n.on("finish",c),!1!==i.error&&n.on("error",d),n.on("close",p),function(){n.removeListener("complete",c),n.removeListener("abort",p),n.removeListener("request",y),n.req&&n.req.removeListener("finish",c),n.removeListener("end",u),n.removeListener("close",u),n.removeListener("finish",c),n.removeListener("end",l),n.removeListener("error",d),n.removeListener("close",p)}},tt}function At(){if(nt)return rt;var t;function e(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}nt=1;var r=Et(),n=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),a=Symbol("ended"),s=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function h(t,e){return{value:t,done:e}}function l(t){var e=t[n];if(null!==e){var r=t[c].read();null!==r&&(t[s]=null,t[n]=null,t[i]=null,e(h(r,!1)))}}function d(t){f(l,t)}var p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((e(t={get stream(){return this[c]},next:function(){var t=this,e=this[o];if(null!==e)return Promise.reject(e);if(this[a])return Promise.resolve(h(void 0,!0));if(this[c].destroyed)return new Promise((function(e,r){f((function(){t[o]?r(t[o]):e(h(void 0,!0))}))}));var r,n=this[s];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[a]?r(h(void 0,!0)):e[u](r,n)}),n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(h(i,!1));r=new Promise(this[u])}return this[s]=r,r}},Symbol.asyncIterator,(function(){return this})),e(t,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(h(void 0,!0))}))}))})),t),p);return rt=function(t){var f,l=Object.create(y,(e(f={},c,{value:t,writable:!0}),e(f,n,{value:null,writable:!0}),e(f,i,{value:null,writable:!0}),e(f,o,{value:null,writable:!0}),e(f,a,{value:t._readableState.endEmitted,writable:!0}),e(f,u,{value:function(t,e){var r=l[c].read();r?(l[s]=null,l[n]=null,l[i]=null,t(h(r,!1))):(l[n]=t,l[i]=e)},writable:!0}),f));return l[s]=null,r(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=l[i];return null!==e&&(l[s]=null,l[n]=null,l[i]=null,e(t)),void(l[o]=t)}var r=l[n];null!==r&&(l[s]=null,l[n]=null,l[i]=null,r(h(void 0,!0))),l[a]=!0})),t.on("readable",d.bind(null,l)),l}}function kt(){if(st)return at;var t;st=1,at=P,P.ReadableState=R,B.EventEmitter;var e=function(t,e){return t.listeners(e).length},r=L(),n=w.Buffer,i=(void 0!==a?a:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o,s=g;o=s&&s.debuglog?s.debuglog("stream"):function(){};var u,h,l,d=D(),p=C(),y=J().getHighWaterMark,b=z().codes,v=b.ERR_INVALID_ARG_TYPE,m=b.ERR_STREAM_PUSH_AFTER_EOF,S=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;_()(P,r);var A=p.errorOrDestroy,k=["error","close","destroy","pause","resume"];function R(e,r,n){t=t||Q(),e=e||{},"boolean"!=typeof n&&(n=r instanceof t),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",n),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=St().StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function P(e){if(t=t||Q(),!(this instanceof P))return new P(e);var n=this instanceof t;this._readableState=new R(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function M(t,e,r,a,s){o("readableAddChunk",e);var u,f=t._readableState;if(null===e)f.reading=!1,function(t,e){if(o("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?x(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}(t,f);else if(s||(u=function(t,e){var r;o=e,n.isBuffer(o)||o instanceof i||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var o;return r}(f,e)),u)A(t,u);else if(f.objectMode||e&&e.length>0)if("string"==typeof e||f.objectMode||Object.getPrototypeOf(e)===n.prototype||(e=function(t){return n.from(t)}(e)),a)f.endEmitted?A(t,new E):T(t,f,e,!0);else if(f.ended)A(t,new m);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!r?(e=f.decoder.write(e),f.objectMode||0!==e.length?T(t,f,e,!1):U(t,f)):T(t,f,e,!1)}else a||(f.reading=!1,U(t,f));return!f.ended&&(f.length<f.highWaterMark||0===f.length)}function T(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&x(t)),U(t,e)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),P.prototype.destroy=p.destroy,P.prototype._undestroy=p.undestroy,P.prototype._destroy=function(t,e){e(t)},P.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=n.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},P.prototype.unshift=function(t){return M(this,t,null,!0,!1)},P.prototype.isPaused=function(){return!1===this._readableState.flowing},P.prototype.setEncoding=function(t){u||(u=St().StringDecoder);var e=new u(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var O=1073741824;function j(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=O?t=O:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,f(I,t))}function I(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,W(t)}function U(t,e){e.readingMore||(e.readingMore=!0,f(N,t,e))}function N(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function K(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function F(t){o("readable nexttick read 0"),t.read(0)}function V(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),W(t),e.flowing&&!e.reading&&t.read(0)}function W(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function q(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function H(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,f(G,e,t))}function G(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function $(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return P.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?H(this):x(this),null;if(0===(t=j(t,e))&&e.ended)return 0===e.length&&H(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=j(r,e))),null===(n=t>0?q(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&H(this)),null!==n&&this.emit("data",n),n},P.prototype._read=function(t){A(this,new S("_read()"))},P.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,r);var a=(!r||!1!==r.end)&&t!==c.stdout&&t!==c.stderr?u:g;function s(e,r){o("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,o("cleanup"),t.removeListener("close",y),t.removeListener("finish",b),t.removeListener("drain",h),t.removeListener("error",p),t.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",d),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function u(){o("onend"),t.end()}i.endEmitted?f(a):n.once("end",a),t.on("unpipe",s);var h=function(t){return function(){var r=t._readableState;o("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&e(t,"data")&&(r.flowing=!0,W(t))}}(n);t.on("drain",h);var l=!1;function d(e){o("ondata");var r=t.write(e);o("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==$(i.pipes,t))&&!l&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function p(r){o("onerror",r),g(),t.removeListener("error",p),0===e(t,"error")&&A(t,r)}function y(){t.removeListener("finish",b),g()}function b(){o("onfinish"),t.removeListener("close",y),g()}function g(){o("unpipe"),n.unpipe(t)}return n.on("data",d),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",p),t.once("close",y),t.once("finish",b),t.emit("pipe",n),i.flowing||(o("pipe resume"),n.resume()),t},P.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=$(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},P.prototype.on=function(t,e){var n=r.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?x(this):i.reading||f(F,this))),n},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(t,e){var n=r.prototype.removeListener.call(this,t,e);return"readable"===t&&f(K,this),n},P.prototype.removeAllListeners=function(t){var e=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||f(K,this),e},P.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,f(V,t,e))}(this,t)),t.paused=!1,this},P.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a<k.length;a++)t.on(k[a],this.emit.bind(this,k[a]));return this._read=function(e){o("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(P.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=At()),h(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),P._fromList=q,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(P.from=function(t,e){return void 0===l&&(l=ot?it:(ot=1,it=function(){throw new Error("Readable.from is not available in the browser")})),l(P,t,e)}),at}function Rt(){if(ft)return ut;ft=1,ut=s;var t=z().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,o=Q();function a(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(null===i)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(e,r){f(t,e,r)}))}function f(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new i;if(t._transformState.transforming)throw new n;return t.push(null)}return _()(s,o),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,o.prototype.push.call(this,t,e)},s.prototype._transform=function(t,r,n){n(new e("_transform()"))},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},s.prototype._destroy=function(t,e){o.prototype._destroy.call(this,t,(function(t){e(t)}))},ut}function Pt(){if(dt)return lt;var t;dt=1;var e=z().codes,r=e.ERR_MISSING_ARGS,n=e.ERR_STREAM_DESTROYED;function i(t){if(t)throw t}function o(t){t()}function a(t,e){return t.pipe(e)}return lt=function(){for(var e=arguments.length,s=new Array(e),u=0;u<e;u++)s[u]=arguments[u];var f,c=function(t){return t.length?"function"!=typeof t[t.length-1]?i:t.pop():i}(s);if(Array.isArray(s[0])&&(s=s[0]),s.length<2)throw new r("streams");var h=s.map((function(e,r){var i=r<s.length-1;return function(e,r,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===t&&(t=Et()),t(e,{readable:r,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var s=!1;return function(t){if(!a&&!s)return s=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new n("pipe"))}}(e,i,r>0,(function(t){f||(f=t),t&&h.forEach(o),i||(h.forEach(o),c(f))}))}));return s.reduce(a)},lt}function Mt(){return pt||(pt=1,t=I.exports,(t=I.exports=kt()).Stream=t,t.Readable=t,t.Writable=X(),t.Duplex=Q(),t.Transform=Rt(),t.PassThrough=function(){if(ht)return ct;ht=1,ct=e;var t=Rt();function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return _()(e,t),e.prototype._transform=function(t,e,r){r(null,t)},ct}(),t.finished=Et(),t.pipeline=Pt()),I.exports;var t}function Tt(){if(bt)return yt;bt=1;var t=y().Buffer,e=Mt().Transform;function r(r){e.call(this),this._block=t.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return _()(r,e),r.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},r.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},r.prototype.update=function(e,r){if(function(e,r){if(!t.isBuffer(e)&&"string"!=typeof e)throw new TypeError(r+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");t.isBuffer(e)||(e=t.from(e,r));for(var n=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)n[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},r.prototype._update=function(){throw new Error("_update is not implemented")},r.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},r.prototype._digest=function(){throw new Error("_digest is not implemented")},yt=r}var Ot,jt,xt,It,Bt,Lt,Dt,Ct,Ut,Nt,Kt,Ft,Vt,Wt,qt,Ht,Gt,$t,zt,Jt,Yt,Xt,Qt,Zt,te,ee,re,ne,ie,oe,ae,se,ue,fe,ce,he,le,de,pe,ye,be,ge,_e,we,ve,me,Se,Ee,Ae,ke,Re,Pe,Me,Te,Oe,je,xe,Ie,Be,Le,De,Ce,Ue,Ne,Ke,Fe,Ve,We,qe,He,Ge,$e,ze,Je,Ye,Xe,Qe,Ze,tr,er,rr={exports:{}};function nr(){return It?xt:(It=1,xt=TypeError)}function ir(){return Lt?Bt:(Lt=1,Bt=Object)}function or(){return Ct?Dt:(Ct=1,Dt=Error)}function ar(){return Nt?Ut:(Nt=1,Ut=EvalError)}function sr(){return Ft?Kt:(Ft=1,Kt=RangeError)}function ur(){return Wt?Vt:(Wt=1,Vt=ReferenceError)}function fr(){return Ht?qt:(Ht=1,qt=SyntaxError)}function cr(){return $t?Gt:($t=1,Gt=URIError)}function hr(){return Jt?zt:(Jt=1,zt=Math.abs)}function lr(){return Xt?Yt:(Xt=1,Yt=Math.floor)}function dr(){return Zt?Qt:(Zt=1,Qt=Math.max)}function pr(){return ee?te:(ee=1,te=Math.min)}function yr(){return ne?re:(ne=1,re=Math.pow)}function br(){return oe?ie:(oe=1,ie=Math.round)}function gr(){return se?ae:(se=1,ae=Number.isNaN||function(t){return t!=t})}function _r(){if(fe)return ue;fe=1;var t=gr();return ue=function(e){return t(e)||0===e?e:e<0?-1:1}}function wr(){return he?ce:(he=1,ce=Object.getOwnPropertyDescriptor)}function vr(){if(de)return le;de=1;var t=wr();if(t)try{t([],"length")}catch(e){t=null}return le=t}function mr(){if(ye)return pe;ye=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}return pe=t}function Sr(){return ge?be:(ge=1,be=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0})}function Er(){if(we)return _e;we=1;var t="undefined"!=typeof Symbol&&Symbol,e=Sr();return _e=function(){return"function"==typeof t&&("function"==typeof Symbol&&("symbol"==typeof t("foo")&&("symbol"==typeof Symbol("bar")&&e())))}}function Ar(){return me?ve:(me=1,ve="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function kr(){return Ee?Se:(Ee=1,Se=ir().getPrototypeOf||null)}function Rr(){if(ke)return Ae;ke=1;var t=Object.prototype.toString,e=Math.max,r=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var i=0;i<e.length;i+=1)r[i+t.length]=e[i];return r};return Ae=function(n){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,a=function(t,e){for(var r=[],n=e,i=0;n<t.length;n+=1,i+=1)r[i]=t[n];return r}(arguments,1),s=e(0,i.length-a.length),u=[],f=0;f<s;f++)u[f]="$"+f;if(o=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r}(u,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var t=i.apply(this,r(a,arguments));return Object(t)===t?t:this}return i.apply(n,r(a,arguments))})),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o},Ae}function Pr(){if(Pe)return Re;Pe=1;var t=Rr();return Re=Function.prototype.bind||t}function Mr(){return Te?Me:(Te=1,Me=Function.prototype.call)}function Tr(){return je?Oe:(je=1,Oe=Function.prototype.apply)}function Or(){if(Le)return Be;Le=1;var t=Pr(),e=Tr(),r=Mr(),n=Ie?xe:(Ie=1,xe="undefined"!=typeof Reflect&&Reflect&&Reflect.apply);return Be=n||t.call(r,e)}function jr(){if(Ce)return De;Ce=1;var t=Pr(),e=nr(),r=Mr(),n=Or();return De=function(i){if(i.length<1||"function"!=typeof i[0])throw new e("a function is required");return n(t,r,i)}}function xr(){if(Ne)return Ue;Ne=1;var t,e=jr(),r=vr();try{t=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var n=!!t&&r&&r(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return Ue=n&&"function"==typeof n.get?e([n.get]):"function"==typeof o&&function(t){return o(null==t?t:i(t))}}function Ir(){if(Fe)return Ke;Fe=1;var t=Ar(),e=kr(),r=xr();return Ke=t?function(e){return t(e)}:e?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return e(t)}:r?function(t){return r(t)}:null}function Br(){if(We)return Ve;We=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=Pr();return Ve=r.call(t,e)}function Lr(){if(He)return qe;var t;He=1;var e=ir(),r=or(),n=ar(),i=sr(),o=ur(),a=fr(),s=nr(),u=cr(),f=hr(),c=lr(),h=dr(),l=pr(),d=yr(),p=br(),y=_r(),b=Function,g=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},_=vr(),w=mr(),v=function(){throw new s},m=_?function(){try{return v}catch(t){try{return _(arguments,"callee").get}catch(t){return v}}}():v,S=Er()(),E=Ir(),A=kr(),k=Ar(),R=Tr(),P=Mr(),M={},T="undefined"!=typeof Uint8Array&&E?E(Uint8Array):t,O={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?t:ArrayBuffer,"%ArrayIteratorPrototype%":S&&E?E([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"undefined"==typeof Atomics?t:Atomics,"%BigInt%":"undefined"==typeof BigInt?t:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?t:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":"undefined"==typeof Float16Array?t:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?t:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?t:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?t:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":M,"%Int8Array%":"undefined"==typeof Int8Array?t:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?t:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&E?E(E([][Symbol.iterator]())):t,"%JSON%":"object"==typeof JSON?JSON:t,"%Map%":"undefined"==typeof Map?t:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&S&&E?E((new Map)[Symbol.iterator]()):t,"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?t:Promise,"%Proxy%":"undefined"==typeof Proxy?t:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":"undefined"==typeof Reflect?t:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?t:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&S&&E?E((new Set)[Symbol.iterator]()):t,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&E?E(""[Symbol.iterator]()):t,"%Symbol%":S?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":m,"%TypedArray%":T,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?t:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?t:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?t:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?t:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?t:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?t:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?t:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":R,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":A,"%Math.abs%":f,"%Math.floor%":c,"%Math.max%":h,"%Math.min%":l,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":y,"%Reflect.getPrototypeOf%":k};if(E)try{null.error}catch(t){var j=E(E(t));O["%Error.prototype%"]=j}var x=function t(e){var r;if("%AsyncFunction%"===e)r=g("async function () {}");else if("%GeneratorFunction%"===e)r=g("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=g("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&E&&(r=E(i.prototype))}return O[e]=r,r},I={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},B=Pr(),L=Br(),D=B.call(P,Array.prototype.concat),C=B.call(R,Array.prototype.splice),U=B.call(P,String.prototype.replace),N=B.call(P,String.prototype.slice),K=B.call(P,RegExp.prototype.exec),F=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,W=function(t,e){var r,n=t;if(L(I,n)&&(n="%"+(r=I[n])[0]+"%"),L(O,n)){var i=O[n];if(i===M&&(i=x(n)),void 0===i&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new a("intrinsic "+t+" does not exist!")};return qe=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===K(/^%?[^%]*%?$/,t))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new a("invalid intrinsic syntax, expected opening `%`");var n=[];return U(t,F,(function(t,e,r,i){n[n.length]=r?U(i,V,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=W("%"+n+"%",e),o=i.name,u=i.value,f=!1,c=i.alias;c&&(n=c[0],C(r,D([0,1],c)));for(var h=1,l=!0;h<r.length;h+=1){var d=r[h],p=N(d,0,1),y=N(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===y||"'"===y||"`"===y)&&p!==y)throw new a("property names with quotes must have matching quotes");if("constructor"!==d&&l||(f=!0),L(O,o="%"+(n+="."+d)+"%"))u=O[o];else if(null!=u){if(!(d in u)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(_&&h+1>=r.length){var b=_(u,d);u=(l=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[d]}else l=L(u,d),u=u[d];l&&!f&&(O[o]=u)}}return u},qe}function Dr(){if($e)return Ge;$e=1;var t=Lr(),e=jr(),r=e([t("%String.prototype.indexOf%")]);return Ge=function(n,i){var o=t(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?e([o]):o}}function Cr(){if(Je)return ze;Je=1;var t,e,r=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw e}}),e={},n((function(){throw 42}),null,t)}catch(t){t!==e&&(n=null)}else n=null;var i=/^\s*class\b/,o=function(t){try{var e=r.call(t);return i.test(e)}catch(t){return!1}},a=function(t){try{return!o(t)&&(r.call(t),!0)}catch(t){return!1}},s=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),c=function(){return!1};if("object"==typeof document){var h=document.all;s.call(h)===s.call(document.all)&&(c=function(t){if((f||!t)&&(void 0===t||"object"==typeof t))try{var e=s.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}return ze=n?function(r){if(c(r))return!0;if(!r)return!1;if("function"!=typeof r&&"object"!=typeof r)return!1;try{n(r,null,t)}catch(t){if(t!==e)return!1}return!o(r)&&a(r)}:function(t){if(c(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(o(t))return!1;var e=s.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}}function Ur(){if(Xe)return Ye;Xe=1;var t=Cr(),e=Object.prototype.toString,r=Object.prototype.hasOwnProperty;return Ye=function(n,i,o){if(!t(i))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=o),s=n,"[object Array]"===e.call(s)?function(t,e,n){for(var i=0,o=t.length;i<o;i++)r.call(t,i)&&(null==n?e(t[i],i,t):e.call(n,t[i],i,t))}(n,i,a):"string"==typeof n?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(n,i,a):function(t,e,n){for(var i in t)r.call(t,i)&&(null==n?e(t[i],i,t):e.call(n,t[i],i,t))}(n,i,a)},Ye}function Nr(){return Ze?Qe:(Ze=1,Qe=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"])}function Kr(){if(er)return tr;er=1;var t=Nr(),e="undefined"==typeof globalThis?a:globalThis;return tr=function(){for(var r=[],n=0;n<t.length;n++)"function"==typeof e[t[n]]&&(r[r.length]=t[n]);return r}}var Fr,Vr,Wr,qr,Hr,Gr,$r,zr,Jr,Yr,Xr,Qr,Zr,tn,en,rn,nn,on,an,sn,un,fn,cn,hn,ln,dn,pn,yn,bn,gn,_n,wn,vn,mn,Sn={exports:{}};function En(){if(Vr)return Fr;Vr=1;var t=mr(),e=fr(),r=nr(),n=vr();return Fr=function(i,o,a){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!n&&n(i,o);if(t)t(i,o,{configurable:null===f&&h?h.configurable:!f,enumerable:null===s&&h?h.enumerable:!s,value:a,writable:null===u&&h?h.writable:!u});else{if(!c&&(s||u||f))throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");i[o]=a}},Fr}function An(){if(qr)return Wr;qr=1;var t=mr(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return 1!==t([],"length",{value:1}).length}catch(t){return!0}},Wr=e}function kn(){if(Gr)return Hr;Gr=1;var t=Lr(),e=En(),r=An()(),n=vr(),i=nr(),o=t("%Math.floor%");return Hr=function(t,a){if("function"!=typeof t)throw new i("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||o(a)!==a)throw new i("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],u=!0,f=!0;if("length"in t&&n){var c=n(t,"length");c&&!c.configurable&&(u=!1),c&&!c.writable&&(f=!1)}return(u||f||!s)&&(r?e(t,"length",a,!0,!0):e(t,"length",a)),t},Hr}function Rn(){if(zr)return $r;zr=1;var t=Pr(),e=Tr(),r=Or();return $r=function(){return r(t,e,arguments)},$r}function Pn(){return Jr||(Jr=1,function(t){var e=kn(),r=mr(),n=jr(),i=Rn();t.exports=function(t){var r=n(arguments),i=t.length-(arguments.length-1);return e(r,1+(i>0?i:0),!0)},r?r(t.exports,"apply",{value:i}):t.exports.apply=i}(Sn)),Sn.exports}function Mn(){if(Zr)return Qr;Zr=1;var t=Ur(),e=Kr(),r=Pn(),n=Dr(),i=vr(),o=Ir(),s=n("Object.prototype.toString"),u=function(){if(Xr)return Yr;Xr=1;var t=Sr();return Yr=function(){return t()&&!!Symbol.toStringTag}}()(),f="undefined"==typeof globalThis?a:globalThis,c=e(),h=n("String.prototype.slice"),l=n("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},d={__proto__:null};t(c,u&&i&&o?function(t){var e=new f[t];if(Symbol.toStringTag in e&&o){var n=o(e),a=i(n,Symbol.toStringTag);if(!a&&n){var s=o(n);a=i(s,Symbol.toStringTag)}d["$"+t]=r(a.get)}}:function(t){var e=new f[t],n=e.slice||e.set;n&&(d["$"+t]=r(n))});return Qr=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var r=h(s(e),8,-1);return l(c,r)>-1?r:"Object"===r&&function(e){var r=!1;return t(d,(function(t,n){if(!r)try{t(e),r=h(n,1)}catch(t){}})),r}(e)}return i?function(e){var r=!1;return t(d,(function(t,n){if(!r)try{"$"+t(e)===n&&(r=h(n,1))}catch(t){}})),r}(e):null}}function Tn(){if(en)return tn;en=1;var t=Mn();return tn=function(e){return!!t(e)}}function On(){if(nn)return rn;nn=1;var t=nr(),e=Dr()("TypedArray.prototype.buffer",!0),r=Tn();return rn=e||function(e){if(!r(e))throw new t("Not a Typed Array");return e.buffer}}function jn(){if(an)return on;an=1;var t=y().Buffer,e=function(){if(jt)return Ot;jt=1;var t={}.toString;return Ot=Array.isArray||function(e){return"[object Array]"==t.call(e)}}(),r=On(),n=ArrayBuffer.isView||function(t){try{return r(t),!0}catch(t){return!1}},i="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,a=o&&(t.prototype instanceof Uint8Array||t.TYPED_ARRAY_SUPPORT);return on=function(r,s){if(r instanceof t)return r;if("string"==typeof r)return t.from(r,s);if(o&&n(r)){if(0===r.byteLength)return t.alloc(0);if(a){var u=t.from(r.buffer,r.byteOffset,r.byteLength);if(u.byteLength===r.byteLength)return u}var f=r instanceof Uint8Array?r:new Uint8Array(r.buffer,r.byteOffset,r.byteLength),c=t.from(f);if(c.length===r.byteLength)return c}if(i&&r instanceof Uint8Array)return t.from(r);var h=e(r);if(h)for(var l=0;l<r.length;l+=1){var d=r[l];if("number"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError("Array items must be numbers in the range 0-255.")}if(h||t.isBuffer(r)&&r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))return t.from(r);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}function xn(){if(un)return sn;un=1;var t=y().Buffer,e=jn();function r(e,r){this._block=t.alloc(e),this._finalSize=r,this._blockSize=e,this._len=0}return r.prototype.update=function(t,r){t=e(t,r||"utf8");for(var n=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var u=a%i,f=Math.min(o-s,i-u),c=0;c<f;c++)n[u+c]=t[s+c];s+=f,(a+=f)%i==0&&this._update(n)}return this._len+=o,this},r.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},sn=r}function In(){if(pn)return dn;pn=1;var t=_(),e=xn(),r=y().Buffer,n=[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],i=new Array(64);function o(){this.init(),this._w=i,e.call(this,64,56)}function a(t,e,r){return r^t&(e^r)}function s(t,e,r){return t&e|r&(t|e)}function u(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function f(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function c(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}return t(o,e),o.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},o.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,o=0|this._b,h=0|this._c,l=0|this._d,d=0|this._e,p=0|this._f,y=0|this._g,b=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+c(r[g-15])+r[g-16];for(var _=0;_<64;++_){var w=b+f(d)+a(d,p,y)+n[_]+r[_]|0,v=u(i)+s(i,o,h)|0;b=y,y=p,p=d,d=l+w|0,l=h,h=o,o=i,i=w+v|0}this._a=i+this._a|0,this._b=o+this._b|0,this._c=h+this._c|0,this._d=l+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},o.prototype._hash=function(){var t=r.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},dn=o}function Bn(){if(_n)return gn;_n=1;var t=_(),e=xn(),r=y().Buffer,n=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],i=new Array(160);function o(){this.init(),this._w=i,e.call(this,128,112)}function a(t,e,r){return r^t&(e^r)}function s(t,e,r){return t&e|r&(t|e)}function u(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function f(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function c(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function h(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function l(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function d(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function p(t,e){return t>>>0<e>>>0?1:0}return t(o,e),o.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},o.prototype._update=function(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,o=0|this._ch,y=0|this._dh,b=0|this._eh,g=0|this._fh,_=0|this._gh,w=0|this._hh,v=0|this._al,m=0|this._bl,S=0|this._cl,E=0|this._dl,A=0|this._el,k=0|this._fl,R=0|this._gl,P=0|this._hl,M=0;M<32;M+=2)e[M]=t.readInt32BE(4*M),e[M+1]=t.readInt32BE(4*M+4);for(;M<160;M+=2){var T=e[M-30],O=e[M-30+1],j=c(T,O),x=h(O,T),I=l(T=e[M-4],O=e[M-4+1]),B=d(O,T),L=e[M-14],D=e[M-14+1],C=e[M-32],U=e[M-32+1],N=x+D|0,K=j+L+p(N,x)|0;K=(K=K+I+p(N=N+B|0,B)|0)+C+p(N=N+U|0,U)|0,e[M]=K,e[M+1]=N}for(var F=0;F<160;F+=2){K=e[F],N=e[F+1];var V=s(r,i,o),W=s(v,m,S),q=u(r,v),H=u(v,r),G=f(b,A),$=f(A,b),z=n[F],J=n[F+1],Y=a(b,g,_),X=a(A,k,R),Q=P+$|0,Z=w+G+p(Q,P)|0;Z=(Z=(Z=Z+Y+p(Q=Q+X|0,X)|0)+z+p(Q=Q+J|0,J)|0)+K+p(Q=Q+N|0,N)|0;var tt=H+W|0,et=q+V+p(tt,H)|0;w=_,P=R,_=g,R=k,g=b,k=A,b=y+Z+p(A=E+Q|0,E)|0,y=o,E=S,o=i,S=m,i=r,m=v,r=Z+et+p(v=Q+tt|0,Q)|0}this._al=this._al+v|0,this._bl=this._bl+m|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+k|0,this._gl=this._gl+R|0,this._hl=this._hl+P|0,this._ah=this._ah+r+p(this._al,v)|0,this._bh=this._bh+i+p(this._bl,m)|0,this._ch=this._ch+o+p(this._cl,S)|0,this._dh=this._dh+y+p(this._dl,E)|0,this._eh=this._eh+b+p(this._el,A)|0,this._fh=this._fh+g+p(this._fl,k)|0,this._gh=this._gh+_+p(this._gl,R)|0,this._hh=this._hh+w+p(this._hl,P)|0},o.prototype._hash=function(){var t=r.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},gn=o}function Ln(){return mn||(mn=1,(t=rr).exports=function(e){var r=e.toLowerCase(),n=t.exports[r];if(!n)throw new Error(r+" is not supported (we accept pull requests)");return new n},t.exports.sha=function(){if(cn)return fn;cn=1;var t=_(),e=xn(),r=y().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function o(){this.init(),this._w=i,e.call(this,64,56)}function a(t){return t<<30|t>>>2}function s(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}return t(o,e),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,o=0|this._b,u=0|this._c,f=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=i)<<5|e>>>27)+s(d,o,u,f)+c+r[l]+n[d];c=f,f=u,u=a(o),o=i,i=p}this._a=i+this._a|0,this._b=o+this._b|0,this._c=u+this._c|0,this._d=f+this._d|0,this._e=c+this._e|0},o.prototype._hash=function(){var t=r.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},fn=o}(),t.exports.sha1=function(){if(ln)return hn;ln=1;var t=_(),e=xn(),r=y().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function o(){this.init(),this._w=i,e.call(this,64,56)}function a(t){return t<<5|t>>>27}function s(t){return t<<30|t>>>2}function u(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}return t(o,e),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(t){for(var e,r=this._w,i=0|this._a,o=0|this._b,f=0|this._c,c=0|this._d,h=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),y=a(i)+u(p,o,f,c)+h+r[d]+n[p]|0;h=c,c=f,f=s(o),o=i,i=y}this._a=i+this._a|0,this._b=o+this._b|0,this._c=f+this._c|0,this._d=c+this._d|0,this._e=h+this._e|0},o.prototype._hash=function(){var t=r.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},hn=o}(),t.exports.sha224=function(){if(bn)return yn;bn=1;var t=_(),e=In(),r=xn(),n=y().Buffer,i=new Array(64);function o(){this.init(),this._w=i,r.call(this,64,56)}return t(o,e),o.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},o.prototype._hash=function(){var t=n.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},yn=o}(),t.exports.sha256=In(),t.exports.sha384=function(){if(vn)return wn;vn=1;var t=_(),e=Bn(),r=xn(),n=y().Buffer,i=new Array(160);function o(){this.init(),this._w=i,r.call(this,128,112)}return t(o,e),o.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},o.prototype._hash=function(){var t=n.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},wn=o}(),t.exports.sha512=Bn()),rr.exports;var t}var Dn,Cn,Un,Nn,Kn=s(u);function Fn(){if(Cn)return Dn;Cn=1;var t=y().Buffer,e=b.Transform,r=Kn.StringDecoder;function n(t){e.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}_()(n,e);var i="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(t.prototype instanceof Uint8Array||t.TYPED_ARRAY_SUPPORT);return n.prototype.update=function(e,r,n){var a=function(e,r){if(e instanceof t)return e;if("string"==typeof e)return t.from(e,r);if(o&&ArrayBuffer.isView(e)){if(0===e.byteLength)return t.alloc(0);var n=t.from(e.buffer,e.byteOffset,e.byteLength);if(n.byteLength===e.byteLength)return n}if(i&&e instanceof Uint8Array)return t.from(e);if(t.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return t.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(e,r),s=this._update(a);return this.hashMode?this:(n&&(s=this._toString(s,n)),s)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},n.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},n.prototype._finalOrDigest=function(e){var r=this.__final()||t.alloc(0);return e&&(r=this._toString(r,e,!0)),r},n.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new r(e),this._encoding=e),this._encoding!==e)throw new Error("can’t switch encodings");var i=this._decoder.write(t);return n&&(i+=this._decoder.end()),i},Dn=n}var Vn,Wn=function(){if(Nn)return Un;Nn=1;var t=_(),e=function(){if(_t)return gt;_t=1;var t=_(),e=Tt(),r=y().Buffer,n=new Array(16);function i(){e.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(t,e){return t<<e|t>>>32-e}function a(t,e,r,n,i,a,s){return o(t+(e&r|~e&n)+i+a|0,s)+e|0}function s(t,e,r,n,i,a,s){return o(t+(e&n|r&~n)+i+a|0,s)+e|0}function u(t,e,r,n,i,a,s){return o(t+(e^r^n)+i+a|0,s)+e|0}function f(t,e,r,n,i,a,s){return o(t+(r^(e|~n))+i+a|0,s)+e|0}return t(i,e),i.prototype._update=function(){for(var t=n,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,o=this._c,c=this._d;r=a(r,i,o,c,t[0],3614090360,7),c=a(c,r,i,o,t[1],3905402710,12),o=a(o,c,r,i,t[2],606105819,17),i=a(i,o,c,r,t[3],3250441966,22),r=a(r,i,o,c,t[4],4118548399,7),c=a(c,r,i,o,t[5],1200080426,12),o=a(o,c,r,i,t[6],2821735955,17),i=a(i,o,c,r,t[7],4249261313,22),r=a(r,i,o,c,t[8],1770035416,7),c=a(c,r,i,o,t[9],2336552879,12),o=a(o,c,r,i,t[10],4294925233,17),i=a(i,o,c,r,t[11],2304563134,22),r=a(r,i,o,c,t[12],1804603682,7),c=a(c,r,i,o,t[13],4254626195,12),o=a(o,c,r,i,t[14],2792965006,17),r=s(r,i=a(i,o,c,r,t[15],1236535329,22),o,c,t[1],4129170786,5),c=s(c,r,i,o,t[6],3225465664,9),o=s(o,c,r,i,t[11],643717713,14),i=s(i,o,c,r,t[0],3921069994,20),r=s(r,i,o,c,t[5],3593408605,5),c=s(c,r,i,o,t[10],38016083,9),o=s(o,c,r,i,t[15],3634488961,14),i=s(i,o,c,r,t[4],3889429448,20),r=s(r,i,o,c,t[9],568446438,5),c=s(c,r,i,o,t[14],3275163606,9),o=s(o,c,r,i,t[3],4107603335,14),i=s(i,o,c,r,t[8],1163531501,20),r=s(r,i,o,c,t[13],2850285829,5),c=s(c,r,i,o,t[2],4243563512,9),o=s(o,c,r,i,t[7],1735328473,14),r=u(r,i=s(i,o,c,r,t[12],2368359562,20),o,c,t[5],4294588738,4),c=u(c,r,i,o,t[8],2272392833,11),o=u(o,c,r,i,t[11],1839030562,16),i=u(i,o,c,r,t[14],4259657740,23),r=u(r,i,o,c,t[1],2763975236,4),c=u(c,r,i,o,t[4],1272893353,11),o=u(o,c,r,i,t[7],4139469664,16),i=u(i,o,c,r,t[10],3200236656,23),r=u(r,i,o,c,t[13],681279174,4),c=u(c,r,i,o,t[0],3936430074,11),o=u(o,c,r,i,t[3],3572445317,16),i=u(i,o,c,r,t[6],76029189,23),r=u(r,i,o,c,t[9],3654602809,4),c=u(c,r,i,o,t[12],3873151461,11),o=u(o,c,r,i,t[15],530742520,16),r=f(r,i=u(i,o,c,r,t[2],3299628645,23),o,c,t[0],4096336452,6),c=f(c,r,i,o,t[7],1126891415,10),o=f(o,c,r,i,t[14],2878612391,15),i=f(i,o,c,r,t[5],4237533241,21),r=f(r,i,o,c,t[12],1700485571,6),c=f(c,r,i,o,t[3],2399980690,10),o=f(o,c,r,i,t[10],4293915773,15),i=f(i,o,c,r,t[1],2240044497,21),r=f(r,i,o,c,t[8],1873313359,6),c=f(c,r,i,o,t[15],4264355552,10),o=f(o,c,r,i,t[6],2734768916,15),i=f(i,o,c,r,t[13],1309151649,21),r=f(r,i,o,c,t[4],4149444226,6),c=f(c,r,i,o,t[11],3174756917,10),o=f(o,c,r,i,t[2],718787259,15),i=f(i,o,c,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+o|0,this._d=this._d+c|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=r.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},gt=i}(),r=function(){if(vt)return wt;vt=1;var t=w.Buffer,e=_(),r=Tt(),n=new Array(16),i=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],o=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],a=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function c(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(t,e){return t<<e|t>>>32-e}function l(t,e,r,n,i,o,a,s){return h(t+(e^r^n)+o+a|0,s)+i|0}function d(t,e,r,n,i,o,a,s){return h(t+(e&r|~e&n)+o+a|0,s)+i|0}function p(t,e,r,n,i,o,a,s){return h(t+((e|~r)^n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return h(t+(e&n|r&~n)+o+a|0,s)+i|0}function b(t,e,r,n,i,o,a,s){return h(t+(e^(r|~n))+o+a|0,s)+i|0}return e(c,r),c.prototype._update=function(){for(var t=n,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,c=0|this._b,g=0|this._c,_=0|this._d,w=0|this._e,v=0|this._a,m=0|this._b,S=0|this._c,E=0|this._d,A=0|this._e,k=0;k<80;k+=1){var R,P;k<16?(R=l(r,c,g,_,w,t[i[k]],u[0],a[k]),P=b(v,m,S,E,A,t[o[k]],f[0],s[k])):k<32?(R=d(r,c,g,_,w,t[i[k]],u[1],a[k]),P=y(v,m,S,E,A,t[o[k]],f[1],s[k])):k<48?(R=p(r,c,g,_,w,t[i[k]],u[2],a[k]),P=p(v,m,S,E,A,t[o[k]],f[2],s[k])):k<64?(R=y(r,c,g,_,w,t[i[k]],u[3],a[k]),P=d(v,m,S,E,A,t[o[k]],f[3],s[k])):(R=b(r,c,g,_,w,t[i[k]],u[4],a[k]),P=l(v,m,S,E,A,t[o[k]],f[4],s[k])),r=w,w=_,_=h(g,10),g=c,c=R,v=A,A=E,E=h(S,10),S=m,m=P}var M=this._b+g+E|0;this._b=this._c+_+A|0,this._c=this._d+w+v|0,this._d=this._e+r+m|0,this._e=this._a+c+S|0,this._a=M},c.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=t.alloc?t.alloc(20):new t(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},wt=c}(),n=Ln(),i=Fn();function o(t){i.call(this,"digest"),this._hash=t}return t(o,i),o.prototype._update=function(t){this._hash.update(t)},o.prototype._final=function(){return this._hash.digest()},Un=function(t){return"md5"===(t=t.toLowerCase())?new e:"rmd160"===t||"ripemd160"===t?new r:new o(n(t))}}(),qn=i(Wn),Hn={exports:{}};var Gn,$n,zn,Jn,Yn,Xn,Qn=function(){if(Vn)return Hn.exports;Vn=1;var t=65536,e=4294967295,r=y().Buffer,n=a.crypto||a.msCrypto;return n&&n.getRandomValues?Hn.exports=function(i,o){if(i>e)throw new RangeError("requested too many random bytes");var a=r.allocUnsafe(i);if(i>0)if(i>t)for(var s=0;s<i;s+=t)n.getRandomValues(a.slice(s,s+t));else n.getRandomValues(a);if("function"==typeof o)return f((function(){o(null,a)}));return a}:Hn.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},Hn.exports}(),Zn=i(Qn);var ti=function(){if(Xn)return Yn;Xn=1;const{CryptoLD:t}=($n||($n=1,Gn={CryptoLD:class{constructor({suites:t}={}){this.suites=t||new Map}use(t){this.suites.set(t.suite,t)}async generate(t={}){return this._suiteForType(t).generate(t)}async from(t={}){const e=this._suiteForType(t);return t["@context"]?e.fromKeyDocument({document:t}):e.from(t)}async fromKeyDocument({document:t,checkContext:e=!0,checkRevoked:r=!0}={}){if(!t)throw new TypeError('The "document" parameter is required.');return this._suiteForType(t).fromKeyDocument({document:t,checkContext:e,checkRevoked:r})}async fromKeyId({id:t,documentLoader:e,checkContext:r=!0,checkRevoked:n=!0}={}){if(!t)throw new TypeError('The "id" parameter is required.');if(!e)throw new TypeError('The "documentLoader" parameter is required.');let i;try{if(({document:i}=await e(t)),!i)throw new Error('The "documentLoader" function must return a "document" object.')}catch(t){const e=new Error("Error fetching document: "+t.message);throw e.cause=t,e}const o=i.type;if(!o)throw new Error("Key suite type not found in fetched document.");const a=this.suites.get(o);if(!a)throw new Error(`Support for suite "${o}" is not installed.`);return a.fromKeyDocument({document:i,checkContext:r,checkRevoked:n})}_installed({type:t}){return this.suites.has(t)}_suiteForType(t){const e=t&&t.type;if(!e)throw new TypeError("Missing key type.");if(!this._installed({type:e}))throw new Error(`Support for key type "${e}" is not installed.`);return this.suites.get(e)}}}),Gn),{LDKeyPair:e}=function(){if(Jn)return zn;Jn=1;class t{constructor({id:t,controller:e,revoked:r}={}){this.id=t,this.controller=e,this.revoked=r}static async generate(){throw new Error("Abstract method, must be implemented in subclass.")}static async fromKeyDocument({document:t,checkContext:e=!0,checkRevoked:r=!0}={}){if(!t)throw new TypeError('The "document" parameter is required.');if(e&&![].concat(t["@context"]).includes(this.SUITE_CONTEXT))throw new Error('Key document does not contain required context "'+this.SUITE_CONTEXT+'".');if(r&&t.revoked)throw new Error(`Key has been revoked since: "${t.revoked}".`);return this.from(t)}static async from(){throw new Error("Abstract method from() must be implemented in subclass.")}export({publicKey:t=!1,privateKey:e=!1}={}){if(!t&&!e)throw new Error('Export requires specifying either "publicKey" or "privateKey".');const r={id:this.id,type:this.type,controller:this.controller};return this.revoked&&(r.revoked=this.revoked),r}fingerprint(){throw new Error("Abstract method, must be implemented in subclass.")}verifyFingerprint(){throw new Error("Abstract method, must be implemented in subclass.")}signer(){return{async sign({}){throw new Error("Abstract method, must be implemented in subclass.")}}}verifier(){return{async verify({}){throw new Error("Abstract method, must be implemented in subclass.")}}}}return t.SUITE_CONTEXT="INVALID LDKeyPair CONTEXT",zn={LDKeyPair:t}}();return Yn={CryptoLD:t,LDKeyPair:e}}(),ei=i(ti);const ri="EcdsaSecp256k1VerificationKey2019",ni=t=>qn("sha256").update(t).digest();class ii extends ei.LDKeyPair{constructor({publicKeyBase58:t,privateKeyBase58:e,...r}){if(super(r),this.type=void 0,this.publicKeyBase58=void 0,this.privateKeyBase58=void 0,e&&!t){const t=v.publicKeyCreate(m(e));this.publicKeyBase58=S(t)}else this.publicKeyBase58=t;if(this.type=ri,this.privateKeyBase58=e,!this.publicKeyBase58)throw new TypeError('The "publicKeyBase58" property is required.')}static from(t){if(t.publicKeyHex||t.privateKeyHex){const{publicKeyHex:e,privateKeyHex:r,...n}=t;return new ii({...n,publicKeyBase58:e?S(o.from(e,"hex")):void 0,privateKeyBase58:r?S(o.from(r,"hex")):void 0})}return new ii(t)}static async generate({seed:t,compressed:e,...r}){if(t&&!v.privateKeyVerify(t))throw new Error("Provided seed is not a valid private key");let n=t;for(;void 0===n||!v.privateKeyVerify(n);)n=new Uint8Array(Zn(32));const i=v.publicKeyCreate(n,e);return new ii({publicKeyBase58:S(i),privateKeyBase58:S(n),...r})}export({publicKey:t=!1,privateKey:e=!1,includeContext:r=!1}={}){if(!t&&!e)throw new TypeError('export requires specifying either "publicKey" or "privateKey".');if(e&&!this.privateKeyBase58)throw new TypeError("No privateKey to export.");if(t&&!this.publicKeyBase58)throw new TypeError("No publicKey to export.");const n={type:this.type,id:this.id,controller:this.controller,revoked:this.revoked};return r&&(n["@context"]=ii.SUITE_CONTEXT),e&&(n.privateKeyBase58=this.privateKeyBase58),t&&(n.publicKeyBase58=this.publicKeyBase58),n}signer(){const{privateKeyBase58:t}=this;return t?{async sign({data:e}){const r=p.encode(JSON.stringify({alg:"ES256K",b64:!1,crit:["b64"]})),n=o.from(e.buffer,e.byteOffset,e.length),i=ni(o.from(o.concat([o.from(`${r}.`,"utf8"),o.from(n.buffer,n.byteOffset,n.length)]))),{signature:a}=v.ecdsaSign(i,m(t));return`${r}..${p.encode(o.from(a))}`},id:this.id}:{async sign(){throw new Error("No private key to sign with.")},id:this.id}}verifier(){const{publicKeyBase58:t}=this;return t?{async verify({data:e,signature:r}){if(r.indexOf("..")<0)return!1;const[n,i]=r.split(".."),a=JSON.parse(p.decode(n));if("ES256K"!==a.alg||!1!==a.b64||!a.crit||!a.crit.length||"b64"!==a.crit[0])return!1;const s=o.from(e.buffer,e.byteOffset,e.length),u=ni(o.from(o.concat([o.from(`${n}.`,"utf8"),o.from(s.buffer,s.byteOffset,s.length)])));let f;try{f=v.ecdsaVerify(o.from(p.decode(i,"hex"),"hex"),u,m(t))}catch(t){f=!1}return f},id:this.id}:{async verify(){throw new Error("No public key to verify against")},id:this.id}}}ii.suite=ri,ii.SUITE_CONTEXT="https://ns.did.ai/suites/secp256k1-2019/v1";const oi="https://ns.did.ai/suites/secp256k1-2019/v1",ai="https://www.w3.org/ns/credentials/v2",si=({document:t,contextUrl:e})=>{const r=t["@context"];return Array.isArray(r)?e.some((t=>r.includes(t))):e.includes(r)},ui=({document:t})=>{const e=si({document:t,contextUrl:[oi,"https://w3id.org/security/suites/secp256k1-2019/v1"]}),r=si({document:t,contextUrl:["https://www.w3.org/2018/credentials/v1"]}),n=si({document:t,contextUrl:[ai]}),i=si({document:t,contextUrl:["https://w3id.org/security/v2"]});return e&&r?(console.warn("Warning: The secp256k1-2019/v1 and credentials/v1 contexts are incompatible."),console.warn("For VCs using EcdsaSecp256k1Signature2019 suite, using the credentials/v1 context is sufficient."),!1):!e&&n?(console.warn("This library does not (yet) follow the Data Integrity Proof format."),console.warn("When using the credentials/v2 context, consumers need to specify the secp256k1-2019/v1 context."),!1):e&&i?(console.warn("Warning: The secp256k1-2019/v1 and security/v2 contexts are incompatible."),console.warn("For VCs using EcdsaSecp256k1Signature2019 suite, using the security/v2 context is sufficient."),!1):e||r||i};let fi=class extends l.suites.LinkedDataSignature{constructor(t={}){super({type:"EcdsaSecp256k1Signature2019",LDKeyClass:ii,contextUrl:oi,...t}),this.requiredKeyType=void 0,this.requiredKeyType="EcdsaSecp256k1VerificationKey2019"}async sign({verifyData:t,proof:e}){if(!this.signer||"function"!=typeof this.signer.sign)throw new Error("A signer API has not been specified.");return{...e,jws:await this.signer.sign({data:t})}}async verifySignature({verifyData:t,verificationMethod:e,proof:r}){const{jws:n}=r;if(!n||"string"!=typeof n)throw new TypeError('The proof does not include a valid "jws" property.');let{verifier:i}=this;if(!i){i=(await this.LDKeyClass.from(e)).verifier()}return i.verify({data:t,signature:n})}async assertVerificationMethod({verificationMethod:t}){if(!ui({document:t}))throw new TypeError(`The verification method (key) must contain "${this.contextUrl}".`);if(!d.hasValue(t,"type",this.requiredKeyType))throw new Error(`Invalid key type. Key type must be "${this.requiredKeyType}".`);if(void 0!==t.revoked)throw new Error("The verification method has been revoked.")}async getVerificationMethod({proof:t,documentLoader:e}){if(this.key)return this.key.export({publicKey:!0});const r="object"==typeof t.verificationMethod?t.verificationMethod.id:t.verificationMethod;if(!r)throw new Error('No "verificationMethod" found in proof.');const n=await d.frame(r,{"@context":this.contextUrl,"@embed":"@always",id:r},{documentLoader:e,compactToRelative:!1});if(!n)throw new Error(`Verification method ${r} not found.`);if(void 0!==n.revoked)throw new Error("The verification method has been revoked.");return await this.assertVerificationMethod({verificationMethod:n}),n}async matchProof({proof:t,document:e,purpose:r,documentLoader:n,expansionMap:i}){if(!ui({document:e}))return!1;if(!await super.matchProof({proof:t,document:e,purpose:r,documentLoader:n,expansionMap:i}))return!1;if(!this.key)return!0;const{verificationMethod:o}=t,a="object"==typeof o?o.id:o;return this.isVerificationMethodMatchingKeyId(a)}ensureSuiteContext({document:t,addSuiteContext:e}){ui({document:t})&&!si({document:t,contextUrl:[ai]})||super.ensureSuiteContext({document:t,addSuiteContext:e})}isVerificationMethodMatchingKeyId(t){return t===this.key.id||t===`${this.key.controller}${this.key.id}`}};fi.CONTEXT_URL=oi,fi.CONTEXT={"@context":{id:"@id",type:"@type","@protected":!0,proof:{"@id":"https://w3id.org/security#proof","@type":"@id","@container":"@graph"},EcdsaSecp256k1VerificationKey2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1VerificationKey2019","@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"},blockchainAccountId:{"@id":"https://w3id.org/security#blockchainAccountId"},publicKeyJwk:{"@id":"https://w3id.org/security#publicKeyJwk","@type":"@json"},publicKeyBase58:{"@id":"https://w3id.org/security#publicKeyBase58"},publicKeyMultibase:{"@id":"https://w3id.org/security#publicKeyMultibase","@type":"https://w3id.org/security#multibase"}}},EcdsaSecp256k1Signature2019:{"@id":"https://w3id.org/security#EcdsaSecp256k1Signature2019","@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"}}},jws:{"@id":"https://w3id.org/security#jws"},verificationMethod:{"@id":"https://w3id.org/security#verificationMethod","@type":"@id"}}}}};const{purposes:{AssertionProofPurpose:ci,AuthenticationProofPurpose:hi}}=l;var li;!function(t){t.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",t.ensureVerificationMethodValidity="ensureVerificationMethodValidity",t.checkDocumentSignature="checkDocumentSignature"}(li||(li={}));class di extends E{verificationProcess=[li.retrieveVerificationMethodPublicKey,li.ensureVerificationMethodValidity,li.checkDocumentSignature];documentToVerify;issuer;proof;type="EcdsaSecp256k1Signature2019";verificationKey;verificationMethod;publicKey;proofPurpose;challenge;domain;proofPurposeMap;constructor(t){super(t),t.executeStep&&(this.executeStep=t.executeStep),this.documentToVerify=t.document,this.issuer=t.issuer,this.proof=t.proof,this.proofPurpose=t.proofPurpose??"assertionMethod",this.challenge=t.proofChallenge??"",this.domain=t.proofDomain,this.proofPurposeMap={authentication:hi,assertionMethod:ci},this.validateProofType()}async init(){}async verifyProof(){for(const t of this.verificationProcess){if(!this[t])return void console.error("verification logic for",t,"not implemented");await this[t]()}}async verifyIdentity(){}getProofVerificationSteps(e){return this.verificationProcess.map((r=>t.verifier.convertToVerificationSubsteps(e,r)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return this.publicKey}getIssuerName(){return this.issuer.name??""}getIssuerProfileDomain(){try{return new URL(this.getIssuerProfileUrl()).hostname??""}catch(t){return""}}getIssuerProfileUrl(){return this.issuer.id??""}getSigningDate(){return this.proof.created}async executeStep(t,e,r){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}validateProofType(){const t=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if(t!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${t}`)}isProofChain(){return"ChainedProof2021"===this.proof.type}generateDocumentLoader(){e[this.documentToVerify.issuer]=this.getTargetVerificationMethodContainer();return function(t){return t in e?{contextUrl:null,document:e[t],documentUrl:t}:d.documentLoader(t)}}retrieveInitialDocument(){const t=r(this.documentToVerify);if(Array.isArray(t.proof)){const e=t.proof.find((t=>t.type===this.type));delete t.proof,t.proof=e}return t}getTargetVerificationMethodContainer(){if(this.issuer.didDocument){if(this.findVerificationMethod(this.issuer.didDocument.verificationMethod,this.issuer.didDocument.id))return this.issuer.didDocument}const t={...this.issuer};return delete t.didDocument,t}findVerificationMethod(t,e){return t.find((t=>t.id===this.proof.verificationMethod||e+t.id===this.proof.verificationMethod))??null}getErrorMessage(t){return t.error.errors[0].message}async retrieveVerificationMethodPublicKey(){this.verificationKey=await this.executeStep(li.retrieveVerificationMethodPublicKey,(async()=>{if(this.verificationMethod=R(this.getTargetVerificationMethodContainer(),this.proof.verificationMethod),this.verificationMethod.publicKeyJwk&&!this.verificationMethod.publicKeyBase58){const t=A(this.verificationMethod.publicKeyJwk);this.verificationMethod.publicKeyBase58=k(t),this.documentToVerify["@context"].includes("https://www.w3.org/ns/credentials/v2")&&!this.documentToVerify["@context"].includes("https://w3id.org/security/suites/secp256k1-2019/v1")&&this.documentToVerify["@context"].push("https://w3id.org/security/suites/secp256k1-2019/v1")}this.publicKey=this.verificationMethod.publicKeyBase58;const t=ii.from({...this.verificationMethod});if(!t)throw new n(li.retrieveVerificationMethodPublicKey,"Could not derive the verification key");if(t.revoked)throw new n(li.retrieveVerificationMethodPublicKey,"The verification key has been revoked");return t}),this.type)}async ensureVerificationMethodValidity(){await this.executeStep(li.ensureVerificationMethodValidity,(async()=>{if(this.verificationMethod.expires){if(new Date(this.verificationMethod.expires).getTime()<Date.now())throw new n(li.ensureVerificationMethodValidity,"The verification key has expired")}if(this.verificationMethod.revoked)throw new n(li.ensureVerificationMethodValidity,"The verification key has been revoked")}),this.type)}async checkDocumentSignature(){await this.executeStep(li.checkDocumentSignature,(async()=>{const t=new fi({key:this.verificationKey});t.date=new Date(Date.now()).toISOString(),"authentication"!==this.proofPurpose||this.proof.challenge||(this.proof.challenge="");const e=await l.verify(this.retrieveInitialDocument(),{suite:t,purpose:new this.proofPurposeMap[this.proofPurpose]({controller:this.getTargetVerificationMethodContainer(),challenge:this.challenge,domain:this.domain}),documentLoader:this.generateDocumentLoader()});if(!e.verified)throw console.error(JSON.stringify(e,null,2)),new n(li.checkDocumentSignature,`The document's ${this.type} signature could not be confirmed: ${this.getErrorMessage(e)}`);console.log("Credential Secp256k1 signature successfully verified")}),this.type)}}export{di as default};
@@ -1,14 +0,0 @@
1
- import{d as e,f as i,V as t}from"./main.js";import{D as o,r}from"./DataIntegrityProof-CsicZNrL-BkSRjzkI.js";import{j as n}from"./jsonld-BAMY2WqE-BJ5uVeOU.js";import{E as s,f as a}from"./ed25519-key-pair.esm-DQF2kkXh-XX5BXBcl.js";import{j as c}from"./jsonld-signatures-BbHr1fSN-BSospRuX.js";import{S as h}from"./Suite-BmP2Qu19-D1ucdMDB.js";import{j as d}from"./keyUtils-ue8EY3Op-DoHdKWgN.js";import"./tslib.es6--gQC4x5c-CmLYFWVC.js";import"./x25519-hG3WOzPe-Dh8L0KYb.js";import"./elliptic-6I21PEnR-CsYseRX1.js";import"./index-DZLKRa_V-D_IQzjvG.js";import"./base64url-Cy03LJLt-vkTPfQOh.js";import"./_commonjs-dynamic-modules-COweQ1RR-BHR_E30J.js";import"./elliptic-mDX7fQQx-BpaNaVm0.js";
2
- /*!
3
- * Copyright (c) 2023-2024 Digital Bazaar, Inc. All rights reserved.
4
- */
5
- /*!
6
- * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
7
- */
8
- const f={canonize:async function(e,i){i={algorithm:"RDFC-1.0",format:"application/n-quads",base:null,safe:!0,...i};const t={rdfDirection:"i18n-datatype",...i,produceGeneralizedRdf:!1};delete t.format;const o=await n.toRDF(e,t);return r.canonize(o,i)}
9
- /*!
10
- * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
11
- */,createVerifier:async function({verificationMethod:e}){return(await a(e)).verifier()},name:"eddsa-rdfc-2022",requiredAlgorithm:"Ed25519"},{purposes:{AssertionProofPurpose:u,AuthenticationProofPurpose:p}}=c;
12
- /*!
13
- * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved.
14
- */var l;!function(e){e.retrieveVerificationMethodPublicKey="retrieveVerificationMethodPublicKey",e.ensureVerificationMethodValidity="ensureVerificationMethodValidity",e.checkDocumentSignature="checkDocumentSignature"}(l||(l={}));class y extends h{verificationProcess=[l.retrieveVerificationMethodPublicKey,l.ensureVerificationMethodValidity,l.checkDocumentSignature];documentToVerify;issuer;proof;type="EddsaRdfc2022";cryptosuite="eddsa-rdfc-2022";verificationKey;verificationMethod;publicKey;proofPurpose;challenge;domain;proofPurposeMap;constructor(e){super(e),e.executeStep&&(this.executeStep=e.executeStep),this.documentToVerify=e.document,this.issuer=e.issuer,this.proof=e.proof,this.proofPurpose=e.proofPurpose??"assertionMethod",this.challenge=e.proofChallenge??"",this.domain=e.proofDomain,this.proofPurposeMap={authentication:p,assertionMethod:u},this.validateProofType()}async init(){}async verifyProof(){for(const e of this.verificationProcess){if(!this[e])return void console.error("verification logic for",e,"not implemented");await this[e]()}}async verifyIdentity(){}getProofVerificationSteps(i){return this.verificationProcess.map((t=>e.verifier.convertToVerificationSubsteps(i,t)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return this.publicKey}getIssuerName(){return this.issuer.name??""}getIssuerProfileDomain(){try{return new URL(this.getIssuerProfileUrl()).hostname??""}catch(e){return""}}getIssuerProfileUrl(){return this.issuer.id??""}getSigningDate(){return this.proof.created}async executeStep(e,i,t){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}async publicKeyJwkToString(e){return await s.fingerprintFromPublicKey(e)}validateProofType(){const e=this.isProofChain()?this.proof.chainedProofType:this.proof.type;if("DataIntegrityProof"!==e){if(e!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${e}`)}else{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}`)}}isProofChain(){return"ChainedProof2021"===this.proof.type}generateDocumentLoader(){i[this.documentToVerify.issuer]=this.issuer.didDocument,i[this.proof.verificationMethod]=this.getMultikeyRepresentation();return function(e){return e in i?{contextUrl:null,document:i[e],documentUrl:e}:n.documentLoader(e)}}getErrorMessage(e){return e.error.errors[0].message}getTargetVerificationMethodContainer(){if(this.issuer.didDocument){if(this.findVerificationMethod(this.issuer.didDocument.verificationMethod,this.issuer.didDocument.id))return this.issuer.didDocument}const e={...this.issuer};return delete e.didDocument,e}findVerificationMethod(e,i){return e.find((e=>e.id===this.proof.verificationMethod||i+e.id===this.proof.verificationMethod))??null}getMultikeyRepresentation(){return{"@context":"https://w3id.org/security/multikey/v1",type:"Multikey",publicKeyMultibase:d(this.verificationMethod.publicKeyJwk),id:"string"==typeof this.verificationMethod.id?this.verificationMethod.id:void 0,controller:"string"==typeof this.verificationMethod.controller?this.verificationMethod.controller:void 0}}async retrieveVerificationMethodPublicKey(){this.verificationKey=await this.executeStep(l.retrieveVerificationMethodPublicKey,(async()=>{const e=this.getTargetVerificationMethodContainer();if(!e)throw new t(l.retrieveVerificationMethodPublicKey,"The verification method of the document does not match the provided issuer.");if(this.verificationMethod=this.findVerificationMethod(e.verificationMethod,e.id),!this.verificationMethod)throw new t(l.retrieveVerificationMethodPublicKey,"The verification method of the document does not match the provided issuer.");try{this.publicKey=this.verificationMethod.publicKeyMultibase??await this.publicKeyJwkToString(this.verificationMethod)}catch(e){console.error("ERROR retrieving Ed25519Signature2020 public key",e)}const i=await a({...this.verificationMethod});if(!i)throw new t(l.retrieveVerificationMethodPublicKey,"Could not derive the verification key");if(i.revoked)throw new t(l.retrieveVerificationMethodPublicKey,"The verification key has been revoked");return i}),this.type)}async ensureVerificationMethodValidity(){await this.executeStep(l.ensureVerificationMethodValidity,(async()=>{if(this.verificationMethod.expires){if(new Date(this.verificationMethod.expires).getTime()<Date.now())throw new t(l.ensureVerificationMethodValidity,"The verification key has expired")}if(this.verificationMethod.revoked)throw new t(l.ensureVerificationMethodValidity,"The verification key has been revoked")}),this.type)}async checkDocumentSignature(){await this.executeStep(l.checkDocumentSignature,(async()=>{const e=new o({cryptosuite:f}),i=await c.verify(this.documentToVerify,{suite:e,purpose:new this.proofPurposeMap[this.proofPurpose]({controller:this.getTargetVerificationMethodContainer(),challenge:this.challenge,domain:this.domain}),documentLoader:this.generateDocumentLoader()});if(!i.verified)throw console.error(JSON.stringify(i,null,2)),new t(l.checkDocumentSignature,`The document's ${this.type} signature could not be confirmed: ${this.getErrorMessage(i)}`);console.log("Credential EddsaRdfc2022 signature successfully verified")}),this.type)}}export{y as default};