@wix/cli-app 1.1.17 → 1.1.19

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 (120) hide show
  1. package/build/CreateVersionCommand-3UL6NYDF.js +4 -0
  2. package/build/{CreateVersionCommand-F7A6HDJI.js.map → CreateVersionCommand-3UL6NYDF.js.map} +1 -1
  3. package/build/DevCommand-GD7XT72H.js +4 -0
  4. package/build/DevCommand-GD7XT72H.js.map +1 -0
  5. package/build/GenerateCommand-YW37BTUB.js +99 -0
  6. package/build/GenerateCommand-YW37BTUB.js.map +1 -0
  7. package/build/PreviewCommand-HDEZ6LT3.js +4 -0
  8. package/build/{ServeCommand-Z5NQEEE5.js → ServeCommand-YRMZVHZN.js} +2 -2
  9. package/build/ServeCommand-YRMZVHZN.js.map +1 -0
  10. package/build/build-FJMITZHU.js +4 -0
  11. package/build/build-FJMITZHU.js.map +1 -0
  12. package/build/chunk-4VOJ4MBF.js +4 -0
  13. package/build/chunk-4VOJ4MBF.js.map +1 -0
  14. package/build/{chunk-QW5H4VGJ.js → chunk-56GO226U.js} +2 -2
  15. package/build/chunk-56GO226U.js.map +1 -0
  16. package/build/chunk-6U7WFIFR.js +87 -0
  17. package/build/chunk-6U7WFIFR.js.map +1 -0
  18. package/build/chunk-CXTD4ANR.js +4 -0
  19. package/build/{chunk-S7NF452E.js → chunk-EL4LLNE3.js} +2 -2
  20. package/build/chunk-EVTSTCPY.js +4 -0
  21. package/build/chunk-EVTSTCPY.js.map +1 -0
  22. package/build/chunk-FMEEFVFZ.js +4 -0
  23. package/build/chunk-FMEEFVFZ.js.map +1 -0
  24. package/build/chunk-I4ARVL5S.js +6 -0
  25. package/build/chunk-I4ARVL5S.js.map +1 -0
  26. package/build/chunk-KF76KJSL.js +4 -0
  27. package/build/chunk-KF76KJSL.js.map +1 -0
  28. package/build/chunk-L47BPWKS.js +23 -0
  29. package/build/chunk-L47BPWKS.js.map +1 -0
  30. package/build/chunk-LINHFSVS.js +4 -0
  31. package/build/{chunk-G7NSXRI7.js.map → chunk-LINHFSVS.js.map} +1 -1
  32. package/build/chunk-LKXDY7ME.js +27 -0
  33. package/build/chunk-LKXDY7ME.js.map +1 -0
  34. package/build/chunk-MNS7PUKJ.js +11 -0
  35. package/build/chunk-MNS7PUKJ.js.map +1 -0
  36. package/build/{chunk-7TOOBLT6.js → chunk-POJEX3XJ.js} +12 -12
  37. package/build/chunk-POJEX3XJ.js.map +1 -0
  38. package/build/chunk-PWKG7UKK.js +4 -0
  39. package/build/{chunk-ZIVYB6TM.js.map → chunk-PWKG7UKK.js.map} +1 -1
  40. package/build/{chunk-RYS7G2PY.js → chunk-QLWXUOAT.js} +2 -2
  41. package/build/{chunk-3EQ4ZYU2.js → chunk-QOQRQIMF.js} +2 -2
  42. package/build/chunk-QZS4ARDD.js +4 -0
  43. package/build/chunk-QZS4ARDD.js.map +1 -0
  44. package/build/chunk-RJKCVYVO.js +73 -0
  45. package/build/chunk-RJKCVYVO.js.map +1 -0
  46. package/build/{chunk-JIUANWPO.js → chunk-TPV6MPZ4.js} +2 -2
  47. package/build/{chunk-PSXIV7FJ.js → chunk-V35F6N6Y.js} +2 -2
  48. package/build/{chunk-HFDLXX7R.js → chunk-V4TR6DCM.js} +1 -1
  49. package/build/{chunk-GHVN7KTY.js → chunk-YE7MFP76.js} +2 -2
  50. package/build/chunk-YE7MFP76.js.map +1 -0
  51. package/build/{devtools-WFBFD7GB.js → devtools-WDPQJNQZ.js} +2 -2
  52. package/build/{devtools-WFBFD7GB.js.map → devtools-WDPQJNQZ.js.map} +1 -1
  53. package/build/{esm-CECOC7V2.js → esm-MUZJUC5Q.js} +4 -4
  54. package/build/esm-MUZJUC5Q.js.map +1 -0
  55. package/build/index.js +14 -14
  56. package/build/index.js.map +1 -1
  57. package/build/preview-3ZAXKZ4E.js +4 -0
  58. package/build/preview-3ZAXKZ4E.js.map +1 -0
  59. package/build/{render-command-JEBHYUZV.js → render-command-SBXRR4MG.js} +2 -2
  60. package/build/{types.impl-HD4UTKFC.js → types.impl-V4PI7Z6L.js} +2 -2
  61. package/build/types.impl-V4PI7Z6L.js.map +1 -0
  62. package/package.json +8 -7
  63. package/schemas/custom-element.json +1 -1
  64. package/schemas/dashboard-menu-plugin.json +1 -1
  65. package/schemas/dashboard-modal.json +1 -1
  66. package/schemas/dashboard-page.json +1 -1
  67. package/schemas/dashboard-plugin.json +1 -1
  68. package/schemas/embedded-script.json +1 -1
  69. package/schemas/wix-config.json +1 -1
  70. package/templates/custom-element/element.tsx.ejs +27 -4
  71. package/templates/custom-element/panel.tsx.ejs +45 -6
  72. package/build/CreateVersionCommand-F7A6HDJI.js +0 -4
  73. package/build/DevCommand-KHV22E2S.js +0 -4
  74. package/build/DevCommand-KHV22E2S.js.map +0 -1
  75. package/build/GenerateCommand-46EMTVWN.js +0 -99
  76. package/build/GenerateCommand-46EMTVWN.js.map +0 -1
  77. package/build/PreviewCommand-XX7TWOJR.js +0 -4
  78. package/build/PreviewCommand-XX7TWOJR.js.map +0 -1
  79. package/build/ServeCommand-Z5NQEEE5.js.map +0 -1
  80. package/build/build-WOV3ZNZF.js +0 -4
  81. package/build/build-WOV3ZNZF.js.map +0 -1
  82. package/build/chunk-4NIGEF2O.js +0 -87
  83. package/build/chunk-4NIGEF2O.js.map +0 -1
  84. package/build/chunk-62RRZRN6.js +0 -6
  85. package/build/chunk-62RRZRN6.js.map +0 -1
  86. package/build/chunk-7IB3ZF3I.js +0 -4
  87. package/build/chunk-7IB3ZF3I.js.map +0 -1
  88. package/build/chunk-7TOOBLT6.js.map +0 -1
  89. package/build/chunk-CUWQRNQL.js +0 -4
  90. package/build/chunk-EH27FYQH.js +0 -4
  91. package/build/chunk-EH27FYQH.js.map +0 -1
  92. package/build/chunk-G7NSXRI7.js +0 -4
  93. package/build/chunk-GHVN7KTY.js.map +0 -1
  94. package/build/chunk-KK4X6NH5.js +0 -4
  95. package/build/chunk-KK4X6NH5.js.map +0 -1
  96. package/build/chunk-LT3WXWI5.js +0 -23
  97. package/build/chunk-LT3WXWI5.js.map +0 -1
  98. package/build/chunk-LW6PZKOJ.js +0 -27
  99. package/build/chunk-LW6PZKOJ.js.map +0 -1
  100. package/build/chunk-LZ4SXWLW.js +0 -11
  101. package/build/chunk-LZ4SXWLW.js.map +0 -1
  102. package/build/chunk-QW5H4VGJ.js.map +0 -1
  103. package/build/chunk-RWN7XXN6.js +0 -4
  104. package/build/chunk-RWN7XXN6.js.map +0 -1
  105. package/build/chunk-YWJFUO7I.js +0 -73
  106. package/build/chunk-YWJFUO7I.js.map +0 -1
  107. package/build/chunk-ZIVYB6TM.js +0 -4
  108. package/build/esm-CECOC7V2.js.map +0 -1
  109. package/build/preview-FV7ZP3YC.js +0 -4
  110. package/build/preview-FV7ZP3YC.js.map +0 -1
  111. package/schemas/dashboard-sidebar-category.json +0 -1
  112. /package/build/{types.impl-HD4UTKFC.js.map → PreviewCommand-HDEZ6LT3.js.map} +0 -0
  113. /package/build/{chunk-CUWQRNQL.js.map → chunk-CXTD4ANR.js.map} +0 -0
  114. /package/build/{chunk-S7NF452E.js.map → chunk-EL4LLNE3.js.map} +0 -0
  115. /package/build/{chunk-RYS7G2PY.js.map → chunk-QLWXUOAT.js.map} +0 -0
  116. /package/build/{chunk-3EQ4ZYU2.js.map → chunk-QOQRQIMF.js.map} +0 -0
  117. /package/build/{chunk-JIUANWPO.js.map → chunk-TPV6MPZ4.js.map} +0 -0
  118. /package/build/{chunk-PSXIV7FJ.js.map → chunk-V35F6N6Y.js.map} +0 -0
  119. /package/build/{chunk-HFDLXX7R.js.map → chunk-V4TR6DCM.js.map} +0 -0
  120. /package/build/{render-command-JEBHYUZV.js.map → render-command-SBXRR4MG.js.map} +0 -0
@@ -1,25 +1,25 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{F as Zs,O as eo,Q as to,S as yi,T as un,U as mi,a as Xs,b as $s,ba as ro,ca as io,da as ao,fa as ln,ha as Ai,ia as Ci,ja as fn,ka as no,la as so}from"./chunk-YWJFUO7I.js";import{a as Ws,c as Gr,d as jr}from"./chunk-62RRZRN6.js";import{a as Le,c as F,e as ra,h as S}from"./chunk-HFDLXX7R.js";var Et=F(yn=>{"use strict";S();yn.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((i,r)=>{e.call(this,...t,(a,n)=>a!=null?r(a):i(n))})},"name",{value:e.name})};yn.fromPromise=function(e){return Object.defineProperty(function(...t){let i=t[t.length-1];if(typeof i!="function")return e.apply(this,t);e.apply(this,t.slice(0,-1)).then(r=>i(null,r),i)},"name",{value:e.name})}});var po=F((AA,ho)=>{"use strict";S();var hr=Le("constants"),hh=process.cwd,na=null,ph=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return na||(na=hh.call(process)),na};try{process.cwd()}catch{}typeof process.chdir=="function"&&(mn=process.chdir,process.chdir=function(e){na=null,mn.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,mn));var mn;ho.exports=dh;function dh(e){hr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||i(e),e.chown=n(e.chown),e.fchown=n(e.fchown),e.lchown=n(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(f,c,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(f,c,p,m){m&&process.nextTick(m)},e.lchownSync=function(){}),ph==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(f){function c(p,m,v){var C=Date.now(),E=0;f(p,m,function B(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-C<6e4){setTimeout(function(){e.stat(m,function(T,U){T&&T.code==="ENOENT"?f(p,m,B):v(w)})},E),E<100&&(E+=10);return}v&&v(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,f),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(f){function c(p,m,v,C,E,B){var w;if(B&&typeof B=="function"){var T=0;w=function(U,P,Q){if(U&&U.code==="EAGAIN"&&T<10)return T++,f.call(e,p,m,v,C,E,w);B.apply(this,arguments)}}return f.call(e,p,m,v,C,E,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,f),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(f){return function(c,p,m,v,C){for(var E=0;;)try{return f.call(e,c,p,m,v,C)}catch(B){if(B.code==="EAGAIN"&&E<10){E++;continue}throw B}}}(e.readSync);function t(f){f.lchmod=function(c,p,m){f.open(c,hr.O_WRONLY|hr.O_SYMLINK,p,function(v,C){if(v){m&&m(v);return}f.fchmod(C,p,function(E){f.close(C,function(B){m&&m(E||B)})})})},f.lchmodSync=function(c,p){var m=f.openSync(c,hr.O_WRONLY|hr.O_SYMLINK,p),v=!0,C;try{C=f.fchmodSync(m,p),v=!1}finally{if(v)try{f.closeSync(m)}catch{}else f.closeSync(m)}return C}}function i(f){hr.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(c,p,m,v){f.open(c,hr.O_SYMLINK,function(C,E){if(C){v&&v(C);return}f.futimes(E,p,m,function(B){f.close(E,function(w){v&&v(B||w)})})})},f.lutimesSync=function(c,p,m){var v=f.openSync(c,hr.O_SYMLINK),C,E=!0;try{C=f.futimesSync(v,p,m),E=!1}finally{if(E)try{f.closeSync(v)}catch{}else f.closeSync(v)}return C}):f.futimes&&(f.lutimes=function(c,p,m,v){v&&process.nextTick(v)},f.lutimesSync=function(){})}function r(f){return f&&function(c,p,m){return f.call(e,c,p,function(v){l(v)&&(v=null),m&&m.apply(this,arguments)})}}function a(f){return f&&function(c,p){try{return f.call(e,c,p)}catch(m){if(!l(m))throw m}}}function n(f){return f&&function(c,p,m,v){return f.call(e,c,p,m,function(C){l(C)&&(C=null),v&&v.apply(this,arguments)})}}function s(f){return f&&function(c,p,m){try{return f.call(e,c,p,m)}catch(v){if(!l(v))throw v}}}function o(f){return f&&function(c,p,m){typeof p=="function"&&(m=p,p=null);function v(C,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),m&&m.apply(this,arguments)}return p?f.call(e,c,p,v):f.call(e,c,v)}}function u(f){return f&&function(c,p){var m=p?f.call(e,c,p):f.call(e,c);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function l(f){if(!f||f.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(f.code==="EINVAL"||f.code==="EPERM"))}}});var yo=F((EA,vo)=>{"use strict";S();var go=Le("stream").Stream;vo.exports=gh;function gh(e){return{ReadStream:t,WriteStream:i};function t(r,a){if(!(this instanceof t))return new t(r,a);go.call(this);var n=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,a=a||{};for(var s=Object.keys(a),o=0,u=s.length;o<u;o++){var l=s[o];this[l]=a[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}e.open(this.path,this.flags,this.mode,function(f,c){if(f){n.emit("error",f),n.readable=!1;return}n.fd=c,n.emit("open",c),n._read()})}function i(r,a){if(!(this instanceof i))return new i(r,a);go.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,a=a||{};for(var n=Object.keys(a),s=0,o=n.length;s<o;s++){var u=n[s];this[u]=a[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Ao=F((SA,mo)=>{"use strict";S();mo.exports=yh;var vh=Object.getPrototypeOf||function(e){return e.__proto__};function yh(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:vh(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}),t}});var dt=F((BA,En)=>{"use strict";S();var Qe=Le("fs"),mh=po(),Ah=yo(),Ch=Ao(),sa=Le("util"),Je,ua;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Je=Symbol.for("graceful-fs.queue"),ua=Symbol.for("graceful-fs.previous")):(Je="___graceful-fs.queue",ua="___graceful-fs.previous");function Eh(){}function xo(e,t){Object.defineProperty(e,Je,{get:function(){return t}})}var Rr=Eh;sa.debuglog?Rr=sa.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Rr=function(){var e=sa.format.apply(sa,arguments);e="GFS4: "+e.split(/\n/).join(`
4
- GFS4: `),console.error(e)});Qe[Je]||(Co=global[Je]||[],xo(Qe,Co),Qe.close=function(e){function t(i,r){return e.call(Qe,i,function(a){a||Eo(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,ua,{value:e}),t}(Qe.close),Qe.closeSync=function(e){function t(i){e.apply(Qe,arguments),Eo()}return Object.defineProperty(t,ua,{value:e}),t}(Qe.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Rr(Qe[Je]),Le("assert").equal(Qe[Je].length,0)}));var Co;global[Je]||xo(global,Qe[Je]);En.exports=An(Ch(Qe));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Qe.__patched&&(En.exports=An(Qe),Qe.__patched=!0);function An(e){mh(e),e.gracefulify=An,e.createReadStream=P,e.createWriteStream=Q;var t=e.readFile;e.readFile=i;function i(H,z,Y){return typeof z=="function"&&(Y=z,z=null),re(H,z,Y);function re(ye,Ee,$,ie){return t(ye,Ee,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?zr([re,[ye,Ee,$],V,ie||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=a;function a(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return r(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=e.appendFile;n&&(e.appendFile=s);function s(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return n(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var o=e.copyFile;o&&(e.copyFile=u);function u(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=0),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return o(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=e.readdir;e.readdir=c;var f=/^v[0-5]\./;function c(H,z,Y){typeof z=="function"&&(Y=z,z=null);var re=f.test(process.version)?function($,ie,V,_e){return l($,ye($,ie,V,_e))}:function($,ie,V,_e){return l($,ie,ye($,ie,V,_e))};return re(H,z,Y);function ye(Ee,$,ie,V){return function(_e,xe){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?zr([re,[Ee,$,ie],_e,V||Date.now(),Date.now()]):(xe&&xe.sort&&xe.sort(),typeof ie=="function"&&ie.call(this,_e,xe))}}}if(process.version.substr(0,4)==="v0.8"){var p=Ah(e);B=p.ReadStream,T=p.WriteStream}var m=e.ReadStream;m&&(B.prototype=Object.create(m.prototype),B.prototype.open=w);var v=e.WriteStream;v&&(T.prototype=Object.create(v.prototype),T.prototype.open=U),Object.defineProperty(e,"ReadStream",{get:function(){return B},set:function(H){B=H},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(H){T=H},enumerable:!0,configurable:!0});var C=B;Object.defineProperty(e,"FileReadStream",{get:function(){return C},set:function(H){C=H},enumerable:!0,configurable:!0});var E=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return E},set:function(H){E=H},enumerable:!0,configurable:!0});function B(H,z){return this instanceof B?(m.apply(this,arguments),this):B.apply(Object.create(B.prototype),arguments)}function w(){var H=this;ne(H.path,H.flags,H.mode,function(z,Y){z?(H.autoClose&&H.destroy(),H.emit("error",z)):(H.fd=Y,H.emit("open",Y),H.read())})}function T(H,z){return this instanceof T?(v.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function U(){var H=this;ne(H.path,H.flags,H.mode,function(z,Y){z?(H.destroy(),H.emit("error",z)):(H.fd=Y,H.emit("open",Y))})}function P(H,z){return new e.ReadStream(H,z)}function Q(H,z){return new e.WriteStream(H,z)}var te=e.open;e.open=ne;function ne(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return te(Ee,$,ie,function(xe,Oe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return e}function zr(e){Rr("ENQUEUE",e[0].name,e[1]),Qe[Je].push(e),Cn()}var oa;function Eo(){for(var e=Date.now(),t=0;t<Qe[Je].length;++t)Qe[Je][t].length>2&&(Qe[Je][t][3]=e,Qe[Je][t][4]=e);Cn()}function Cn(){if(clearTimeout(oa),oa=void 0,Qe[Je].length!==0){var e=Qe[Je].shift(),t=e[0],i=e[1],r=e[2],a=e[3],n=e[4];if(a===void 0)Rr("RETRY",t.name,i),t.apply(null,i);else if(Date.now()-a>=6e4){Rr("TIMEOUT",t.name,i);var s=i.pop();typeof s=="function"&&s.call(null,r)}else{var o=Date.now()-n,u=Math.max(n-a,1),l=Math.min(u*1.2,100);o>=l?(Rr("RETRY",t.name,i),t.apply(null,i.concat([a]))):Qe[Je].push(e)}oa===void 0&&(oa=setTimeout(Cn,0))}}});var Dr=F(pr=>{"use strict";S();var So=Et().fromCallback,xt=dt(),xh=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof xt[e]=="function");Object.assign(pr,xt);xh.forEach(e=>{pr[e]=So(xt[e])});pr.exists=function(e,t){return typeof t=="function"?xt.exists(e,t):new Promise(i=>xt.exists(e,i))};pr.read=function(e,t,i,r,a,n){return typeof n=="function"?xt.read(e,t,i,r,a,n):new Promise((s,o)=>{xt.read(e,t,i,r,a,(u,l,f)=>{if(u)return o(u);s({bytesRead:l,buffer:f})})})};pr.write=function(e,t,...i){return typeof i[i.length-1]=="function"?xt.write(e,t,...i):new Promise((r,a)=>{xt.write(e,t,...i,(n,s,o)=>{if(n)return a(n);r({bytesWritten:s,buffer:o})})})};typeof xt.writev=="function"&&(pr.writev=function(e,t,...i){return typeof i[i.length-1]=="function"?xt.writev(e,t,...i):new Promise((r,a)=>{xt.writev(e,t,...i,(n,s,o)=>{if(n)return a(n);r({bytesWritten:s,buffers:o})})})});typeof xt.realpath.native=="function"?pr.realpath.native=So(xt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Bo=F((_A,Io)=>{"use strict";S();var Sh=Le("path");Io.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sh.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}}});var _o=F((kA,xn)=>{"use strict";S();var bo=Dr(),{checkPath:To}=Bo(),wo=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};xn.exports.makeDir=async(e,t)=>(To(e),bo.mkdir(e,{mode:wo(t),recursive:!0}));xn.exports.makeDirSync=(e,t)=>(To(e),bo.mkdirSync(e,{mode:wo(t),recursive:!0}))});var Mt=F((RA,No)=>{"use strict";S();var Ih=Et().fromPromise,{makeDir:Bh,makeDirSync:Sn}=_o(),In=Ih(Bh);No.exports={mkdirs:In,mkdirsSync:Sn,mkdirp:In,mkdirpSync:Sn,ensureDir:In,ensureDirSync:Sn}});var dr=F((PA,Lo)=>{"use strict";S();var bh=Et().fromPromise,ko=Dr();function Th(e){return ko.access(e).then(()=>!0).catch(()=>!1)}Lo.exports={pathExists:bh(Th),pathExistsSync:ko.existsSync}});var Bn=F((UA,Ro)=>{"use strict";S();var Jr=dt();function wh(e,t,i,r){Jr.open(e,"r+",(a,n)=>{if(a)return r(a);Jr.futimes(n,t,i,s=>{Jr.close(n,o=>{r&&r(s||o)})})})}function _h(e,t,i){let r=Jr.openSync(e,"r+");return Jr.futimesSync(r,t,i),Jr.closeSync(r)}Ro.exports={utimesMillis:wh,utimesMillisSync:_h}});var Pr=F((VA,Qo)=>{"use strict";S();var Wr=Dr(),Ke=Le("path"),Nh=Le("util");function kh(e,t,i){let r=i.dereference?a=>Wr.stat(a,{bigint:!0}):a=>Wr.lstat(a,{bigint:!0});return Promise.all([r(e),r(t).catch(a=>{if(a.code==="ENOENT")return null;throw a})]).then(([a,n])=>({srcStat:a,destStat:n}))}function Lh(e,t,i){let r,a=i.dereference?s=>Wr.statSync(s,{bigint:!0}):s=>Wr.lstatSync(s,{bigint:!0}),n=a(e);try{r=a(t)}catch(s){if(s.code==="ENOENT")return{srcStat:n,destStat:null};throw s}return{srcStat:n,destStat:r}}function Rh(e,t,i,r,a){Nh.callbackify(kh)(e,t,r,(n,s)=>{if(n)return a(n);let{srcStat:o,destStat:u}=s;if(u){if(Bi(o,u)){let l=Ke.basename(e),f=Ke.basename(t);return i==="move"&&l!==f&&l.toLowerCase()===f.toLowerCase()?a(null,{srcStat:o,destStat:u,isChangingCase:!0}):a(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!u.isDirectory())return a(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!o.isDirectory()&&u.isDirectory())return a(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return o.isDirectory()&&bn(e,t)?a(new Error(la(e,t,i))):a(null,{srcStat:o,destStat:u})})}function Dh(e,t,i,r){let{srcStat:a,destStat:n}=Lh(e,t,r);if(n){if(Bi(a,n)){let s=Ke.basename(e),o=Ke.basename(t);if(i==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:n,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(a.isDirectory()&&!n.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&n.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&bn(e,t))throw new Error(la(e,t,i));return{srcStat:a,destStat:n}}function Do(e,t,i,r,a){let n=Ke.resolve(Ke.dirname(e)),s=Ke.resolve(Ke.dirname(i));if(s===n||s===Ke.parse(s).root)return a();Wr.stat(s,{bigint:!0},(o,u)=>o?o.code==="ENOENT"?a():a(o):Bi(t,u)?a(new Error(la(e,i,r))):Do(e,t,s,r,a))}function Po(e,t,i,r){let a=Ke.resolve(Ke.dirname(e)),n=Ke.resolve(Ke.dirname(i));if(n===a||n===Ke.parse(n).root)return;let s;try{s=Wr.statSync(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(Bi(t,s))throw new Error(la(e,i,r));return Po(e,t,n,r)}function Bi(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function bn(e,t){let i=Ke.resolve(e).split(Ke.sep).filter(a=>a),r=Ke.resolve(t).split(Ke.sep).filter(a=>a);return i.reduce((a,n,s)=>a&&r[s]===n,!0)}function la(e,t,i){return`Cannot ${i} '${e}' to a subdirectory of itself, '${t}'.`}Qo.exports={checkPaths:Rh,checkPathsSync:Dh,checkParentPaths:Do,checkParentPathsSync:Po,isSrcSubdir:bn,areIdentical:Bi}});var Ho=F((MA,Ko)=>{"use strict";S();var St=dt(),bi=Le("path"),Ph=Mt().mkdirs,Qh=dr().pathExists,Uh=Bn().utimesMillis,Ti=Pr();function Oh(e,t,i,r){typeof i=="function"&&!r?(r=i,i={}):typeof i=="function"&&(i={filter:i}),r=r||function(){},i=i||{},i.clobber="clobber"in i?!!i.clobber:!0,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
3
+ import{H as Zs,Q as eo,S as to,U as yi,V as un,W as mi,a as Xs,b as $s,da as ro,ea as io,fa as ao,ha as ln,ja as Ai,ka as Ci,la as fn,ma as no,na as so}from"./chunk-RJKCVYVO.js";import{a as Ws,c as Gr,d as jr}from"./chunk-I4ARVL5S.js";import{a as Le,c as F,e as ra,h as S}from"./chunk-V4TR6DCM.js";var Et=F(yn=>{"use strict";S();yn.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((i,r)=>{e.call(this,...t,(a,n)=>a!=null?r(a):i(n))})},"name",{value:e.name})};yn.fromPromise=function(e){return Object.defineProperty(function(...t){let i=t[t.length-1];if(typeof i!="function")return e.apply(this,t);e.apply(this,t.slice(0,-1)).then(r=>i(null,r),i)},"name",{value:e.name})}});var po=F((CA,ho)=>{"use strict";S();var hr=Le("constants"),hh=process.cwd,na=null,ph=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return na||(na=hh.call(process)),na};try{process.cwd()}catch{}typeof process.chdir=="function"&&(mn=process.chdir,process.chdir=function(e){na=null,mn.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,mn));var mn;ho.exports=dh;function dh(e){hr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||i(e),e.chown=n(e.chown),e.fchown=n(e.fchown),e.lchown=n(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=s(e.chownSync),e.fchownSync=s(e.fchownSync),e.lchownSync=s(e.lchownSync),e.chmodSync=a(e.chmodSync),e.fchmodSync=a(e.fchmodSync),e.lchmodSync=a(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(f,c,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(f,c,p,m){m&&process.nextTick(m)},e.lchownSync=function(){}),ph==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(f){function c(p,m,v){var C=Date.now(),E=0;f(p,m,function B(w){if(w&&(w.code==="EACCES"||w.code==="EPERM"||w.code==="EBUSY")&&Date.now()-C<6e4){setTimeout(function(){e.stat(m,function(T,U){T&&T.code==="ENOENT"?f(p,m,B):v(w)})},E),E<100&&(E+=10);return}v&&v(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,f),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(f){function c(p,m,v,C,E,B){var w;if(B&&typeof B=="function"){var T=0;w=function(U,P,Q){if(U&&U.code==="EAGAIN"&&T<10)return T++,f.call(e,p,m,v,C,E,w);B.apply(this,arguments)}}return f.call(e,p,m,v,C,E,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,f),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(f){return function(c,p,m,v,C){for(var E=0;;)try{return f.call(e,c,p,m,v,C)}catch(B){if(B.code==="EAGAIN"&&E<10){E++;continue}throw B}}}(e.readSync);function t(f){f.lchmod=function(c,p,m){f.open(c,hr.O_WRONLY|hr.O_SYMLINK,p,function(v,C){if(v){m&&m(v);return}f.fchmod(C,p,function(E){f.close(C,function(B){m&&m(E||B)})})})},f.lchmodSync=function(c,p){var m=f.openSync(c,hr.O_WRONLY|hr.O_SYMLINK,p),v=!0,C;try{C=f.fchmodSync(m,p),v=!1}finally{if(v)try{f.closeSync(m)}catch{}else f.closeSync(m)}return C}}function i(f){hr.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(c,p,m,v){f.open(c,hr.O_SYMLINK,function(C,E){if(C){v&&v(C);return}f.futimes(E,p,m,function(B){f.close(E,function(w){v&&v(B||w)})})})},f.lutimesSync=function(c,p,m){var v=f.openSync(c,hr.O_SYMLINK),C,E=!0;try{C=f.futimesSync(v,p,m),E=!1}finally{if(E)try{f.closeSync(v)}catch{}else f.closeSync(v)}return C}):f.futimes&&(f.lutimes=function(c,p,m,v){v&&process.nextTick(v)},f.lutimesSync=function(){})}function r(f){return f&&function(c,p,m){return f.call(e,c,p,function(v){l(v)&&(v=null),m&&m.apply(this,arguments)})}}function a(f){return f&&function(c,p){try{return f.call(e,c,p)}catch(m){if(!l(m))throw m}}}function n(f){return f&&function(c,p,m,v){return f.call(e,c,p,m,function(C){l(C)&&(C=null),v&&v.apply(this,arguments)})}}function s(f){return f&&function(c,p,m){try{return f.call(e,c,p,m)}catch(v){if(!l(v))throw v}}}function o(f){return f&&function(c,p,m){typeof p=="function"&&(m=p,p=null);function v(C,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),m&&m.apply(this,arguments)}return p?f.call(e,c,p,v):f.call(e,c,v)}}function u(f){return f&&function(c,p){var m=p?f.call(e,c,p):f.call(e,c);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function l(f){if(!f||f.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(f.code==="EINVAL"||f.code==="EPERM"))}}});var yo=F((xA,vo)=>{"use strict";S();var go=Le("stream").Stream;vo.exports=gh;function gh(e){return{ReadStream:t,WriteStream:i};function t(r,a){if(!(this instanceof t))return new t(r,a);go.call(this);var n=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,a=a||{};for(var s=Object.keys(a),o=0,u=s.length;o<u;o++){var l=s[o];this[l]=a[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}e.open(this.path,this.flags,this.mode,function(f,c){if(f){n.emit("error",f),n.readable=!1;return}n.fd=c,n.emit("open",c),n._read()})}function i(r,a){if(!(this instanceof i))return new i(r,a);go.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,a=a||{};for(var n=Object.keys(a),s=0,o=n.length;s<o;s++){var u=n[s];this[u]=a[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Ao=F((IA,mo)=>{"use strict";S();mo.exports=yh;var vh=Object.getPrototypeOf||function(e){return e.__proto__};function yh(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:vh(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}),t}});var dt=F((bA,En)=>{"use strict";S();var Qe=Le("fs"),mh=po(),Ah=yo(),Ch=Ao(),sa=Le("util"),Je,ua;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Je=Symbol.for("graceful-fs.queue"),ua=Symbol.for("graceful-fs.previous")):(Je="___graceful-fs.queue",ua="___graceful-fs.previous");function Eh(){}function xo(e,t){Object.defineProperty(e,Je,{get:function(){return t}})}var Rr=Eh;sa.debuglog?Rr=sa.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Rr=function(){var e=sa.format.apply(sa,arguments);e="GFS4: "+e.split(/\n/).join(`
4
+ GFS4: `),console.error(e)});Qe[Je]||(Co=global[Je]||[],xo(Qe,Co),Qe.close=function(e){function t(i,r){return e.call(Qe,i,function(a){a||Eo(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,ua,{value:e}),t}(Qe.close),Qe.closeSync=function(e){function t(i){e.apply(Qe,arguments),Eo()}return Object.defineProperty(t,ua,{value:e}),t}(Qe.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Rr(Qe[Je]),Le("assert").equal(Qe[Je].length,0)}));var Co;global[Je]||xo(global,Qe[Je]);En.exports=An(Ch(Qe));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Qe.__patched&&(En.exports=An(Qe),Qe.__patched=!0);function An(e){mh(e),e.gracefulify=An,e.createReadStream=P,e.createWriteStream=Q;var t=e.readFile;e.readFile=i;function i(H,z,Y){return typeof z=="function"&&(Y=z,z=null),re(H,z,Y);function re(ye,Ee,$,ie){return t(ye,Ee,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?zr([re,[ye,Ee,$],V,ie||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=a;function a(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return r(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=e.appendFile;n&&(e.appendFile=s);function s(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return n(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var o=e.copyFile;o&&(e.copyFile=u);function u(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=0),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return o(Ee,$,ie,function(xe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=e.readdir;e.readdir=c;var f=/^v[0-5]\./;function c(H,z,Y){typeof z=="function"&&(Y=z,z=null);var re=f.test(process.version)?function($,ie,V,_e){return l($,ye($,ie,V,_e))}:function($,ie,V,_e){return l($,ie,ye($,ie,V,_e))};return re(H,z,Y);function ye(Ee,$,ie,V){return function(_e,xe){_e&&(_e.code==="EMFILE"||_e.code==="ENFILE")?zr([re,[Ee,$,ie],_e,V||Date.now(),Date.now()]):(xe&&xe.sort&&xe.sort(),typeof ie=="function"&&ie.call(this,_e,xe))}}}if(process.version.substr(0,4)==="v0.8"){var p=Ah(e);B=p.ReadStream,T=p.WriteStream}var m=e.ReadStream;m&&(B.prototype=Object.create(m.prototype),B.prototype.open=w);var v=e.WriteStream;v&&(T.prototype=Object.create(v.prototype),T.prototype.open=U),Object.defineProperty(e,"ReadStream",{get:function(){return B},set:function(H){B=H},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(H){T=H},enumerable:!0,configurable:!0});var C=B;Object.defineProperty(e,"FileReadStream",{get:function(){return C},set:function(H){C=H},enumerable:!0,configurable:!0});var E=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return E},set:function(H){E=H},enumerable:!0,configurable:!0});function B(H,z){return this instanceof B?(m.apply(this,arguments),this):B.apply(Object.create(B.prototype),arguments)}function w(){var H=this;ne(H.path,H.flags,H.mode,function(z,Y){z?(H.autoClose&&H.destroy(),H.emit("error",z)):(H.fd=Y,H.emit("open",Y),H.read())})}function T(H,z){return this instanceof T?(v.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function U(){var H=this;ne(H.path,H.flags,H.mode,function(z,Y){z?(H.destroy(),H.emit("error",z)):(H.fd=Y,H.emit("open",Y))})}function P(H,z){return new e.ReadStream(H,z)}function Q(H,z){return new e.WriteStream(H,z)}var te=e.open;e.open=ne;function ne(H,z,Y,re){return typeof Y=="function"&&(re=Y,Y=null),ye(H,z,Y,re);function ye(Ee,$,ie,V,_e){return te(Ee,$,ie,function(xe,Oe){xe&&(xe.code==="EMFILE"||xe.code==="ENFILE")?zr([ye,[Ee,$,ie,V],xe,_e||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return e}function zr(e){Rr("ENQUEUE",e[0].name,e[1]),Qe[Je].push(e),Cn()}var oa;function Eo(){for(var e=Date.now(),t=0;t<Qe[Je].length;++t)Qe[Je][t].length>2&&(Qe[Je][t][3]=e,Qe[Je][t][4]=e);Cn()}function Cn(){if(clearTimeout(oa),oa=void 0,Qe[Je].length!==0){var e=Qe[Je].shift(),t=e[0],i=e[1],r=e[2],a=e[3],n=e[4];if(a===void 0)Rr("RETRY",t.name,i),t.apply(null,i);else if(Date.now()-a>=6e4){Rr("TIMEOUT",t.name,i);var s=i.pop();typeof s=="function"&&s.call(null,r)}else{var o=Date.now()-n,u=Math.max(n-a,1),l=Math.min(u*1.2,100);o>=l?(Rr("RETRY",t.name,i),t.apply(null,i.concat([a]))):Qe[Je].push(e)}oa===void 0&&(oa=setTimeout(Cn,0))}}});var Dr=F(pr=>{"use strict";S();var So=Et().fromCallback,xt=dt(),xh=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof xt[e]=="function");Object.assign(pr,xt);xh.forEach(e=>{pr[e]=So(xt[e])});pr.exists=function(e,t){return typeof t=="function"?xt.exists(e,t):new Promise(i=>xt.exists(e,i))};pr.read=function(e,t,i,r,a,n){return typeof n=="function"?xt.read(e,t,i,r,a,n):new Promise((s,o)=>{xt.read(e,t,i,r,a,(u,l,f)=>{if(u)return o(u);s({bytesRead:l,buffer:f})})})};pr.write=function(e,t,...i){return typeof i[i.length-1]=="function"?xt.write(e,t,...i):new Promise((r,a)=>{xt.write(e,t,...i,(n,s,o)=>{if(n)return a(n);r({bytesWritten:s,buffer:o})})})};typeof xt.writev=="function"&&(pr.writev=function(e,t,...i){return typeof i[i.length-1]=="function"?xt.writev(e,t,...i):new Promise((r,a)=>{xt.writev(e,t,...i,(n,s,o)=>{if(n)return a(n);r({bytesWritten:s,buffers:o})})})});typeof xt.realpath.native=="function"?pr.realpath.native=So(xt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Bo=F((NA,Io)=>{"use strict";S();var Sh=Le("path");Io.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sh.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}}});var _o=F((LA,xn)=>{"use strict";S();var bo=Dr(),{checkPath:To}=Bo(),wo=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};xn.exports.makeDir=async(e,t)=>(To(e),bo.mkdir(e,{mode:wo(t),recursive:!0}));xn.exports.makeDirSync=(e,t)=>(To(e),bo.mkdirSync(e,{mode:wo(t),recursive:!0}))});var Mt=F((DA,No)=>{"use strict";S();var Ih=Et().fromPromise,{makeDir:Bh,makeDirSync:Sn}=_o(),In=Ih(Bh);No.exports={mkdirs:In,mkdirsSync:Sn,mkdirp:In,mkdirpSync:Sn,ensureDir:In,ensureDirSync:Sn}});var dr=F((QA,Lo)=>{"use strict";S();var bh=Et().fromPromise,ko=Dr();function Th(e){return ko.access(e).then(()=>!0).catch(()=>!1)}Lo.exports={pathExists:bh(Th),pathExistsSync:ko.existsSync}});var Bn=F((OA,Ro)=>{"use strict";S();var Jr=dt();function wh(e,t,i,r){Jr.open(e,"r+",(a,n)=>{if(a)return r(a);Jr.futimes(n,t,i,s=>{Jr.close(n,o=>{r&&r(s||o)})})})}function _h(e,t,i){let r=Jr.openSync(e,"r+");return Jr.futimesSync(r,t,i),Jr.closeSync(r)}Ro.exports={utimesMillis:wh,utimesMillisSync:_h}});var Pr=F((FA,Qo)=>{"use strict";S();var Wr=Dr(),Ke=Le("path"),Nh=Le("util");function kh(e,t,i){let r=i.dereference?a=>Wr.stat(a,{bigint:!0}):a=>Wr.lstat(a,{bigint:!0});return Promise.all([r(e),r(t).catch(a=>{if(a.code==="ENOENT")return null;throw a})]).then(([a,n])=>({srcStat:a,destStat:n}))}function Lh(e,t,i){let r,a=i.dereference?s=>Wr.statSync(s,{bigint:!0}):s=>Wr.lstatSync(s,{bigint:!0}),n=a(e);try{r=a(t)}catch(s){if(s.code==="ENOENT")return{srcStat:n,destStat:null};throw s}return{srcStat:n,destStat:r}}function Rh(e,t,i,r,a){Nh.callbackify(kh)(e,t,r,(n,s)=>{if(n)return a(n);let{srcStat:o,destStat:u}=s;if(u){if(Bi(o,u)){let l=Ke.basename(e),f=Ke.basename(t);return i==="move"&&l!==f&&l.toLowerCase()===f.toLowerCase()?a(null,{srcStat:o,destStat:u,isChangingCase:!0}):a(new Error("Source and destination must not be the same."))}if(o.isDirectory()&&!u.isDirectory())return a(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!o.isDirectory()&&u.isDirectory())return a(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return o.isDirectory()&&bn(e,t)?a(new Error(la(e,t,i))):a(null,{srcStat:o,destStat:u})})}function Dh(e,t,i,r){let{srcStat:a,destStat:n}=Lh(e,t,r);if(n){if(Bi(a,n)){let s=Ke.basename(e),o=Ke.basename(t);if(i==="move"&&s!==o&&s.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:n,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(a.isDirectory()&&!n.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&n.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&bn(e,t))throw new Error(la(e,t,i));return{srcStat:a,destStat:n}}function Do(e,t,i,r,a){let n=Ke.resolve(Ke.dirname(e)),s=Ke.resolve(Ke.dirname(i));if(s===n||s===Ke.parse(s).root)return a();Wr.stat(s,{bigint:!0},(o,u)=>o?o.code==="ENOENT"?a():a(o):Bi(t,u)?a(new Error(la(e,i,r))):Do(e,t,s,r,a))}function Po(e,t,i,r){let a=Ke.resolve(Ke.dirname(e)),n=Ke.resolve(Ke.dirname(i));if(n===a||n===Ke.parse(n).root)return;let s;try{s=Wr.statSync(n,{bigint:!0})}catch(o){if(o.code==="ENOENT")return;throw o}if(Bi(t,s))throw new Error(la(e,i,r));return Po(e,t,n,r)}function Bi(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function bn(e,t){let i=Ke.resolve(e).split(Ke.sep).filter(a=>a),r=Ke.resolve(t).split(Ke.sep).filter(a=>a);return i.reduce((a,n,s)=>a&&r[s]===n,!0)}function la(e,t,i){return`Cannot ${i} '${e}' to a subdirectory of itself, '${t}'.`}Qo.exports={checkPaths:Rh,checkPathsSync:Dh,checkParentPaths:Do,checkParentPathsSync:Po,isSrcSubdir:bn,areIdentical:Bi}});var Ho=F((qA,Ko)=>{"use strict";S();var St=dt(),bi=Le("path"),Ph=Mt().mkdirs,Qh=dr().pathExists,Uh=Bn().utimesMillis,Ti=Pr();function Oh(e,t,i,r){typeof i=="function"&&!r?(r=i,i={}):typeof i=="function"&&(i={filter:i}),r=r||function(){},i=i||{},i.clobber="clobber"in i?!!i.clobber:!0,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
5
5
 
6
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Ti.checkPaths(e,t,"copy",i,(a,n)=>{if(a)return r(a);let{srcStat:s,destStat:o}=n;Ti.checkParentPaths(e,s,t,"copy",u=>u?r(u):i.filter?Vo(Uo,o,e,t,i,r):Uo(o,e,t,i,r))})}function Uo(e,t,i,r,a){let n=bi.dirname(i);Qh(n,(s,o)=>{if(s)return a(s);if(o)return fa(e,t,i,r,a);Ph(n,u=>u?a(u):fa(e,t,i,r,a))})}function Vo(e,t,i,r,a,n){Promise.resolve(a.filter(i,r)).then(s=>s?e(t,i,r,a,n):n(),s=>n(s))}function Vh(e,t,i,r,a){return r.filter?Vo(fa,e,t,i,r,a):fa(e,t,i,r,a)}function fa(e,t,i,r,a){(r.dereference?St.stat:St.lstat)(t,(s,o)=>s?a(s):o.isDirectory()?jh(o,e,t,i,r,a):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?Fh(o,e,t,i,r,a):o.isSymbolicLink()?Jh(e,t,i,r,a):o.isSocket()?a(new Error(`Cannot copy a socket file: ${t}`)):o.isFIFO()?a(new Error(`Cannot copy a FIFO pipe: ${t}`)):a(new Error(`Unknown file: ${t}`)))}function Fh(e,t,i,r,a,n){return t?Mh(e,i,r,a,n):Fo(e,i,r,a,n)}function Mh(e,t,i,r,a){if(r.overwrite)St.unlink(i,n=>n?a(n):Fo(e,t,i,r,a));else return r.errorOnExist?a(new Error(`'${i}' already exists`)):a()}function Fo(e,t,i,r,a){St.copyFile(t,i,n=>n?a(n):r.preserveTimestamps?qh(e.mode,t,i,a):ca(i,e.mode,a))}function qh(e,t,i,r){return Kh(e)?Hh(i,e,a=>a?r(a):Oo(e,t,i,r)):Oo(e,t,i,r)}function Kh(e){return(e&128)===0}function Hh(e,t,i){return ca(e,t|128,i)}function Oo(e,t,i,r){Gh(t,i,a=>a?r(a):ca(i,e,r))}function ca(e,t,i){return St.chmod(e,t,i)}function Gh(e,t,i){St.stat(e,(r,a)=>r?i(r):Uh(t,a.atime,a.mtime,i))}function jh(e,t,i,r,a,n){return t?Mo(i,r,a,n):Yh(e.mode,i,r,a,n)}function Yh(e,t,i,r,a){St.mkdir(i,n=>{if(n)return a(n);Mo(t,i,r,s=>s?a(s):ca(i,e,a))})}function Mo(e,t,i,r){St.readdir(e,(a,n)=>a?r(a):qo(n,e,t,i,r))}function qo(e,t,i,r,a){let n=e.pop();return n?zh(e,n,t,i,r,a):a()}function zh(e,t,i,r,a,n){let s=bi.join(i,t),o=bi.join(r,t);Ti.checkPaths(s,o,"copy",a,(u,l)=>{if(u)return n(u);let{destStat:f}=l;Vh(f,s,o,a,c=>c?n(c):qo(e,i,r,a,n))})}function Jh(e,t,i,r,a){St.readlink(t,(n,s)=>{if(n)return a(n);if(r.dereference&&(s=bi.resolve(process.cwd(),s)),e)St.readlink(i,(o,u)=>o?o.code==="EINVAL"||o.code==="UNKNOWN"?St.symlink(s,i,a):a(o):(r.dereference&&(u=bi.resolve(process.cwd(),u)),Ti.isSrcSubdir(s,u)?a(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):e.isDirectory()&&Ti.isSrcSubdir(u,s)?a(new Error(`Cannot overwrite '${u}' with '${s}'.`)):Wh(s,i,a)));else return St.symlink(s,i,a)})}function Wh(e,t,i){St.unlink(t,r=>r?i(r):St.symlink(e,t,i))}Ko.exports=Oh});var Jo=F((KA,zo)=>{"use strict";S();var pt=dt(),wi=Le("path"),Xh=Mt().mkdirsSync,$h=Bn().utimesMillisSync,_i=Pr();function Zh(e,t,i){typeof i=="function"&&(i={filter:i}),i=i||{},i.clobber="clobber"in i?!!i.clobber:!0,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
6
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Ti.checkPaths(e,t,"copy",i,(a,n)=>{if(a)return r(a);let{srcStat:s,destStat:o}=n;Ti.checkParentPaths(e,s,t,"copy",u=>u?r(u):i.filter?Vo(Uo,o,e,t,i,r):Uo(o,e,t,i,r))})}function Uo(e,t,i,r,a){let n=bi.dirname(i);Qh(n,(s,o)=>{if(s)return a(s);if(o)return fa(e,t,i,r,a);Ph(n,u=>u?a(u):fa(e,t,i,r,a))})}function Vo(e,t,i,r,a,n){Promise.resolve(a.filter(i,r)).then(s=>s?e(t,i,r,a,n):n(),s=>n(s))}function Vh(e,t,i,r,a){return r.filter?Vo(fa,e,t,i,r,a):fa(e,t,i,r,a)}function fa(e,t,i,r,a){(r.dereference?St.stat:St.lstat)(t,(s,o)=>s?a(s):o.isDirectory()?jh(o,e,t,i,r,a):o.isFile()||o.isCharacterDevice()||o.isBlockDevice()?Fh(o,e,t,i,r,a):o.isSymbolicLink()?Jh(e,t,i,r,a):o.isSocket()?a(new Error(`Cannot copy a socket file: ${t}`)):o.isFIFO()?a(new Error(`Cannot copy a FIFO pipe: ${t}`)):a(new Error(`Unknown file: ${t}`)))}function Fh(e,t,i,r,a,n){return t?Mh(e,i,r,a,n):Fo(e,i,r,a,n)}function Mh(e,t,i,r,a){if(r.overwrite)St.unlink(i,n=>n?a(n):Fo(e,t,i,r,a));else return r.errorOnExist?a(new Error(`'${i}' already exists`)):a()}function Fo(e,t,i,r,a){St.copyFile(t,i,n=>n?a(n):r.preserveTimestamps?qh(e.mode,t,i,a):ca(i,e.mode,a))}function qh(e,t,i,r){return Kh(e)?Hh(i,e,a=>a?r(a):Oo(e,t,i,r)):Oo(e,t,i,r)}function Kh(e){return(e&128)===0}function Hh(e,t,i){return ca(e,t|128,i)}function Oo(e,t,i,r){Gh(t,i,a=>a?r(a):ca(i,e,r))}function ca(e,t,i){return St.chmod(e,t,i)}function Gh(e,t,i){St.stat(e,(r,a)=>r?i(r):Uh(t,a.atime,a.mtime,i))}function jh(e,t,i,r,a,n){return t?Mo(i,r,a,n):Yh(e.mode,i,r,a,n)}function Yh(e,t,i,r,a){St.mkdir(i,n=>{if(n)return a(n);Mo(t,i,r,s=>s?a(s):ca(i,e,a))})}function Mo(e,t,i,r){St.readdir(e,(a,n)=>a?r(a):qo(n,e,t,i,r))}function qo(e,t,i,r,a){let n=e.pop();return n?zh(e,n,t,i,r,a):a()}function zh(e,t,i,r,a,n){let s=bi.join(i,t),o=bi.join(r,t);Ti.checkPaths(s,o,"copy",a,(u,l)=>{if(u)return n(u);let{destStat:f}=l;Vh(f,s,o,a,c=>c?n(c):qo(e,i,r,a,n))})}function Jh(e,t,i,r,a){St.readlink(t,(n,s)=>{if(n)return a(n);if(r.dereference&&(s=bi.resolve(process.cwd(),s)),e)St.readlink(i,(o,u)=>o?o.code==="EINVAL"||o.code==="UNKNOWN"?St.symlink(s,i,a):a(o):(r.dereference&&(u=bi.resolve(process.cwd(),u)),Ti.isSrcSubdir(s,u)?a(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):e.isDirectory()&&Ti.isSrcSubdir(u,s)?a(new Error(`Cannot overwrite '${u}' with '${s}'.`)):Wh(s,i,a)));else return St.symlink(s,i,a)})}function Wh(e,t,i){St.unlink(t,r=>r?i(r):St.symlink(e,t,i))}Ko.exports=Oh});var Jo=F((HA,zo)=>{"use strict";S();var pt=dt(),wi=Le("path"),Xh=Mt().mkdirsSync,$h=Bn().utimesMillisSync,_i=Pr();function Zh(e,t,i){typeof i=="function"&&(i={filter:i}),i=i||{},i.clobber="clobber"in i?!!i.clobber:!0,i.overwrite="overwrite"in i?!!i.overwrite:i.clobber,i.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
7
7
 
8
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:a}=_i.checkPathsSync(e,t,"copy",i);return _i.checkParentPathsSync(e,r,t,"copy"),ep(a,e,t,i)}function ep(e,t,i,r){if(r.filter&&!r.filter(t,i))return;let a=wi.dirname(i);return pt.existsSync(a)||Xh(a),Go(e,t,i,r)}function tp(e,t,i,r){if(!(r.filter&&!r.filter(t,i)))return Go(e,t,i,r)}function Go(e,t,i,r){let n=(r.dereference?pt.statSync:pt.lstatSync)(t);if(n.isDirectory())return up(n,e,t,i,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return rp(n,e,t,i,r);if(n.isSymbolicLink())return cp(e,t,i,r);throw n.isSocket()?new Error(`Cannot copy a socket file: ${t}`):n.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function rp(e,t,i,r,a){return t?ip(e,i,r,a):jo(e,i,r,a)}function ip(e,t,i,r){if(r.overwrite)return pt.unlinkSync(i),jo(e,t,i,r);if(r.errorOnExist)throw new Error(`'${i}' already exists`)}function jo(e,t,i,r){return pt.copyFileSync(t,i),r.preserveTimestamps&&ap(e.mode,t,i),Tn(i,e.mode)}function ap(e,t,i){return np(e)&&sp(i,e),op(t,i)}function np(e){return(e&128)===0}function sp(e,t){return Tn(e,t|128)}function Tn(e,t){return pt.chmodSync(e,t)}function op(e,t){let i=pt.statSync(e);return $h(t,i.atime,i.mtime)}function up(e,t,i,r,a){return t?Yo(i,r,a):lp(e.mode,i,r,a)}function lp(e,t,i,r){return pt.mkdirSync(i),Yo(t,i,r),Tn(i,e)}function Yo(e,t,i){pt.readdirSync(e).forEach(r=>fp(r,e,t,i))}function fp(e,t,i,r){let a=wi.join(t,e),n=wi.join(i,e),{destStat:s}=_i.checkPathsSync(a,n,"copy",r);return tp(s,a,n,r)}function cp(e,t,i,r){let a=pt.readlinkSync(t);if(r.dereference&&(a=wi.resolve(process.cwd(),a)),e){let n;try{n=pt.readlinkSync(i)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return pt.symlinkSync(a,i);throw s}if(r.dereference&&(n=wi.resolve(process.cwd(),n)),_i.isSrcSubdir(a,n))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${n}'.`);if(pt.statSync(i).isDirectory()&&_i.isSrcSubdir(n,a))throw new Error(`Cannot overwrite '${n}' with '${a}'.`);return hp(a,i)}else return pt.symlinkSync(a,i)}function hp(e,t){return pt.unlinkSync(t),pt.symlinkSync(e,t)}zo.exports=Zh});var ha=F((GA,Wo)=>{"use strict";S();var pp=Et().fromCallback;Wo.exports={copy:pp(Ho()),copySync:Jo()}});var nu=F((YA,au)=>{"use strict";S();var Xo=dt(),tu=Le("path"),Be=Le("assert"),Ni=process.platform==="win32";function ru(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(i=>{e[i]=e[i]||Xo[i],i=i+"Sync",e[i]=e[i]||Xo[i]}),e.maxBusyTries=e.maxBusyTries||3}function wn(e,t,i){let r=0;typeof t=="function"&&(i=t,t={}),Be(e,"rimraf: missing path"),Be.strictEqual(typeof e,"string","rimraf: path should be a string"),Be.strictEqual(typeof i,"function","rimraf: callback function required"),Be(t,"rimraf: invalid options argument provided"),Be.strictEqual(typeof t,"object","rimraf: options should be object"),ru(t),$o(e,t,function a(n){if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&r<t.maxBusyTries){r++;let s=r*100;return setTimeout(()=>$o(e,t,a),s)}n.code==="ENOENT"&&(n=null)}i(n)})}function $o(e,t,i){Be(e),Be(t),Be(typeof i=="function"),t.lstat(e,(r,a)=>{if(r&&r.code==="ENOENT")return i(null);if(r&&r.code==="EPERM"&&Ni)return Zo(e,t,r,i);if(a&&a.isDirectory())return pa(e,t,r,i);t.unlink(e,n=>{if(n){if(n.code==="ENOENT")return i(null);if(n.code==="EPERM")return Ni?Zo(e,t,n,i):pa(e,t,n,i);if(n.code==="EISDIR")return pa(e,t,n,i)}return i(n)})})}function Zo(e,t,i,r){Be(e),Be(t),Be(typeof r=="function"),t.chmod(e,438,a=>{a?r(a.code==="ENOENT"?null:i):t.stat(e,(n,s)=>{n?r(n.code==="ENOENT"?null:i):s.isDirectory()?pa(e,t,i,r):t.unlink(e,r)})})}function eu(e,t,i){let r;Be(e),Be(t);try{t.chmodSync(e,438)}catch(a){if(a.code==="ENOENT")return;throw i}try{r=t.statSync(e)}catch(a){if(a.code==="ENOENT")return;throw i}r.isDirectory()?da(e,t,i):t.unlinkSync(e)}function pa(e,t,i,r){Be(e),Be(t),Be(typeof r=="function"),t.rmdir(e,a=>{a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")?dp(e,t,r):a&&a.code==="ENOTDIR"?r(i):r(a)})}function dp(e,t,i){Be(e),Be(t),Be(typeof i=="function"),t.readdir(e,(r,a)=>{if(r)return i(r);let n=a.length,s;if(n===0)return t.rmdir(e,i);a.forEach(o=>{wn(tu.join(e,o),t,u=>{if(!s){if(u)return i(s=u);--n===0&&t.rmdir(e,i)}})})})}function iu(e,t){let i;t=t||{},ru(t),Be(e,"rimraf: missing path"),Be.strictEqual(typeof e,"string","rimraf: path should be a string"),Be(t,"rimraf: missing options"),Be.strictEqual(typeof t,"object","rimraf: options should be object");try{i=t.lstatSync(e)}catch(r){if(r.code==="ENOENT")return;r.code==="EPERM"&&Ni&&eu(e,t,r)}try{i&&i.isDirectory()?da(e,t,null):t.unlinkSync(e)}catch(r){if(r.code==="ENOENT")return;if(r.code==="EPERM")return Ni?eu(e,t,r):da(e,t,r);if(r.code!=="EISDIR")throw r;da(e,t,r)}}function da(e,t,i){Be(e),Be(t);try{t.rmdirSync(e)}catch(r){if(r.code==="ENOTDIR")throw i;if(r.code==="ENOTEMPTY"||r.code==="EEXIST"||r.code==="EPERM")gp(e,t);else if(r.code!=="ENOENT")throw r}}function gp(e,t){if(Be(e),Be(t),t.readdirSync(e).forEach(i=>iu(tu.join(e,i),t)),Ni){let i=Date.now();do try{return t.rmdirSync(e,t)}catch{}while(Date.now()-i<500)}else return t.rmdirSync(e,t)}au.exports=wn;wn.sync=iu});var ki=F((JA,ou)=>{"use strict";S();var ga=dt(),vp=Et().fromCallback,su=nu();function yp(e,t){if(ga.rm)return ga.rm(e,{recursive:!0,force:!0},t);su(e,t)}function mp(e){if(ga.rmSync)return ga.rmSync(e,{recursive:!0,force:!0});su.sync(e)}ou.exports={remove:vp(yp),removeSync:mp}});var gu=F((XA,du)=>{"use strict";S();var Ap=Et().fromPromise,fu=Dr(),cu=Le("path"),hu=Mt(),pu=ki(),uu=Ap(async function(t){let i;try{i=await fu.readdir(t)}catch{return hu.mkdirs(t)}return Promise.all(i.map(r=>pu.remove(cu.join(t,r))))});function lu(e){let t;try{t=fu.readdirSync(e)}catch{return hu.mkdirsSync(e)}t.forEach(i=>{i=cu.join(e,i),pu.removeSync(i)})}du.exports={emptyDirSync:lu,emptydirSync:lu,emptyDir:uu,emptydir:uu}});var Au=F((ZA,mu)=>{"use strict";S();var Cp=Et().fromCallback,vu=Le("path"),gr=dt(),yu=Mt();function Ep(e,t){function i(){gr.writeFile(e,"",r=>{if(r)return t(r);t()})}gr.stat(e,(r,a)=>{if(!r&&a.isFile())return t();let n=vu.dirname(e);gr.stat(n,(s,o)=>{if(s)return s.code==="ENOENT"?yu.mkdirs(n,u=>{if(u)return t(u);i()}):t(s);o.isDirectory()?i():gr.readdir(n,u=>{if(u)return t(u)})})})}function xp(e){let t;try{t=gr.statSync(e)}catch{}if(t&&t.isFile())return;let i=vu.dirname(e);try{gr.statSync(i).isDirectory()||gr.readdirSync(i)}catch(r){if(r&&r.code==="ENOENT")yu.mkdirsSync(i);else throw r}gr.writeFileSync(e,"")}mu.exports={createFile:Cp(Ep),createFileSync:xp}});var Iu=F((t1,Su)=>{"use strict";S();var Sp=Et().fromCallback,Cu=Le("path"),vr=dt(),Eu=Mt(),Ip=dr().pathExists,{areIdentical:xu}=Pr();function Bp(e,t,i){function r(a,n){vr.link(a,n,s=>{if(s)return i(s);i(null)})}vr.lstat(t,(a,n)=>{vr.lstat(e,(s,o)=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),i(s);if(n&&xu(o,n))return i(null);let u=Cu.dirname(t);Ip(u,(l,f)=>{if(l)return i(l);if(f)return r(e,t);Eu.mkdirs(u,c=>{if(c)return i(c);r(e,t)})})})})}function bp(e,t){let i;try{i=vr.lstatSync(t)}catch{}try{let n=vr.lstatSync(e);if(i&&xu(n,i))return}catch(n){throw n.message=n.message.replace("lstat","ensureLink"),n}let r=Cu.dirname(t);return vr.existsSync(r)||Eu.mkdirsSync(r),vr.linkSync(e,t)}Su.exports={createLink:Sp(Bp),createLinkSync:bp}});var bu=F((i1,Bu)=>{"use strict";S();var yr=Le("path"),Li=dt(),Tp=dr().pathExists;function wp(e,t,i){if(yr.isAbsolute(e))return Li.lstat(e,r=>r?(r.message=r.message.replace("lstat","ensureSymlink"),i(r)):i(null,{toCwd:e,toDst:e}));{let r=yr.dirname(t),a=yr.join(r,e);return Tp(a,(n,s)=>n?i(n):s?i(null,{toCwd:a,toDst:e}):Li.lstat(e,o=>o?(o.message=o.message.replace("lstat","ensureSymlink"),i(o)):i(null,{toCwd:e,toDst:yr.relative(r,e)})))}}function _p(e,t){let i;if(yr.isAbsolute(e)){if(i=Li.existsSync(e),!i)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{let r=yr.dirname(t),a=yr.join(r,e);if(i=Li.existsSync(a),i)return{toCwd:a,toDst:e};if(i=Li.existsSync(e),!i)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:yr.relative(r,e)}}}Bu.exports={symlinkPaths:wp,symlinkPathsSync:_p}});var _u=F((n1,wu)=>{"use strict";S();var Tu=dt();function Np(e,t,i){if(i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,t)return i(null,t);Tu.lstat(e,(r,a)=>{if(r)return i(null,"file");t=a&&a.isDirectory()?"dir":"file",i(null,t)})}function kp(e,t){let i;if(t)return t;try{i=Tu.lstatSync(e)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}wu.exports={symlinkType:Np,symlinkTypeSync:kp}});var Uu=F((o1,Qu)=>{"use strict";S();var Lp=Et().fromCallback,ku=Le("path"),qt=Dr(),Lu=Mt(),Rp=Lu.mkdirs,Dp=Lu.mkdirsSync,Ru=bu(),Pp=Ru.symlinkPaths,Qp=Ru.symlinkPathsSync,Du=_u(),Up=Du.symlinkType,Op=Du.symlinkTypeSync,Vp=dr().pathExists,{areIdentical:Pu}=Pr();function Fp(e,t,i,r){r=typeof i=="function"?i:r,i=typeof i=="function"?!1:i,qt.lstat(t,(a,n)=>{!a&&n.isSymbolicLink()?Promise.all([qt.stat(e),qt.stat(t)]).then(([s,o])=>{if(Pu(s,o))return r(null);Nu(e,t,i,r)}):Nu(e,t,i,r)})}function Nu(e,t,i,r){Pp(e,t,(a,n)=>{if(a)return r(a);e=n.toDst,Up(n.toCwd,i,(s,o)=>{if(s)return r(s);let u=ku.dirname(t);Vp(u,(l,f)=>{if(l)return r(l);if(f)return qt.symlink(e,t,o,r);Rp(u,c=>{if(c)return r(c);qt.symlink(e,t,o,r)})})})})}function Mp(e,t,i){let r;try{r=qt.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){let o=qt.statSync(e),u=qt.statSync(t);if(Pu(o,u))return}let a=Qp(e,t);e=a.toDst,i=Op(a.toCwd,i);let n=ku.dirname(t);return qt.existsSync(n)||Dp(n),qt.symlinkSync(e,t,i)}Qu.exports={createSymlink:Lp(Fp),createSymlinkSync:Mp}});var Gu=F((l1,Hu)=>{"use strict";S();var{createFile:Ou,createFileSync:Vu}=Au(),{createLink:Fu,createLinkSync:Mu}=Iu(),{createSymlink:qu,createSymlinkSync:Ku}=Uu();Hu.exports={createFile:Ou,createFileSync:Vu,ensureFile:Ou,ensureFileSync:Vu,createLink:Fu,createLinkSync:Mu,ensureLink:Fu,ensureLinkSync:Mu,createSymlink:qu,createSymlinkSync:Ku,ensureSymlink:qu,ensureSymlinkSync:Ku}});var va=F((c1,ju)=>{"use strict";S();function qp(e,{EOL:t=`
9
- `,finalEOL:i=!0,replacer:r=null,spaces:a}={}){let n=i?t:"";return JSON.stringify(e,r,a).replace(/\n/g,t)+n}function Kp(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}ju.exports={stringify:qp,stripBom:Kp}});var Wu=F((p1,Ju)=>{"use strict";S();var Xr;try{Xr=dt()}catch{Xr=Le("fs")}var ya=Et(),{stringify:Yu,stripBom:zu}=va();async function Hp(e,t={}){typeof t=="string"&&(t={encoding:t});let i=t.fs||Xr,r="throws"in t?t.throws:!0,a=await ya.fromCallback(i.readFile)(e,t);a=zu(a);let n;try{n=JSON.parse(a,t?t.reviver:null)}catch(s){if(r)throw s.message=`${e}: ${s.message}`,s;return null}return n}var Gp=ya.fromPromise(Hp);function jp(e,t={}){typeof t=="string"&&(t={encoding:t});let i=t.fs||Xr,r="throws"in t?t.throws:!0;try{let a=i.readFileSync(e,t);return a=zu(a),JSON.parse(a,t.reviver)}catch(a){if(r)throw a.message=`${e}: ${a.message}`,a;return null}}async function Yp(e,t,i={}){let r=i.fs||Xr,a=Yu(t,i);await ya.fromCallback(r.writeFile)(e,a,i)}var zp=ya.fromPromise(Yp);function Jp(e,t,i={}){let r=i.fs||Xr,a=Yu(t,i);return r.writeFileSync(e,a,i)}var Wp={readFile:Gp,readFileSync:jp,writeFile:zp,writeFileSync:Jp};Ju.exports=Wp});var $u=F((g1,Xu)=>{"use strict";S();var ma=Wu();Xu.exports={readJson:ma.readFile,readJsonSync:ma.readFileSync,writeJson:ma.writeFile,writeJsonSync:ma.writeFileSync}});var Aa=F((y1,tl)=>{"use strict";S();var Xp=Et().fromCallback,Ri=dt(),Zu=Le("path"),el=Mt(),$p=dr().pathExists;function Zp(e,t,i,r){typeof i=="function"&&(r=i,i="utf8");let a=Zu.dirname(e);$p(a,(n,s)=>{if(n)return r(n);if(s)return Ri.writeFile(e,t,i,r);el.mkdirs(a,o=>{if(o)return r(o);Ri.writeFile(e,t,i,r)})})}function ed(e,...t){let i=Zu.dirname(e);if(Ri.existsSync(i))return Ri.writeFileSync(e,...t);el.mkdirsSync(i),Ri.writeFileSync(e,...t)}tl.exports={outputFile:Xp(Zp),outputFileSync:ed}});var il=F((A1,rl)=>{"use strict";S();var{stringify:td}=va(),{outputFile:rd}=Aa();async function id(e,t,i={}){let r=td(t,i);await rd(e,r,i)}rl.exports=id});var nl=F((E1,al)=>{"use strict";S();var{stringify:ad}=va(),{outputFileSync:nd}=Aa();function sd(e,t,i){let r=ad(t,i);nd(e,r,i)}al.exports=sd});var ol=F((S1,sl)=>{"use strict";S();var od=Et().fromPromise,gt=$u();gt.outputJson=od(il());gt.outputJsonSync=nl();gt.outputJSON=gt.outputJson;gt.outputJSONSync=gt.outputJsonSync;gt.writeJSON=gt.writeJson;gt.writeJSONSync=gt.writeJsonSync;gt.readJSON=gt.readJson;gt.readJSONSync=gt.readJsonSync;sl.exports=gt});var hl=F((B1,cl)=>{"use strict";S();var ud=dt(),Nn=Le("path"),ld=ha().copy,fl=ki().remove,fd=Mt().mkdirp,cd=dr().pathExists,ul=Pr();function hd(e,t,i,r){typeof i=="function"&&(r=i,i={}),i=i||{};let a=i.overwrite||i.clobber||!1;ul.checkPaths(e,t,"move",i,(n,s)=>{if(n)return r(n);let{srcStat:o,isChangingCase:u=!1}=s;ul.checkParentPaths(e,o,t,"move",l=>{if(l)return r(l);if(pd(t))return ll(e,t,a,u,r);fd(Nn.dirname(t),f=>f?r(f):ll(e,t,a,u,r))})})}function pd(e){let t=Nn.dirname(e);return Nn.parse(t).root===t}function ll(e,t,i,r,a){if(r)return _n(e,t,i,a);if(i)return fl(t,n=>n?a(n):_n(e,t,i,a));cd(t,(n,s)=>n?a(n):s?a(new Error("dest already exists.")):_n(e,t,i,a))}function _n(e,t,i,r){ud.rename(e,t,a=>a?a.code!=="EXDEV"?r(a):dd(e,t,i,r):r())}function dd(e,t,i,r){ld(e,t,{overwrite:i,errorOnExist:!0},n=>n?r(n):fl(e,r))}cl.exports=hd});var yl=F((T1,vl)=>{"use strict";S();var dl=dt(),Ln=Le("path"),gd=ha().copySync,gl=ki().removeSync,vd=Mt().mkdirpSync,pl=Pr();function yd(e,t,i){i=i||{};let r=i.overwrite||i.clobber||!1,{srcStat:a,isChangingCase:n=!1}=pl.checkPathsSync(e,t,"move",i);return pl.checkParentPathsSync(e,a,t,"move"),md(t)||vd(Ln.dirname(t)),Ad(e,t,r,n)}function md(e){let t=Ln.dirname(e);return Ln.parse(t).root===t}function Ad(e,t,i,r){if(r)return kn(e,t,i);if(i)return gl(t),kn(e,t,i);if(dl.existsSync(t))throw new Error("dest already exists.");return kn(e,t,i)}function kn(e,t,i){try{dl.renameSync(e,t)}catch(r){if(r.code!=="EXDEV")throw r;return Cd(e,t,i)}}function Cd(e,t,i){return gd(e,t,{overwrite:i,errorOnExist:!0}),gl(e)}vl.exports=yd});var Al=F((_1,ml)=>{"use strict";S();var Ed=Et().fromCallback;ml.exports={move:Ed(hl()),moveSync:yl()}});var El=F((k1,Cl)=>{"use strict";S();Cl.exports={...Dr(),...ha(),...gu(),...Gu(),...ol(),...Mt(),...Al(),...Aa(),...dr(),...ki()}});var oe=F((mC,Lf)=>{"use strict";S();Lf.exports={options:{usePureJavaScript:!1}}});var Pf=F((CC,Df)=>{"use strict";S();var Yn={};Df.exports=Yn;var Rf={};Yn.encode=function(e,t,i){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(i!==void 0&&typeof i!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=fg(e,t);else{var a=0,n=t.length,s=t.charAt(0),o=[0];for(a=0;a<e.length;++a){for(var u=0,l=e[a];u<o.length;++u)l+=o[u]<<8,o[u]=l%n,l=l/n|0;for(;l>0;)o.push(l%n),l=l/n|0}for(a=0;e[a]===0&&a<e.length-1;++a)r+=s;for(a=o.length-1;a>=0;--a)r+=t[o[a]]}if(i){var f=new RegExp(".{1,"+i+"}","g");r=r.match(f).join(`\r
10
- `)}return r};Yn.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var i=Rf[t];if(!i){i=Rf[t]=[];for(var r=0;r<t.length;++r)i[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var a=t.length,n=t.charAt(0),s=[0],r=0;r<e.length;r++){var o=i[e.charCodeAt(r)];if(o===void 0)return;for(var u=0,l=o;u<s.length;++u)l+=s[u]*a,s[u]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var f=0;e[f]===n&&f<e.length-1;++f)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function fg(e,t){var i=0,r=t.length,a=t.charAt(0),n=[0];for(i=0;i<e.length();++i){for(var s=0,o=e.at(i);s<n.length;++s)o+=n[s]<<8,n[s]=o%r,o=o/r|0;for(;o>0;)n.push(o%r),o=o/r|0}var u="";for(i=0;e.at(i)===0&&i<e.length()-1;++i)u+=a;for(i=n.length-1;i>=0;--i)u+=t[n[i]];return u}});var Ae=F((xC,Vf)=>{"use strict";S();var Qf=oe(),Uf=Pf(),I=Vf.exports=Qf.util=Qf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){I.nextTick=process.nextTick,typeof setImmediate=="function"?I.setImmediate=setImmediate:I.setImmediate=I.nextTick;return}if(typeof setImmediate=="function"){I.setImmediate=function(){return setImmediate.apply(void 0,arguments)},I.nextTick=function(o){return setImmediate(o)};return}if(I.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(u){if(u.source===window&&u.data===e){u.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(f){f()})}};var s=o,e="forge.setImmediate",t=[];I.setImmediate=function(u){t.push(u),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var i=Date.now(),r=!0,a=document.createElement("div"),t=[];new MutationObserver(function(){var u=t.slice();t.length=0,u.forEach(function(l){l()})}).observe(a,{attributes:!0});var n=I.setImmediate;I.setImmediate=function(u){Date.now()-i>15?(i=Date.now(),n(u)):(t.push(u),t.length===1&&a.setAttribute("a",r=!r))}}I.nextTick=I.setImmediate})();I.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;I.globalScope=function(){return I.isNodejs?global:typeof self>"u"?window:self}();I.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};I.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};I.isArrayBufferView=function(e){return e&&I.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Mi(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}I.ByteBuffer=zn;function zn(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(I.isArrayBuffer(e)||I.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var i=0;i<t.length;++i)this.putByte(t[i])}}else(e instanceof zn||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}I.ByteStringBuffer=zn;var cg=4096;I.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>cg&&(this.data.substr(0,1),this._constructedStringLength=0)};I.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};I.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};I.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};I.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var i=this.data;t>0;)t&1&&(i+=e),t>>>=1,t>0&&(e+=e);return this.data=i,this._optimizeConstructedString(t),this};I.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};I.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(I.encodeUtf8(e))};I.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};I.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};I.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};I.ByteStringBuffer.prototype.putInt=function(e,t){Mi(t);var i="";do t-=8,i+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(i)};I.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};I.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};I.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};I.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};I.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};I.ByteStringBuffer.prototype.getInt=function(e){Mi(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};I.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),i=2<<e-2;return t>=i&&(t-=i<<1),t};I.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};I.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};I.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};I.ByteStringBuffer.prototype.copy=function(){var e=I.createBuffer(this.data);return e.read=this.read,e};I.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};I.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};I.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};I.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var i=this.data.charCodeAt(t);i<16&&(e+="0"),e+=i.toString(16)}return e};I.ByteStringBuffer.prototype.toString=function(){return I.decodeUtf8(this.bytes())};function hg(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var i=I.isArrayBuffer(e),r=I.isArrayBufferView(e);if(i||r){i?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}I.DataBuffer=hg;I.DataBuffer.prototype.length=function(){return this.write-this.read};I.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};I.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var i=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(i),this.data=new DataView(r.buffer),this};I.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};I.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var i=0;i<t;++i)this.data.setUint8(e);return this};I.DataBuffer.prototype.putBytes=function(e,t){if(I.isArrayBufferView(e)){var i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=i.byteLength-i.byteOffset;this.accommodate(r);var a=new Uint8Array(this.data.buffer,this.write);return a.set(i),this.write+=r,this}if(I.isArrayBuffer(e)){var i=new Uint8Array(e);this.accommodate(i.byteLength);var a=new Uint8Array(this.data.buffer);return a.set(i,this.write),this.write+=i.byteLength,this}if(e instanceof I.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&I.isArrayBufferView(e.data)){var i=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(i.byteLength);var a=new Uint8Array(e.data.byteLength,this.write);return a.set(i),this.write+=i.byteLength,this}if(e instanceof I.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var n;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.hex.decode(e,n,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.base64.decode(e,n,this.write),this;if(t==="utf8"&&(e=I.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.raw.decode(n),this;if(t==="utf16")return this.accommodate(e.length*2),n=new Uint16Array(this.data.buffer,this.write),this.write+=I.text.utf16.encode(n),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};I.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};I.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};I.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};I.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};I.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};I.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};I.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};I.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};I.DataBuffer.prototype.putInt=function(e,t){Mi(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};I.DataBuffer.prototype.putSignedInt=function(e,t){return Mi(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};I.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};I.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};I.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};I.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};I.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};I.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};I.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};I.DataBuffer.prototype.getInt=function(e){Mi(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};I.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),i=2<<e-2;return t>=i&&(t-=i<<1),t};I.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};I.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};I.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};I.DataBuffer.prototype.copy=function(){return new I.DataBuffer(this)};I.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};I.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};I.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};I.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var i=this.data.getUint8(t);i<16&&(e+="0"),e+=i.toString(16)}return e};I.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return I.binary.raw.encode(t);if(e==="hex")return I.binary.hex.encode(t);if(e==="base64")return I.binary.base64.encode(t);if(e==="utf8")return I.text.utf8.decode(t);if(e==="utf16")return I.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};I.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=I.encodeUtf8(e)),new I.ByteBuffer(e)};I.fillString=function(e,t){for(var i="";t>0;)t&1&&(i+=e),t>>>=1,t>0&&(e+=e);return i};I.xorBytes=function(e,t,i){for(var r="",a="",n="",s=0,o=0;i>0;--i,++s)a=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(r+=n,n="",o=0),n+=String.fromCharCode(a),++o;return r+=n,r};I.hexToBytes=function(e){var t="",i=0;for(e.length&!0&&(i=1,t+=String.fromCharCode(parseInt(e[0],16)));i<e.length;i+=2)t+=String.fromCharCode(parseInt(e.substr(i,2),16));return t};I.bytesToHex=function(e){return I.createBuffer(e).toHex()};I.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Of="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";I.encode64=function(e,t){for(var i="",r="",a,n,s,o=0;o<e.length;)a=e.charCodeAt(o++),n=e.charCodeAt(o++),s=e.charCodeAt(o++),i+=xr.charAt(a>>2),i+=xr.charAt((a&3)<<4|n>>4),isNaN(n)?i+="==":(i+=xr.charAt((n&15)<<2|s>>6),i+=isNaN(s)?"=":xr.charAt(s&63)),t&&i.length>t&&(r+=i.substr(0,t)+`\r
8
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:a}=_i.checkPathsSync(e,t,"copy",i);return _i.checkParentPathsSync(e,r,t,"copy"),ep(a,e,t,i)}function ep(e,t,i,r){if(r.filter&&!r.filter(t,i))return;let a=wi.dirname(i);return pt.existsSync(a)||Xh(a),Go(e,t,i,r)}function tp(e,t,i,r){if(!(r.filter&&!r.filter(t,i)))return Go(e,t,i,r)}function Go(e,t,i,r){let n=(r.dereference?pt.statSync:pt.lstatSync)(t);if(n.isDirectory())return up(n,e,t,i,r);if(n.isFile()||n.isCharacterDevice()||n.isBlockDevice())return rp(n,e,t,i,r);if(n.isSymbolicLink())return cp(e,t,i,r);throw n.isSocket()?new Error(`Cannot copy a socket file: ${t}`):n.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function rp(e,t,i,r,a){return t?ip(e,i,r,a):jo(e,i,r,a)}function ip(e,t,i,r){if(r.overwrite)return pt.unlinkSync(i),jo(e,t,i,r);if(r.errorOnExist)throw new Error(`'${i}' already exists`)}function jo(e,t,i,r){return pt.copyFileSync(t,i),r.preserveTimestamps&&ap(e.mode,t,i),Tn(i,e.mode)}function ap(e,t,i){return np(e)&&sp(i,e),op(t,i)}function np(e){return(e&128)===0}function sp(e,t){return Tn(e,t|128)}function Tn(e,t){return pt.chmodSync(e,t)}function op(e,t){let i=pt.statSync(e);return $h(t,i.atime,i.mtime)}function up(e,t,i,r,a){return t?Yo(i,r,a):lp(e.mode,i,r,a)}function lp(e,t,i,r){return pt.mkdirSync(i),Yo(t,i,r),Tn(i,e)}function Yo(e,t,i){pt.readdirSync(e).forEach(r=>fp(r,e,t,i))}function fp(e,t,i,r){let a=wi.join(t,e),n=wi.join(i,e),{destStat:s}=_i.checkPathsSync(a,n,"copy",r);return tp(s,a,n,r)}function cp(e,t,i,r){let a=pt.readlinkSync(t);if(r.dereference&&(a=wi.resolve(process.cwd(),a)),e){let n;try{n=pt.readlinkSync(i)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return pt.symlinkSync(a,i);throw s}if(r.dereference&&(n=wi.resolve(process.cwd(),n)),_i.isSrcSubdir(a,n))throw new Error(`Cannot copy '${a}' to a subdirectory of itself, '${n}'.`);if(pt.statSync(i).isDirectory()&&_i.isSrcSubdir(n,a))throw new Error(`Cannot overwrite '${n}' with '${a}'.`);return hp(a,i)}else return pt.symlinkSync(a,i)}function hp(e,t){return pt.unlinkSync(t),pt.symlinkSync(e,t)}zo.exports=Zh});var ha=F((jA,Wo)=>{"use strict";S();var pp=Et().fromCallback;Wo.exports={copy:pp(Ho()),copySync:Jo()}});var nu=F((zA,au)=>{"use strict";S();var Xo=dt(),tu=Le("path"),Be=Le("assert"),Ni=process.platform==="win32";function ru(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(i=>{e[i]=e[i]||Xo[i],i=i+"Sync",e[i]=e[i]||Xo[i]}),e.maxBusyTries=e.maxBusyTries||3}function wn(e,t,i){let r=0;typeof t=="function"&&(i=t,t={}),Be(e,"rimraf: missing path"),Be.strictEqual(typeof e,"string","rimraf: path should be a string"),Be.strictEqual(typeof i,"function","rimraf: callback function required"),Be(t,"rimraf: invalid options argument provided"),Be.strictEqual(typeof t,"object","rimraf: options should be object"),ru(t),$o(e,t,function a(n){if(n){if((n.code==="EBUSY"||n.code==="ENOTEMPTY"||n.code==="EPERM")&&r<t.maxBusyTries){r++;let s=r*100;return setTimeout(()=>$o(e,t,a),s)}n.code==="ENOENT"&&(n=null)}i(n)})}function $o(e,t,i){Be(e),Be(t),Be(typeof i=="function"),t.lstat(e,(r,a)=>{if(r&&r.code==="ENOENT")return i(null);if(r&&r.code==="EPERM"&&Ni)return Zo(e,t,r,i);if(a&&a.isDirectory())return pa(e,t,r,i);t.unlink(e,n=>{if(n){if(n.code==="ENOENT")return i(null);if(n.code==="EPERM")return Ni?Zo(e,t,n,i):pa(e,t,n,i);if(n.code==="EISDIR")return pa(e,t,n,i)}return i(n)})})}function Zo(e,t,i,r){Be(e),Be(t),Be(typeof r=="function"),t.chmod(e,438,a=>{a?r(a.code==="ENOENT"?null:i):t.stat(e,(n,s)=>{n?r(n.code==="ENOENT"?null:i):s.isDirectory()?pa(e,t,i,r):t.unlink(e,r)})})}function eu(e,t,i){let r;Be(e),Be(t);try{t.chmodSync(e,438)}catch(a){if(a.code==="ENOENT")return;throw i}try{r=t.statSync(e)}catch(a){if(a.code==="ENOENT")return;throw i}r.isDirectory()?da(e,t,i):t.unlinkSync(e)}function pa(e,t,i,r){Be(e),Be(t),Be(typeof r=="function"),t.rmdir(e,a=>{a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")?dp(e,t,r):a&&a.code==="ENOTDIR"?r(i):r(a)})}function dp(e,t,i){Be(e),Be(t),Be(typeof i=="function"),t.readdir(e,(r,a)=>{if(r)return i(r);let n=a.length,s;if(n===0)return t.rmdir(e,i);a.forEach(o=>{wn(tu.join(e,o),t,u=>{if(!s){if(u)return i(s=u);--n===0&&t.rmdir(e,i)}})})})}function iu(e,t){let i;t=t||{},ru(t),Be(e,"rimraf: missing path"),Be.strictEqual(typeof e,"string","rimraf: path should be a string"),Be(t,"rimraf: missing options"),Be.strictEqual(typeof t,"object","rimraf: options should be object");try{i=t.lstatSync(e)}catch(r){if(r.code==="ENOENT")return;r.code==="EPERM"&&Ni&&eu(e,t,r)}try{i&&i.isDirectory()?da(e,t,null):t.unlinkSync(e)}catch(r){if(r.code==="ENOENT")return;if(r.code==="EPERM")return Ni?eu(e,t,r):da(e,t,r);if(r.code!=="EISDIR")throw r;da(e,t,r)}}function da(e,t,i){Be(e),Be(t);try{t.rmdirSync(e)}catch(r){if(r.code==="ENOTDIR")throw i;if(r.code==="ENOTEMPTY"||r.code==="EEXIST"||r.code==="EPERM")gp(e,t);else if(r.code!=="ENOENT")throw r}}function gp(e,t){if(Be(e),Be(t),t.readdirSync(e).forEach(i=>iu(tu.join(e,i),t)),Ni){let i=Date.now();do try{return t.rmdirSync(e,t)}catch{}while(Date.now()-i<500)}else return t.rmdirSync(e,t)}au.exports=wn;wn.sync=iu});var ki=F((WA,ou)=>{"use strict";S();var ga=dt(),vp=Et().fromCallback,su=nu();function yp(e,t){if(ga.rm)return ga.rm(e,{recursive:!0,force:!0},t);su(e,t)}function mp(e){if(ga.rmSync)return ga.rmSync(e,{recursive:!0,force:!0});su.sync(e)}ou.exports={remove:vp(yp),removeSync:mp}});var gu=F(($A,du)=>{"use strict";S();var Ap=Et().fromPromise,fu=Dr(),cu=Le("path"),hu=Mt(),pu=ki(),uu=Ap(async function(t){let i;try{i=await fu.readdir(t)}catch{return hu.mkdirs(t)}return Promise.all(i.map(r=>pu.remove(cu.join(t,r))))});function lu(e){let t;try{t=fu.readdirSync(e)}catch{return hu.mkdirsSync(e)}t.forEach(i=>{i=cu.join(e,i),pu.removeSync(i)})}du.exports={emptyDirSync:lu,emptydirSync:lu,emptyDir:uu,emptydir:uu}});var Au=F((e1,mu)=>{"use strict";S();var Cp=Et().fromCallback,vu=Le("path"),gr=dt(),yu=Mt();function Ep(e,t){function i(){gr.writeFile(e,"",r=>{if(r)return t(r);t()})}gr.stat(e,(r,a)=>{if(!r&&a.isFile())return t();let n=vu.dirname(e);gr.stat(n,(s,o)=>{if(s)return s.code==="ENOENT"?yu.mkdirs(n,u=>{if(u)return t(u);i()}):t(s);o.isDirectory()?i():gr.readdir(n,u=>{if(u)return t(u)})})})}function xp(e){let t;try{t=gr.statSync(e)}catch{}if(t&&t.isFile())return;let i=vu.dirname(e);try{gr.statSync(i).isDirectory()||gr.readdirSync(i)}catch(r){if(r&&r.code==="ENOENT")yu.mkdirsSync(i);else throw r}gr.writeFileSync(e,"")}mu.exports={createFile:Cp(Ep),createFileSync:xp}});var Iu=F((r1,Su)=>{"use strict";S();var Sp=Et().fromCallback,Cu=Le("path"),vr=dt(),Eu=Mt(),Ip=dr().pathExists,{areIdentical:xu}=Pr();function Bp(e,t,i){function r(a,n){vr.link(a,n,s=>{if(s)return i(s);i(null)})}vr.lstat(t,(a,n)=>{vr.lstat(e,(s,o)=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),i(s);if(n&&xu(o,n))return i(null);let u=Cu.dirname(t);Ip(u,(l,f)=>{if(l)return i(l);if(f)return r(e,t);Eu.mkdirs(u,c=>{if(c)return i(c);r(e,t)})})})})}function bp(e,t){let i;try{i=vr.lstatSync(t)}catch{}try{let n=vr.lstatSync(e);if(i&&xu(n,i))return}catch(n){throw n.message=n.message.replace("lstat","ensureLink"),n}let r=Cu.dirname(t);return vr.existsSync(r)||Eu.mkdirsSync(r),vr.linkSync(e,t)}Su.exports={createLink:Sp(Bp),createLinkSync:bp}});var bu=F((a1,Bu)=>{"use strict";S();var yr=Le("path"),Li=dt(),Tp=dr().pathExists;function wp(e,t,i){if(yr.isAbsolute(e))return Li.lstat(e,r=>r?(r.message=r.message.replace("lstat","ensureSymlink"),i(r)):i(null,{toCwd:e,toDst:e}));{let r=yr.dirname(t),a=yr.join(r,e);return Tp(a,(n,s)=>n?i(n):s?i(null,{toCwd:a,toDst:e}):Li.lstat(e,o=>o?(o.message=o.message.replace("lstat","ensureSymlink"),i(o)):i(null,{toCwd:e,toDst:yr.relative(r,e)})))}}function _p(e,t){let i;if(yr.isAbsolute(e)){if(i=Li.existsSync(e),!i)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{let r=yr.dirname(t),a=yr.join(r,e);if(i=Li.existsSync(a),i)return{toCwd:a,toDst:e};if(i=Li.existsSync(e),!i)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:yr.relative(r,e)}}}Bu.exports={symlinkPaths:wp,symlinkPathsSync:_p}});var _u=F((s1,wu)=>{"use strict";S();var Tu=dt();function Np(e,t,i){if(i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,t)return i(null,t);Tu.lstat(e,(r,a)=>{if(r)return i(null,"file");t=a&&a.isDirectory()?"dir":"file",i(null,t)})}function kp(e,t){let i;if(t)return t;try{i=Tu.lstatSync(e)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}wu.exports={symlinkType:Np,symlinkTypeSync:kp}});var Uu=F((u1,Qu)=>{"use strict";S();var Lp=Et().fromCallback,ku=Le("path"),qt=Dr(),Lu=Mt(),Rp=Lu.mkdirs,Dp=Lu.mkdirsSync,Ru=bu(),Pp=Ru.symlinkPaths,Qp=Ru.symlinkPathsSync,Du=_u(),Up=Du.symlinkType,Op=Du.symlinkTypeSync,Vp=dr().pathExists,{areIdentical:Pu}=Pr();function Fp(e,t,i,r){r=typeof i=="function"?i:r,i=typeof i=="function"?!1:i,qt.lstat(t,(a,n)=>{!a&&n.isSymbolicLink()?Promise.all([qt.stat(e),qt.stat(t)]).then(([s,o])=>{if(Pu(s,o))return r(null);Nu(e,t,i,r)}):Nu(e,t,i,r)})}function Nu(e,t,i,r){Pp(e,t,(a,n)=>{if(a)return r(a);e=n.toDst,Up(n.toCwd,i,(s,o)=>{if(s)return r(s);let u=ku.dirname(t);Vp(u,(l,f)=>{if(l)return r(l);if(f)return qt.symlink(e,t,o,r);Rp(u,c=>{if(c)return r(c);qt.symlink(e,t,o,r)})})})})}function Mp(e,t,i){let r;try{r=qt.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){let o=qt.statSync(e),u=qt.statSync(t);if(Pu(o,u))return}let a=Qp(e,t);e=a.toDst,i=Op(a.toCwd,i);let n=ku.dirname(t);return qt.existsSync(n)||Dp(n),qt.symlinkSync(e,t,i)}Qu.exports={createSymlink:Lp(Fp),createSymlinkSync:Mp}});var Gu=F((f1,Hu)=>{"use strict";S();var{createFile:Ou,createFileSync:Vu}=Au(),{createLink:Fu,createLinkSync:Mu}=Iu(),{createSymlink:qu,createSymlinkSync:Ku}=Uu();Hu.exports={createFile:Ou,createFileSync:Vu,ensureFile:Ou,ensureFileSync:Vu,createLink:Fu,createLinkSync:Mu,ensureLink:Fu,ensureLinkSync:Mu,createSymlink:qu,createSymlinkSync:Ku,ensureSymlink:qu,ensureSymlinkSync:Ku}});var va=F((h1,ju)=>{"use strict";S();function qp(e,{EOL:t=`
9
+ `,finalEOL:i=!0,replacer:r=null,spaces:a}={}){let n=i?t:"";return JSON.stringify(e,r,a).replace(/\n/g,t)+n}function Kp(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}ju.exports={stringify:qp,stripBom:Kp}});var Wu=F((d1,Ju)=>{"use strict";S();var Xr;try{Xr=dt()}catch{Xr=Le("fs")}var ya=Et(),{stringify:Yu,stripBom:zu}=va();async function Hp(e,t={}){typeof t=="string"&&(t={encoding:t});let i=t.fs||Xr,r="throws"in t?t.throws:!0,a=await ya.fromCallback(i.readFile)(e,t);a=zu(a);let n;try{n=JSON.parse(a,t?t.reviver:null)}catch(s){if(r)throw s.message=`${e}: ${s.message}`,s;return null}return n}var Gp=ya.fromPromise(Hp);function jp(e,t={}){typeof t=="string"&&(t={encoding:t});let i=t.fs||Xr,r="throws"in t?t.throws:!0;try{let a=i.readFileSync(e,t);return a=zu(a),JSON.parse(a,t.reviver)}catch(a){if(r)throw a.message=`${e}: ${a.message}`,a;return null}}async function Yp(e,t,i={}){let r=i.fs||Xr,a=Yu(t,i);await ya.fromCallback(r.writeFile)(e,a,i)}var zp=ya.fromPromise(Yp);function Jp(e,t,i={}){let r=i.fs||Xr,a=Yu(t,i);return r.writeFileSync(e,a,i)}var Wp={readFile:Gp,readFileSync:jp,writeFile:zp,writeFileSync:Jp};Ju.exports=Wp});var $u=F((v1,Xu)=>{"use strict";S();var ma=Wu();Xu.exports={readJson:ma.readFile,readJsonSync:ma.readFileSync,writeJson:ma.writeFile,writeJsonSync:ma.writeFileSync}});var Aa=F((m1,tl)=>{"use strict";S();var Xp=Et().fromCallback,Ri=dt(),Zu=Le("path"),el=Mt(),$p=dr().pathExists;function Zp(e,t,i,r){typeof i=="function"&&(r=i,i="utf8");let a=Zu.dirname(e);$p(a,(n,s)=>{if(n)return r(n);if(s)return Ri.writeFile(e,t,i,r);el.mkdirs(a,o=>{if(o)return r(o);Ri.writeFile(e,t,i,r)})})}function ed(e,...t){let i=Zu.dirname(e);if(Ri.existsSync(i))return Ri.writeFileSync(e,...t);el.mkdirsSync(i),Ri.writeFileSync(e,...t)}tl.exports={outputFile:Xp(Zp),outputFileSync:ed}});var il=F((C1,rl)=>{"use strict";S();var{stringify:td}=va(),{outputFile:rd}=Aa();async function id(e,t,i={}){let r=td(t,i);await rd(e,r,i)}rl.exports=id});var nl=F((x1,al)=>{"use strict";S();var{stringify:ad}=va(),{outputFileSync:nd}=Aa();function sd(e,t,i){let r=ad(t,i);nd(e,r,i)}al.exports=sd});var ol=F((I1,sl)=>{"use strict";S();var od=Et().fromPromise,gt=$u();gt.outputJson=od(il());gt.outputJsonSync=nl();gt.outputJSON=gt.outputJson;gt.outputJSONSync=gt.outputJsonSync;gt.writeJSON=gt.writeJson;gt.writeJSONSync=gt.writeJsonSync;gt.readJSON=gt.readJson;gt.readJSONSync=gt.readJsonSync;sl.exports=gt});var hl=F((b1,cl)=>{"use strict";S();var ud=dt(),Nn=Le("path"),ld=ha().copy,fl=ki().remove,fd=Mt().mkdirp,cd=dr().pathExists,ul=Pr();function hd(e,t,i,r){typeof i=="function"&&(r=i,i={}),i=i||{};let a=i.overwrite||i.clobber||!1;ul.checkPaths(e,t,"move",i,(n,s)=>{if(n)return r(n);let{srcStat:o,isChangingCase:u=!1}=s;ul.checkParentPaths(e,o,t,"move",l=>{if(l)return r(l);if(pd(t))return ll(e,t,a,u,r);fd(Nn.dirname(t),f=>f?r(f):ll(e,t,a,u,r))})})}function pd(e){let t=Nn.dirname(e);return Nn.parse(t).root===t}function ll(e,t,i,r,a){if(r)return _n(e,t,i,a);if(i)return fl(t,n=>n?a(n):_n(e,t,i,a));cd(t,(n,s)=>n?a(n):s?a(new Error("dest already exists.")):_n(e,t,i,a))}function _n(e,t,i,r){ud.rename(e,t,a=>a?a.code!=="EXDEV"?r(a):dd(e,t,i,r):r())}function dd(e,t,i,r){ld(e,t,{overwrite:i,errorOnExist:!0},n=>n?r(n):fl(e,r))}cl.exports=hd});var yl=F((w1,vl)=>{"use strict";S();var dl=dt(),Ln=Le("path"),gd=ha().copySync,gl=ki().removeSync,vd=Mt().mkdirpSync,pl=Pr();function yd(e,t,i){i=i||{};let r=i.overwrite||i.clobber||!1,{srcStat:a,isChangingCase:n=!1}=pl.checkPathsSync(e,t,"move",i);return pl.checkParentPathsSync(e,a,t,"move"),md(t)||vd(Ln.dirname(t)),Ad(e,t,r,n)}function md(e){let t=Ln.dirname(e);return Ln.parse(t).root===t}function Ad(e,t,i,r){if(r)return kn(e,t,i);if(i)return gl(t),kn(e,t,i);if(dl.existsSync(t))throw new Error("dest already exists.");return kn(e,t,i)}function kn(e,t,i){try{dl.renameSync(e,t)}catch(r){if(r.code!=="EXDEV")throw r;return Cd(e,t,i)}}function Cd(e,t,i){return gd(e,t,{overwrite:i,errorOnExist:!0}),gl(e)}vl.exports=yd});var Al=F((N1,ml)=>{"use strict";S();var Ed=Et().fromCallback;ml.exports={move:Ed(hl()),moveSync:yl()}});var El=F((L1,Cl)=>{"use strict";S();Cl.exports={...Dr(),...ha(),...gu(),...Gu(),...ol(),...Mt(),...Al(),...Aa(),...dr(),...ki()}});var oe=F((AC,Lf)=>{"use strict";S();Lf.exports={options:{usePureJavaScript:!1}}});var Pf=F((EC,Df)=>{"use strict";S();var Yn={};Df.exports=Yn;var Rf={};Yn.encode=function(e,t,i){if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(i!==void 0&&typeof i!="number")throw new TypeError('"maxline" must be a number.');var r="";if(!(e instanceof Uint8Array))r=fg(e,t);else{var a=0,n=t.length,s=t.charAt(0),o=[0];for(a=0;a<e.length;++a){for(var u=0,l=e[a];u<o.length;++u)l+=o[u]<<8,o[u]=l%n,l=l/n|0;for(;l>0;)o.push(l%n),l=l/n|0}for(a=0;e[a]===0&&a<e.length-1;++a)r+=s;for(a=o.length-1;a>=0;--a)r+=t[o[a]]}if(i){var f=new RegExp(".{1,"+i+"}","g");r=r.match(f).join(`\r
10
+ `)}return r};Yn.decode=function(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');var i=Rf[t];if(!i){i=Rf[t]=[];for(var r=0;r<t.length;++r)i[t.charCodeAt(r)]=r}e=e.replace(/\s/g,"");for(var a=t.length,n=t.charAt(0),s=[0],r=0;r<e.length;r++){var o=i[e.charCodeAt(r)];if(o===void 0)return;for(var u=0,l=o;u<s.length;++u)l+=s[u]*a,s[u]=l&255,l>>=8;for(;l>0;)s.push(l&255),l>>=8}for(var f=0;e[f]===n&&f<e.length-1;++f)s.push(0);return typeof Buffer<"u"?Buffer.from(s.reverse()):new Uint8Array(s.reverse())};function fg(e,t){var i=0,r=t.length,a=t.charAt(0),n=[0];for(i=0;i<e.length();++i){for(var s=0,o=e.at(i);s<n.length;++s)o+=n[s]<<8,n[s]=o%r,o=o/r|0;for(;o>0;)n.push(o%r),o=o/r|0}var u="";for(i=0;e.at(i)===0&&i<e.length()-1;++i)u+=a;for(i=n.length-1;i>=0;--i)u+=t[n[i]];return u}});var Ae=F((SC,Vf)=>{"use strict";S();var Qf=oe(),Uf=Pf(),I=Vf.exports=Qf.util=Qf.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){I.nextTick=process.nextTick,typeof setImmediate=="function"?I.setImmediate=setImmediate:I.setImmediate=I.nextTick;return}if(typeof setImmediate=="function"){I.setImmediate=function(){return setImmediate.apply(void 0,arguments)},I.nextTick=function(o){return setImmediate(o)};return}if(I.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(u){if(u.source===window&&u.data===e){u.stopPropagation();var l=t.slice();t.length=0,l.forEach(function(f){f()})}};var s=o,e="forge.setImmediate",t=[];I.setImmediate=function(u){t.push(u),t.length===1&&window.postMessage(e,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var i=Date.now(),r=!0,a=document.createElement("div"),t=[];new MutationObserver(function(){var u=t.slice();t.length=0,u.forEach(function(l){l()})}).observe(a,{attributes:!0});var n=I.setImmediate;I.setImmediate=function(u){Date.now()-i>15?(i=Date.now(),n(u)):(t.push(u),t.length===1&&a.setAttribute("a",r=!r))}}I.nextTick=I.setImmediate})();I.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;I.globalScope=function(){return I.isNodejs?global:typeof self>"u"?window:self}();I.isArray=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};I.isArrayBuffer=function(e){return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer};I.isArrayBufferView=function(e){return e&&I.isArrayBuffer(e.buffer)&&e.byteLength!==void 0};function Mi(e){if(!(e===8||e===16||e===24||e===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}I.ByteBuffer=zn;function zn(e){if(this.data="",this.read=0,typeof e=="string")this.data=e;else if(I.isArrayBuffer(e)||I.isArrayBufferView(e))if(typeof Buffer<"u"&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch{for(var i=0;i<t.length;++i)this.putByte(t[i])}}else(e instanceof zn||typeof e=="object"&&typeof e.data=="string"&&typeof e.read=="number")&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}I.ByteStringBuffer=zn;var cg=4096;I.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>cg&&(this.data.substr(0,1),this._constructedStringLength=0)};I.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};I.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};I.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))};I.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var i=this.data;t>0;)t&1&&(i+=e),t>>>=1,t>0&&(e+=e);return this.data=i,this._optimizeConstructedString(t),this};I.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this};I.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(I.encodeUtf8(e))};I.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255))};I.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255))};I.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))};I.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(e&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))};I.ByteStringBuffer.prototype.putInt=function(e,t){Mi(t);var i="";do t-=8,i+=String.fromCharCode(e>>t&255);while(t>0);return this.putBytes(i)};I.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)};I.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())};I.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};I.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e};I.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e};I.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e};I.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e};I.ByteStringBuffer.prototype.getInt=function(e){Mi(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0);return t};I.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),i=2<<e-2;return t>=i&&(t-=i<<1),t};I.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.ByteStringBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)};I.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this};I.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};I.ByteStringBuffer.prototype.copy=function(){var e=I.createBuffer(this.data);return e.read=this.read,e};I.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};I.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};I.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this};I.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var i=this.data.charCodeAt(t);i<16&&(e+="0"),e+=i.toString(16)}return e};I.ByteStringBuffer.prototype.toString=function(){return I.decodeUtf8(this.bytes())};function hg(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var i=I.isArrayBuffer(e),r=I.isArrayBufferView(e);if(i||r){i?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,e!=null&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)}I.DataBuffer=hg;I.DataBuffer.prototype.length=function(){return this.write-this.read};I.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};I.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var i=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),r=new Uint8Array(this.length()+t);return r.set(i),this.data=new DataView(r.buffer),this};I.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this};I.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var i=0;i<t;++i)this.data.setUint8(e);return this};I.DataBuffer.prototype.putBytes=function(e,t){if(I.isArrayBufferView(e)){var i=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=i.byteLength-i.byteOffset;this.accommodate(r);var a=new Uint8Array(this.data.buffer,this.write);return a.set(i),this.write+=r,this}if(I.isArrayBuffer(e)){var i=new Uint8Array(e);this.accommodate(i.byteLength);var a=new Uint8Array(this.data.buffer);return a.set(i,this.write),this.write+=i.byteLength,this}if(e instanceof I.DataBuffer||typeof e=="object"&&typeof e.read=="number"&&typeof e.write=="number"&&I.isArrayBufferView(e.data)){var i=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(i.byteLength);var a=new Uint8Array(e.data.byteLength,this.write);return a.set(i),this.write+=i.byteLength,this}if(e instanceof I.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary",typeof e=="string"){var n;if(t==="hex")return this.accommodate(Math.ceil(e.length/2)),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.hex.decode(e,n,this.write),this;if(t==="base64")return this.accommodate(Math.ceil(e.length/4)*3),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.base64.decode(e,n,this.write),this;if(t==="utf8"&&(e=I.encodeUtf8(e),t="binary"),t==="binary"||t==="raw")return this.accommodate(e.length),n=new Uint8Array(this.data.buffer,this.write),this.write+=I.binary.raw.decode(n),this;if(t==="utf16")return this.accommodate(e.length*2),n=new Uint16Array(this.data.buffer,this.write),this.write+=I.text.utf16.encode(n),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)};I.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this};I.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")};I.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this};I.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this};I.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this};I.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this};I.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this};I.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this};I.DataBuffer.prototype.putInt=function(e,t){Mi(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0);return this};I.DataBuffer.prototype.putSignedInt=function(e,t){return Mi(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)};I.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};I.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e};I.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e};I.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e};I.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e};I.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e};I.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e};I.DataBuffer.prototype.getInt=function(e){Mi(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0);return t};I.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),i=2<<e-2;return t>=i&&(t-=i<<1),t};I.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):e===0?t="":(t=this.read===0?this.data:this.data.slice(this.read),this.clear()),t};I.DataBuffer.prototype.bytes=function(e){return typeof e>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+e)};I.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)};I.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this};I.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};I.DataBuffer.prototype.copy=function(){return new I.DataBuffer(this)};I.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this};I.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};I.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this};I.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var i=this.data.getUint8(t);i<16&&(e+="0"),e+=i.toString(16)}return e};I.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if(e=e||"utf8",e==="binary"||e==="raw")return I.binary.raw.encode(t);if(e==="hex")return I.binary.hex.encode(t);if(e==="base64")return I.binary.base64.encode(t);if(e==="utf8")return I.text.utf8.decode(t);if(e==="utf16")return I.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)};I.createBuffer=function(e,t){return t=t||"raw",e!==void 0&&t==="utf8"&&(e=I.encodeUtf8(e)),new I.ByteBuffer(e)};I.fillString=function(e,t){for(var i="";t>0;)t&1&&(i+=e),t>>>=1,t>0&&(e+=e);return i};I.xorBytes=function(e,t,i){for(var r="",a="",n="",s=0,o=0;i>0;--i,++s)a=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(r+=n,n="",o=0),n+=String.fromCharCode(a),++o;return r+=n,r};I.hexToBytes=function(e){var t="",i=0;for(e.length&!0&&(i=1,t+=String.fromCharCode(parseInt(e[0],16)));i<e.length;i+=2)t+=String.fromCharCode(parseInt(e.substr(i,2),16));return t};I.bytesToHex=function(e){return I.createBuffer(e).toHex()};I.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(e&255)};var xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Sr=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],Of="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";I.encode64=function(e,t){for(var i="",r="",a,n,s,o=0;o<e.length;)a=e.charCodeAt(o++),n=e.charCodeAt(o++),s=e.charCodeAt(o++),i+=xr.charAt(a>>2),i+=xr.charAt((a&3)<<4|n>>4),isNaN(n)?i+="==":(i+=xr.charAt((n&15)<<2|s>>6),i+=isNaN(s)?"=":xr.charAt(s&63)),t&&i.length>t&&(r+=i.substr(0,t)+`\r
11
11
  `,i=i.substr(t));return r+=i,r};I.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t="",i,r,a,n,s=0;s<e.length;)i=Sr[e.charCodeAt(s++)-43],r=Sr[e.charCodeAt(s++)-43],a=Sr[e.charCodeAt(s++)-43],n=Sr[e.charCodeAt(s++)-43],t+=String.fromCharCode(i<<2|r>>4),a!==64&&(t+=String.fromCharCode((r&15)<<4|a>>2),n!==64&&(t+=String.fromCharCode((a&3)<<6|n)));return t};I.encodeUtf8=function(e){return unescape(encodeURIComponent(e))};I.decodeUtf8=function(e){return decodeURIComponent(escape(e))};I.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:Uf.encode,decode:Uf.decode}};I.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)};I.binary.raw.decode=function(e,t,i){var r=t;r||(r=new Uint8Array(e.length)),i=i||0;for(var a=i,n=0;n<e.length;++n)r[a++]=e.charCodeAt(n);return t?a-i:r};I.binary.hex.encode=I.bytesToHex;I.binary.hex.decode=function(e,t,i){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/2))),i=i||0;var a=0,n=i;for(e.length&1&&(a=1,r[n++]=parseInt(e[0],16));a<e.length;a+=2)r[n++]=parseInt(e.substr(a,2),16);return t?n-i:r};I.binary.base64.encode=function(e,t){for(var i="",r="",a,n,s,o=0;o<e.byteLength;)a=e[o++],n=e[o++],s=e[o++],i+=xr.charAt(a>>2),i+=xr.charAt((a&3)<<4|n>>4),isNaN(n)?i+="==":(i+=xr.charAt((n&15)<<2|s>>6),i+=isNaN(s)?"=":xr.charAt(s&63)),t&&i.length>t&&(r+=i.substr(0,t)+`\r
12
- `,i=i.substr(t));return r+=i,r};I.binary.base64.decode=function(e,t,i){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),i=i||0;for(var a,n,s,o,u=0,l=i;u<e.length;)a=Sr[e.charCodeAt(u++)-43],n=Sr[e.charCodeAt(u++)-43],s=Sr[e.charCodeAt(u++)-43],o=Sr[e.charCodeAt(u++)-43],r[l++]=a<<2|n>>4,s!==64&&(r[l++]=(n&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return t?l-i:r.subarray(0,l)};I.binary.base58.encode=function(e,t){return I.binary.baseN.encode(e,Of,t)};I.binary.base58.decode=function(e,t){return I.binary.baseN.decode(e,Of,t)};I.text={utf8:{},utf16:{}};I.text.utf8.encode=function(e,t,i){e=I.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),i=i||0;for(var a=i,n=0;n<e.length;++n)r[a++]=e.charCodeAt(n);return t?a-i:r};I.text.utf8.decode=function(e){return I.decodeUtf8(String.fromCharCode.apply(null,e))};I.text.utf16.encode=function(e,t,i){var r=t;r||(r=new Uint8Array(e.length*2));var a=new Uint16Array(r.buffer);i=i||0;for(var n=i,s=i,o=0;o<e.length;++o)a[s++]=e.charCodeAt(o),n+=2;return t?n-i:r};I.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};I.deflate=function(e,t,i){if(t=I.decode64(e.deflate(I.encode64(t)).rval),i){var r=2,a=t.charCodeAt(1);a&32&&(r=6),t=t.substring(r,t.length-4)}return t};I.inflate=function(e,t,i){var r=e.inflate(I.encode64(t)).rval;return r===null?null:I.decode64(r)};var Jn=function(e,t,i){if(!e)throw new Error("WebStorage not available.");var r;if(i===null?r=e.removeItem(t):(i=I.encode64(JSON.stringify(i)),r=e.setItem(t,i)),typeof r<"u"&&r.rval!==!0){var a=new Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}},Wn=function(e,t){if(!e)throw new Error("WebStorage not available.");var i=e.getItem(t);if(e.init)if(i.rval===null){if(i.error){var r=new Error(i.error.message);throw r.id=i.error.id,r.name=i.error.name,r}i=null}else i=i.rval;return i!==null&&(i=JSON.parse(I.decode64(i))),i},pg=function(e,t,i,r){var a=Wn(e,t);a===null&&(a={}),a[i]=r,Jn(e,t,a)},dg=function(e,t,i){var r=Wn(e,t);return r!==null&&(r=i in r?r[i]:null),r},gg=function(e,t,i){var r=Wn(e,t);if(r!==null&&i in r){delete r[i];var a=!0;for(var n in r){a=!1;break}a&&(r=null),Jn(e,t,r)}},vg=function(e,t){Jn(e,t,null)},_a=function(e,t,i){var r=null;typeof i>"u"&&(i=["web","flash"]);var a,n=!1,s=null;for(var o in i){a=i[o];try{if(a==="flash"||a==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),n=a==="flash"}(a==="web"||a==="both")&&(t[0]=localStorage,r=e.apply(this,t),n=!0)}catch(u){s=u}if(n)break}if(!n)throw s;return r};I.setItem=function(e,t,i,r,a){_a(pg,arguments,a)};I.getItem=function(e,t,i,r){return _a(dg,arguments,r)};I.removeItem=function(e,t,i,r){_a(gg,arguments,r)};I.clearItems=function(e,t,i){_a(vg,arguments,i)};I.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};I.format=function(e){for(var t=/%./g,i,r,a=0,n=[],s=0;i=t.exec(e);){r=e.substring(s,t.lastIndex-2),r.length>0&&n.push(r),s=t.lastIndex;var o=i[0][1];switch(o){case"s":case"o":a<arguments.length?n.push(arguments[a+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+o+"?>")}}return n.push(e.substring(s)),n.join("")};I.formatNumber=function(e,t,i,r){var a=e,n=isNaN(t=Math.abs(t))?2:t,s=i===void 0?",":i,o=r===void 0?".":r,u=a<0?"-":"",l=parseInt(a=Math.abs(+a||0).toFixed(n),10)+"",f=l.length>3?l.length%3:0;return u+(f?l.substr(0,f)+o:"")+l.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+o)+(n?s+Math.abs(a-l).toFixed(n).slice(2):"")};I.formatSize=function(e){return e>=1073741824?e=I.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=I.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=I.formatNumber(e/1024,0)+" KiB":e=I.formatNumber(e,0)+" bytes",e};I.bytesFromIP=function(e){return e.indexOf(".")!==-1?I.bytesFromIPv4(e):e.indexOf(":")!==-1?I.bytesFromIPv6(e):null};I.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=I.createBuffer(),i=0;i<e.length;++i){var r=parseInt(e[i],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()};I.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var i=(8-e.length+t)*2,r=I.createBuffer(),a=0;a<8;++a){if(!e[a]||e[a].length===0){r.fillWithByte(0,i),i=0;continue}var n=I.hexToBytes(e[a]);n.length<2&&r.putByte(0),r.putBytes(n)}return r.getBytes()};I.bytesToIP=function(e){return e.length===4?I.bytesToIPv4(e):e.length===16?I.bytesToIPv6(e):null};I.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t.join(".")};I.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],i=[],r=0,a=0;a<e.length;a+=2){for(var n=I.bytesToHex(e[a]+e[a+1]);n[0]==="0"&&n!=="0";)n=n.substr(1);if(n==="0"){var s=i[i.length-1],o=t.length;!s||o!==s.end+1?i.push({start:o,end:o}):(s.end=o,s.end-s.start>i[r].end-i[r].start&&(r=i.length-1))}t.push(n)}if(i.length>0){var u=i[r];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),u.start===0&&t.unshift(""),u.end===7&&t.push(""))}return t.join(":")};I.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in I&&!e.update)return t(null,I.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return I.cores=navigator.hardwareConcurrency,t(null,I.cores);if(typeof Worker>"u")return I.cores=1,t(null,I.cores);if(typeof Blob>"u")return I.cores=2,t(null,I.cores);var i=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),u=o+4;Date.now()<u;);self.postMessage({st:o,et:u})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,u){if(o===0){var l=Math.floor(s.reduce(function(f,c){return f+c},0)/s.length);return I.cores=Math.max(1,l),URL.revokeObjectURL(i),t(null,I.cores)}a(u,function(f,c){s.push(n(u,c)),r(s,o-1,u)})}function a(s,o){for(var u=[],l=[],f=0;f<s;++f){var c=new Worker(i);c.addEventListener("message",function(p){if(l.push(p.data),l.length===s){for(var m=0;m<s;++m)u[m].terminate();o(null,l)}}),u.push(c)}for(var f=0;f<s;++f)u[f].postMessage(f)}function n(s,o){for(var u=[],l=0;l<s;++l)for(var f=o[l],c=u[l]=[],p=0;p<s;++p)if(l!==p){var m=o[p];(f.st>m.st&&f.st<m.et||m.st>f.st&&m.st<f.et)&&c.push(p)}return u.reduce(function(v,C){return Math.max(v,C.length)},0)}}});var Na=F((IC,Ff)=>{"use strict";S();var He=oe();Ae();Ff.exports=He.cipher=He.cipher||{};He.cipher.algorithms=He.cipher.algorithms||{};He.cipher.createCipher=function(e,t){var i=e;if(typeof i=="string"&&(i=He.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:i,key:t,decrypt:!1})};He.cipher.createDecipher=function(e,t){var i=e;if(typeof i=="string"&&(i=He.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:i,key:t,decrypt:!0})};He.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),He.cipher.algorithms[e]=t};He.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in He.cipher.algorithms?He.cipher.algorithms[e]:null};var Xn=He.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Xn.prototype.start=function(e){e=e||{};var t={};for(var i in e)t[i]=e[i];t.decrypt=this._decrypt,this._finish=!1,this._input=He.util.createBuffer(),this.output=e.output||He.util.createBuffer(),this.mode.start(t)};Xn.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Xn.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return e(this.blockSize,i,!1)},this.mode.unpad=function(i){return e(this.blockSize,i,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}});var Zn=F((bC,Mf)=>{"use strict";S();var Ge=oe();Ae();Ge.cipher=Ge.cipher||{};var le=Mf.exports=Ge.cipher.modes=Ge.cipher.modes||{};le.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};le.ecb.prototype.start=function(e){};le.ecb.prototype.encrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};le.ecb.prototype.decrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};le.ecb.prototype.pad=function(e,t){var i=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(i,i),!0};le.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var i=e.length(),r=e.at(i-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};le.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};le.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=ka(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};le.cbc.prototype.encrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock};le.cbc.prototype.decrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};le.cbc.prototype.pad=function(e,t){var i=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(i,i),!0};le.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var i=e.length(),r=e.at(i-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};le.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.cfb.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32()^this._outBlock[a],t.putInt32(this._inBlock[a]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialBlock[a]=e.getInt32()^this._outBlock[a],this._partialOutput.putInt32(this._partialBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._partialBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.cfb.prototype.decrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32(),t.putInt32(this._inBlock[a]^this._outBlock[a]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialBlock[a]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[a]^this._outBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._partialBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.ofb.prototype.encrypt=function(e,t,i){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]),this._inBlock[a]=this._outBlock[a];return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._outBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.ofb.prototype.decrypt=le.ofb.prototype.encrypt;le.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.ctr.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}La(this._inBlock)};le.ctr.prototype.decrypt=le.ctr.prototype.encrypt;le.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0,this._R=3774873600};le.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=Ge.util.createBuffer(e.iv);this._cipherLength=0;var i;if("additionalData"in e?i=Ge.util.createBuffer(e.additionalData):i=Ge.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=Ge.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat($n(r*8)))}this._inBlock=this._j0.slice(0),La(this._inBlock),this._partialBytes=0,i=Ge.util.createBuffer(i),this._aDataLength=$n(i.length()*8);var a=i.length()%this.blockSize;for(a&&i.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];i.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[i.getInt32(),i.getInt32(),i.getInt32(),i.getInt32()])};le.gcm.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n<=0||i){if(i){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),La(this._inBlock)};le.gcm.prototype.decrypt=function(e,t,i){var r=e.length();if(r<this.blockSize&&!(i&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),La(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};le.gcm.prototype.afterFinish=function(e,t){var i=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=Ge.util.createBuffer();var r=this._aDataLength.concat($n(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var a=[];this.cipher.encrypt(this._j0,a);for(var n=0;n<this._ints;++n)this.tag.putInt32(this._s[n]^a[n]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(i=!1),i};le.gcm.prototype.multiply=function(e,t){for(var i=[0,0,0,0],r=t.slice(0),a=0;a<128;++a){var n=e[a/32|0]&1<<31-a%32;n&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),this.pow(r,r)}return i};le.gcm.prototype.pow=function(e,t){for(var i=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,i&&(t[0]^=this._R)};le.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],i=0;i<32;++i){var r=i/8|0,a=e[r]>>>(7-i%8)*4&15,n=this._m[i][a];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}return t};le.gcm.prototype.ghash=function(e,t,i){return t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3],this.tableMultiply(t)};le.gcm.prototype.generateHashTable=function(e,t){for(var i=8/t,r=4*i,a=16*i,n=new Array(a),s=0;s<a;++s){var o=[0,0,0,0],u=s/r|0,l=(r-1-s%r)*t;o[u]=1<<t-1<<l,n[s]=this.generateSubHashTable(this.multiply(o,e),t)}return n};le.gcm.prototype.generateSubHashTable=function(e,t){var i=1<<t,r=i>>>1,a=new Array(i);a[r]=e.slice(0);for(var n=r>>>1;n>0;)this.pow(a[2*n],a[n]=[]),n>>=1;for(n=2;n<r;){for(var s=1;s<n;++s){var o=a[n],u=a[s];a[n+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}n*=2}for(a[0]=[0,0,0,0],n=r+1;n<i;++n){var l=a[n^r];a[n]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return a};function ka(e,t){if(typeof e=="string"&&(e=Ge.util.createBuffer(e)),Ge.util.isArray(e)&&e.length>4){var i=e;e=Ge.util.createBuffer();for(var r=0;r<i.length;++r)e.putByte(i[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!Ge.util.isArray(e)){for(var a=[],n=t/4,r=0;r<n;++r)a.push(e.getInt32());e=a}return e}function La(e){e[e.length-1]=e[e.length-1]+1&4294967295}function $n(e){return[e/4294967296|0,e&4294967295]}});var Ir=F((wC,Gf)=>{"use strict";S();var Te=oe();Na();Zn();Ae();Gf.exports=Te.aes=Te.aes||{};Te.aes.startEncrypting=function(e,t,i,r){var a=Ra({key:e,output:i,decrypt:!1,mode:r});return a.start(t),a};Te.aes.createEncryptionCipher=function(e,t){return Ra({key:e,output:null,decrypt:!1,mode:t})};Te.aes.startDecrypting=function(e,t,i,r){var a=Ra({key:e,output:i,decrypt:!0,mode:r});return a.start(t),a};Te.aes.createDecryptionCipher=function(e,t){return Ra({key:e,output:null,decrypt:!0,mode:t})};Te.aes.Algorithm=function(e,t){rs||Kf();var i=this;i.name=e,i.mode=new t({blockSize:16,cipher:{encrypt:function(r,a){return ts(i._w,r,a,!1)},decrypt:function(r,a){return ts(i._w,r,a,!0)}}}),i._init=!1};Te.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,i;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Te.util.createBuffer(t);else if(Te.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){i=t,t=Te.util.createBuffer();for(var r=0;r<i.length;++r)t.putByte(i[r])}if(!Te.util.isArray(t)){i=t,t=[];var a=i.length();if(a===16||a===24||a===32){a=a>>>2;for(var r=0;r<a;++r)t.push(i.getInt32())}}if(!Te.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var n=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(n)!==-1;this._w=Hf(t,e.decrypt&&!s),this._init=!0}};Te.aes._expandKey=function(e,t){return rs||Kf(),Hf(e,t)};Te.aes._updateBlock=ts;ii("AES-ECB",Te.cipher.modes.ecb);ii("AES-CBC",Te.cipher.modes.cbc);ii("AES-CFB",Te.cipher.modes.cfb);ii("AES-OFB",Te.cipher.modes.ofb);ii("AES-CTR",Te.cipher.modes.ctr);ii("AES-GCM",Te.cipher.modes.gcm);function ii(e,t){var i=function(){return new Te.aes.Algorithm(e,t)};Te.cipher.registerAlgorithm(e,i)}var rs=!1,ri=4,yt,es,qf,Qr,Ht;function Kf(){rs=!0,qf=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;yt=new Array(256),es=new Array(256),Qr=new Array(4),Ht=new Array(4);for(var t=0;t<4;++t)Qr[t]=new Array(256),Ht[t]=new Array(256);for(var i=0,r=0,a,n,s,o,u,l,f,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,yt[i]=o,es[o]=i,u=e[o],a=e[i],n=e[a],s=e[n],l=u<<24^o<<16^o<<8^(o^u),f=(a^n^s)<<24^(i^s)<<16^(i^n^s)<<8^(i^a^s);for(var c=0;c<4;++c)Qr[c][i]=l,Ht[c][o]=f,l=l<<24|l>>>8,f=f<<24|f>>>8;i===0?i=r=1:(i=a^e[e[e[a^s]]],r^=e[e[r]])}}function Hf(e,t){for(var i=e.slice(0),r,a=1,n=i.length,s=n+6+1,o=ri*s,u=n;u<o;++u)r=i[u-1],u%n===0?(r=yt[r>>>16&255]<<24^yt[r>>>8&255]<<16^yt[r&255]<<8^yt[r>>>24]^qf[a]<<24,a++):n>6&&u%n===4&&(r=yt[r>>>24]<<24^yt[r>>>16&255]<<16^yt[r>>>8&255]<<8^yt[r&255]),i[u]=i[u-n]^r;if(t){var l,f=Ht[0],c=Ht[1],p=Ht[2],m=Ht[3],v=i.slice(0);o=i.length;for(var u=0,C=o-ri;u<o;u+=ri,C-=ri)if(u===0||u===o-ri)v[u]=i[C],v[u+1]=i[C+3],v[u+2]=i[C+2],v[u+3]=i[C+1];else for(var E=0;E<ri;++E)l=i[C+E],v[u+(3&-E)]=f[yt[l>>>24]]^c[yt[l>>>16&255]]^p[yt[l>>>8&255]]^m[yt[l&255]];i=v}return i}function ts(e,t,i,r){var a=e.length/4-1,n,s,o,u,l;r?(n=Ht[0],s=Ht[1],o=Ht[2],u=Ht[3],l=es):(n=Qr[0],s=Qr[1],o=Qr[2],u=Qr[3],l=yt);var f,c,p,m,v,C,E;f=t[0]^e[0],c=t[r?3:1]^e[1],p=t[2]^e[2],m=t[r?1:3]^e[3];for(var B=3,w=1;w<a;++w)v=n[f>>>24]^s[c>>>16&255]^o[p>>>8&255]^u[m&255]^e[++B],C=n[c>>>24]^s[p>>>16&255]^o[m>>>8&255]^u[f&255]^e[++B],E=n[p>>>24]^s[m>>>16&255]^o[f>>>8&255]^u[c&255]^e[++B],m=n[m>>>24]^s[f>>>16&255]^o[c>>>8&255]^u[p&255]^e[++B],f=v,c=C,p=E;i[0]=l[f>>>24]<<24^l[c>>>16&255]<<16^l[p>>>8&255]<<8^l[m&255]^e[++B],i[r?3:1]=l[c>>>24]<<24^l[p>>>16&255]<<16^l[m>>>8&255]<<8^l[f&255]^e[++B],i[2]=l[p>>>24]<<24^l[m>>>16&255]<<16^l[f>>>8&255]<<8^l[c&255]^e[++B],i[r?1:3]=l[m>>>24]<<24^l[f>>>16&255]<<16^l[c>>>8&255]<<8^l[p&255]^e[++B]}function Ra(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),i="AES-"+t,r;e.decrypt?r=Te.cipher.createDecipher(i,e.key):r=Te.cipher.createCipher(i,e.key);var a=r.start;return r.start=function(n,s){var o=null;s instanceof Te.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,a.call(r,s)},r}});var Br=F((NC,jf)=>{"use strict";S();var qi=oe();qi.pki=qi.pki||{};var is=jf.exports=qi.pki.oids=qi.oids=qi.oids||{};function L(e,t){is[e]=t,is[t]=e}function Se(e,t){is[e]=t}L("1.2.840.113549.1.1.1","rsaEncryption");L("1.2.840.113549.1.1.4","md5WithRSAEncryption");L("1.2.840.113549.1.1.5","sha1WithRSAEncryption");L("1.2.840.113549.1.1.7","RSAES-OAEP");L("1.2.840.113549.1.1.8","mgf1");L("1.2.840.113549.1.1.9","pSpecified");L("1.2.840.113549.1.1.10","RSASSA-PSS");L("1.2.840.113549.1.1.11","sha256WithRSAEncryption");L("1.2.840.113549.1.1.12","sha384WithRSAEncryption");L("1.2.840.113549.1.1.13","sha512WithRSAEncryption");L("1.3.101.112","EdDSA25519");L("1.2.840.10040.4.3","dsa-with-sha1");L("1.3.14.3.2.7","desCBC");L("1.3.14.3.2.26","sha1");L("1.3.14.3.2.29","sha1WithRSASignature");L("2.16.840.1.101.3.4.2.1","sha256");L("2.16.840.1.101.3.4.2.2","sha384");L("2.16.840.1.101.3.4.2.3","sha512");L("2.16.840.1.101.3.4.2.4","sha224");L("2.16.840.1.101.3.4.2.5","sha512-224");L("2.16.840.1.101.3.4.2.6","sha512-256");L("1.2.840.113549.2.2","md2");L("1.2.840.113549.2.5","md5");L("1.2.840.113549.1.7.1","data");L("1.2.840.113549.1.7.2","signedData");L("1.2.840.113549.1.7.3","envelopedData");L("1.2.840.113549.1.7.4","signedAndEnvelopedData");L("1.2.840.113549.1.7.5","digestedData");L("1.2.840.113549.1.7.6","encryptedData");L("1.2.840.113549.1.9.1","emailAddress");L("1.2.840.113549.1.9.2","unstructuredName");L("1.2.840.113549.1.9.3","contentType");L("1.2.840.113549.1.9.4","messageDigest");L("1.2.840.113549.1.9.5","signingTime");L("1.2.840.113549.1.9.6","counterSignature");L("1.2.840.113549.1.9.7","challengePassword");L("1.2.840.113549.1.9.8","unstructuredAddress");L("1.2.840.113549.1.9.14","extensionRequest");L("1.2.840.113549.1.9.20","friendlyName");L("1.2.840.113549.1.9.21","localKeyId");L("1.2.840.113549.1.9.22.1","x509Certificate");L("1.2.840.113549.1.12.10.1.1","keyBag");L("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");L("1.2.840.113549.1.12.10.1.3","certBag");L("1.2.840.113549.1.12.10.1.4","crlBag");L("1.2.840.113549.1.12.10.1.5","secretBag");L("1.2.840.113549.1.12.10.1.6","safeContentsBag");L("1.2.840.113549.1.5.13","pkcs5PBES2");L("1.2.840.113549.1.5.12","pkcs5PBKDF2");L("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");L("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");L("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");L("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");L("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");L("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");L("1.2.840.113549.2.7","hmacWithSHA1");L("1.2.840.113549.2.8","hmacWithSHA224");L("1.2.840.113549.2.9","hmacWithSHA256");L("1.2.840.113549.2.10","hmacWithSHA384");L("1.2.840.113549.2.11","hmacWithSHA512");L("1.2.840.113549.3.7","des-EDE3-CBC");L("2.16.840.1.101.3.4.1.2","aes128-CBC");L("2.16.840.1.101.3.4.1.22","aes192-CBC");L("2.16.840.1.101.3.4.1.42","aes256-CBC");L("2.5.4.3","commonName");L("2.5.4.4","surname");L("2.5.4.5","serialNumber");L("2.5.4.6","countryName");L("2.5.4.7","localityName");L("2.5.4.8","stateOrProvinceName");L("2.5.4.9","streetAddress");L("2.5.4.10","organizationName");L("2.5.4.11","organizationalUnitName");L("2.5.4.12","title");L("2.5.4.13","description");L("2.5.4.15","businessCategory");L("2.5.4.17","postalCode");L("2.5.4.42","givenName");L("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");L("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");L("2.16.840.1.113730.1.1","nsCertType");L("2.16.840.1.113730.1.13","nsComment");Se("2.5.29.1","authorityKeyIdentifier");Se("2.5.29.2","keyAttributes");Se("2.5.29.3","certificatePolicies");Se("2.5.29.4","keyUsageRestriction");Se("2.5.29.5","policyMapping");Se("2.5.29.6","subtreesConstraint");Se("2.5.29.7","subjectAltName");Se("2.5.29.8","issuerAltName");Se("2.5.29.9","subjectDirectoryAttributes");Se("2.5.29.10","basicConstraints");Se("2.5.29.11","nameConstraints");Se("2.5.29.12","policyConstraints");Se("2.5.29.13","basicConstraints");L("2.5.29.14","subjectKeyIdentifier");L("2.5.29.15","keyUsage");Se("2.5.29.16","privateKeyUsagePeriod");L("2.5.29.17","subjectAltName");L("2.5.29.18","issuerAltName");L("2.5.29.19","basicConstraints");Se("2.5.29.20","cRLNumber");Se("2.5.29.21","cRLReason");Se("2.5.29.22","expirationDate");Se("2.5.29.23","instructionCode");Se("2.5.29.24","invalidityDate");Se("2.5.29.25","cRLDistributionPoints");Se("2.5.29.26","issuingDistributionPoint");Se("2.5.29.27","deltaCRLIndicator");Se("2.5.29.28","issuingDistributionPoint");Se("2.5.29.29","certificateIssuer");Se("2.5.29.30","nameConstraints");L("2.5.29.31","cRLDistributionPoints");L("2.5.29.32","certificatePolicies");Se("2.5.29.33","policyMappings");Se("2.5.29.34","policyConstraints");L("2.5.29.35","authorityKeyIdentifier");Se("2.5.29.36","policyConstraints");L("2.5.29.37","extKeyUsage");Se("2.5.29.46","freshestCRL");Se("2.5.29.54","inhibitAnyPolicy");L("1.3.6.1.4.1.11129.2.4.2","timestampList");L("1.3.6.1.5.5.7.1.1","authorityInfoAccess");L("1.3.6.1.5.5.7.3.1","serverAuth");L("1.3.6.1.5.5.7.3.2","clientAuth");L("1.3.6.1.5.5.7.3.3","codeSigning");L("1.3.6.1.5.5.7.3.4","emailProtection");L("1.3.6.1.5.5.7.3.8","timeStamping")});var Gt=F((LC,zf)=>{"use strict";S();var Ne=oe();Ae();Br();var q=zf.exports=Ne.asn1=Ne.asn1||{};q.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};q.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};q.create=function(e,t,i,r,a){if(Ne.util.isArray(r)){for(var n=[],s=0;s<r.length;++s)r[s]!==void 0&&n.push(r[s]);r=n}var o={tagClass:e,type:t,constructed:i,composed:i||Ne.util.isArray(r),value:r};return a&&"bitStringContents"in a&&(o.bitStringContents=a.bitStringContents,o.original=q.copy(o)),o};q.copy=function(e,t){var i;if(Ne.util.isArray(e)){i=[];for(var r=0;r<e.length;++r)i.push(q.copy(e[r],t));return i}return typeof e=="string"?e:(i={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:q.copy(e.value,t)},t&&!t.excludeBitStringContents&&(i.bitStringContents=e.bitStringContents),i)};q.equals=function(e,t,i){if(Ne.util.isArray(e)){if(!Ne.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!q.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&q.equals(e.value,t.value);return i&&i.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a};q.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var i,r=t&128;return r?i=e.getInt((t&127)<<3):i=t,i}};function Ki(e,t,i){if(i>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=i,r}}var yg=function(e,t){var i=e.getByte();if(t--,i!==128){var r,a=i&128;if(!a)r=i;else{var n=i&127;Ki(e,t,n),r=e.getInt(n<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};q.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=Ne.util.createBuffer(e));var i=e.length(),r=Da(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var a=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw a.byteCount=i,a.remaining=e.length(),a}return r};function Da(e,t,i,r){var a;Ki(e,t,2);var n=e.getByte();t--;var s=n&192,o=n&31;a=e.length();var u=yg(e,t);if(t-=a-e.length(),u!==void 0&&u>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=u,l}u=t}var f,c,p=(n&32)===32;if(p)if(f=[],u===void 0)for(;;){if(Ki(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}a=e.length(),f.push(Da(e,t,i+1,r)),t-=a-e.length()}else for(;u>0;)a=e.length(),f.push(Da(e,u,i+1,r)),t-=a-e.length(),u-=a-e.length();if(f===void 0&&s===q.Class.UNIVERSAL&&o===q.Type.BITSTRING&&(c=e.bytes(u)),f===void 0&&r.decodeBitStrings&&s===q.Class.UNIVERSAL&&o===q.Type.BITSTRING&&u>1){var m=e.read,v=t,C=0;if(o===q.Type.BITSTRING&&(Ki(e,t,1),C=e.getByte(),t--),C===0)try{a=e.length();var E={strict:!0,decodeBitStrings:!0},B=Da(e,t,i+1,E),w=a-e.length();t-=w,o==q.Type.BITSTRING&&w++;var T=B.tagClass;w===u&&(T===q.Class.UNIVERSAL||T===q.Class.CONTEXT_SPECIFIC)&&(f=[B])}catch{}f===void 0&&(e.read=m,t=v)}if(f===void 0){if(u===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=t}if(o===q.Type.BMPSTRING)for(f="";u>0;u-=2)Ki(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(u),t-=u}var U=c===void 0?null:{bitStringContents:c};return q.create(s,o,p,f,U)}q.toDer=function(e){var t=Ne.util.createBuffer(),i=e.tagClass|e.type,r=Ne.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=q.equals(e,e.original))),a)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?i|=32:r.putByte(0);for(var n=0;n<e.value.length;++n)e.value[n]!==void 0&&r.putBuffer(q.toDer(e.value[n]))}else if(e.type===q.Type.BMPSTRING)for(var n=0;n<e.value.length;++n)r.putInt16(e.value.charCodeAt(n));else e.type===q.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(i),r.length()<=127)t.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);t.putByte(o.length|128);for(var n=o.length-1;n>=0;--n)t.putByte(o.charCodeAt(n))}return t.putBuffer(r),t};q.oidToDer=function(e){var t=e.split("."),i=Ne.util.createBuffer();i.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,a,n,s,o=2;o<t.length;++o){r=!0,a=[],n=parseInt(t[o],10);do s=n&127,n=n>>>7,r||(s|=128),a.push(s),r=!1;while(n>0);for(var u=a.length-1;u>=0;--u)i.putByte(a[u])}return i};q.derToOid=function(e){var t;typeof e=="string"&&(e=Ne.util.createBuffer(e));var i=e.getByte();t=Math.floor(i/40)+"."+i%40;for(var r=0;e.length()>0;)i=e.getByte(),r=r<<7,i&128?r+=i&127:(t+="."+(r+i),r=0);return t};q.utcTimeToDate=function(e){var t=new Date,i=parseInt(e.substr(0,2),10);i=i>=50?1900+i:2e3+i;var r=parseInt(e.substr(2,2),10)-1,a=parseInt(e.substr(4,2),10),n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var u=e.charAt(10),l=10;u!=="+"&&u!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(i,r,a),t.setUTCHours(n,s,o,0),l&&(u=e.charAt(l),u==="+"||u==="-")){var f=parseInt(e.substr(l+1,2),10),c=parseInt(e.substr(l+4,2),10),p=f*60+c;p*=6e4,u==="+"?t.setTime(+t-p):t.setTime(+t+p)}return t};q.generalizedTimeToDate=function(e){var t=new Date,i=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,a=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),u=0,l=0,f=!1;e.charAt(e.length-1)==="Z"&&(f=!0);var c=e.length-5,p=e.charAt(c);if(p==="+"||p==="-"){var m=parseInt(e.substr(c+1,2),10),v=parseInt(e.substr(c+4,2),10);l=m*60+v,l*=6e4,p==="+"&&(l*=-1),f=!0}return e.charAt(14)==="."&&(u=parseFloat(e.substr(14),10)*1e3),f?(t.setUTCFullYear(i,r,a),t.setUTCHours(n,s,o,u),t.setTime(+t+l)):(t.setFullYear(i,r,a),t.setHours(n,s,o,u)),t};q.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",i=[];i.push((""+e.getUTCFullYear()).substr(2)),i.push(""+(e.getUTCMonth()+1)),i.push(""+e.getUTCDate()),i.push(""+e.getUTCHours()),i.push(""+e.getUTCMinutes()),i.push(""+e.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(t+="0"),t+=i[r];return t+="Z",t};q.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",i=[];i.push(""+e.getUTCFullYear()),i.push(""+(e.getUTCMonth()+1)),i.push(""+e.getUTCDate()),i.push(""+e.getUTCHours()),i.push(""+e.getUTCMinutes()),i.push(""+e.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(t+="0"),t+=i[r];return t+="Z",t};q.integerToDer=function(e){var t=Ne.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var i=new Error("Integer too large; max is 32-bits.");throw i.integer=e,i};q.derToInteger=function(e){typeof e=="string"&&(e=Ne.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};q.validate=function(e,t,i,r){var a=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(a=!0,t.value&&Ne.util.isArray(t.value))for(var n=0,s=0;a&&s<t.value.length;++s)a=t.value[s].optional||!1,e.value[n]&&(a=q.validate(e.value[n],t.value[s],i,r),a?++n:t.value[s].optional&&(a=!0)),!a&&r&&r.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(a&&i&&(t.capture&&(i[t.capture]=e.value),t.captureAsn1&&(i[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(i[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){var o;if(e.bitStringContents.length<2)i[t.captureBitStringValue]="";else{var u=e.bitStringContents.charCodeAt(0);if(u!==0)throw new Error("captureBitStringValue only supported for zero unused bits");i[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return a};var Yf=/[^\\u0000-\\u00ff]/;q.prettyPrint=function(e,t,i){var r="";t=t||0,i=i||2,t>0&&(r+=`
12
+ `,i=i.substr(t));return r+=i,r};I.binary.base64.decode=function(e,t,i){var r=t;r||(r=new Uint8Array(Math.ceil(e.length/4)*3)),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),i=i||0;for(var a,n,s,o,u=0,l=i;u<e.length;)a=Sr[e.charCodeAt(u++)-43],n=Sr[e.charCodeAt(u++)-43],s=Sr[e.charCodeAt(u++)-43],o=Sr[e.charCodeAt(u++)-43],r[l++]=a<<2|n>>4,s!==64&&(r[l++]=(n&15)<<4|s>>2,o!==64&&(r[l++]=(s&3)<<6|o));return t?l-i:r.subarray(0,l)};I.binary.base58.encode=function(e,t){return I.binary.baseN.encode(e,Of,t)};I.binary.base58.decode=function(e,t){return I.binary.baseN.decode(e,Of,t)};I.text={utf8:{},utf16:{}};I.text.utf8.encode=function(e,t,i){e=I.encodeUtf8(e);var r=t;r||(r=new Uint8Array(e.length)),i=i||0;for(var a=i,n=0;n<e.length;++n)r[a++]=e.charCodeAt(n);return t?a-i:r};I.text.utf8.decode=function(e){return I.decodeUtf8(String.fromCharCode.apply(null,e))};I.text.utf16.encode=function(e,t,i){var r=t;r||(r=new Uint8Array(e.length*2));var a=new Uint16Array(r.buffer);i=i||0;for(var n=i,s=i,o=0;o<e.length;++o)a[s++]=e.charCodeAt(o),n+=2;return t?n-i:r};I.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};I.deflate=function(e,t,i){if(t=I.decode64(e.deflate(I.encode64(t)).rval),i){var r=2,a=t.charCodeAt(1);a&32&&(r=6),t=t.substring(r,t.length-4)}return t};I.inflate=function(e,t,i){var r=e.inflate(I.encode64(t)).rval;return r===null?null:I.decode64(r)};var Jn=function(e,t,i){if(!e)throw new Error("WebStorage not available.");var r;if(i===null?r=e.removeItem(t):(i=I.encode64(JSON.stringify(i)),r=e.setItem(t,i)),typeof r<"u"&&r.rval!==!0){var a=new Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}},Wn=function(e,t){if(!e)throw new Error("WebStorage not available.");var i=e.getItem(t);if(e.init)if(i.rval===null){if(i.error){var r=new Error(i.error.message);throw r.id=i.error.id,r.name=i.error.name,r}i=null}else i=i.rval;return i!==null&&(i=JSON.parse(I.decode64(i))),i},pg=function(e,t,i,r){var a=Wn(e,t);a===null&&(a={}),a[i]=r,Jn(e,t,a)},dg=function(e,t,i){var r=Wn(e,t);return r!==null&&(r=i in r?r[i]:null),r},gg=function(e,t,i){var r=Wn(e,t);if(r!==null&&i in r){delete r[i];var a=!0;for(var n in r){a=!1;break}a&&(r=null),Jn(e,t,r)}},vg=function(e,t){Jn(e,t,null)},_a=function(e,t,i){var r=null;typeof i>"u"&&(i=["web","flash"]);var a,n=!1,s=null;for(var o in i){a=i[o];try{if(a==="flash"||a==="both"){if(t[0]===null)throw new Error("Flash local storage not available.");r=e.apply(this,t),n=a==="flash"}(a==="web"||a==="both")&&(t[0]=localStorage,r=e.apply(this,t),n=!0)}catch(u){s=u}if(n)break}if(!n)throw s;return r};I.setItem=function(e,t,i,r,a){_a(pg,arguments,a)};I.getItem=function(e,t,i,r){return _a(dg,arguments,r)};I.removeItem=function(e,t,i,r){_a(gg,arguments,r)};I.clearItems=function(e,t,i){_a(vg,arguments,i)};I.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0};I.format=function(e){for(var t=/%./g,i,r,a=0,n=[],s=0;i=t.exec(e);){r=e.substring(s,t.lastIndex-2),r.length>0&&n.push(r),s=t.lastIndex;var o=i[0][1];switch(o){case"s":case"o":a<arguments.length?n.push(arguments[a+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+o+"?>")}}return n.push(e.substring(s)),n.join("")};I.formatNumber=function(e,t,i,r){var a=e,n=isNaN(t=Math.abs(t))?2:t,s=i===void 0?",":i,o=r===void 0?".":r,u=a<0?"-":"",l=parseInt(a=Math.abs(+a||0).toFixed(n),10)+"",f=l.length>3?l.length%3:0;return u+(f?l.substr(0,f)+o:"")+l.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+o)+(n?s+Math.abs(a-l).toFixed(n).slice(2):"")};I.formatSize=function(e){return e>=1073741824?e=I.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?e=I.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?e=I.formatNumber(e/1024,0)+" KiB":e=I.formatNumber(e,0)+" bytes",e};I.bytesFromIP=function(e){return e.indexOf(".")!==-1?I.bytesFromIPv4(e):e.indexOf(":")!==-1?I.bytesFromIPv6(e):null};I.bytesFromIPv4=function(e){if(e=e.split("."),e.length!==4)return null;for(var t=I.createBuffer(),i=0;i<e.length;++i){var r=parseInt(e[i],10);if(isNaN(r))return null;t.putByte(r)}return t.getBytes()};I.bytesFromIPv6=function(e){var t=0;e=e.split(":").filter(function(s){return s.length===0&&++t,!0});for(var i=(8-e.length+t)*2,r=I.createBuffer(),a=0;a<8;++a){if(!e[a]||e[a].length===0){r.fillWithByte(0,i),i=0;continue}var n=I.hexToBytes(e[a]);n.length<2&&r.putByte(0),r.putBytes(n)}return r.getBytes()};I.bytesToIP=function(e){return e.length===4?I.bytesToIPv4(e):e.length===16?I.bytesToIPv6(e):null};I.bytesToIPv4=function(e){if(e.length!==4)return null;for(var t=[],i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t.join(".")};I.bytesToIPv6=function(e){if(e.length!==16)return null;for(var t=[],i=[],r=0,a=0;a<e.length;a+=2){for(var n=I.bytesToHex(e[a]+e[a+1]);n[0]==="0"&&n!=="0";)n=n.substr(1);if(n==="0"){var s=i[i.length-1],o=t.length;!s||o!==s.end+1?i.push({start:o,end:o}):(s.end=o,s.end-s.start>i[r].end-i[r].start&&(r=i.length-1))}t.push(n)}if(i.length>0){var u=i[r];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),u.start===0&&t.unshift(""),u.end===7&&t.push(""))}return t.join(":")};I.estimateCores=function(e,t){if(typeof e=="function"&&(t=e,e={}),e=e||{},"cores"in I&&!e.update)return t(null,I.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return I.cores=navigator.hardwareConcurrency,t(null,I.cores);if(typeof Worker>"u")return I.cores=1,t(null,I.cores);if(typeof Blob>"u")return I.cores=2,t(null,I.cores);var i=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(s){for(var o=Date.now(),u=o+4;Date.now()<u;);self.postMessage({st:o,et:u})})}.toString(),")()"],{type:"application/javascript"}));r([],5,16);function r(s,o,u){if(o===0){var l=Math.floor(s.reduce(function(f,c){return f+c},0)/s.length);return I.cores=Math.max(1,l),URL.revokeObjectURL(i),t(null,I.cores)}a(u,function(f,c){s.push(n(u,c)),r(s,o-1,u)})}function a(s,o){for(var u=[],l=[],f=0;f<s;++f){var c=new Worker(i);c.addEventListener("message",function(p){if(l.push(p.data),l.length===s){for(var m=0;m<s;++m)u[m].terminate();o(null,l)}}),u.push(c)}for(var f=0;f<s;++f)u[f].postMessage(f)}function n(s,o){for(var u=[],l=0;l<s;++l)for(var f=o[l],c=u[l]=[],p=0;p<s;++p)if(l!==p){var m=o[p];(f.st>m.st&&f.st<m.et||m.st>f.st&&m.st<f.et)&&c.push(p)}return u.reduce(function(v,C){return Math.max(v,C.length)},0)}}});var Na=F((BC,Ff)=>{"use strict";S();var He=oe();Ae();Ff.exports=He.cipher=He.cipher||{};He.cipher.algorithms=He.cipher.algorithms||{};He.cipher.createCipher=function(e,t){var i=e;if(typeof i=="string"&&(i=He.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:i,key:t,decrypt:!1})};He.cipher.createDecipher=function(e,t){var i=e;if(typeof i=="string"&&(i=He.cipher.getAlgorithm(i),i&&(i=i())),!i)throw new Error("Unsupported algorithm: "+e);return new He.cipher.BlockCipher({algorithm:i,key:t,decrypt:!0})};He.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),He.cipher.algorithms[e]=t};He.cipher.getAlgorithm=function(e){return e=e.toUpperCase(),e in He.cipher.algorithms?He.cipher.algorithms[e]:null};var Xn=He.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};Xn.prototype.start=function(e){e=e||{};var t={};for(var i in e)t[i]=e[i];t.decrypt=this._decrypt,this._finish=!1,this._input=He.util.createBuffer(),this.output=e.output||He.util.createBuffer(),this.mode.start(t)};Xn.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};Xn.prototype.finish=function(e){e&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(i){return e(this.blockSize,i,!1)},this.mode.unpad=function(i){return e(this.blockSize,i,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t))}});var Zn=F((TC,Mf)=>{"use strict";S();var Ge=oe();Ae();Ge.cipher=Ge.cipher||{};var le=Mf.exports=Ge.cipher.modes=Ge.cipher.modes||{};le.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};le.ecb.prototype.start=function(e){};le.ecb.prototype.encrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};le.ecb.prototype.decrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r])};le.ecb.prototype.pad=function(e,t){var i=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(i,i),!0};le.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var i=e.length(),r=e.at(i-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};le.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};le.cbc.prototype.start=function(e){if(e.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=ka(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};le.cbc.prototype.encrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=this._prev[r]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._outBlock[r]);this._prev=this._outBlock};le.cbc.prototype.decrypt=function(e,t,i){if(e.length()<this.blockSize&&!(i&&e.length()>0))return!0;for(var r=0;r<this._ints;++r)this._inBlock[r]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var r=0;r<this._ints;++r)t.putInt32(this._prev[r]^this._outBlock[r]);this._prev=this._inBlock.slice(0)};le.cbc.prototype.pad=function(e,t){var i=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(i,i),!0};le.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var i=e.length(),r=e.at(i-1);return r>this.blockSize<<2?!1:(e.truncate(r),!0)};le.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.cfb.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32()^this._outBlock[a],t.putInt32(this._inBlock[a]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialBlock[a]=e.getInt32()^this._outBlock[a],this._partialOutput.putInt32(this._partialBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._partialBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.cfb.prototype.decrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32(),t.putInt32(this._inBlock[a]^this._outBlock[a]);return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialBlock[a]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[a]^this._outBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._partialBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.ofb.prototype.encrypt=function(e,t,i){var r=e.length();if(e.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]),this._inBlock[a]=this._outBlock[a];return}var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n>0)e.read-=this.blockSize;else for(var a=0;a<this._ints;++a)this._inBlock[a]=this._outBlock[a];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0};le.ofb.prototype.decrypt=le.ofb.prototype.encrypt;le.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0};le.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=ka(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};le.ctr.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize)for(var a=0;a<this._ints;++a)t.putInt32(e.getInt32()^this._outBlock[a]);else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}La(this._inBlock)};le.ctr.prototype.decrypt=le.ctr.prototype.encrypt;le.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=Ge.util.createBuffer(),this._partialBytes=0,this._R=3774873600};le.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t=Ge.util.createBuffer(e.iv);this._cipherLength=0;var i;if("additionalData"in e?i=Ge.util.createBuffer(e.additionalData):i=Ge.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=Ge.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var r=t.length();if(r===12)this._j0=[t.getInt32(),t.getInt32(),t.getInt32(),1];else{for(this._j0=[0,0,0,0];t.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat($n(r*8)))}this._inBlock=this._j0.slice(0),La(this._inBlock),this._partialBytes=0,i=Ge.util.createBuffer(i),this._aDataLength=$n(i.length()*8);var a=i.length()%this.blockSize;for(a&&i.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];i.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[i.getInt32(),i.getInt32(),i.getInt32(),i.getInt32()])};le.gcm.prototype.encrypt=function(e,t,i){var r=e.length();if(r===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&r>=this.blockSize){for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^=e.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-r)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var a=0;a<this._ints;++a)this._partialOutput.putInt32(e.getInt32()^this._outBlock[a]);if(n<=0||i){if(i){var s=r%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(var a=0;a<this._ints;++a)this._outBlock[a]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!i)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(r-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),La(this._inBlock)};le.gcm.prototype.decrypt=function(e,t,i){var r=e.length();if(r<this.blockSize&&!(i&&r>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),La(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]^this._hashBlock[a]);r<this.blockSize?this._cipherLength+=r%this.blockSize:this._cipherLength+=this.blockSize};le.gcm.prototype.afterFinish=function(e,t){var i=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=Ge.util.createBuffer();var r=this._aDataLength.concat($n(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,r);var a=[];this.cipher.encrypt(this._j0,a);for(var n=0;n<this._ints;++n)this.tag.putInt32(this._s[n]^a[n]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(i=!1),i};le.gcm.prototype.multiply=function(e,t){for(var i=[0,0,0,0],r=t.slice(0),a=0;a<128;++a){var n=e[a/32|0]&1<<31-a%32;n&&(i[0]^=r[0],i[1]^=r[1],i[2]^=r[2],i[3]^=r[3]),this.pow(r,r)}return i};le.gcm.prototype.pow=function(e,t){for(var i=e[3]&1,r=3;r>0;--r)t[r]=e[r]>>>1|(e[r-1]&1)<<31;t[0]=e[0]>>>1,i&&(t[0]^=this._R)};le.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],i=0;i<32;++i){var r=i/8|0,a=e[r]>>>(7-i%8)*4&15,n=this._m[i][a];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}return t};le.gcm.prototype.ghash=function(e,t,i){return t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3],this.tableMultiply(t)};le.gcm.prototype.generateHashTable=function(e,t){for(var i=8/t,r=4*i,a=16*i,n=new Array(a),s=0;s<a;++s){var o=[0,0,0,0],u=s/r|0,l=(r-1-s%r)*t;o[u]=1<<t-1<<l,n[s]=this.generateSubHashTable(this.multiply(o,e),t)}return n};le.gcm.prototype.generateSubHashTable=function(e,t){var i=1<<t,r=i>>>1,a=new Array(i);a[r]=e.slice(0);for(var n=r>>>1;n>0;)this.pow(a[2*n],a[n]=[]),n>>=1;for(n=2;n<r;){for(var s=1;s<n;++s){var o=a[n],u=a[s];a[n+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}n*=2}for(a[0]=[0,0,0,0],n=r+1;n<i;++n){var l=a[n^r];a[n]=[e[0]^l[0],e[1]^l[1],e[2]^l[2],e[3]^l[3]]}return a};function ka(e,t){if(typeof e=="string"&&(e=Ge.util.createBuffer(e)),Ge.util.isArray(e)&&e.length>4){var i=e;e=Ge.util.createBuffer();for(var r=0;r<i.length;++r)e.putByte(i[r])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!Ge.util.isArray(e)){for(var a=[],n=t/4,r=0;r<n;++r)a.push(e.getInt32());e=a}return e}function La(e){e[e.length-1]=e[e.length-1]+1&4294967295}function $n(e){return[e/4294967296|0,e&4294967295]}});var Ir=F((_C,Gf)=>{"use strict";S();var Te=oe();Na();Zn();Ae();Gf.exports=Te.aes=Te.aes||{};Te.aes.startEncrypting=function(e,t,i,r){var a=Ra({key:e,output:i,decrypt:!1,mode:r});return a.start(t),a};Te.aes.createEncryptionCipher=function(e,t){return Ra({key:e,output:null,decrypt:!1,mode:t})};Te.aes.startDecrypting=function(e,t,i,r){var a=Ra({key:e,output:i,decrypt:!0,mode:r});return a.start(t),a};Te.aes.createDecryptionCipher=function(e,t){return Ra({key:e,output:null,decrypt:!0,mode:t})};Te.aes.Algorithm=function(e,t){rs||Kf();var i=this;i.name=e,i.mode=new t({blockSize:16,cipher:{encrypt:function(r,a){return ts(i._w,r,a,!1)},decrypt:function(r,a){return ts(i._w,r,a,!0)}}}),i._init=!1};Te.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t=e.key,i;if(typeof t=="string"&&(t.length===16||t.length===24||t.length===32))t=Te.util.createBuffer(t);else if(Te.util.isArray(t)&&(t.length===16||t.length===24||t.length===32)){i=t,t=Te.util.createBuffer();for(var r=0;r<i.length;++r)t.putByte(i[r])}if(!Te.util.isArray(t)){i=t,t=[];var a=i.length();if(a===16||a===24||a===32){a=a>>>2;for(var r=0;r<a;++r)t.push(i.getInt32())}}if(!Te.util.isArray(t)||!(t.length===4||t.length===6||t.length===8))throw new Error("Invalid key parameter.");var n=this.mode.name,s=["CFB","OFB","CTR","GCM"].indexOf(n)!==-1;this._w=Hf(t,e.decrypt&&!s),this._init=!0}};Te.aes._expandKey=function(e,t){return rs||Kf(),Hf(e,t)};Te.aes._updateBlock=ts;ii("AES-ECB",Te.cipher.modes.ecb);ii("AES-CBC",Te.cipher.modes.cbc);ii("AES-CFB",Te.cipher.modes.cfb);ii("AES-OFB",Te.cipher.modes.ofb);ii("AES-CTR",Te.cipher.modes.ctr);ii("AES-GCM",Te.cipher.modes.gcm);function ii(e,t){var i=function(){return new Te.aes.Algorithm(e,t)};Te.cipher.registerAlgorithm(e,i)}var rs=!1,ri=4,yt,es,qf,Qr,Ht;function Kf(){rs=!0,qf=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;yt=new Array(256),es=new Array(256),Qr=new Array(4),Ht=new Array(4);for(var t=0;t<4;++t)Qr[t]=new Array(256),Ht[t]=new Array(256);for(var i=0,r=0,a,n,s,o,u,l,f,t=0;t<256;++t){o=r^r<<1^r<<2^r<<3^r<<4,o=o>>8^o&255^99,yt[i]=o,es[o]=i,u=e[o],a=e[i],n=e[a],s=e[n],l=u<<24^o<<16^o<<8^(o^u),f=(a^n^s)<<24^(i^s)<<16^(i^n^s)<<8^(i^a^s);for(var c=0;c<4;++c)Qr[c][i]=l,Ht[c][o]=f,l=l<<24|l>>>8,f=f<<24|f>>>8;i===0?i=r=1:(i=a^e[e[e[a^s]]],r^=e[e[r]])}}function Hf(e,t){for(var i=e.slice(0),r,a=1,n=i.length,s=n+6+1,o=ri*s,u=n;u<o;++u)r=i[u-1],u%n===0?(r=yt[r>>>16&255]<<24^yt[r>>>8&255]<<16^yt[r&255]<<8^yt[r>>>24]^qf[a]<<24,a++):n>6&&u%n===4&&(r=yt[r>>>24]<<24^yt[r>>>16&255]<<16^yt[r>>>8&255]<<8^yt[r&255]),i[u]=i[u-n]^r;if(t){var l,f=Ht[0],c=Ht[1],p=Ht[2],m=Ht[3],v=i.slice(0);o=i.length;for(var u=0,C=o-ri;u<o;u+=ri,C-=ri)if(u===0||u===o-ri)v[u]=i[C],v[u+1]=i[C+3],v[u+2]=i[C+2],v[u+3]=i[C+1];else for(var E=0;E<ri;++E)l=i[C+E],v[u+(3&-E)]=f[yt[l>>>24]]^c[yt[l>>>16&255]]^p[yt[l>>>8&255]]^m[yt[l&255]];i=v}return i}function ts(e,t,i,r){var a=e.length/4-1,n,s,o,u,l;r?(n=Ht[0],s=Ht[1],o=Ht[2],u=Ht[3],l=es):(n=Qr[0],s=Qr[1],o=Qr[2],u=Qr[3],l=yt);var f,c,p,m,v,C,E;f=t[0]^e[0],c=t[r?3:1]^e[1],p=t[2]^e[2],m=t[r?1:3]^e[3];for(var B=3,w=1;w<a;++w)v=n[f>>>24]^s[c>>>16&255]^o[p>>>8&255]^u[m&255]^e[++B],C=n[c>>>24]^s[p>>>16&255]^o[m>>>8&255]^u[f&255]^e[++B],E=n[p>>>24]^s[m>>>16&255]^o[f>>>8&255]^u[c&255]^e[++B],m=n[m>>>24]^s[f>>>16&255]^o[c>>>8&255]^u[p&255]^e[++B],f=v,c=C,p=E;i[0]=l[f>>>24]<<24^l[c>>>16&255]<<16^l[p>>>8&255]<<8^l[m&255]^e[++B],i[r?3:1]=l[c>>>24]<<24^l[p>>>16&255]<<16^l[m>>>8&255]<<8^l[f&255]^e[++B],i[2]=l[p>>>24]<<24^l[m>>>16&255]<<16^l[f>>>8&255]<<8^l[c&255]^e[++B],i[r?1:3]=l[m>>>24]<<24^l[f>>>16&255]<<16^l[c>>>8&255]<<8^l[p&255]^e[++B]}function Ra(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),i="AES-"+t,r;e.decrypt?r=Te.cipher.createDecipher(i,e.key):r=Te.cipher.createCipher(i,e.key);var a=r.start;return r.start=function(n,s){var o=null;s instanceof Te.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,a.call(r,s)},r}});var Br=F((kC,jf)=>{"use strict";S();var qi=oe();qi.pki=qi.pki||{};var is=jf.exports=qi.pki.oids=qi.oids=qi.oids||{};function D(e,t){is[e]=t,is[t]=e}function Se(e,t){is[e]=t}D("1.2.840.113549.1.1.1","rsaEncryption");D("1.2.840.113549.1.1.4","md5WithRSAEncryption");D("1.2.840.113549.1.1.5","sha1WithRSAEncryption");D("1.2.840.113549.1.1.7","RSAES-OAEP");D("1.2.840.113549.1.1.8","mgf1");D("1.2.840.113549.1.1.9","pSpecified");D("1.2.840.113549.1.1.10","RSASSA-PSS");D("1.2.840.113549.1.1.11","sha256WithRSAEncryption");D("1.2.840.113549.1.1.12","sha384WithRSAEncryption");D("1.2.840.113549.1.1.13","sha512WithRSAEncryption");D("1.3.101.112","EdDSA25519");D("1.2.840.10040.4.3","dsa-with-sha1");D("1.3.14.3.2.7","desCBC");D("1.3.14.3.2.26","sha1");D("1.3.14.3.2.29","sha1WithRSASignature");D("2.16.840.1.101.3.4.2.1","sha256");D("2.16.840.1.101.3.4.2.2","sha384");D("2.16.840.1.101.3.4.2.3","sha512");D("2.16.840.1.101.3.4.2.4","sha224");D("2.16.840.1.101.3.4.2.5","sha512-224");D("2.16.840.1.101.3.4.2.6","sha512-256");D("1.2.840.113549.2.2","md2");D("1.2.840.113549.2.5","md5");D("1.2.840.113549.1.7.1","data");D("1.2.840.113549.1.7.2","signedData");D("1.2.840.113549.1.7.3","envelopedData");D("1.2.840.113549.1.7.4","signedAndEnvelopedData");D("1.2.840.113549.1.7.5","digestedData");D("1.2.840.113549.1.7.6","encryptedData");D("1.2.840.113549.1.9.1","emailAddress");D("1.2.840.113549.1.9.2","unstructuredName");D("1.2.840.113549.1.9.3","contentType");D("1.2.840.113549.1.9.4","messageDigest");D("1.2.840.113549.1.9.5","signingTime");D("1.2.840.113549.1.9.6","counterSignature");D("1.2.840.113549.1.9.7","challengePassword");D("1.2.840.113549.1.9.8","unstructuredAddress");D("1.2.840.113549.1.9.14","extensionRequest");D("1.2.840.113549.1.9.20","friendlyName");D("1.2.840.113549.1.9.21","localKeyId");D("1.2.840.113549.1.9.22.1","x509Certificate");D("1.2.840.113549.1.12.10.1.1","keyBag");D("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");D("1.2.840.113549.1.12.10.1.3","certBag");D("1.2.840.113549.1.12.10.1.4","crlBag");D("1.2.840.113549.1.12.10.1.5","secretBag");D("1.2.840.113549.1.12.10.1.6","safeContentsBag");D("1.2.840.113549.1.5.13","pkcs5PBES2");D("1.2.840.113549.1.5.12","pkcs5PBKDF2");D("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");D("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");D("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");D("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");D("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");D("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");D("1.2.840.113549.2.7","hmacWithSHA1");D("1.2.840.113549.2.8","hmacWithSHA224");D("1.2.840.113549.2.9","hmacWithSHA256");D("1.2.840.113549.2.10","hmacWithSHA384");D("1.2.840.113549.2.11","hmacWithSHA512");D("1.2.840.113549.3.7","des-EDE3-CBC");D("2.16.840.1.101.3.4.1.2","aes128-CBC");D("2.16.840.1.101.3.4.1.22","aes192-CBC");D("2.16.840.1.101.3.4.1.42","aes256-CBC");D("2.5.4.3","commonName");D("2.5.4.4","surname");D("2.5.4.5","serialNumber");D("2.5.4.6","countryName");D("2.5.4.7","localityName");D("2.5.4.8","stateOrProvinceName");D("2.5.4.9","streetAddress");D("2.5.4.10","organizationName");D("2.5.4.11","organizationalUnitName");D("2.5.4.12","title");D("2.5.4.13","description");D("2.5.4.15","businessCategory");D("2.5.4.17","postalCode");D("2.5.4.42","givenName");D("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");D("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");D("2.16.840.1.113730.1.1","nsCertType");D("2.16.840.1.113730.1.13","nsComment");Se("2.5.29.1","authorityKeyIdentifier");Se("2.5.29.2","keyAttributes");Se("2.5.29.3","certificatePolicies");Se("2.5.29.4","keyUsageRestriction");Se("2.5.29.5","policyMapping");Se("2.5.29.6","subtreesConstraint");Se("2.5.29.7","subjectAltName");Se("2.5.29.8","issuerAltName");Se("2.5.29.9","subjectDirectoryAttributes");Se("2.5.29.10","basicConstraints");Se("2.5.29.11","nameConstraints");Se("2.5.29.12","policyConstraints");Se("2.5.29.13","basicConstraints");D("2.5.29.14","subjectKeyIdentifier");D("2.5.29.15","keyUsage");Se("2.5.29.16","privateKeyUsagePeriod");D("2.5.29.17","subjectAltName");D("2.5.29.18","issuerAltName");D("2.5.29.19","basicConstraints");Se("2.5.29.20","cRLNumber");Se("2.5.29.21","cRLReason");Se("2.5.29.22","expirationDate");Se("2.5.29.23","instructionCode");Se("2.5.29.24","invalidityDate");Se("2.5.29.25","cRLDistributionPoints");Se("2.5.29.26","issuingDistributionPoint");Se("2.5.29.27","deltaCRLIndicator");Se("2.5.29.28","issuingDistributionPoint");Se("2.5.29.29","certificateIssuer");Se("2.5.29.30","nameConstraints");D("2.5.29.31","cRLDistributionPoints");D("2.5.29.32","certificatePolicies");Se("2.5.29.33","policyMappings");Se("2.5.29.34","policyConstraints");D("2.5.29.35","authorityKeyIdentifier");Se("2.5.29.36","policyConstraints");D("2.5.29.37","extKeyUsage");Se("2.5.29.46","freshestCRL");Se("2.5.29.54","inhibitAnyPolicy");D("1.3.6.1.4.1.11129.2.4.2","timestampList");D("1.3.6.1.5.5.7.1.1","authorityInfoAccess");D("1.3.6.1.5.5.7.3.1","serverAuth");D("1.3.6.1.5.5.7.3.2","clientAuth");D("1.3.6.1.5.5.7.3.3","codeSigning");D("1.3.6.1.5.5.7.3.4","emailProtection");D("1.3.6.1.5.5.7.3.8","timeStamping")});var Gt=F((RC,zf)=>{"use strict";S();var Ne=oe();Ae();Br();var q=zf.exports=Ne.asn1=Ne.asn1||{};q.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};q.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};q.create=function(e,t,i,r,a){if(Ne.util.isArray(r)){for(var n=[],s=0;s<r.length;++s)r[s]!==void 0&&n.push(r[s]);r=n}var o={tagClass:e,type:t,constructed:i,composed:i||Ne.util.isArray(r),value:r};return a&&"bitStringContents"in a&&(o.bitStringContents=a.bitStringContents,o.original=q.copy(o)),o};q.copy=function(e,t){var i;if(Ne.util.isArray(e)){i=[];for(var r=0;r<e.length;++r)i.push(q.copy(e[r],t));return i}return typeof e=="string"?e:(i={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:q.copy(e.value,t)},t&&!t.excludeBitStringContents&&(i.bitStringContents=e.bitStringContents),i)};q.equals=function(e,t,i){if(Ne.util.isArray(e)){if(!Ne.util.isArray(t)||e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!q.equals(e[r],t[r]))return!1;return!0}if(typeof e!=typeof t)return!1;if(typeof e=="string")return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&q.equals(e.value,t.value);return i&&i.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a};q.getBerValueLength=function(e){var t=e.getByte();if(t!==128){var i,r=t&128;return r?i=e.getInt((t&127)<<3):i=t,i}};function Ki(e,t,i){if(i>t){var r=new Error("Too few bytes to parse DER.");throw r.available=e.length(),r.remaining=t,r.requested=i,r}}var yg=function(e,t){var i=e.getByte();if(t--,i!==128){var r,a=i&128;if(!a)r=i;else{var n=i&127;Ki(e,t,n),r=e.getInt(n<<3)}if(r<0)throw new Error("Negative length: "+r);return r}};q.fromDer=function(e,t){t===void 0&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof t=="boolean"&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),typeof e=="string"&&(e=Ne.util.createBuffer(e));var i=e.length(),r=Da(e,e.length(),0,t);if(t.parseAllBytes&&e.length()!==0){var a=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw a.byteCount=i,a.remaining=e.length(),a}return r};function Da(e,t,i,r){var a;Ki(e,t,2);var n=e.getByte();t--;var s=n&192,o=n&31;a=e.length();var u=yg(e,t);if(t-=a-e.length(),u!==void 0&&u>t){if(r.strict){var l=new Error("Too few bytes to read ASN.1 value.");throw l.available=e.length(),l.remaining=t,l.requested=u,l}u=t}var f,c,p=(n&32)===32;if(p)if(f=[],u===void 0)for(;;){if(Ki(e,t,2),e.bytes(2)==="\0\0"){e.getBytes(2),t-=2;break}a=e.length(),f.push(Da(e,t,i+1,r)),t-=a-e.length()}else for(;u>0;)a=e.length(),f.push(Da(e,u,i+1,r)),t-=a-e.length(),u-=a-e.length();if(f===void 0&&s===q.Class.UNIVERSAL&&o===q.Type.BITSTRING&&(c=e.bytes(u)),f===void 0&&r.decodeBitStrings&&s===q.Class.UNIVERSAL&&o===q.Type.BITSTRING&&u>1){var m=e.read,v=t,C=0;if(o===q.Type.BITSTRING&&(Ki(e,t,1),C=e.getByte(),t--),C===0)try{a=e.length();var E={strict:!0,decodeBitStrings:!0},B=Da(e,t,i+1,E),w=a-e.length();t-=w,o==q.Type.BITSTRING&&w++;var T=B.tagClass;w===u&&(T===q.Class.UNIVERSAL||T===q.Class.CONTEXT_SPECIFIC)&&(f=[B])}catch{}f===void 0&&(e.read=m,t=v)}if(f===void 0){if(u===void 0){if(r.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=t}if(o===q.Type.BMPSTRING)for(f="";u>0;u-=2)Ki(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(u),t-=u}var U=c===void 0?null:{bitStringContents:c};return q.create(s,o,p,f,U)}q.toDer=function(e){var t=Ne.util.createBuffer(),i=e.tagClass|e.type,r=Ne.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=q.equals(e,e.original))),a)r.putBytes(e.bitStringContents);else if(e.composed){e.constructed?i|=32:r.putByte(0);for(var n=0;n<e.value.length;++n)e.value[n]!==void 0&&r.putBuffer(q.toDer(e.value[n]))}else if(e.type===q.Type.BMPSTRING)for(var n=0;n<e.value.length;++n)r.putInt16(e.value.charCodeAt(n));else e.type===q.Type.INTEGER&&e.value.length>1&&(e.value.charCodeAt(0)===0&&!(e.value.charCodeAt(1)&128)||e.value.charCodeAt(0)===255&&(e.value.charCodeAt(1)&128)===128)?r.putBytes(e.value.substr(1)):r.putBytes(e.value);if(t.putByte(i),r.length()<=127)t.putByte(r.length()&127);else{var s=r.length(),o="";do o+=String.fromCharCode(s&255),s=s>>>8;while(s>0);t.putByte(o.length|128);for(var n=o.length-1;n>=0;--n)t.putByte(o.charCodeAt(n))}return t.putBuffer(r),t};q.oidToDer=function(e){var t=e.split("."),i=Ne.util.createBuffer();i.putByte(40*parseInt(t[0],10)+parseInt(t[1],10));for(var r,a,n,s,o=2;o<t.length;++o){r=!0,a=[],n=parseInt(t[o],10);do s=n&127,n=n>>>7,r||(s|=128),a.push(s),r=!1;while(n>0);for(var u=a.length-1;u>=0;--u)i.putByte(a[u])}return i};q.derToOid=function(e){var t;typeof e=="string"&&(e=Ne.util.createBuffer(e));var i=e.getByte();t=Math.floor(i/40)+"."+i%40;for(var r=0;e.length()>0;)i=e.getByte(),r=r<<7,i&128?r+=i&127:(t+="."+(r+i),r=0);return t};q.utcTimeToDate=function(e){var t=new Date,i=parseInt(e.substr(0,2),10);i=i>=50?1900+i:2e3+i;var r=parseInt(e.substr(2,2),10)-1,a=parseInt(e.substr(4,2),10),n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var u=e.charAt(10),l=10;u!=="+"&&u!=="-"&&(o=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(i,r,a),t.setUTCHours(n,s,o,0),l&&(u=e.charAt(l),u==="+"||u==="-")){var f=parseInt(e.substr(l+1,2),10),c=parseInt(e.substr(l+4,2),10),p=f*60+c;p*=6e4,u==="+"?t.setTime(+t-p):t.setTime(+t+p)}return t};q.generalizedTimeToDate=function(e){var t=new Date,i=parseInt(e.substr(0,4),10),r=parseInt(e.substr(4,2),10)-1,a=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),u=0,l=0,f=!1;e.charAt(e.length-1)==="Z"&&(f=!0);var c=e.length-5,p=e.charAt(c);if(p==="+"||p==="-"){var m=parseInt(e.substr(c+1,2),10),v=parseInt(e.substr(c+4,2),10);l=m*60+v,l*=6e4,p==="+"&&(l*=-1),f=!0}return e.charAt(14)==="."&&(u=parseFloat(e.substr(14),10)*1e3),f?(t.setUTCFullYear(i,r,a),t.setUTCHours(n,s,o,u),t.setTime(+t+l)):(t.setFullYear(i,r,a),t.setHours(n,s,o,u)),t};q.dateToUtcTime=function(e){if(typeof e=="string")return e;var t="",i=[];i.push((""+e.getUTCFullYear()).substr(2)),i.push(""+(e.getUTCMonth()+1)),i.push(""+e.getUTCDate()),i.push(""+e.getUTCHours()),i.push(""+e.getUTCMinutes()),i.push(""+e.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(t+="0"),t+=i[r];return t+="Z",t};q.dateToGeneralizedTime=function(e){if(typeof e=="string")return e;var t="",i=[];i.push(""+e.getUTCFullYear()),i.push(""+(e.getUTCMonth()+1)),i.push(""+e.getUTCDate()),i.push(""+e.getUTCHours()),i.push(""+e.getUTCMinutes()),i.push(""+e.getUTCSeconds());for(var r=0;r<i.length;++r)i[r].length<2&&(t+="0"),t+=i[r];return t+="Z",t};q.integerToDer=function(e){var t=Ne.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var i=new Error("Integer too large; max is 32-bits.");throw i.integer=e,i};q.derToInteger=function(e){typeof e=="string"&&(e=Ne.util.createBuffer(e));var t=e.length()*8;if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)};q.validate=function(e,t,i,r){var a=!1;if((e.tagClass===t.tagClass||typeof t.tagClass>"u")&&(e.type===t.type||typeof t.type>"u"))if(e.constructed===t.constructed||typeof t.constructed>"u"){if(a=!0,t.value&&Ne.util.isArray(t.value))for(var n=0,s=0;a&&s<t.value.length;++s)a=t.value[s].optional||!1,e.value[n]&&(a=q.validate(e.value[n],t.value[s],i,r),a?++n:t.value[s].optional&&(a=!0)),!a&&r&&r.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(a&&i&&(t.capture&&(i[t.capture]=e.value),t.captureAsn1&&(i[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(i[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)){var o;if(e.bitStringContents.length<2)i[t.captureBitStringValue]="";else{var u=e.bitStringContents.charCodeAt(0);if(u!==0)throw new Error("captureBitStringValue only supported for zero unused bits");i[t.captureBitStringValue]=e.bitStringContents.slice(1)}}}else r&&r.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else r&&(e.tagClass!==t.tagClass&&r.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&r.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return a};var Yf=/[^\\u0000-\\u00ff]/;q.prettyPrint=function(e,t,i){var r="";t=t||0,i=i||2,t>0&&(r+=`
13
13
  `);for(var a="",n=0;n<t*i;++n)a+=" ";switch(r+=a+"Tag: ",e.tagClass){case q.Class.UNIVERSAL:r+="Universal:";break;case q.Class.APPLICATION:r+="Application:";break;case q.Class.CONTEXT_SPECIFIC:r+="Context-Specific:";break;case q.Class.PRIVATE:r+="Private:";break}if(e.tagClass===q.Class.UNIVERSAL)switch(r+=e.type,e.type){case q.Type.NONE:r+=" (None)";break;case q.Type.BOOLEAN:r+=" (Boolean)";break;case q.Type.INTEGER:r+=" (Integer)";break;case q.Type.BITSTRING:r+=" (Bit string)";break;case q.Type.OCTETSTRING:r+=" (Octet string)";break;case q.Type.NULL:r+=" (Null)";break;case q.Type.OID:r+=" (Object Identifier)";break;case q.Type.ODESC:r+=" (Object Descriptor)";break;case q.Type.EXTERNAL:r+=" (External or Instance of)";break;case q.Type.REAL:r+=" (Real)";break;case q.Type.ENUMERATED:r+=" (Enumerated)";break;case q.Type.EMBEDDED:r+=" (Embedded PDV)";break;case q.Type.UTF8:r+=" (UTF8)";break;case q.Type.ROID:r+=" (Relative Object Identifier)";break;case q.Type.SEQUENCE:r+=" (Sequence)";break;case q.Type.SET:r+=" (Set)";break;case q.Type.PRINTABLESTRING:r+=" (Printable String)";break;case q.Type.IA5String:r+=" (IA5String (ASCII))";break;case q.Type.UTCTIME:r+=" (UTC time)";break;case q.Type.GENERALIZEDTIME:r+=" (Generalized time)";break;case q.Type.BMPSTRING:r+=" (BMP String)";break}else r+=e.type;if(r+=`
14
14
  `,r+=a+"Constructed: "+e.constructed+`
15
- `,e.composed){for(var s=0,o="",n=0;n<e.value.length;++n)e.value[n]!==void 0&&(s+=1,o+=q.prettyPrint(e.value[n],t+1,i),n+1<e.value.length&&(o+=","));r+=a+"Sub values: "+s+o}else{if(r+=a+"Value: ",e.type===q.Type.OID){var u=q.derToOid(e.value);r+=u,Ne.pki&&Ne.pki.oids&&u in Ne.pki.oids&&(r+=" ("+Ne.pki.oids[u]+") ")}if(e.type===q.Type.INTEGER)try{r+=q.derToInteger(e.value)}catch{r+="0x"+Ne.util.bytesToHex(e.value)}else if(e.type===q.Type.BITSTRING){if(e.value.length>1?r+="0x"+Ne.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?r+=" (1 unused bit shown)":l>1&&(r+=" ("+l+" unused bits shown)")}}else if(e.type===q.Type.OCTETSTRING)Yf.test(e.value)||(r+="("+e.value+") "),r+="0x"+Ne.util.bytesToHex(e.value);else if(e.type===q.Type.UTF8)try{r+=Ne.util.decodeUtf8(e.value)}catch(f){if(f.message==="URI malformed")r+="0x"+Ne.util.bytesToHex(e.value)+" (malformed UTF8)";else throw f}else e.type===q.Type.PRINTABLESTRING||e.type===q.Type.IA5String?r+=e.value:Yf.test(e.value)?r+="0x"+Ne.util.bytesToHex(e.value):e.value.length===0?r+="[null]":r+=e.value}return r}});var Jt=F((DC,Jf)=>{"use strict";S();var Pa=oe();Jf.exports=Pa.md=Pa.md||{};Pa.md.algorithms=Pa.md.algorithms||{}});var ai=F((QC,Wf)=>{"use strict";S();var ur=oe();Jt();Ae();var mg=Wf.exports=ur.hmac=ur.hmac||{};mg.create=function(){var e=null,t=null,i=null,r=null,a={};return a.start=function(n,s){if(n!==null)if(typeof n=="string")if(n=n.toLowerCase(),n in ur.md.algorithms)t=ur.md.algorithms[n].create();else throw new Error('Unknown hash algorithm "'+n+'"');else t=n;if(s===null)s=e;else{if(typeof s=="string")s=ur.util.createBuffer(s);else if(ur.util.isArray(s)){var o=s;s=ur.util.createBuffer();for(var u=0;u<o.length;++u)s.putByte(o[u])}var l=s.length();l>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),i=ur.util.createBuffer(),r=ur.util.createBuffer(),l=s.length();for(var u=0;u<l;++u){var o=s.at(u);i.putByte(54^o),r.putByte(92^o)}if(l<t.blockLength)for(var o=t.blockLength-l,u=0;u<o;++u)i.putByte(54),r.putByte(92);e=s,i=i.bytes(),r=r.bytes()}t.start(),t.update(i)},a.update=function(n){t.update(n)},a.getMac=function(){var n=t.digest().bytes();return t.start(),t.update(r),t.update(n),t.digest()},a.digest=a.getMac,a}});var Ua=F((OC,ec)=>{"use strict";S();var Wt=oe();Jt();Ae();var $f=ec.exports=Wt.md5=Wt.md5||{};Wt.md.md5=Wt.md.algorithms.md5=$f;$f.create=function(){Zf||Ag();var e=null,t=Wt.util.createBuffer(),i=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=Wt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=Wt.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),Xf(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=Wt.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(as.substr(0,r.blockLength-s));for(var o,u=0,l=r.fullMessageLength.length-1;l>=0;--l)o=r.fullMessageLength[l]*8+u,u=o/4294967296>>>0,a.putInt32Le(o>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Xf(f,i,a);var c=Wt.util.createBuffer();return c.putInt32Le(f.h0),c.putInt32Le(f.h1),c.putInt32Le(f.h2),c.putInt32Le(f.h3),c},r};var as=null,Qa=null,Hi=null,ni=null,Zf=!1;function Ag(){as="\x80",as+=Wt.util.fillString("\0",64),Qa=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],Hi=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],ni=new Array(64);for(var e=0;e<64;++e)ni[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);Zf=!0}function Xf(e,t,i){for(var r,a,n,s,o,u,l,f,c=i.length();c>=64;){for(a=e.h0,n=e.h1,s=e.h2,o=e.h3,f=0;f<16;++f)t[f]=i.getInt32Le(),u=o^n&(s^o),r=a+u+ni[f]+t[f],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<32;++f)u=s^o&(n^s),r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<48;++f)u=n^s^o,r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<64;++f)u=s^(n|~o),r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;e.h0=e.h0+a|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,c-=64}}});var Ur=F((FC,rc)=>{"use strict";S();var Va=oe();Ae();var tc=rc.exports=Va.pem=Va.pem||{};tc.encode=function(e,t){t=t||{};var i="-----BEGIN "+e.type+`-----\r
15
+ `,e.composed){for(var s=0,o="",n=0;n<e.value.length;++n)e.value[n]!==void 0&&(s+=1,o+=q.prettyPrint(e.value[n],t+1,i),n+1<e.value.length&&(o+=","));r+=a+"Sub values: "+s+o}else{if(r+=a+"Value: ",e.type===q.Type.OID){var u=q.derToOid(e.value);r+=u,Ne.pki&&Ne.pki.oids&&u in Ne.pki.oids&&(r+=" ("+Ne.pki.oids[u]+") ")}if(e.type===q.Type.INTEGER)try{r+=q.derToInteger(e.value)}catch{r+="0x"+Ne.util.bytesToHex(e.value)}else if(e.type===q.Type.BITSTRING){if(e.value.length>1?r+="0x"+Ne.util.bytesToHex(e.value.slice(1)):r+="(none)",e.value.length>0){var l=e.value.charCodeAt(0);l==1?r+=" (1 unused bit shown)":l>1&&(r+=" ("+l+" unused bits shown)")}}else if(e.type===q.Type.OCTETSTRING)Yf.test(e.value)||(r+="("+e.value+") "),r+="0x"+Ne.util.bytesToHex(e.value);else if(e.type===q.Type.UTF8)try{r+=Ne.util.decodeUtf8(e.value)}catch(f){if(f.message==="URI malformed")r+="0x"+Ne.util.bytesToHex(e.value)+" (malformed UTF8)";else throw f}else e.type===q.Type.PRINTABLESTRING||e.type===q.Type.IA5String?r+=e.value:Yf.test(e.value)?r+="0x"+Ne.util.bytesToHex(e.value):e.value.length===0?r+="[null]":r+=e.value}return r}});var Jt=F((PC,Jf)=>{"use strict";S();var Pa=oe();Jf.exports=Pa.md=Pa.md||{};Pa.md.algorithms=Pa.md.algorithms||{}});var ai=F((UC,Wf)=>{"use strict";S();var ur=oe();Jt();Ae();var mg=Wf.exports=ur.hmac=ur.hmac||{};mg.create=function(){var e=null,t=null,i=null,r=null,a={};return a.start=function(n,s){if(n!==null)if(typeof n=="string")if(n=n.toLowerCase(),n in ur.md.algorithms)t=ur.md.algorithms[n].create();else throw new Error('Unknown hash algorithm "'+n+'"');else t=n;if(s===null)s=e;else{if(typeof s=="string")s=ur.util.createBuffer(s);else if(ur.util.isArray(s)){var o=s;s=ur.util.createBuffer();for(var u=0;u<o.length;++u)s.putByte(o[u])}var l=s.length();l>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),i=ur.util.createBuffer(),r=ur.util.createBuffer(),l=s.length();for(var u=0;u<l;++u){var o=s.at(u);i.putByte(54^o),r.putByte(92^o)}if(l<t.blockLength)for(var o=t.blockLength-l,u=0;u<o;++u)i.putByte(54),r.putByte(92);e=s,i=i.bytes(),r=r.bytes()}t.start(),t.update(i)},a.update=function(n){t.update(n)},a.getMac=function(){var n=t.digest().bytes();return t.start(),t.update(r),t.update(n),t.digest()},a.digest=a.getMac,a}});var Ua=F((VC,ec)=>{"use strict";S();var Wt=oe();Jt();Ae();var $f=ec.exports=Wt.md5=Wt.md5||{};Wt.md.md5=Wt.md.algorithms.md5=$f;$f.create=function(){Zf||Ag();var e=null,t=Wt.util.createBuffer(),i=new Array(16),r={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=Wt.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=Wt.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),Xf(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=Wt.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(as.substr(0,r.blockLength-s));for(var o,u=0,l=r.fullMessageLength.length-1;l>=0;--l)o=r.fullMessageLength[l]*8+u,u=o/4294967296>>>0,a.putInt32Le(o>>>0);var f={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};Xf(f,i,a);var c=Wt.util.createBuffer();return c.putInt32Le(f.h0),c.putInt32Le(f.h1),c.putInt32Le(f.h2),c.putInt32Le(f.h3),c},r};var as=null,Qa=null,Hi=null,ni=null,Zf=!1;function Ag(){as="\x80",as+=Wt.util.fillString("\0",64),Qa=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],Hi=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],ni=new Array(64);for(var e=0;e<64;++e)ni[e]=Math.floor(Math.abs(Math.sin(e+1))*4294967296);Zf=!0}function Xf(e,t,i){for(var r,a,n,s,o,u,l,f,c=i.length();c>=64;){for(a=e.h0,n=e.h1,s=e.h2,o=e.h3,f=0;f<16;++f)t[f]=i.getInt32Le(),u=o^n&(s^o),r=a+u+ni[f]+t[f],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<32;++f)u=s^o&(n^s),r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<48;++f)u=n^s^o,r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;for(;f<64;++f)u=s^(n|~o),r=a+u+ni[f]+t[Qa[f]],l=Hi[f],a=o,o=s,s=n,n+=r<<l|r>>>32-l;e.h0=e.h0+a|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,c-=64}}});var Ur=F((MC,rc)=>{"use strict";S();var Va=oe();Ae();var tc=rc.exports=Va.pem=Va.pem||{};tc.encode=function(e,t){t=t||{};var i="-----BEGIN "+e.type+`-----\r
16
16
  `,r;if(e.procType&&(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]},i+=Oa(r)),e.contentDomain&&(r={name:"Content-Domain",values:[e.contentDomain]},i+=Oa(r)),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=Oa(r)),e.headers)for(var a=0;a<e.headers.length;++a)i+=Oa(e.headers[a]);return e.procType&&(i+=`\r
17
17
  `),i+=Va.util.encode64(e.body,t.maxline||64)+`\r
18
18
  `,i+="-----END "+e.type+`-----\r
19
19
  `,i};tc.decode=function(e){for(var t=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,r=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,a=/\r?\n/,n;n=i.exec(e),!!n;){var s=n[1];s==="NEW CERTIFICATE REQUEST"&&(s="CERTIFICATE REQUEST");var o={type:s,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Va.util.decode64(n[3])};if(t.push(o),!!n[2]){for(var u=n[2].split(a),l=0;n&&l<u.length;){for(var f=u[l].replace(/\s+$/,""),c=l+1;c<u.length;++c){var p=u[c];if(!/\s/.test(p[0]))break;f+=p,l=c}if(n=f.match(r),n){for(var m={name:n[1],values:[]},v=n[2].split(","),C=0;C<v.length;++C)m.values.push(Cg(v[C]));if(o.procType)if(!o.contentDomain&&m.name==="Content-Domain")o.contentDomain=v[0]||"";else if(!o.dekInfo&&m.name==="DEK-Info"){if(m.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:v[0],parameters:v[1]||null}}else o.headers.push(m);else{if(m.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(m.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:v[0],type:v[1]}}}++l}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(t.length===0)throw new Error("Invalid PEM formatted message.");return t};function Oa(e){for(var t=e.name+": ",i=[],r=function(u,l){return" "+l},a=0;a<e.values.length;++a)i.push(e.values[a].replace(/^(\S+\r\n)/,r));t+=i.join(",")+`\r
20
20
  `;for(var n=0,s=-1,a=0;a<t.length;++a,++n)if(n>65&&s!==-1){var o=t[s];o===","?(++s,t=t.substr(0,s)+`\r
21
21
  `+t.substr(s)):t=t.substr(0,s)+`\r
22
- `+o+t.substr(s+1),n=a-s-1,s=-1,++a}else(t[a]===" "||t[a]===" "||t[a]===",")&&(s=a);return t}function Cg(e){return e.replace(/^\s+/,"")}});var Gi=F((qC,ac)=>{"use strict";S();var Pe=oe();Na();Zn();Ae();ac.exports=Pe.des=Pe.des||{};Pe.des.startEncrypting=function(e,t,i,r){var a=Fa({key:e,output:i,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return a.start(t),a};Pe.des.createEncryptionCipher=function(e,t){return Fa({key:e,output:null,decrypt:!1,mode:t})};Pe.des.startDecrypting=function(e,t,i,r){var a=Fa({key:e,output:i,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return a.start(t),a};Pe.des.createDecryptionCipher=function(e,t){return Fa({key:e,output:null,decrypt:!0,mode:t})};Pe.des.Algorithm=function(e,t){var i=this;i.name=e,i.mode=new t({blockSize:8,cipher:{encrypt:function(r,a){return ic(i._keys,r,a,!1)},decrypt:function(r,a){return ic(i._keys,r,a,!0)}}}),i._init=!1};Pe.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Pe.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=_g(t),this._init=!0}};Xt("DES-ECB",Pe.cipher.modes.ecb);Xt("DES-CBC",Pe.cipher.modes.cbc);Xt("DES-CFB",Pe.cipher.modes.cfb);Xt("DES-OFB",Pe.cipher.modes.ofb);Xt("DES-CTR",Pe.cipher.modes.ctr);Xt("3DES-ECB",Pe.cipher.modes.ecb);Xt("3DES-CBC",Pe.cipher.modes.cbc);Xt("3DES-CFB",Pe.cipher.modes.cfb);Xt("3DES-OFB",Pe.cipher.modes.ofb);Xt("3DES-CTR",Pe.cipher.modes.ctr);function Xt(e,t){var i=function(){return new Pe.des.Algorithm(e,t)};Pe.cipher.registerAlgorithm(e,i)}var Eg=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],xg=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],Sg=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],Ig=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],Bg=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],bg=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],Tg=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],wg=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function _g(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],i=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],n=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],c=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],v=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=e.length()>8?3:1,E=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,T,U=0;U<C;U++){var P=e.getInt32(),Q=e.getInt32();T=(P>>>4^Q)&252645135,Q^=T,P^=T<<4,T=(Q>>>-16^P)&65535,P^=T,Q^=T<<-16,T=(P>>>2^Q)&858993459,Q^=T,P^=T<<2,T=(Q>>>-16^P)&65535,P^=T,Q^=T<<-16,T=(P>>>1^Q)&1431655765,Q^=T,P^=T<<1,T=(Q>>>8^P)&16711935,P^=T,Q^=T<<8,T=(P>>>1^Q)&1431655765,Q^=T,P^=T<<1,T=P<<8|Q>>>20&240,P=Q<<24|Q<<8&16711680|Q>>>8&65280|Q>>>24&240,Q=T;for(var te=0;te<B.length;++te){B[te]?(P=P<<2|P>>>26,Q=Q<<2|Q>>>26):(P=P<<1|P>>>27,Q=Q<<1|Q>>>27),P&=-15,Q&=-15;var ne=t[P>>>28]|i[P>>>24&15]|r[P>>>20&15]|a[P>>>16&15]|n[P>>>12&15]|s[P>>>8&15]|o[P>>>4&15],H=u[Q>>>28]|l[Q>>>24&15]|f[Q>>>20&15]|c[Q>>>16&15]|p[Q>>>12&15]|m[Q>>>8&15]|v[Q>>>4&15];T=(H>>>16^ne)&65535,E[w++]=ne^T,E[w++]=H^T<<16}}return E}function ic(e,t,i,r){var a=e.length===32?3:9,n;a===3?n=r?[30,-2,-2]:[0,32,2]:n=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=t[0],u=t[1];s=(o>>>4^u)&252645135,u^=s,o^=s<<4,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,o=o<<1|o>>>31,u=u<<1|u>>>31;for(var l=0;l<a;l+=3){for(var f=n[l+1],c=n[l+2],p=n[l];p!=f;p+=c){var m=u^e[p],v=(u>>>4|u<<28)^e[p+1];s=o,o=u,u=s^(xg[m>>>24&63]|Ig[m>>>16&63]|bg[m>>>8&63]|wg[m&63]|Eg[v>>>24&63]|Sg[v>>>16&63]|Bg[v>>>8&63]|Tg[v&63])}s=o,o=u,u=s}o=o>>>1|o<<31,u=u>>>1|u<<31,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(o>>>4^u)&252645135,u^=s,o^=s<<4,i[0]=o,i[1]=u}function Fa(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),i="DES-"+t,r;e.decrypt?r=Pe.cipher.createDecipher(i,e.key):r=Pe.cipher.createCipher(i,e.key);var a=r.start;return r.start=function(n,s){var o=null;s instanceof Pe.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,a.call(r,s)},r}});var Ma=F((HC,nc)=>{"use strict";S();var mt=oe();ai();Jt();Ae();var Ng=mt.pkcs5=mt.pkcs5||{},lr;mt.util.isNodejs&&!mt.options.usePureJavaScript&&(lr=Le("crypto"));nc.exports=mt.pbkdf2=Ng.pbkdf2=function(e,t,i,r,a,n){if(typeof a=="function"&&(n=a,a=null),mt.util.isNodejs&&!mt.options.usePureJavaScript&&lr.pbkdf2&&(a===null||typeof a!="object")&&(lr.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),n?lr.pbkdf2Sync.length===4?lr.pbkdf2(e,t,i,r,function(T,U){if(T)return n(T);n(null,U.toString("binary"))}):lr.pbkdf2(e,t,i,r,a,function(T,U){if(T)return n(T);n(null,U.toString("binary"))}):lr.pbkdf2Sync.length===4?lr.pbkdf2Sync(e,t,i,r).toString("binary"):lr.pbkdf2Sync(e,t,i,r,a).toString("binary");if((typeof a>"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in mt.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=mt.md[a].create()}var s=a.digestLength;if(r>4294967295*s){var o=new Error("Derived key is too long.");if(n)return n(o);throw o}var u=Math.ceil(r/s),l=r-(u-1)*s,f=mt.hmac.create();f.start(a,e);var c="",p,m,v;if(!n){for(var C=1;C<=u;++C){f.start(null,null),f.update(t),f.update(mt.util.int32ToBytes(C)),p=v=f.digest().getBytes();for(var E=2;E<=i;++E)f.start(null,null),f.update(v),m=f.digest().getBytes(),p=mt.util.xorBytes(p,m,s),v=m;c+=C<u?p:p.substr(0,l)}return c}var C=1,E;function B(){if(C>u)return n(null,c);f.start(null,null),f.update(t),f.update(mt.util.int32ToBytes(C)),p=v=f.digest().getBytes(),E=2,w()}function w(){if(E<=i)return f.start(null,null),f.update(v),m=f.digest().getBytes(),p=mt.util.xorBytes(p,m,s),v=m,++E,mt.util.setImmediate(w);c+=C<u?p:p.substr(0,l),++C,B()}B()}});var ss=F((jC,fc)=>{"use strict";S();var $t=oe();Jt();Ae();var oc=fc.exports=$t.sha256=$t.sha256||{};$t.md.sha256=$t.md.algorithms.sha256=oc;oc.create=function(){uc||kg();var e=null,t=$t.util.createBuffer(),i=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=$t.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=$t.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),sc(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=$t.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(ns.substr(0,r.blockLength-s));for(var o,u,l=r.fullMessageLength[0]*8,f=0;f<r.fullMessageLength.length-1;++f)o=r.fullMessageLength[f+1]*8,u=o/4294967296>>>0,l+=u,a.putInt32(l>>>0),l=o>>>0;a.putInt32(l);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};sc(c,i,a);var p=$t.util.createBuffer();return p.putInt32(c.h0),p.putInt32(c.h1),p.putInt32(c.h2),p.putInt32(c.h3),p.putInt32(c.h4),p.putInt32(c.h5),p.putInt32(c.h6),p.putInt32(c.h7),p},r};var ns=null,uc=!1,lc=null;function kg(){ns="\x80",ns+=$t.util.fillString("\0",64),lc=[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],uc=!0}function sc(e,t,i){for(var r,a,n,s,o,u,l,f,c,p,m,v,C,E,B,w=i.length();w>=64;){for(l=0;l<16;++l)t[l]=i.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,a=t[l-15],a=(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[l]=r+t[l-7]+a+t[l-16]|0;for(f=e.h0,c=e.h1,p=e.h2,m=e.h3,v=e.h4,C=e.h5,E=e.h6,B=e.h7,l=0;l<64;++l)s=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),o=E^v&(C^E),n=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&c|p&(f^c),r=B+s+o+lc[l]+t[l],a=n+u,B=E,E=C,C=v,v=m+r>>>0,m=p,p=c,c=f,f=r+a>>>0;e.h0=e.h0+f|0,e.h1=e.h1+c|0,e.h2=e.h2+p|0,e.h3=e.h3+m|0,e.h4=e.h4+v|0,e.h5=e.h5+C|0,e.h6=e.h6+E|0,e.h7=e.h7+B|0,w-=64}}});var os=F((zC,cc)=>{"use strict";S();var Zt=oe();Ae();var qa=null;Zt.util.isNodejs&&!Zt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(qa=Le("crypto"));var Lg=cc.exports=Zt.prng=Zt.prng||{};Lg.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},i=e.md,r=new Array(32),a=0;a<32;++a)r[a]=i.create();t.pools=r,t.pool=0,t.generate=function(l,f){if(!f)return t.generateSync(l);var c=t.plugin.cipher,p=t.plugin.increment,m=t.plugin.formatKey,v=t.plugin.formatSeed,C=Zt.util.createBuffer();t.key=null,E();function E(B){if(B)return f(B);if(C.length()>=l)return f(null,C.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return Zt.util.nextTick(function(){n(E)});var w=c(t.key,t.seed);t.generated+=w.length,C.putBytes(w),t.key=m(c(t.key,p(t.seed))),t.seed=v(c(t.key,t.seed)),Zt.util.setImmediate(E)}},t.generateSync=function(l){var f=t.plugin.cipher,c=t.plugin.increment,p=t.plugin.formatKey,m=t.plugin.formatSeed;t.key=null;for(var v=Zt.util.createBuffer();v.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&s();var C=f(t.key,t.seed);t.generated+=C.length,v.putBytes(C),t.key=p(f(t.key,c(t.seed))),t.seed=m(f(t.key,t.seed))}return v.getBytes(l)};function n(l){if(t.pools[0].messageLength>=32)return o(),l();var f=32-t.pools[0].messageLength<<5;t.seedFile(f,function(c,p){if(c)return l(c);t.collect(p),o(),l()})}function s(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var f=1,c=0;c<32;++c)t.reseeds%f===0&&(l.update(t.pools[c].digest().getBytes()),t.pools[c].start()),f=f<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var p=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(p),t.generated=0}function u(l){var f=null,c=Zt.util.globalScope,p=c.crypto||c.msCrypto;p&&p.getRandomValues&&(f=function(P){return p.getRandomValues(P)});var m=Zt.util.createBuffer();if(f)for(;m.length()<l;){var v=Math.max(1,Math.min(l-m.length(),65536)/4),C=new Uint32Array(Math.floor(v));try{f(C);for(var E=0;E<C.length;++E)m.putInt32(C[E])}catch(P){if(!(typeof QuotaExceededError<"u"&&P instanceof QuotaExceededError))throw P}}if(m.length()<l)for(var B,w,T,U=Math.floor(Math.random()*65536);m.length()<l;){w=16807*(U&65535),B=16807*(U>>16),w+=(B&32767)<<16,w+=B>>15,w=(w&2147483647)+(w>>31),U=w&4294967295;for(var E=0;E<3;++E)T=U>>>(E<<3),T^=Math.floor(Math.random()*256),m.putByte(T&255)}return m.getBytes(l)}return qa?(t.seedFile=function(l,f){qa.randomBytes(l,function(c,p){if(c)return f(c);f(null,p.toString())})},t.seedFileSync=function(l){return qa.randomBytes(l).toString()}):(t.seedFile=function(l,f){try{f(null,u(l))}catch(c){f(c)}},t.seedFileSync=u),t.collect=function(l){for(var f=l.length,c=0;c<f;++c)t.pools[t.pool].update(l.substr(c,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,f){for(var c="",p=0;p<f;p+=8)c+=String.fromCharCode(l>>p&255);t.collect(c)},t.registerWorker=function(l){if(l===self)t.seedFile=function(c,p){function m(v){var C=v.data;C.forge&&C.forge.prng&&(self.removeEventListener("message",m),p(C.forge.prng.err,C.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:c}}})};else{var f=function(c){var p=c.data;p.forge&&p.forge.prng&&t.seedFile(p.forge.prng.needed,function(m,v){l.postMessage({forge:{prng:{err:m,bytes:v}}})})};l.addEventListener("message",f)}},t}});var Pt=F((WC,us)=>{"use strict";S();var je=oe();Ir();ss();os();Ae();(function(){if(je.random&&je.random.getBytes){us.exports=je.random;return}(function(e){var t={},i=new Array(4),r=je.util.createBuffer();t.formatKey=function(c){var p=je.util.createBuffer(c);return c=new Array(4),c[0]=p.getInt32(),c[1]=p.getInt32(),c[2]=p.getInt32(),c[3]=p.getInt32(),je.aes._expandKey(c,!1)},t.formatSeed=function(c){var p=je.util.createBuffer(c);return c=new Array(4),c[0]=p.getInt32(),c[1]=p.getInt32(),c[2]=p.getInt32(),c[3]=p.getInt32(),c},t.cipher=function(c,p){return je.aes._updateBlock(c,p,i,!1),r.putInt32(i[0]),r.putInt32(i[1]),r.putInt32(i[2]),r.putInt32(i[3]),r.getBytes()},t.increment=function(c){return++c[3],c},t.md=je.md.sha256;function a(){var c=je.prng.create(t);return c.getBytes=function(p,m){return c.generate(p,m)},c.getBytesSync=function(p){return c.generate(p)},c}var n=a(),s=null,o=je.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(s=function(c){return u.getRandomValues(c)}),je.options.usePureJavaScript||!je.util.isNodejs&&!s){if(typeof window>"u"||window.document,n.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var f in navigator)try{typeof navigator[f]=="string"&&(l+=navigator[f])}catch{}n.collect(l),l=null}e&&(e().mousemove(function(c){n.collectInt(c.clientX,16),n.collectInt(c.clientY,16)}),e().keypress(function(c){n.collectInt(c.charCode,8)}))}if(!je.random)je.random=n;else for(var f in n)je.random[f]=n[f];je.random.createInstance=a,us.exports=je.random})(typeof jQuery<"u"?jQuery:null)})()});var fs=F(($C,dc)=>{"use strict";S();var Bt=oe();Ae();var ls=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],hc=[1,2,3,5],Rg=function(e,t){return e<<t&65535|(e&65535)>>16-t},Dg=function(e,t){return(e&65535)>>t|e<<16-t&65535};dc.exports=Bt.rc2=Bt.rc2||{};Bt.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Bt.util.createBuffer(e)),t=t||128;var i=e,r=e.length(),a=t,n=Math.ceil(a/8),s=255>>(a&7),o;for(o=r;o<128;o++)i.putByte(ls[i.at(o-1)+i.at(o-r)&255]);for(i.setAt(128-n,ls[i.at(128-n)&s]),o=127-n;o>=0;o--)i.setAt(o,ls[i.at(o+1)^i.at(o+n)]);return i};var pc=function(e,t,i){var r=!1,a=null,n=null,s=null,o,u,l,f,c=[];for(e=Bt.rc2.expandKey(e,t),l=0;l<64;l++)c.push(e.getInt16Le());i?(o=function(v){for(l=0;l<4;l++)v[l]+=c[f]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),v[l]=Rg(v[l],hc[l]),f++},u=function(v){for(l=0;l<4;l++)v[l]+=c[v[(l+3)%4]&63]}):(o=function(v){for(l=3;l>=0;l--)v[l]=Dg(v[l],hc[l]),v[l]-=c[f]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),f--},u=function(v){for(l=3;l>=0;l--)v[l]-=c[v[(l+3)%4]&63]});var p=function(v){var C=[];for(l=0;l<4;l++){var E=a.getInt16Le();s!==null&&(i?E^=s.getInt16Le():s.putInt16Le(E)),C.push(E&65535)}f=i?0:63;for(var B=0;B<v.length;B++)for(var w=0;w<v[B][0];w++)v[B][1](C);for(l=0;l<4;l++)s!==null&&(i?s.putInt16Le(C[l]):C[l]^=s.getInt16Le()),n.putInt16Le(C[l])},m=null;return m={start:function(v,C){v&&typeof v=="string"&&(v=Bt.util.createBuffer(v)),r=!1,a=Bt.util.createBuffer(),n=C||new Bt.util.createBuffer,s=v,m.output=n},update:function(v){for(r||a.putBuffer(v);a.length()>=8;)p([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(v){var C=!0;if(i)if(v)C=v(8,a,!i);else{var E=a.length()===8?8:8-a.length();a.fillWithByte(E,E)}if(C&&(r=!0,m.update()),!i&&(C=a.length()===0,C))if(v)C=v(8,n,!i);else{var B=n.length(),w=n.at(B-1);w>B?C=!1:n.truncate(w)}return C}},m};Bt.rc2.startEncrypting=function(e,t,i){var r=Bt.rc2.createEncryptionCipher(e,128);return r.start(t,i),r};Bt.rc2.createEncryptionCipher=function(e,t){return pc(e,t,!0)};Bt.rc2.startDecrypting=function(e,t,i){var r=Bt.rc2.createDecryptionCipher(e,128);return r.start(t,i),r};Bt.rc2.createDecryptionCipher=function(e,t){return pc(e,t,!1)}});var Yi=F((eE,xc)=>{"use strict";S();var cs=oe();xc.exports=cs.jsbn=cs.jsbn||{};var fr,Pg=0xdeadbeefcafe,gc=(Pg&16777215)==15715070;function N(e,t,i){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,i):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}cs.jsbn.BigInteger=N;function Ce(){return new N(null)}function Qg(e,t,i,r,a,n){for(;--n>=0;){var s=t*this.data[e++]+i.data[r]+a;a=Math.floor(s/67108864),i.data[r++]=s&67108863}return a}function Ug(e,t,i,r,a,n){for(var s=t&32767,o=t>>15;--n>=0;){var u=this.data[e]&32767,l=this.data[e++]>>15,f=o*u+l*s;u=s*u+((f&32767)<<15)+i.data[r]+(a&1073741823),a=(u>>>30)+(f>>>15)+o*l+(a>>>30),i.data[r++]=u&1073741823}return a}function vc(e,t,i,r,a,n){for(var s=t&16383,o=t>>14;--n>=0;){var u=this.data[e]&16383,l=this.data[e++]>>14,f=o*u+l*s;u=s*u+((f&16383)<<14)+i.data[r]+a,a=(u>>28)+(f>>14)+o*l,i.data[r++]=u&268435455}return a}typeof navigator>"u"?(N.prototype.am=vc,fr=28):gc&&navigator.appName=="Microsoft Internet Explorer"?(N.prototype.am=Ug,fr=30):gc&&navigator.appName!="Netscape"?(N.prototype.am=Qg,fr=26):(N.prototype.am=vc,fr=28);N.prototype.DB=fr;N.prototype.DM=(1<<fr)-1;N.prototype.DV=1<<fr;var hs=52;N.prototype.FV=Math.pow(2,hs);N.prototype.F1=hs-fr;N.prototype.F2=2*fr-hs;var Og="0123456789abcdefghijklmnopqrstuvwxyz",Ka=new Array,si,Qt;si=48;for(Qt=0;Qt<=9;++Qt)Ka[si++]=Qt;si=97;for(Qt=10;Qt<36;++Qt)Ka[si++]=Qt;si=65;for(Qt=10;Qt<36;++Qt)Ka[si++]=Qt;function yc(e){return Og.charAt(e)}function mc(e,t){var i=Ka[e.charCodeAt(t)];return i??-1}function Vg(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function Fg(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function br(e){var t=Ce();return t.fromInt(e),t}function Mg(e,t){var i;if(t==16)i=4;else if(t==8)i=3;else if(t==256)i=8;else if(t==2)i=1;else if(t==32)i=5;else if(t==4)i=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,a=!1,n=0;--r>=0;){var s=i==8?e[r]&255:mc(e,r);if(s<0){e.charAt(r)=="-"&&(a=!0);continue}a=!1,n==0?this.data[this.t++]=s:n+i>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this.data[this.t++]=s>>this.DB-n):this.data[this.t-1]|=s<<n,n+=i,n>=this.DB&&(n-=this.DB)}i==8&&e[0]&128&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),a&&N.ZERO.subTo(this,this)}function qg(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function Kg(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var i=(1<<t)-1,r,a=!1,n="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(a=!0,n=yc(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&i,o<=0&&(o+=this.DB,--s)),r>0&&(a=!0),a&&(n+=yc(r));return a?n:"0"}function Hg(){var e=Ce();return N.ZERO.subTo(this,e),e}function Gg(){return this.s<0?this.negate():this}function jg(e){var t=this.s-e.s;if(t!=0)return t;var i=this.t;if(t=i-e.t,t!=0)return this.s<0?-t:t;for(;--i>=0;)if((t=this.data[i]-e.data[i])!=0)return t;return 0}function Ha(e){var t=1,i;return(i=e>>>16)!=0&&(e=i,t+=16),(i=e>>8)!=0&&(e=i,t+=8),(i=e>>4)!=0&&(e=i,t+=4),(i=e>>2)!=0&&(e=i,t+=2),(i=e>>1)!=0&&(e=i,t+=1),t}function Yg(){return this.t<=0?0:this.DB*(this.t-1)+Ha(this.data[this.t-1]^this.s&this.DM)}function zg(e,t){var i;for(i=this.t-1;i>=0;--i)t.data[i+e]=this.data[i];for(i=e-1;i>=0;--i)t.data[i]=0;t.t=this.t+e,t.s=this.s}function Jg(e,t){for(var i=e;i<this.t;++i)t.data[i-e]=this.data[i];t.t=Math.max(this.t-e,0),t.s=this.s}function Wg(e,t){var i=e%this.DB,r=this.DB-i,a=(1<<r)-1,n=Math.floor(e/this.DB),s=this.s<<i&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+n+1]=this.data[o]>>r|s,s=(this.data[o]&a)<<i;for(o=n-1;o>=0;--o)t.data[o]=0;t.data[n]=s,t.t=this.t+n+1,t.s=this.s,t.clamp()}function Xg(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t){t.t=0;return}var r=e%this.DB,a=this.DB-r,n=(1<<r)-1;t.data[0]=this.data[i]>>r;for(var s=i+1;s<this.t;++s)t.data[s-i-1]|=(this.data[s]&n)<<a,t.data[s-i]=this.data[s]>>r;r>0&&(t.data[this.t-i-1]|=(this.s&n)<<a),t.t=this.t-i,t.clamp()}function $g(e,t){for(var i=0,r=0,a=Math.min(e.t,this.t);i<a;)r+=this.data[i]-e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;i<this.t;)r+=this.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<e.t;)r-=e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[i++]=this.DV+r:r>0&&(t.data[i++]=r),t.t=i,t.clamp()}function Zg(e,t){var i=this.abs(),r=e.abs(),a=i.t;for(t.t=a+r.t;--a>=0;)t.data[a]=0;for(a=0;a<r.t;++a)t.data[a+i.t]=i.am(0,r.data[a],t,a,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&N.ZERO.subTo(t,t)}function ev(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e.data[i]=0;for(i=0;i<t.t-1;++i){var r=t.am(i,t.data[i],e,2*i,0,1);(e.data[i+t.t]+=t.am(i+1,2*t.data[i],e,2*i+1,r,t.t-i-1))>=t.DV&&(e.data[i+t.t]-=t.DV,e.data[i+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(i,t.data[i],e,2*i,0,1)),e.s=0,e.clamp()}function tv(e,t,i){var r=e.abs();if(!(r.t<=0)){var a=this.abs();if(a.t<r.t){t?.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=Ce());var n=Ce(),s=this.s,o=e.s,u=this.DB-Ha(r.data[r.t-1]);u>0?(r.lShiftTo(u,n),a.lShiftTo(u,i)):(r.copyTo(n),a.copyTo(i));var l=n.t,f=n.data[l-1];if(f!=0){var c=f*(1<<this.F1)+(l>1?n.data[l-2]>>this.F2:0),p=this.FV/c,m=(1<<this.F1)/c,v=1<<this.F2,C=i.t,E=C-l,B=t??Ce();for(n.dlShiftTo(E,B),i.compareTo(B)>=0&&(i.data[i.t++]=1,i.subTo(B,i)),N.ONE.dlShiftTo(l,B),B.subTo(n,n);n.t<l;)n.data[n.t++]=0;for(;--E>=0;){var w=i.data[--C]==f?this.DM:Math.floor(i.data[C]*p+(i.data[C-1]+v)*m);if((i.data[C]+=n.am(0,w,i,E,0,l))<w)for(n.dlShiftTo(E,B),i.subTo(B,i);i.data[C]<--w;)i.subTo(B,i)}t!=null&&(i.drShiftTo(l,t),s!=o&&N.ZERO.subTo(t,t)),i.t=l,i.clamp(),u>0&&i.rShiftTo(u,i),s<0&&N.ZERO.subTo(i,i)}}}function rv(e){var t=Ce();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(N.ZERO)>0&&e.subTo(t,t),t}function Or(e){this.m=e}function iv(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function av(e){return e}function nv(e){e.divRemTo(this.m,null,e)}function sv(e,t,i){e.multiplyTo(t,i),this.reduce(i)}function ov(e,t){e.squareTo(t),this.reduce(t)}Or.prototype.convert=iv;Or.prototype.revert=av;Or.prototype.reduce=nv;Or.prototype.mulTo=sv;Or.prototype.sqrTo=ov;function uv(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Vr(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function lv(e){var t=Ce();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(N.ZERO)>0&&this.m.subTo(t,t),t}function fv(e){var t=Ce();return e.copyTo(t),this.reduce(t),t}function cv(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=e.data[t]&32767,r=i*this.mpl+((i*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(i=t+this.m.t,e.data[i]+=this.m.am(0,r,e,t,0,this.m.t);e.data[i]>=e.DV;)e.data[i]-=e.DV,e.data[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function hv(e,t){e.squareTo(t),this.reduce(t)}function pv(e,t,i){e.multiplyTo(t,i),this.reduce(i)}Vr.prototype.convert=lv;Vr.prototype.revert=fv;Vr.prototype.reduce=cv;Vr.prototype.mulTo=pv;Vr.prototype.sqrTo=hv;function dv(){return(this.t>0?this.data[0]&1:this.s)==0}function gv(e,t){if(e>4294967295||e<1)return N.ONE;var i=Ce(),r=Ce(),a=t.convert(this),n=Ha(e)-1;for(a.copyTo(i);--n>=0;)if(t.sqrTo(i,r),(e&1<<n)>0)t.mulTo(r,a,i);else{var s=i;i=r,r=s}return t.revert(i)}function vv(e,t){var i;return e<256||t.isEven()?i=new Or(t):i=new Vr(t),this.exp(e,i)}N.prototype.copyTo=Vg;N.prototype.fromInt=Fg;N.prototype.fromString=Mg;N.prototype.clamp=qg;N.prototype.dlShiftTo=zg;N.prototype.drShiftTo=Jg;N.prototype.lShiftTo=Wg;N.prototype.rShiftTo=Xg;N.prototype.subTo=$g;N.prototype.multiplyTo=Zg;N.prototype.squareTo=ev;N.prototype.divRemTo=tv;N.prototype.invDigit=uv;N.prototype.isEven=dv;N.prototype.exp=gv;N.prototype.toString=Kg;N.prototype.negate=Hg;N.prototype.abs=Gg;N.prototype.compareTo=jg;N.prototype.bitLength=Yg;N.prototype.mod=rv;N.prototype.modPowInt=vv;N.ZERO=br(0);N.ONE=br(1);function yv(){var e=Ce();return this.copyTo(e),e}function mv(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Av(){return this.t==0?this.s:this.data[0]<<24>>24}function Cv(){return this.t==0?this.s:this.data[0]<<16>>16}function Ev(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function xv(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Sv(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),i=Math.pow(e,t),r=br(i),a=Ce(),n=Ce(),s="";for(this.divRemTo(r,a,n);a.signum()>0;)s=(i+n.intValue()).toString(e).substr(1)+s,a.divRemTo(r,a,n);return n.intValue().toString(e)+s}function Iv(e,t){this.fromInt(0),t==null&&(t=10);for(var i=this.chunkSize(t),r=Math.pow(t,i),a=!1,n=0,s=0,o=0;o<e.length;++o){var u=mc(e,o);if(u<0){e.charAt(o)=="-"&&this.signum()==0&&(a=!0);continue}s=t*s+u,++n>=i&&(this.dMultiply(r),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),a&&N.ZERO.subTo(this,this)}function Bv(e,t,i){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(N.ONE.shiftLeft(e-1),ps,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(N.ONE.shiftLeft(e-1),this);else{var r=new Array,a=e&7;r.length=(e>>3)+1,t.nextBytes(r),a>0?r[0]&=(1<<a)-1:r[0]=0,this.fromString(r,256)}}function bv(){var e=this.t,t=new Array;t[0]=this.s;var i=this.DB-e*this.DB%8,r,a=0;if(e-- >0)for(i<this.DB&&(r=this.data[e]>>i)!=(this.s&this.DM)>>i&&(t[a++]=r|this.s<<this.DB-i);e>=0;)i<8?(r=(this.data[e]&(1<<i)-1)<<8-i,r|=this.data[--e]>>(i+=this.DB-8)):(r=this.data[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),r&128&&(r|=-256),a==0&&(this.s&128)!=(r&128)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t}function Tv(e){return this.compareTo(e)==0}function wv(e){return this.compareTo(e)<0?this:e}function _v(e){return this.compareTo(e)>0?this:e}function Nv(e,t,i){var r,a,n=Math.min(e.t,this.t);for(r=0;r<n;++r)i.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(a=e.s&this.DM,r=n;r<this.t;++r)i.data[r]=t(this.data[r],a);i.t=this.t}else{for(a=this.s&this.DM,r=n;r<e.t;++r)i.data[r]=t(a,e.data[r]);i.t=e.t}i.s=t(this.s,e.s),i.clamp()}function kv(e,t){return e&t}function Lv(e){var t=Ce();return this.bitwiseTo(e,kv,t),t}function ps(e,t){return e|t}function Rv(e){var t=Ce();return this.bitwiseTo(e,ps,t),t}function Ac(e,t){return e^t}function Dv(e){var t=Ce();return this.bitwiseTo(e,Ac,t),t}function Cc(e,t){return e&~t}function Pv(e){var t=Ce();return this.bitwiseTo(e,Cc,t),t}function Qv(){for(var e=Ce(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Uv(e){var t=Ce();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Ov(e){var t=Ce();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Vv(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function Fv(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+Vv(this.data[e]);return this.s<0?this.t*this.DB:-1}function Mv(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function qv(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=Mv(this.data[i]^t);return e}function Kv(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function Hv(e,t){var i=N.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i}function Gv(e){return this.changeBit(e,ps)}function jv(e){return this.changeBit(e,Cc)}function Yv(e){return this.changeBit(e,Ac)}function zv(e,t){for(var i=0,r=0,a=Math.min(e.t,this.t);i<a;)r+=this.data[i]+e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;i<this.t;)r+=this.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<e.t;)r+=e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[i++]=r:r<-1&&(t.data[i++]=this.DV+r),t.t=i,t.clamp()}function Jv(e){var t=Ce();return this.addTo(e,t),t}function Wv(e){var t=Ce();return this.subTo(e,t),t}function Xv(e){var t=Ce();return this.multiplyTo(e,t),t}function $v(e){var t=Ce();return this.divRemTo(e,t,null),t}function Zv(e){var t=Ce();return this.divRemTo(e,null,t),t}function ey(e){var t=Ce(),i=Ce();return this.divRemTo(e,t,i),new Array(t,i)}function ty(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function ry(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function ji(){}function Ec(e){return e}function iy(e,t,i){e.multiplyTo(t,i)}function ay(e,t){e.squareTo(t)}ji.prototype.convert=Ec;ji.prototype.revert=Ec;ji.prototype.mulTo=iy;ji.prototype.sqrTo=ay;function ny(e){return this.exp(e,new ji)}function sy(e,t,i){var r=Math.min(this.t+e.t,t);for(i.s=0,i.t=r;r>0;)i.data[--r]=0;var a;for(a=i.t-this.t;r<a;++r)i.data[r+this.t]=this.am(0,e.data[r],i,r,0,this.t);for(a=Math.min(e.t,t);r<a;++r)this.am(0,e.data[r],i,r,0,t-r);i.clamp()}function oy(e,t,i){--t;var r=i.t=this.t+e.t-t;for(i.s=0;--r>=0;)i.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)i.data[this.t+r-t]=this.am(t-r,e.data[r],i,0,0,this.t+r-t);i.clamp(),i.drShiftTo(1,i)}function oi(e){this.r2=Ce(),this.q3=Ce(),N.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function uy(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Ce();return e.copyTo(t),this.reduce(t),t}function ly(e){return e}function fy(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function cy(e,t){e.squareTo(t),this.reduce(t)}function hy(e,t,i){e.multiplyTo(t,i),this.reduce(i)}oi.prototype.convert=uy;oi.prototype.revert=ly;oi.prototype.reduce=fy;oi.prototype.mulTo=hy;oi.prototype.sqrTo=cy;function py(e,t){var i=e.bitLength(),r,a=br(1),n;if(i<=0)return a;i<18?r=1:i<48?r=3:i<144?r=4:i<768?r=5:r=6,i<8?n=new Or(t):t.isEven()?n=new oi(t):n=new Vr(t);var s=new Array,o=3,u=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=Ce();for(n.sqrTo(s[1],f);o<=l;)s[o]=Ce(),n.mulTo(f,s[o-2],s[o]),o+=2}var c=e.t-1,p,m=!0,v=Ce(),C;for(i=Ha(e.data[c])-1;c>=0;){for(i>=u?p=e.data[c]>>i-u&l:(p=(e.data[c]&(1<<i+1)-1)<<u-i,c>0&&(p|=e.data[c-1]>>this.DB+i-u)),o=r;!(p&1);)p>>=1,--o;if((i-=o)<0&&(i+=this.DB,--c),m)s[p].copyTo(a),m=!1;else{for(;o>1;)n.sqrTo(a,v),n.sqrTo(v,a),o-=2;o>0?n.sqrTo(a,v):(C=a,a=v,v=C),n.mulTo(v,s[p],a)}for(;c>=0&&!(e.data[c]&1<<i);)n.sqrTo(a,v),C=a,a=v,v=C,--i<0&&(i=this.DB-1,--c)}return n.revert(a)}function dy(e){var t=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();if(t.compareTo(i)<0){var r=t;t=i,i=r}var a=t.getLowestSetBit(),n=i.getLowestSetBit();if(n<0)return t;for(a<n&&(n=a),n>0&&(t.rShiftTo(n,t),i.rShiftTo(n,i));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=i.getLowestSetBit())>0&&i.rShiftTo(a,i),t.compareTo(i)>=0?(t.subTo(i,t),t.rShiftTo(1,t)):(i.subTo(t,i),i.rShiftTo(1,i));return n>0&&i.lShiftTo(n,i),i}function gy(e){if(e<=0)return 0;var t=this.DV%e,i=this.s<0?e-1:0;if(this.t>0)if(t==0)i=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)i=(t*i+this.data[r])%e;return i}function vy(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return N.ZERO;for(var i=e.clone(),r=this.clone(),a=br(1),n=br(0),s=br(0),o=br(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),t?((!a.isEven()||!n.isEven())&&(a.addTo(this,a),n.subTo(e,n)),a.rShiftTo(1,a)):n.isEven()||n.subTo(e,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);i.compareTo(r)>=0?(i.subTo(r,i),t&&a.subTo(s,a),n.subTo(o,n)):(r.subTo(i,r),t&&s.subTo(a,s),o.subTo(n,o))}if(r.compareTo(N.ONE)!=0)return N.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var jt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],yy=(1<<26)/jt[jt.length-1];function my(e){var t,i=this.abs();if(i.t==1&&i.data[0]<=jt[jt.length-1]){for(t=0;t<jt.length;++t)if(i.data[0]==jt[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<jt.length;){for(var r=jt[t],a=t+1;a<jt.length&&r<yy;)r*=jt[a++];for(r=i.modInt(r);t<a;)if(r%jt[t++]==0)return!1}return i.millerRabin(e)}function Ay(e){var t=this.subtract(N.ONE),i=t.getLowestSetBit();if(i<=0)return!1;for(var r=t.shiftRight(i),a=Cy(),n,s=0;s<e;++s){do n=new N(this.bitLength(),a);while(n.compareTo(N.ONE)<=0||n.compareTo(t)>=0);var o=n.modPow(r,this);if(o.compareTo(N.ONE)!=0&&o.compareTo(t)!=0){for(var u=1;u++<i&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(N.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function Cy(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}N.prototype.chunkSize=Ev;N.prototype.toRadix=Sv;N.prototype.fromRadix=Iv;N.prototype.fromNumber=Bv;N.prototype.bitwiseTo=Nv;N.prototype.changeBit=Hv;N.prototype.addTo=zv;N.prototype.dMultiply=ty;N.prototype.dAddOffset=ry;N.prototype.multiplyLowerTo=sy;N.prototype.multiplyUpperTo=oy;N.prototype.modInt=gy;N.prototype.millerRabin=Ay;N.prototype.clone=yv;N.prototype.intValue=mv;N.prototype.byteValue=Av;N.prototype.shortValue=Cv;N.prototype.signum=xv;N.prototype.toByteArray=bv;N.prototype.equals=Tv;N.prototype.min=wv;N.prototype.max=_v;N.prototype.and=Lv;N.prototype.or=Rv;N.prototype.xor=Dv;N.prototype.andNot=Pv;N.prototype.not=Qv;N.prototype.shiftLeft=Uv;N.prototype.shiftRight=Ov;N.prototype.getLowestSetBit=Fv;N.prototype.bitCount=qv;N.prototype.testBit=Kv;N.prototype.setBit=Gv;N.prototype.clearBit=jv;N.prototype.flipBit=Yv;N.prototype.add=Jv;N.prototype.subtract=Wv;N.prototype.multiply=Xv;N.prototype.divide=$v;N.prototype.remainder=Zv;N.prototype.divideAndRemainder=ey;N.prototype.modPow=py;N.prototype.modInverse=vy;N.prototype.pow=ny;N.prototype.gcd=dy;N.prototype.isProbablePrime=my});var ui=F((rE,bc)=>{"use strict";S();var er=oe();Jt();Ae();var Ic=bc.exports=er.sha1=er.sha1||{};er.md.sha1=er.md.algorithms.sha1=Ic;Ic.create=function(){Bc||Ey();var e=null,t=er.util.createBuffer(),i=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=er.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=er.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),Sc(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=er.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(ds.substr(0,r.blockLength-s));for(var o,u,l=r.fullMessageLength[0]*8,f=0;f<r.fullMessageLength.length-1;++f)o=r.fullMessageLength[f+1]*8,u=o/4294967296>>>0,l+=u,a.putInt32(l>>>0),l=o>>>0;a.putInt32(l);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};Sc(c,i,a);var p=er.util.createBuffer();return p.putInt32(c.h0),p.putInt32(c.h1),p.putInt32(c.h2),p.putInt32(c.h3),p.putInt32(c.h4),p},r};var ds=null,Bc=!1;function Ey(){ds="\x80",ds+=er.util.fillString("\0",64),Bc=!0}function Sc(e,t,i){for(var r,a,n,s,o,u,l,f,c=i.length();c>=64;){for(a=e.h0,n=e.h1,s=e.h2,o=e.h3,u=e.h4,f=0;f<16;++f)r=i.getInt32(),t[f]=r,l=o^n&(s^o),r=(a<<5|a>>>27)+l+u+1518500249+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<20;++f)r=t[f-3]^t[f-8]^t[f-14]^t[f-16],r=r<<1|r>>>31,t[f]=r,l=o^n&(s^o),r=(a<<5|a>>>27)+l+u+1518500249+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<32;++f)r=t[f-3]^t[f-8]^t[f-14]^t[f-16],r=r<<1|r>>>31,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+1859775393+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<40;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+1859775393+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<60;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n&s|o&(n^s),r=(a<<5|a>>>27)+l+u+2400959708+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<80;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+3395469782+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;e.h0=e.h0+a|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+u|0,c-=64}}});var gs=F((aE,wc)=>{"use strict";S();var tr=oe();Ae();Pt();ui();var Tc=wc.exports=tr.pkcs1=tr.pkcs1||{};Tc.encode_rsa_oaep=function(e,t,i){var r,a,n,s;typeof i=="string"?(r=i,a=arguments[3]||void 0,n=arguments[4]||void 0):i&&(r=i.label||void 0,a=i.seed||void 0,n=i.md||void 0,i.mgf1&&i.mgf1.md&&(s=i.mgf1.md)),n?n.start():n=tr.md.sha1.create(),s||(s=n);var o=Math.ceil(e.n.bitLength()/8),u=o-2*n.digestLength-2;if(t.length>u){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=u,l}r||(r=""),n.update(r,"raw");for(var f=n.digest(),c="",p=u-t.length,m=0;m<p;m++)c+="\0";var v=f.getBytes()+c+""+t;if(!a)a=tr.random.getBytes(n.digestLength);else if(a.length!==n.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=a.length,l.digestLength=n.digestLength,l}var C=Ga(a,o-n.digestLength-1,s),E=tr.util.xorBytes(v,C,v.length),B=Ga(E,n.digestLength,s),w=tr.util.xorBytes(a,B,a.length);return"\0"+w+E};Tc.decode_rsa_oaep=function(e,t,i){var r,a,n;typeof i=="string"?(r=i,a=arguments[3]||void 0):i&&(r=i.label||void 0,a=i.md||void 0,i.mgf1&&i.mgf1.md&&(n=i.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=t.length,E.expectedLength=s,E}if(a===void 0?a=tr.md.sha1.create():a.start(),n||(n=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),a.update(r,"raw");for(var o=a.digest().getBytes(),u=t.charAt(0),l=t.substring(1,a.digestLength+1),f=t.substring(1+a.digestLength),c=Ga(f,a.digestLength,n),p=tr.util.xorBytes(l,c,l.length),m=Ga(p,s-a.digestLength-1,n),v=tr.util.xorBytes(f,m,f.length),C=v.substring(0,a.digestLength),E=u!=="\0",B=0;B<a.digestLength;++B)E|=o.charAt(B)!==C.charAt(B);for(var w=1,T=a.digestLength,U=a.digestLength;U<v.length;U++){var P=v.charCodeAt(U),Q=P&1^1,te=w?65534:0;E|=P&te,w=w&Q,T+=w}if(E||v.charCodeAt(T)!==1)throw new Error("Invalid RSAES-OAEP padding.");return v.substring(T+1)};function Ga(e,t,i){i||(i=tr.md.sha1.create());for(var r="",a=Math.ceil(t/i.digestLength),n=0;n<a;++n){var s=String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255);i.start(),i.update(e+s),r+=i.digest().getBytes()}return r.substring(0,t)}});var ys=F((sE,vs)=>{"use strict";S();var Tr=oe();Ae();Yi();Pt();(function(){if(Tr.prime){vs.exports=Tr.prime;return}var e=vs.exports=Tr.prime=Tr.prime||{},t=Tr.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var a=function(c,p){return c|p};e.generateProbablePrime=function(c,p,m){typeof p=="function"&&(m=p,p={}),p=p||{};var v=p.algorithm||"PRIMEINC";typeof v=="string"&&(v={name:v}),v.options=v.options||{};var C=p.prng||Tr.random,E={nextBytes:function(B){for(var w=C.getBytesSync(B.length),T=0;T<B.length;++T)B[T]=w.charCodeAt(T)}};if(v.name==="PRIMEINC")return n(c,E,v.options,m);throw new Error("Invalid prime generation algorithm: "+v.name)};function n(c,p,m,v){return"workers"in m?u(c,p,m,v):s(c,p,m,v)}function s(c,p,m,v){var C=l(c,p),E=0,B=f(C.bitLength());"millerRabinTests"in m&&(B=m.millerRabinTests);var w=10;"maxBlockTime"in m&&(w=m.maxBlockTime),o(C,c,p,E,B,w,v)}function o(c,p,m,v,C,E,B){var w=+new Date;do{if(c.bitLength()>p&&(c=l(p,m)),c.isProbablePrime(C))return B(null,c);c.dAddOffset(i[v++%8],0)}while(E<0||+new Date-w<E);Tr.util.setImmediate(function(){o(c,p,m,v,C,E,B)})}function u(c,p,m,v){if(typeof Worker>"u")return s(c,p,m,v);var C=l(c,p),E=m.workers,B=m.workLoad||100,w=B*30/8,T=m.workerScript||"forge/prime.worker.js";if(E===-1)return Tr.util.estimateCores(function(P,Q){P&&(Q=2),E=Q-1,U()});U();function U(){E=Math.max(1,E);for(var P=[],Q=0;Q<E;++Q)P[Q]=new Worker(T);for(var te=E,Q=0;Q<E;++Q)P[Q].addEventListener("message",H);var ne=!1;function H(z){if(!ne){--te;var Y=z.data;if(Y.found){for(var re=0;re<P.length;++re)P[re].terminate();return ne=!0,v(null,new t(Y.prime,16))}C.bitLength()>c&&(C=l(c,p));var ye=C.toString(16);z.target.postMessage({hex:ye,workLoad:B}),C.dAddOffset(w,0)}}}}function l(c,p){var m=new t(c,p),v=c-1;return m.testBit(v)||m.bitwiseTo(t.ONE.shiftLeft(v),a,m),m.dAddOffset(31-m.mod(r).byteValue(),0),m}function f(c){return c<=100?27:c<=150?18:c<=200?15:c<=250?12:c<=300?9:c<=350?8:c<=400?7:c<=500?6:c<=600?5:c<=800?4:c<=1250?3:2}})()});var zi=F((uE,Pc)=>{"use strict";S();var W=oe();Gt();Yi();Br();gs();ys();Pt();Ae();typeof ge>"u"&&(ge=W.jsbn.BigInteger);var ge,ms=W.util.isNodejs?Le("crypto"):null,b=W.asn1,Ut=W.util;W.pki=W.pki||{};Pc.exports=W.pki.rsa=W.rsa=W.rsa||{};var ae=W.pki,xy=[6,4,2,4,2,4,6,2],Sy={name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Iy={name:"RSAPrivateKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},By={name:"RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},by=W.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Ty={name:"DigestInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:b.Class.UNIVERSAL,type:b.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wy=function(e){var t;if(e.algorithm in ae.oids)t=ae.oids[e.algorithm];else{var i=new Error("Unknown message digest algorithm.");throw i.algorithm=e.algorithm,i}var r=b.oidToDer(t).getBytes(),a=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),n=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);n.value.push(b.create(b.Class.UNIVERSAL,b.Type.OID,!1,r)),n.value.push(b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,""));var s=b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,e.digest().getBytes());return a.value.push(n),a.value.push(s),b.toDer(a).getBytes()},Rc=function(e,t,i){if(i)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(ge.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(ge.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new ge(W.util.bytesToHex(W.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(ge.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var a=e.mod(t.p).modPow(t.dP,t.p),n=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(n)<0;)a=a.add(t.p);var s=a.subtract(n).multiply(t.qInv).mod(t.p).multiply(t.q).add(n);return s=s.multiply(r.modInverse(t.n)).mod(t.n),s};ae.rsa.encrypt=function(e,t,i){var r=i,a,n=Math.ceil(t.n.bitLength()/8);i!==!1&&i!==!0?(r=i===2,a=Dc(e,t,i)):(a=W.util.createBuffer(),a.putBytes(e));for(var s=new ge(a.toHex(),16),o=Rc(s,t,r),u=o.toString(16),l=W.util.createBuffer(),f=n-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return l.putBytes(W.util.hexToBytes(u)),l.getBytes()};ae.rsa.decrypt=function(e,t,i,r){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var n=new Error("Encrypted message length is invalid.");throw n.length=e.length,n.expected=a,n}var s=new ge(W.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=Rc(s,t,i),u=o.toString(16),l=W.util.createBuffer(),f=a-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return l.putBytes(W.util.hexToBytes(u)),r!==!1?ja(l.getBytes(),t,i):l.getBytes()};ae.rsa.createKeyPairGenerationState=function(e,t,i){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,i=i||{};var r=i.prng||W.random,a={nextBytes:function(o){for(var u=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=u.charCodeAt(l)}},n=i.algorithm||"PRIMEINC",s;if(n==="PRIMEINC")s={algorithm:n,state:0,bits:e,rng:a,eInt:t||65537,e:new ge(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+n);return s};ae.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var i=new ge(null);i.fromInt(30);for(var r=0,a=function(c,p){return c|p},n=+new Date,s,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var u=e.p===null?e.pBits:e.qBits,l=u-1;e.pqState===0?(e.num=new ge(u,e.rng),e.num.testBit(l)||e.num.bitwiseTo(ge.ONE.shiftLeft(l),a,e.num),e.num.dAddOffset(31-e.num.mod(i).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(Ny(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(xy[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(ge.ONE),e.q1=e.q.subtract(ge.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(ge.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var f=e.e.modInverse(e.phi);e.keys={privateKey:ae.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:ae.rsa.setPublicKey(e.n,e.e)}}s=+new Date,o+=s-n,n=s}return e.keys!==null};ae.rsa.generateKeyPair=function(e,t,i,r){if(arguments.length===1?typeof e=="object"?(i=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(i=t,t=void 0):(i=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof i=="function"&&(r=i,i=void 0):(r=i,i=t,t=void 0)),i=i||{},e===void 0&&(e=i.bits||2048),t===void 0&&(t=i.e||65537),!W.options.usePureJavaScript&&!i.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(_c("generateKeyPair"))return ms.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,u,l){if(o)return r(o);r(null,{privateKey:ae.privateKeyFromPem(l),publicKey:ae.publicKeyFromPem(u)})});if(Nc("generateKey")&&Nc("exportKey"))return Ut.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:Lc(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ut.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var u=ae.privateKeyFromAsn1(b.fromDer(W.util.createBuffer(o)));r(null,{privateKey:u,publicKey:ae.setRsaPublicKey(u.n,u.e)})}});if(kc("generateKey")&&kc("exportKey")){var a=Ut.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:Lc(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);a.oncomplete=function(o){var u=o.target.result,l=Ut.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);l.oncomplete=function(f){var c=f.target.result,p=ae.privateKeyFromAsn1(b.fromDer(W.util.createBuffer(c)));r(null,{privateKey:p,publicKey:ae.setRsaPublicKey(p.n,p.e)})},l.onerror=function(f){r(f)}},a.onerror=function(o){r(o)};return}}else if(_c("generateKeyPairSync")){var n=ms.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:ae.privateKeyFromPem(n.privateKey),publicKey:ae.publicKeyFromPem(n.publicKey)}}}var s=ae.rsa.createKeyPairGenerationState(e,t,i);if(!r)return ae.rsa.stepKeyPairGenerationState(s,0),s.keys;_y(s,i,r)};ae.setRsaPublicKey=ae.rsa.setPublicKey=function(e,t){var i={n:e,e:t};return i.encrypt=function(r,a,n){if(typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSAES-PKCS1-V1_5"),a==="RSAES-PKCS1-V1_5")a={encode:function(o,u,l){return Dc(o,u,2).getBytes()}};else if(a==="RSA-OAEP"||a==="RSAES-OAEP")a={encode:function(o,u){return W.pkcs1.encode_rsa_oaep(u,o,n)}};else if(["RAW","NONE","NULL",null].indexOf(a)!==-1)a={encode:function(o){return o}};else if(typeof a=="string")throw new Error('Unsupported encryption scheme: "'+a+'".');var s=a.encode(r,i,!0);return ae.rsa.encrypt(s,i,!0)},i.verify=function(r,a,n,s){typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),n==="RSASSA-PKCS1-V1_5"?n={verify:function(u,l){l=ja(l,i,!0);var f=b.fromDer(l,{parseAllBytes:s._parseAllDigestBytes}),c={},p=[];if(!b.validate(f,Ty,c,p)){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=p,m}var v=b.derToOid(c.algorithmIdentifier);if(!(v===W.oids.md2||v===W.oids.md5||v===W.oids.sha1||v===W.oids.sha224||v===W.oids.sha256||v===W.oids.sha384||v===W.oids.sha512||v===W.oids["sha512-224"]||v===W.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=v,m}if((v===W.oids.md2||v===W.oids.md5)&&!("parameters"in c))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return u===c.digest}}:(n==="NONE"||n==="NULL"||n===null)&&(n={verify:function(u,l){return l=ja(l,i,!0),u===l}});var o=ae.rsa.decrypt(a,i,!0,!1);return n.verify(r,o,i.n.bitLength())},i};ae.setRsaPrivateKey=ae.rsa.setPrivateKey=function(e,t,i,r,a,n,s,o){var u={n:e,e:t,d:i,p:r,q:a,dP:n,dQ:s,qInv:o};return u.decrypt=function(l,f,c){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var p=ae.rsa.decrypt(l,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:ja};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:function(m,v){return W.pkcs1.decode_rsa_oaep(v,m,c)}};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(p,u,!1)},u.sign=function(l,f){var c=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:wy},c=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:function(){return l}},c=1);var p=f.encode(l,u.n.bitLength());return ae.rsa.encrypt(p,u,c)},u};ae.wrapRsaPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ae.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,b.toDer(e).getBytes())])};ae.privateKeyFromAsn1=function(e){var t={},i=[];if(b.validate(e,Sy,t,i)&&(e=b.fromDer(W.util.createBuffer(t.privateKey))),t={},i=[],!b.validate(e,Iy,t,i)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=i,r}var a,n,s,o,u,l,f,c;return a=W.util.createBuffer(t.privateKeyModulus).toHex(),n=W.util.createBuffer(t.privateKeyPublicExponent).toHex(),s=W.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=W.util.createBuffer(t.privateKeyPrime1).toHex(),u=W.util.createBuffer(t.privateKeyPrime2).toHex(),l=W.util.createBuffer(t.privateKeyExponent1).toHex(),f=W.util.createBuffer(t.privateKeyExponent2).toHex(),c=W.util.createBuffer(t.privateKeyCoefficient).toHex(),ae.setRsaPrivateKey(new ge(a,16),new ge(n,16),new ge(s,16),new ge(o,16),new ge(u,16),new ge(l,16),new ge(f,16),new ge(c,16))};ae.privateKeyToAsn1=ae.privateKeyToRSAPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.e)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.d)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.p)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.q)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.dP)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.dQ)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.qInv))])};ae.publicKeyFromAsn1=function(e){var t={},i=[];if(b.validate(e,by,t,i)){var r=b.derToOid(t.publicKeyOid);if(r!==ae.oids.rsaEncryption){var a=new Error("Cannot read public key. Unknown OID.");throw a.oid=r,a}e=t.rsaPublicKey}if(i=[],!b.validate(e,By,t,i)){var a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw a.errors=i,a}var n=W.util.createBuffer(t.publicKeyModulus).toHex(),s=W.util.createBuffer(t.publicKeyExponent).toHex();return ae.setRsaPublicKey(new ge(n,16),new ge(s,16))};ae.publicKeyToAsn1=ae.publicKeyToSubjectPublicKeyInfo=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ae.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,[ae.publicKeyToRSAPublicKey(e)])])};ae.publicKeyToRSAPublicKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.e))])};function Dc(e,t,i){var r=W.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var n=new Error("Message is too long for PKCS#1 v1.5 padding.");throw n.length=e.length,n.max=a-11,n}r.putByte(0),r.putByte(i);var s=a-3-e.length,o;if(i===0||i===1){o=i===0?0:255;for(var u=0;u<s;++u)r.putByte(o)}else for(;s>0;){for(var l=0,f=W.random.getBytes(s),u=0;u<s;++u)o=f.charCodeAt(u),o===0?++l:r.putByte(o);s=l}return r.putByte(0),r.putBytes(e),r}function ja(e,t,i,r){var a=Math.ceil(t.n.bitLength()/8),n=W.util.createBuffer(e),s=n.getByte(),o=n.getByte();if(s!==0||i&&o!==0&&o!==1||!i&&o!=2||i&&o===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var u=0;if(o===0){u=a-3-r;for(var l=0;l<u;++l)if(n.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(o===1)for(u=0;n.length()>1;){if(n.getByte()!==255){--n.read;break}++u}else if(o===2)for(u=0;n.length()>1;){if(n.getByte()===0){--n.read;break}++u}var f=n.getByte();if(f!==0||u!==a-3-n.length())throw new Error("Encryption block is invalid.");return n.getBytes()}function _y(e,t,i){typeof t=="function"&&(i=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),a();function a(){n(e.pBits,function(o,u){if(o)return i(o);if(e.p=u,e.q!==null)return s(o,e.q);n(e.qBits,s)})}function n(o,u){W.prime.generateProbablePrime(o,r,u)}function s(o,u){if(o)return i(o);if(e.q=u,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)!==0){e.p=null,a();return}if(e.q.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)!==0){e.q=null,n(e.qBits,s);return}if(e.p1=e.p.subtract(ge.ONE),e.q1=e.q.subtract(ge.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(ge.ONE)!==0){e.p=e.q=null,a();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,n(e.qBits,s);return}var f=e.e.modInverse(e.phi);e.keys={privateKey:ae.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:ae.rsa.setPublicKey(e.n,e.e)},i(null,e.keys)}}function rr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var i=W.util.hexToBytes(t);return i.length>1&&(i.charCodeAt(0)===0&&!(i.charCodeAt(1)&128)||i.charCodeAt(0)===255&&(i.charCodeAt(1)&128)===128)?i.substr(1):i}function Ny(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function _c(e){return W.util.isNodejs&&typeof ms[e]=="function"}function Nc(e){return typeof Ut.globalScope<"u"&&typeof Ut.globalScope.crypto=="object"&&typeof Ut.globalScope.crypto.subtle=="object"&&typeof Ut.globalScope.crypto.subtle[e]=="function"}function kc(e){return typeof Ut.globalScope<"u"&&typeof Ut.globalScope.msCrypto=="object"&&typeof Ut.globalScope.msCrypto.subtle=="object"&&typeof Ut.globalScope.msCrypto.subtle[e]=="function"}function Lc(e){for(var t=W.util.hexToBytes(e.toString(16)),i=new Uint8Array(t.length),r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}});var As=F((fE,Fc)=>{"use strict";S();var G=oe();Ir();Gt();Gi();Jt();Br();Ma();Ur();Pt();fs();zi();Ae();typeof Qc>"u"&&(Qc=G.jsbn.BigInteger);var Qc,_=G.asn1,se=G.pki=G.pki||{};Fc.exports=se.pbe=G.pbe=G.pbe||{};var Fr=se.oids,ky={name:"EncryptedPrivateKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ly={name:"PBES2Algorithms",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Ry={name:"pkcs-12PbeParams",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"iterations"}]};se.encryptPrivateKeyInfo=function(e,t,i){i=i||{},i.saltSize=i.saltSize||8,i.count=i.count||2048,i.algorithm=i.algorithm||"aes128",i.prfAlgorithm=i.prfAlgorithm||"sha1";var r=G.random.getBytesSync(i.saltSize),a=i.count,n=_.integerToDer(a),s,o,u;if(i.algorithm.indexOf("aes")===0||i.algorithm==="des"){var l,f,c;switch(i.algorithm){case"aes128":s=16,l=16,f=Fr["aes128-CBC"],c=G.aes.createEncryptionCipher;break;case"aes192":s=24,l=16,f=Fr["aes192-CBC"],c=G.aes.createEncryptionCipher;break;case"aes256":s=32,l=16,f=Fr["aes256-CBC"],c=G.aes.createEncryptionCipher;break;case"des":s=8,l=8,f=Fr.desCBC,c=G.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=i.algorithm,p}var m="hmacWith"+i.prfAlgorithm.toUpperCase(),v=Vc(m),C=G.pkcs5.pbkdf2(t,r,a,s,v),E=G.random.getBytesSync(l),B=c(C);B.start(E),B.update(_.toDer(e)),B.finish(),u=B.output.getBytes();var w=Dy(r,n,s,m);o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr.pkcs5PBES2).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr.pkcs5PBKDF2).getBytes()),w]),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(f).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,E)])])])}else if(i.algorithm==="3des"){s=24;var T=new G.util.ByteBuffer(r),C=se.pbe.generatePkcs12Key(t,T,1,a,s),E=se.pbe.generatePkcs12Key(t,T,2,a,s),B=G.des.createEncryptionCipher(C);B.start(E),B.update(_.toDer(e)),B.finish(),u=B.output.getBytes(),o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,r),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,n.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=i.algorithm,p}var U=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[o,_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,u)]);return U};se.decryptPrivateKeyInfo=function(e,t){var i=null,r={},a=[];if(!_.validate(e,ky,r,a)){var n=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}var s=_.derToOid(r.encryptionOid),o=se.pbe.getCipher(s,r.encryptionParams,t),u=G.util.createBuffer(r.encryptedData);return o.update(u),o.finish()&&(i=_.fromDer(o.output)),i};se.encryptedPrivateKeyToPem=function(e,t){var i={type:"ENCRYPTED PRIVATE KEY",body:_.toDer(e).getBytes()};return G.pem.encode(i,{maxline:t})};se.encryptedPrivateKeyFromPem=function(e){var t=G.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var i=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return _.fromDer(t.body)};se.encryptRsaPrivateKey=function(e,t,i){if(i=i||{},!i.legacy){var r=se.wrapRsaPrivateKey(se.privateKeyToAsn1(e));return r=se.encryptPrivateKeyInfo(r,t,i),se.encryptedPrivateKeyToPem(r)}var a,n,s,o;switch(i.algorithm){case"aes128":a="AES-128-CBC",s=16,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",s=24,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",s=32,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",s=24,n=G.random.getBytesSync(8),o=G.des.createEncryptionCipher;break;case"des":a="DES-CBC",s=8,n=G.random.getBytesSync(8),o=G.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+i.algorithm+'".');throw u.algorithm=i.algorithm,u}var l=G.pbe.opensslDeriveBytes(t,n.substr(0,8),s),f=o(l);f.start(n),f.update(_.toDer(se.privateKeyToAsn1(e))),f.finish();var c={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:G.util.bytesToHex(n).toUpperCase()},body:f.output.getBytes()};return G.pem.encode(c)};se.decryptRsaPrivateKey=function(e,t){var i=null,r=G.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw a.headerType=a,a}if(r.procType&&r.procType.type==="ENCRYPTED"){var n,s;switch(r.dekInfo.algorithm){case"DES-CBC":n=8,s=G.des.createDecryptionCipher;break;case"DES-EDE3-CBC":n=24,s=G.des.createDecryptionCipher;break;case"AES-128-CBC":n=16,s=G.aes.createDecryptionCipher;break;case"AES-192-CBC":n=24,s=G.aes.createDecryptionCipher;break;case"AES-256-CBC":n=32,s=G.aes.createDecryptionCipher;break;case"RC2-40-CBC":n=5,s=function(c){return G.rc2.createDecryptionCipher(c,40)};break;case"RC2-64-CBC":n=8,s=function(c){return G.rc2.createDecryptionCipher(c,64)};break;case"RC2-128-CBC":n=16,s=function(c){return G.rc2.createDecryptionCipher(c,128)};break;default:var a=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw a.algorithm=r.dekInfo.algorithm,a}var o=G.util.hexToBytes(r.dekInfo.parameters),u=G.pbe.opensslDeriveBytes(t,o.substr(0,8),n),l=s(u);if(l.start(o),l.update(G.util.createBuffer(r.body)),l.finish())i=l.output.getBytes();else return i}else i=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?i=se.decryptPrivateKeyInfo(_.fromDer(i),t):i=_.fromDer(i),i!==null&&(i=se.privateKeyFromAsn1(i)),i};se.pbe.generatePkcs12Key=function(e,t,i,r,a,n){var s,o;if(typeof n>"u"||n===null){if(!("sha1"in G.md))throw new Error('"sha1" hash algorithm unavailable.');n=G.md.sha1.create()}var u=n.digestLength,l=n.blockLength,f=new G.util.ByteBuffer,c=new G.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)c.putInt16(e.charCodeAt(o));c.putInt16(0)}var p=c.length(),m=t.length(),v=new G.util.ByteBuffer;v.fillWithByte(i,l);var C=l*Math.ceil(m/l),E=new G.util.ByteBuffer;for(o=0;o<C;o++)E.putByte(t.at(o%m));var B=l*Math.ceil(p/l),w=new G.util.ByteBuffer;for(o=0;o<B;o++)w.putByte(c.at(o%p));var T=E;T.putBuffer(w);for(var U=Math.ceil(a/u),P=1;P<=U;P++){var Q=new G.util.ByteBuffer;Q.putBytes(v.bytes()),Q.putBytes(T.bytes());for(var te=0;te<r;te++)n.start(),n.update(Q.getBytes()),Q=n.digest();var ne=new G.util.ByteBuffer;for(o=0;o<l;o++)ne.putByte(Q.at(o%u));var H=Math.ceil(m/l)+Math.ceil(p/l),z=new G.util.ByteBuffer;for(s=0;s<H;s++){var Y=new G.util.ByteBuffer(T.getBytes(l)),re=511;for(o=ne.length()-1;o>=0;o--)re=re>>8,re+=ne.at(o)+Y.at(o),Y.setAt(o,re&255);z.putBuffer(Y)}T=z,f.putBuffer(Q)}return f.truncate(f.length()-a),f};se.pbe.getCipher=function(e,t,i){switch(e){case se.oids.pkcs5PBES2:return se.pbe.getCipherForPBES2(e,t,i);case se.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case se.oids["pbewithSHAAnd40BitRC2-CBC"]:return se.pbe.getCipherForPKCS12PBE(e,t,i);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};se.pbe.getCipherForPBES2=function(e,t,i){var r={},a=[];if(!_.validate(t,Ly,r,a)){var n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}if(e=_.derToOid(r.kdfOid),e!==se.oids.pkcs5PBKDF2){var n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw n.oid=e,n.supportedOids=["pkcs5PBKDF2"],n}if(e=_.derToOid(r.encOid),e!==se.oids["aes128-CBC"]&&e!==se.oids["aes192-CBC"]&&e!==se.oids["aes256-CBC"]&&e!==se.oids["des-EDE3-CBC"]&&e!==se.oids.desCBC){var n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw n.oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n}var s=r.kdfSalt,o=G.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var u,l;switch(se.oids[e]){case"aes128-CBC":u=16,l=G.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,l=G.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,l=G.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,l=G.des.createDecryptionCipher;break;case"desCBC":u=8,l=G.des.createDecryptionCipher;break}var f=Oc(r.prfOid),c=G.pkcs5.pbkdf2(i,s,o,u,f),p=r.encIv,m=l(c);return m.start(p),m};se.pbe.getCipherForPKCS12PBE=function(e,t,i){var r={},a=[];if(!_.validate(t,Ry,r,a)){var n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}var s=G.util.createBuffer(r.salt),o=G.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var u,l,f;switch(e){case se.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=G.des.startDecrypting;break;case se.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(C,E){var B=G.rc2.createDecryptionCipher(C,40);return B.start(E,null),B};break;default:var n=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw n.oid=e,n}var c=Oc(r.prfOid),p=se.pbe.generatePkcs12Key(i,s,1,o,u,c);c.start();var m=se.pbe.generatePkcs12Key(i,s,2,o,l,c);return f(p,m)};se.pbe.opensslDeriveBytes=function(e,t,i,r){if(typeof r>"u"||r===null){if(!("md5"in G.md))throw new Error('"md5" hash algorithm unavailable.');r=G.md.md5.create()}t===null&&(t="");for(var a=[Uc(r,e+t)],n=16,s=1;n<i;++s,n+=16)a.push(Uc(r,a[s-1]+e+t));return a.join("").substr(0,i)};function Uc(e,t){return e.start().update(t).digest().getBytes()}function Oc(e){var t;if(!e)t="hmacWithSHA1";else if(t=se.oids[_.derToOid(e)],!t){var i=new Error("Unsupported PRF OID.");throw i.oid=e,i.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],i}return Vc(t)}function Vc(e){var t=G.md;switch(e){case"hmacWithSHA224":t=G.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var i=new Error("Unsupported PRF algorithm.");throw i.algorithm=e,i.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],i}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function Dy(e,t,i,r){var a=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,e),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&a.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,G.util.hexToBytes(i.toString(16))),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(se.oids[r]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])),a}});var Cs=F((hE,Kc)=>{"use strict";S();var li=oe();Gt();Ae();var K=li.asn1,fi=Kc.exports=li.pkcs7asn1=li.pkcs7asn1||{};li.pkcs7=li.pkcs7||{};li.pkcs7.asn1=fi;var Mc={name:"ContentInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};fi.contentInfoValidator=Mc;var qc={name:"EncryptedContentInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};fi.envelopedDataValidator={name:"EnvelopedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(qc)};fi.encryptedDataValidator={name:"EncryptedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"}].concat(qc)};var Py={name:"SignerInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:K.Class.UNIVERSAL,type:K.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:K.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};fi.signedDataValidator={name:"SignedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},Mc,{name:"SignedData.Certificates",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:K.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,capture:"signerInfos",optional:!0,value:[Py]}]};fi.recipientInfoValidator={name:"RecipientInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:K.Class.UNIVERSAL,type:K.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Es=F((dE,Hc)=>{"use strict";S();var Mr=oe();Ae();Mr.mgf=Mr.mgf||{};var Qy=Hc.exports=Mr.mgf.mgf1=Mr.mgf1=Mr.mgf1||{};Qy.create=function(e){var t={generate:function(i,r){for(var a=new Mr.util.ByteBuffer,n=Math.ceil(r/e.digestLength),s=0;s<n;s++){var o=new Mr.util.ByteBuffer;o.putInt32(s),e.start(),e.update(i+o.getBytes()),a.putBuffer(e.digest())}return a.truncate(a.length()-r),a.getBytes()}};return t}});var jc=F((vE,Gc)=>{"use strict";S();var Ya=oe();Es();Gc.exports=Ya.mgf=Ya.mgf||{};Ya.mgf.mgf1=Ya.mgf1});var za=F((mE,Yc)=>{"use strict";S();var qr=oe();Pt();Ae();var Uy=Yc.exports=qr.pss=qr.pss||{};Uy.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,i=e.mgf,r=t.digestLength,a=e.salt||null;typeof a=="string"&&(a=qr.util.createBuffer(a));var n;if("saltLength"in e)n=e.saltLength;else if(a!==null)n=a.length();else throw new Error("Salt length not specified or specific salt not given.");if(a!==null&&a.length()!==n)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||qr.random,o={};return o.encode=function(u,l){var f,c=l-1,p=Math.ceil(c/8),m=u.digest().getBytes();if(p<r+n+2)throw new Error("Message is too long to encrypt.");var v;a===null?v=s.getBytesSync(n):v=a.bytes();var C=new qr.util.ByteBuffer;C.fillWithByte(0,8),C.putBytes(m),C.putBytes(v),t.start(),t.update(C.getBytes());var E=t.digest().getBytes(),B=new qr.util.ByteBuffer;B.fillWithByte(0,p-n-r-2),B.putByte(1),B.putBytes(v);var w=B.getBytes(),T=p-r-1,U=i.generate(E,T),P="";for(f=0;f<T;f++)P+=String.fromCharCode(w.charCodeAt(f)^U.charCodeAt(f));var Q=65280>>8*p-c&255;return P=String.fromCharCode(P.charCodeAt(0)&~Q)+P.substr(1),P+E+"\xBC"},o.verify=function(u,l,f){var c,p=f-1,m=Math.ceil(p/8);if(l=l.substr(-m),m<r+n+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(m-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var v=m-r-1,C=l.substr(0,v),E=l.substr(v,r),B=65280>>8*m-p&255;if(C.charCodeAt(0)&B)throw new Error("Bits beyond keysize not zero as expected.");var w=i.generate(E,v),T="";for(c=0;c<v;c++)T+=String.fromCharCode(C.charCodeAt(c)^w.charCodeAt(c));T=String.fromCharCode(T.charCodeAt(0)&~B)+T.substr(1);var U=m-r-n-2;for(c=0;c<U;c++)if(T.charCodeAt(c)!==0)throw new Error("Leftmost octets not zero as expected");if(T.charCodeAt(U)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var P=T.substr(-n),Q=new qr.util.ByteBuffer;Q.fillWithByte(0,8),Q.putBytes(u),Q.putBytes(P),t.start(),t.update(Q.getBytes());var te=t.digest().getBytes();return E===te},o}});var Xa=F((CE,$c)=>{"use strict";S();var X=oe();Ir();Gt();Gi();Jt();jc();Br();Ur();za();zi();Ae();var h=X.asn1,O=$c.exports=X.pki=X.pki||{},ve=O.oids,Ue={};Ue.CN=ve.commonName;Ue.commonName="CN";Ue.C=ve.countryName;Ue.countryName="C";Ue.L=ve.localityName;Ue.localityName="L";Ue.ST=ve.stateOrProvinceName;Ue.stateOrProvinceName="ST";Ue.O=ve.organizationName;Ue.organizationName="O";Ue.OU=ve.organizationalUnitName;Ue.organizationalUnitName="OU";Ue.E=ve.emailAddress;Ue.emailAddress="E";var Jc=X.pki.rsa.publicKeyValidator,Oy={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},Jc,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},Vy={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Fy={name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},Jc,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},My={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Fy,{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};O.RDNAttributesAsArray=function(e,t){for(var i=[],r,a,n,s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)n={},a=r.value[o],n.type=h.derToOid(a.value[0].value),n.value=a.value[1].value,n.valueTagClass=a.value[1].type,n.type in ve&&(n.name=ve[n.type],n.name in Ue&&(n.shortName=Ue[n.name])),t&&(t.update(n.type),t.update(n.value)),i.push(n)}return i};O.CRIAttributesAsArray=function(e){for(var t=[],i=0;i<e.length;++i)for(var r=e[i],a=h.derToOid(r.value[0].value),n=r.value[1].value,s=0;s<n.length;++s){var o={};if(o.type=a,o.value=n[s].value,o.valueTagClass=n[s].type,o.type in ve&&(o.name=ve[o.type],o.name in Ue&&(o.shortName=Ue[o.name])),o.type===ve.extensionRequest){o.extensions=[];for(var u=0;u<o.value.length;++u)o.extensions.push(O.certificateExtensionFromAsn1(o.value[u]))}t.push(o)}return t};function wr(e,t){typeof t=="string"&&(t={shortName:t});for(var i=null,r,a=0;i===null&&a<e.attributes.length;++a)r=e.attributes[a],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(i=r);return i}var Ja=function(e,t,i){var r={};if(e!==ve["RSASSA-PSS"])return r;i&&(r={hash:{algorithmOid:ve.sha1},mgf:{algorithmOid:ve.mgf1,hash:{algorithmOid:ve.sha1}},saltLength:20});var a={},n=[];if(!h.validate(t,Vy,a,n)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=n,s}return a.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=h.derToOid(a.hashOid)),a.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=h.derToOid(a.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=h.derToOid(a.maskGenHashOid)),a.saltLength!==void 0&&(r.saltLength=a.saltLength.charCodeAt(0)),r},Wa=function(e){switch(ve[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return X.md.sha1.create();case"md5WithRSAEncryption":return X.md.md5.create();case"sha256WithRSAEncryption":return X.md.sha256.create();case"sha384WithRSAEncryption":return X.md.sha384.create();case"sha512WithRSAEncryption":return X.md.sha512.create();case"RSASSA-PSS":return X.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},Wc=function(e){var t=e.certificate,i;switch(t.signatureOid){case ve.sha1WithRSAEncryption:case ve.sha1WithRSASignature:break;case ve["RSASSA-PSS"]:var r,a;if(r=ve[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||X.md[r]===void 0){var n=new Error("Unsupported MGF hash function.");throw n.oid=t.signatureParameters.mgf.hash.algorithmOid,n.name=r,n}if(a=ve[t.signatureParameters.mgf.algorithmOid],a===void 0||X.mgf[a]===void 0){var n=new Error("Unsupported MGF function.");throw n.oid=t.signatureParameters.mgf.algorithmOid,n.name=a,n}if(a=X.mgf[a].create(X.md[r].create()),r=ve[t.signatureParameters.hash.algorithmOid],r===void 0||X.md[r]===void 0){var n=new Error("Unsupported RSASSA-PSS hash function.");throw n.oid=t.signatureParameters.hash.algorithmOid,n.name=r,n}i=X.pss.create(X.md[r].create(),a,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,i)};O.certificateFromPem=function(e,t,i){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=r.type,a}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var n=h.fromDer(r.body,i);return O.certificateFromAsn1(n,t)};O.certificateToPem=function(e,t){var i={type:"CERTIFICATE",body:h.toDer(O.certificateToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.publicKeyFromPem=function(e){var t=X.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var i=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=h.fromDer(t.body);return O.publicKeyFromAsn1(r)};O.publicKeyToPem=function(e,t){var i={type:"PUBLIC KEY",body:h.toDer(O.publicKeyToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.publicKeyToRSAPublicKeyPem=function(e,t){var i={type:"RSA PUBLIC KEY",body:h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.getPublicKeyFingerprint=function(e,t){t=t||{};var i=t.md||X.md.sha1.create(),r=t.type||"RSAPublicKey",a;switch(r){case"RSAPublicKey":a=h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":a=h.toDer(O.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}i.start(),i.update(a);var n=i.digest();if(t.encoding==="hex"){var s=n.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return n.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return n};O.certificationRequestFromPem=function(e,t,i){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=r.type,a}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var n=h.fromDer(r.body,i);return O.certificationRequestFromAsn1(n,t)};O.certificationRequestToPem=function(e,t){var i={type:"CERTIFICATE REQUEST",body:h.toDer(O.certificationRequestToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return wr(e.issuer,t)},e.issuer.addField=function(t){Ot([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return wr(e.subject,t)},e.subject.addField=function(t){Ot([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,i){Ot(t),e.subject.attributes=t,delete e.subject.uniqueId,i&&(e.subject.uniqueId=i),e.subject.hash=null},e.setIssuer=function(t,i){Ot(t),e.issuer.attributes=t,delete e.issuer.uniqueId,i&&(e.issuer.uniqueId=i),e.issuer.hash=null},e.setExtensions=function(t){for(var i=0;i<t.length;++i)Xc(t[i],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var i=null,r,a=0;i===null&&a<e.extensions.length;++a)r=e.extensions[a],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(i=r);return i},e.sign=function(t,i){e.md=i||X.md.sha1.create();var r=ve[e.md.algorithm+"WithRSAEncryption"];if(!r){var a=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw a.algorithm=e.md.algorithm,a}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=O.getTBSCertificate(e);var n=h.toDer(e.tbsCertificate);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var i=!1;if(!e.issued(t)){var r=t.issuer,a=e.subject,n=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw n.expectedIssuer=a.attributes,n.actualIssuer=r.attributes,n}var s=t.md;if(s===null){s=Wa({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||O.getTBSCertificate(t),u=h.toDer(o);s.update(u.getBytes())}return s!==null&&(i=Wc({certificate:e,md:s,signature:t.signature})),i},e.isIssuer=function(t){var i=!1,r=e.issuer,a=t.subject;if(r.hash&&a.hash)i=r.hash===a.hash;else if(r.attributes.length===a.attributes.length){i=!0;for(var n,s,o=0;i&&o<r.attributes.length;++o)n=r.attributes[o],s=a.attributes[o],(n.type!==s.type||n.value!==s.value)&&(i=!1)}return i},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return O.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=ve.subjectKeyIdentifier,i=0;i<e.extensions.length;++i){var r=e.extensions[i];if(r.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return X.util.hexToBytes(r.subjectKeyIdentifier)===a}}return!1},e};O.certificateFromAsn1=function(e,t){var i={},r=[];if(!h.validate(e,Oy,i,r)){var a=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw a.errors=r,a}var n=h.derToOid(i.publicKeyOid);if(n!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificate();s.version=i.certVersion?i.certVersion.charCodeAt(0):0;var o=X.util.createBuffer(i.certSerialNumber);s.serialNumber=o.toHex(),s.signatureOid=X.asn1.derToOid(i.certSignatureOid),s.signatureParameters=Ja(s.signatureOid,i.certSignatureParams,!0),s.siginfo.algorithmOid=X.asn1.derToOid(i.certinfoSignatureOid),s.siginfo.parameters=Ja(s.siginfo.algorithmOid,i.certinfoSignatureParams,!1),s.signature=i.certSignature;var u=[];if(i.certValidity1UTCTime!==void 0&&u.push(h.utcTimeToDate(i.certValidity1UTCTime)),i.certValidity2GeneralizedTime!==void 0&&u.push(h.generalizedTimeToDate(i.certValidity2GeneralizedTime)),i.certValidity3UTCTime!==void 0&&u.push(h.utcTimeToDate(i.certValidity3UTCTime)),i.certValidity4GeneralizedTime!==void 0&&u.push(h.generalizedTimeToDate(i.certValidity4GeneralizedTime)),u.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=u[0],s.validity.notAfter=u[1],s.tbsCertificate=i.tbsCertificate,t){s.md=Wa({signatureOid:s.signatureOid,type:"certificate"});var l=h.toDer(s.tbsCertificate);s.md.update(l.getBytes())}var f=X.md.sha1.create(),c=h.toDer(i.certIssuer);f.update(c.getBytes()),s.issuer.getField=function(v){return wr(s.issuer,v)},s.issuer.addField=function(v){Ot([v]),s.issuer.attributes.push(v)},s.issuer.attributes=O.RDNAttributesAsArray(i.certIssuer),i.certIssuerUniqueId&&(s.issuer.uniqueId=i.certIssuerUniqueId),s.issuer.hash=f.digest().toHex();var p=X.md.sha1.create(),m=h.toDer(i.certSubject);return p.update(m.getBytes()),s.subject.getField=function(v){return wr(s.subject,v)},s.subject.addField=function(v){Ot([v]),s.subject.attributes.push(v)},s.subject.attributes=O.RDNAttributesAsArray(i.certSubject),i.certSubjectUniqueId&&(s.subject.uniqueId=i.certSubjectUniqueId),s.subject.hash=p.digest().toHex(),i.certExtensions?s.extensions=O.certificateExtensionsFromAsn1(i.certExtensions):s.extensions=[],s.publicKey=O.publicKeyFromAsn1(i.subjectPublicKeyInfo),s};O.certificateExtensionsFromAsn1=function(e){for(var t=[],i=0;i<e.value.length;++i)for(var r=e.value[i],a=0;a<r.value.length;++a)t.push(O.certificateExtensionFromAsn1(r.value[a]));return t};O.certificateExtensionFromAsn1=function(e){var t={};if(t.id=h.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===h.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in ve){if(t.name=ve[t.id],t.name==="keyUsage"){var i=h.fromDer(t.value),r=0,a=0;i.value.length>1&&(r=i.value.charCodeAt(1),a=i.value.length>2?i.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(a&128)===128}else if(t.name==="basicConstraints"){var i=h.fromDer(t.value);i.value.length>0&&i.value[0].type===h.Type.BOOLEAN?t.cA=i.value[0].value.charCodeAt(0)!==0:t.cA=!1;var n=null;i.value.length>0&&i.value[0].type===h.Type.INTEGER?n=i.value[0].value:i.value.length>1&&(n=i.value[1].value),n!==null&&(t.pathLenConstraint=h.derToInteger(n))}else if(t.name==="extKeyUsage")for(var i=h.fromDer(t.value),s=0;s<i.value.length;++s){var o=h.derToOid(i.value[s].value);o in ve?t[ve[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var i=h.fromDer(t.value),r=0;i.value.length>1&&(r=i.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var u,i=h.fromDer(t.value),l=0;l<i.value.length;++l){u=i.value[l];var f={type:u.type,value:u.value};switch(t.altNames.push(f),u.type){case 1:case 2:case 6:break;case 7:f.ip=X.util.bytesToIP(u.value);break;case 8:f.oid=h.derToOid(u.value);break;default:}}}else if(t.name==="subjectKeyIdentifier"){var i=h.fromDer(t.value);t.subjectKeyIdentifier=X.util.bytesToHex(i.value)}}return t};O.certificationRequestFromAsn1=function(e,t){var i={},r=[];if(!h.validate(e,My,i,r)){var a=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw a.errors=r,a}var n=h.derToOid(i.publicKeyOid);if(n!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificationRequest();if(s.version=i.csrVersion?i.csrVersion.charCodeAt(0):0,s.signatureOid=X.asn1.derToOid(i.csrSignatureOid),s.signatureParameters=Ja(s.signatureOid,i.csrSignatureParams,!0),s.siginfo.algorithmOid=X.asn1.derToOid(i.csrSignatureOid),s.siginfo.parameters=Ja(s.siginfo.algorithmOid,i.csrSignatureParams,!1),s.signature=i.csrSignature,s.certificationRequestInfo=i.certificationRequestInfo,t){s.md=Wa({signatureOid:s.signatureOid,type:"certification request"});var o=h.toDer(s.certificationRequestInfo);s.md.update(o.getBytes())}var u=X.md.sha1.create();return s.subject.getField=function(l){return wr(s.subject,l)},s.subject.addField=function(l){Ot([l]),s.subject.attributes.push(l)},s.subject.attributes=O.RDNAttributesAsArray(i.certificationRequestInfoSubject,u),s.subject.hash=u.digest().toHex(),s.publicKey=O.publicKeyFromAsn1(i.subjectPublicKeyInfo),s.getAttribute=function(l){return wr(s,l)},s.addAttribute=function(l){Ot([l]),s.attributes.push(l)},s.attributes=O.CRIAttributesAsArray(i.certificationRequestInfoAttributes||[]),s};O.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return wr(e.subject,t)},e.subject.addField=function(t){Ot([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return wr(e,t)},e.addAttribute=function(t){Ot([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Ot(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Ot(t),e.attributes=t},e.sign=function(t,i){e.md=i||X.md.sha1.create();var r=ve[e.md.algorithm+"WithRSAEncryption"];if(!r){var a=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw a.algorithm=e.md.algorithm,a}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=O.getCertificationRequestInfo(e);var n=h.toDer(e.certificationRequestInfo);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,i=e.md;if(i===null){i=Wa({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||O.getCertificationRequestInfo(e),a=h.toDer(r);i.update(a.getBytes())}return i!==null&&(t=Wc({certificate:e,md:i,signature:e.signature})),t},e};function ci(e){for(var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),i,r,a=e.attributes,n=0;n<a.length;++n){i=a[n];var s=i.value,o=h.Type.PRINTABLESTRING;"valueTagClass"in i&&(o=i.valueTagClass,o===h.Type.UTF8&&(s=X.util.encodeUtf8(s))),r=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(i.type).getBytes()),h.create(h.Class.UNIVERSAL,o,!1,s)])]),t.value.push(r)}return t}function Ot(e){for(var t,i=0;i<e.length;++i){if(t=e[i],typeof t.name>"u"&&(t.type&&t.type in O.oids?t.name=O.oids[t.type]:t.shortName&&t.shortName in Ue&&(t.name=O.oids[Ue[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in O.oids)t.type=O.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Ue&&(t.shortName=Ue[t.name]),t.type===ve.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=h.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var a=0;a<t.extensions.length;++a)t.value.push(O.certificateExtensionToAsn1(Xc(t.extensions[a])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function Xc(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in O.oids&&(e.name=O.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in O.oids)e.id=O.oids[e.name];else{var i=new Error("Extension ID not specified.");throw i.extension=e,i}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,a=0,n=0;e.digitalSignature&&(a|=128,r=7),e.nonRepudiation&&(a|=64,r=6),e.keyEncipherment&&(a|=32,r=5),e.dataEncipherment&&(a|=16,r=4),e.keyAgreement&&(a|=8,r=3),e.keyCertSign&&(a|=4,r=2),e.cRLSign&&(a|=2,r=1),e.encipherOnly&&(a|=1,r=0),e.decipherOnly&&(n|=128,r=7);var s=String.fromCharCode(r);n!==0?s+=String.fromCharCode(a)+String.fromCharCode(n):a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var u in e)e[u]===!0&&(u in ve?o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(ve[u]).getBytes())):u.indexOf(".")!==-1&&o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(u).getBytes())))}else if(e.name==="nsCertType"){var r=0,a=0;e.client&&(a|=128,r=7),e.server&&(a|=64,r=6),e.email&&(a|=32,r=5),e.objsign&&(a|=16,r=4),e.reserved&&(a|=8,r=3),e.sslCA&&(a|=4,r=2),e.emailCA&&(a|=2,r=1),e.objCA&&(a|=1,r=0);var s=String.fromCharCode(r);a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var l,f=0;f<e.altNames.length;++f){l=e.altNames[f];var s=l.value;if(l.type===7&&l.ip){if(s=X.util.bytesFromIP(l.ip),s===null){var i=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw i.extension=e,i}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));e.value.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=h.create(h.Class.UNIVERSAL,h.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var c=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=c.toHex(),e.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,c.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var p=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var m=[h.create(h.Class.CONTEXT_SPECIFIC,4,!0,[ci(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var v=X.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if(e.name==="cRLDistributionPoints"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var o=e.value.value,C=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),E=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]),l,f=0;f<e.altNames.length;++f){l=e.altNames[f];var s=l.value;if(l.type===7&&l.ip){if(s=X.util.bytesFromIP(l.ip),s===null){var i=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw i.extension=e,i}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));E.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}C.value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[E])),o.push(C)}if(typeof e.value>"u"){var i=new Error("Extension value not specified.");throw i.extension=e,i}return e}function xs(e,t){switch(e){case ve["RSASSA-PSS"]:var i=[];return t.hash.algorithmOid!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(t.saltLength).getBytes())])),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,i);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")}}function qy(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var i=e.attributes,r=0;r<i.length;++r){var a=i[r],n=a.value,s=h.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===h.Type.UTF8&&(n=X.util.encodeUtf8(n));var o=!1;"valueConstructed"in a&&(o=a.valueConstructed);var u=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,s,o,n)])]);t.value.push(u)}return t}var Ky=new Date("1950-01-01T00:00:00Z"),Hy=new Date("2050-01-01T00:00:00Z");function zc(e){return e>=Ky&&e<Hy?h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(e)):h.create(h.Class.UNIVERSAL,h.Type.GENERALIZEDTIME,!1,h.dateToGeneralizedTime(e))}O.getTBSCertificate=function(e){var t=zc(e.validity.notBefore),i=zc(e.validity.notAfter),r=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,X.util.hexToBytes(e.serialNumber)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.siginfo.algorithmOid).getBytes()),xs(e.siginfo.algorithmOid,e.siginfo.parameters)]),ci(e.issuer),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,i]),ci(e.subject),O.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(O.certificateExtensionsToAsn1(e.extensions)),r};O.getCertificationRequestInfo=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),ci(e.subject),O.publicKeyToAsn1(e.publicKey),qy(e)]);return t};O.distinguishedNameToAsn1=function(e){return ci(e)};O.certificateToAsn1=function(e){var t=e.tbsCertificate||O.getTBSCertificate(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),xs(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])};O.certificateExtensionsToAsn1=function(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),i=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(i);for(var r=0;r<e.length;++r)i.value.push(O.certificateExtensionToAsn1(e[r]));return t};O.certificateExtensionToAsn1=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.id).getBytes())),e.critical&&t.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF"));var i=e.value;return typeof e.value!="string"&&(i=h.toDer(i).getBytes()),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,i)),t};O.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||O.getCertificationRequestInfo(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),xs(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])};O.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(s){var o=i(s.issuer);return o},t.addCertificate=function(s){if(typeof s=="string"&&(s=X.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))if(s.subject.hash in t.certs){var o=t.certs[s.subject.hash];X.util.isArray(o)||(o=[o]),o.push(s),t.certs[s.subject.hash]=o}else t.certs[s.subject.hash]=s},t.hasCertificate=function(s){typeof s=="string"&&(s=X.pki.certificateFromPem(s));var o=i(s.subject);if(!o)return!1;X.util.isArray(o)||(o=[o]);for(var u=h.toDer(O.certificateToAsn1(s)).getBytes(),l=0;l<o.length;++l){var f=h.toDer(O.certificateToAsn1(o[l])).getBytes();if(u===f)return!0}return!1},t.listAllCertificates=function(){var s=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var u=t.certs[o];if(!X.util.isArray(u))s.push(u);else for(var l=0;l<u.length;++l)s.push(u[l])}return s},t.removeCertificate=function(s){var o;if(typeof s=="string"&&(s=X.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))return null;var u=i(s.subject);if(!X.util.isArray(u))return o=t.certs[s.subject.hash],delete t.certs[s.subject.hash],o;for(var l=h.toDer(O.certificateToAsn1(s)).getBytes(),f=0;f<u.length;++f){var c=h.toDer(O.certificateToAsn1(u[f])).getBytes();l===c&&(o=u[f],u.splice(f,1))}return u.length===0&&delete t.certs[s.subject.hash],o};function i(s){return r(s),t.certs[s.hash]||null}function r(s){if(!s.hash){var o=X.md.sha1.create();s.attributes=O.RDNAttributesAsArray(ci(s),o),s.hash=o.digest().toHex()}}if(e)for(var a=0;a<e.length;++a){var n=e[a];t.addCertificate(n)}return t};O.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};O.verifyCertificateChain=function(e,t,i){typeof i=="function"&&(i={verify:i}),i=i||{},t=t.slice(0);var r=t.slice(0),a=i.validityCheckDate;typeof a>"u"&&(a=new Date);var n=!0,s=null,o=0;do{var u=t.shift(),l=null,f=!1;if(a&&(a<u.validity.notBefore||a>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:O.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),s===null){if(l=t[0]||e.getIssuer(u),l===null&&u.isIssuer(u)&&(f=!0,l=u),l){var c=l;X.util.isArray(c)||(c=[c]);for(var p=!1;!p&&c.length>0;){l=c.shift();try{p=l.verify(u)}catch{}}p||(s={message:"Certificate signature is invalid.",error:O.certificateError.bad_certificate})}s===null&&(!l||f)&&!e.hasCertificate(u)&&(s={message:"Certificate is not trusted.",error:O.certificateError.unknown_ca})}if(s===null&&l&&!u.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:O.certificateError.bad_certificate}),s===null)for(var m={keyUsage:!0,basicConstraints:!0},v=0;s===null&&v<u.extensions.length;++v){var C=u.extensions[v];C.critical&&!(C.name in m)&&(s={message:"Certificate has an unsupported critical extension.",error:O.certificateError.unsupported_certificate})}if(s===null&&(!n||t.length===0&&(!l||f))){var E=u.getExtension("basicConstraints"),B=u.getExtension("keyUsage");if(B!==null&&(!B.keyCertSign||E===null)&&(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:O.certificateError.bad_certificate}),s===null&&E!==null&&!E.cA&&(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:O.certificateError.bad_certificate}),s===null&&B!==null&&"pathLenConstraint"in E){var w=o-1;w>E.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:O.certificateError.bad_certificate})}}var T=s===null?!0:s.error,U=i.verify?i.verify(T,o,r):T;if(U===!0)s=null;else throw T===!0&&(s={message:"The application rejected the certificate.",error:O.certificateError.bad_certificate}),(U||U===0)&&(typeof U=="object"&&!X.util.isArray(U)?(U.message&&(s.message=U.message),U.error&&(s.error=U.error)):typeof U=="string"&&(s.error=U)),s;n=!1,++o}while(t.length>0);return!0}});var Is=F((xE,e0)=>{"use strict";S();var we=oe();Gt();ai();Br();Cs();As();Pt();zi();ui();Ae();Xa();var A=we.asn1,fe=we.pki,Wi=e0.exports=we.pkcs12=we.pkcs12||{},Zc={name:"ContentInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},Gy={name:"PFX",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"version"},Zc,{name:"PFX.macData",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:A.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},jy={name:"SafeBag",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:A.Class.UNIVERSAL,type:A.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},Yy={name:"Attribute",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:A.Class.UNIVERSAL,type:A.Type.SET,constructed:!0,capture:"values"}]},zy={name:"CertBag",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:A.Class.UNIVERSAL,type:A.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ji(e,t,i,r){for(var a=[],n=0;n<e.length;n++)for(var s=0;s<e[n].safeBags.length;s++){var o=e[n].safeBags[s];if(!(r!==void 0&&o.type!==r)){if(t===null){a.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(i)>=0&&a.push(o)}}return a}Wi.pkcs12FromAsn1=function(e,t,i){typeof t=="string"?(i=t,t=!0):t===void 0&&(t=!0);var r={},a=[];if(!A.validate(e,Gy,r,a)){var n=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw n.errors=n,n}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(E){var B={},w;return"localKeyId"in E?w=E.localKeyId:"localKeyIdHex"in E&&(w=we.util.hexToBytes(E.localKeyIdHex)),w===void 0&&!("friendlyName"in E)&&"bagType"in E&&(B[E.bagType]=Ji(s.safeContents,null,null,E.bagType)),w!==void 0&&(B.localKeyId=Ji(s.safeContents,"localKeyId",w,E.bagType)),"friendlyName"in E&&(B.friendlyName=Ji(s.safeContents,"friendlyName",E.friendlyName,E.bagType)),B},getBagsByFriendlyName:function(E,B){return Ji(s.safeContents,"friendlyName",E,B)},getBagsByLocalKeyId:function(E,B){return Ji(s.safeContents,"localKeyId",E,B)}};if(r.version.charCodeAt(0)!==3){var n=new Error("PKCS#12 PFX of version other than 3 not supported.");throw n.version=r.version.charCodeAt(0),n}if(A.derToOid(r.contentType)!==fe.oids.data){var n=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw n.oid=A.derToOid(r.contentType),n}var o=r.content.value[0];if(o.tagClass!==A.Class.UNIVERSAL||o.type!==A.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Ss(o),r.mac){var u=null,l=0,f=A.derToOid(r.macAlgorithm);switch(f){case fe.oids.sha1:u=we.md.sha1.create(),l=20;break;case fe.oids.sha256:u=we.md.sha256.create(),l=32;break;case fe.oids.sha384:u=we.md.sha384.create(),l=48;break;case fe.oids.sha512:u=we.md.sha512.create(),l=64;break;case fe.oids.md5:u=we.md.md5.create(),l=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var c=new we.util.ByteBuffer(r.macSalt),p="macIterations"in r?parseInt(we.util.bytesToHex(r.macIterations),16):1,m=Wi.generateKey(i,c,3,p,l,u),v=we.hmac.create();v.start(u,m),v.update(o.value);var C=v.getMac();if(C.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return Jy(s,o.value,t,i),s};function Ss(e){if(e.composed||e.constructed){for(var t=we.util.createBuffer(),i=0;i<e.value.length;++i)t.putBytes(e.value[i].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function Jy(e,t,i,r){if(t=A.fromDer(t,i),t.tagClass!==A.Class.UNIVERSAL||t.type!==A.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var n=t.value[a],s={},o=[];if(!A.validate(n,Zc,s,o)){var u=new Error("Cannot read ContentInfo.");throw u.errors=o,u}var l={encrypted:!1},f=null,c=s.content.value[0];switch(A.derToOid(s.contentType)){case fe.oids.data:if(c.tagClass!==A.Class.UNIVERSAL||c.type!==A.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");f=Ss(c).value;break;case fe.oids.encryptedData:f=Wy(c,r),l.encrypted=!0;break;default:var u=new Error("Unsupported PKCS#12 contentType.");throw u.contentType=A.derToOid(s.contentType),u}l.safeBags=Xy(f,i,r),e.safeContents.push(l)}}function Wy(e,t){var i={},r=[];if(!A.validate(e,we.pkcs7.asn1.encryptedDataValidator,i,r)){var a=new Error("Cannot read EncryptedContentInfo.");throw a.errors=r,a}var n=A.derToOid(i.contentType);if(n!==fe.oids.data){var a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw a.oid=n,a}n=A.derToOid(i.encAlgorithm);var s=fe.pbe.getCipher(n,i.encParameter,t),o=Ss(i.encryptedContentAsn1),u=we.util.createBuffer(o.value);if(s.update(u),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function Xy(e,t,i){if(!t&&e.length===0)return[];if(e=A.fromDer(e,t),e.tagClass!==A.Class.UNIVERSAL||e.type!==A.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],a=0;a<e.value.length;a++){var n=e.value[a],s={},o=[];if(!A.validate(n,jy,s,o)){var u=new Error("Cannot read SafeBag.");throw u.errors=o,u}var l={type:A.derToOid(s.bagId),attributes:$y(s.bagAttributes)};r.push(l);var f,c,p=s.bagValue.value[0];switch(l.type){case fe.oids.pkcs8ShroudedKeyBag:if(p=fe.decryptPrivateKeyInfo(p,i),p===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case fe.oids.keyBag:try{l.key=fe.privateKeyFromAsn1(p)}catch{l.key=null,l.asn1=p}continue;case fe.oids.certBag:f=zy,c=function(){if(A.derToOid(s.certId)!==fe.oids.x509Certificate){var v=new Error("Unsupported certificate type, only X.509 supported.");throw v.oid=A.derToOid(s.certId),v}var C=A.fromDer(s.cert,t);try{l.cert=fe.certificateFromAsn1(C,!0)}catch{l.cert=null,l.asn1=C}};break;default:var u=new Error("Unsupported PKCS#12 SafeBag type.");throw u.oid=l.type,u}if(f!==void 0&&!A.validate(p,f,s,o)){var u=new Error("Cannot read PKCS#12 "+f.name);throw u.errors=o,u}c()}return r}function $y(e){var t={};if(e!==void 0)for(var i=0;i<e.length;++i){var r={},a=[];if(!A.validate(e[i],Yy,r,a)){var n=new Error("Cannot read PKCS#12 BagAttribute.");throw n.errors=a,n}var s=A.derToOid(r.oid);if(fe.oids[s]!==void 0){t[fe.oids[s]]=[];for(var o=0;o<r.values.length;++o)t[fe.oids[s]].push(r.values[o].value)}}return t}Wi.toPkcs12Asn1=function(e,t,i,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var a=r.localKeyId,n;if(a!==null)a=we.util.hexToBytes(a);else if(r.generateLocalKeyId)if(t){var s=we.util.isArray(t)?t[0]:t;typeof s=="string"&&(s=fe.certificateFromPem(s));var o=we.md.sha1.create();o.update(A.toDer(fe.certificateToAsn1(s)).getBytes()),a=o.digest().getBytes()}else a=we.random.getBytes(20);var u=[];a!==null&&u.push(A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.localKeyId).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SET,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,a)])])),"friendlyName"in r&&u.push(A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.friendlyName).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SET,!0,[A.create(A.Class.UNIVERSAL,A.Type.BMPSTRING,!1,r.friendlyName)])])),u.length>0&&(n=A.create(A.Class.UNIVERSAL,A.Type.SET,!0,u));var l=[],f=[];t!==null&&(we.util.isArray(t)?f=t:f=[t]);for(var c=[],p=0;p<f.length;++p){t=f[p],typeof t=="string"&&(t=fe.certificateFromPem(t));var m=p===0?n:void 0,v=fe.certificateToAsn1(t),C=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.certBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.x509Certificate).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(v).getBytes())])])]),m]);c.push(C)}if(c.length>0){var E=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,c),B=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(E).getBytes())])]);l.push(B)}var w=null;if(e!==null){var T=fe.wrapRsaPrivateKey(fe.privateKeyToAsn1(e));i===null?w=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.keyBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[T]),n]):w=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.pkcs8ShroudedKeyBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[fe.encryptPrivateKeyInfo(T,i,r)]),n]);var U=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[w]),P=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(U).getBytes())])]);l.push(P)}var Q=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,l),te;if(r.useMac){var o=we.md.sha1.create(),ne=new we.util.ByteBuffer(we.random.getBytes(r.saltSize)),H=r.count,e=Wi.generateKey(i,ne,3,H,20),z=we.hmac.create();z.start(o,e),z.update(A.toDer(Q).getBytes());var Y=z.getMac();te=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.sha1).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.NULL,!1,"")]),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,Y.getBytes())]),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,ne.getBytes()),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,A.integerToDer(H).getBytes())])}return A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,A.integerToDer(3).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(Q).getBytes())])]),te])};Wi.generateKey=we.pbe.generatePkcs12Key});var bs=F((IE,t0)=>{"use strict";S();var _r=oe();Gt();Br();As();Ur();Ma();Is();za();zi();Ae();Xa();var Bs=_r.asn1,hi=t0.exports=_r.pki=_r.pki||{};hi.pemToDer=function(e){var t=_r.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return _r.util.createBuffer(t.body)};hi.privateKeyFromPem=function(e){var t=_r.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Bs.fromDer(t.body);return hi.privateKeyFromAsn1(r)};hi.privateKeyToPem=function(e,t){var i={type:"RSA PRIVATE KEY",body:Bs.toDer(hi.privateKeyToAsn1(e)).getBytes()};return _r.pem.encode(i,{maxline:t})};hi.privateKeyInfoToPem=function(e,t){var i={type:"PRIVATE KEY",body:Bs.toDer(e).getBytes()};return _r.pem.encode(i,{maxline:t})}});var Ls=F((bE,l0)=>{"use strict";S();var k=oe();Gt();ai();Ua();Ur();bs();Pt();ui();Ae();var tn=function(e,t,i,r){var a=k.util.createBuffer(),n=e.length>>1,s=n+(e.length&1),o=e.substr(0,s),u=e.substr(n,s),l=k.util.createBuffer(),f=k.hmac.create();i=t+i;var c=Math.ceil(r/16),p=Math.ceil(r/20);f.start("MD5",o);var m=k.util.createBuffer();l.putBytes(i);for(var v=0;v<c;++v)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+i),m.putBuffer(f.digest());f.start("SHA1",u);var C=k.util.createBuffer();l.clear(),l.putBytes(i);for(var v=0;v<p;++v)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+i),C.putBuffer(f.digest());return a.putBytes(k.util.xorBytes(m.getBytes(),C.getBytes(),r)),a},Zy=function(e,t,i){var r=k.hmac.create();r.start("SHA1",e);var a=k.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(i.type),a.putByte(i.version.major),a.putByte(i.version.minor),a.putInt16(i.length),a.putBytes(i.fragment.bytes()),r.update(a.getBytes()),r.digest().getBytes()},em=function(e,t,i){var r=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=k.util.createBuffer(a),t.length=a.length,r=!0}catch{}return r},tm=function(e,t,i){var r=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=k.util.createBuffer(a),t.length=a.length,r=!0}catch{}return r},Tt=function(e,t){var i=0;switch(t){case 1:i=e.getByte();break;case 2:i=e.getInt16();break;case 3:i=e.getInt24();break;case 4:i=e.getInt32();break}return k.util.createBuffer(e.getBytes(i))},Vt=function(e,t,i){e.putInt(i.length(),t<<3),e.putBuffer(i)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0];g.Version=g.SupportedVersions[0];g.MaxFragment=15360;g.ConnectionEnd={server:0,client:1};g.PRFAlgorithm={tls_prf_sha256:0};g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};g.CipherType={stream:0,block:1,aead:2};g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};g.CompressionMethod={none:0,deflate:1};g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};g.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};g.Alert={};g.Alert.Level={warning:1,fatal:2};g.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};g.CipherSuites={};g.getCipherSuite=function(e){var t=null;for(var i in g.CipherSuites){var r=g.CipherSuites[i];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};g.handleUnexpected=function(e,t){var i=!e.open&&e.entity===g.ConnectionEnd.client;i||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})};g.handleHelloRequest=function(e,t,i){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()};g.parseHelloMessage=function(e,t,i){var r=null,a=e.entity===g.ConnectionEnd.client;if(i<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var n=t.fragment,s=n.length();if(r={version:{major:n.getByte(),minor:n.getByte()},random:k.util.createBuffer(n.getBytes(32)),session_id:Tt(n,1),extensions:[]},a?(r.cipher_suite=n.getBytes(2),r.compression_method=n.getByte()):(r.cipher_suites=Tt(n,2),r.compression_methods=Tt(n,1)),s=i-(s-n.length()),s>0){for(var o=Tt(n,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:Tt(o,2)});if(!a)for(var u=0;u<r.extensions.length;++u){var l=r.extensions[u];if(l.type[0]===0&&l.type[1]===0)for(var f=Tt(l.data,2);f.length()>0;){var c=f.getByte();if(c!==0)break;e.session.extensions.server_name.serverNameList.push(Tt(f,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=g.getCipherSuite(r.cipher_suite);else for(var p=k.util.createBuffer(r.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=g.getCipherSuite(p.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:k.util.bytesToHex(r.cipher_suite)});a?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return r};g.createSecurityParameters=function(e,t){var i=e.entity===g.ConnectionEnd.client,r=t.random.bytes(),a=i?e.session.sp.client_random:r,n=i?r:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:a,server_random:n}};g.handleServerHello=function(e,t,i){var r=g.parseHelloMessage(e,t,i);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var a=r.session_id.bytes();a.length>0&&a===e.session.id?(e.expect=a0,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=im,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.session.id=a,e.process()}};g.handleClientHello=function(e,t,i){var r=g.parseHelloMessage(e,t,i);if(!e.fail){var a=r.session_id.bytes(),n=null;if(e.sessionCache&&(n=e.sessionCache.getSession(a),n===null?a="":(n.version.major!==r.version.major||n.version.minor>r.version.minor)&&(n=null,a="")),a.length===0&&(a=k.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=r.version,e.session.sp={},n)e.version=e.session.version=n.version,e.session.sp=n.sp;else{for(var s,o=1;o<g.SupportedVersions.length&&(s=g.SupportedVersions[o],!(s.minor<=r.version.minor));++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}n!==null?(e.expect=Ns,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?fm:_s,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}};g.handleCertificate=function(e,t,i){if(i<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,a={certificate_list:Tt(r,3)},n,s,o=[];try{for(;a.certificate_list.length()>0;)n=Tt(a.certificate_list,3),s=k.asn1.fromDer(n),n=k.pki.certificateFromAsn1(s,!0),o.push(n)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var u=e.entity===g.ConnectionEnd.client;(u||e.verifyClient===!0)&&o.length===0?e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=u?r0:_s:(u?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=u?r0:_s)),e.process()};g.handleServerKeyExchange=function(e,t,i){if(i>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=am,e.process()};g.handleClientKeyExchange=function(e,t,i){if(i<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var r=t.fragment,a={enc_pre_master_secret:Tt(r,2).getBytes()},n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.serverCertificate),n=k.pki.privateKeyFromPem(n)}catch(u){e.error(e,{message:"Could not get private key.",cause:u,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(n===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=n.decrypt(a.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=k.random.getBytes(48)}e.expect=Ns,e.session.clientCertificate!==null&&(e.expect=cm),e.process()};g.handleCertificateRequest=function(e,t,i){if(i<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,a={certificate_types:Tt(r,1),certificate_authorities:Tt(r,2)};e.session.certificateRequest=a,e.expect=nm,e.process()};g.handleCertificateVerify=function(e,t,i){if(i<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var n={signature:Tt(r,2).getBytes()},s=k.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,n.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=Ns,e.process()};g.handleServerHelloDone=function(e,t,i){if(i>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},a=0,n=e.verify(e,r.alert.description,a,[]);if(n!==!0)return(n||n===0)&&(typeof n=="object"&&!k.util.isArray(n)?(n.message&&(r.message=n.message),n.alert&&(r.alert.description=n.alert)):typeof n=="number"&&(r.alert.description=n)),e.error(e,r)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=um;var s=function(o,u){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,u)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=a0,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);g.getClientSignature(e,s)};g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var i=e.entity===g.ConnectionEnd.client;(e.session.resuming&&i||!e.session.resuming&&!i)&&(e.state.pending=g.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&i||e.session.resuming&&!i)&&(e.state.pending=null),e.expect=i?sm:hm,e.process()};g.handleFinished=function(e,t,i){var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var n=t.fragment.getBytes();r=k.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===g.ConnectionEnd.client,o=s?"server finished":"client finished",u=e.session.sp,l=12,f=tn;if(r=f(u.master_secret,o,r.getBytes(),l),r.getBytes()!==n)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&s||!e.session.resuming&&!s)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=s?om:pm,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()};g.handleAlert=function(e,t){var i=t.fragment,r={level:i.getByte(),description:i.getByte()},a;switch(r.description){case g.Alert.Description.close_notify:a="Connection closed.";break;case g.Alert.Description.unexpected_message:a="Unexpected message.";break;case g.Alert.Description.bad_record_mac:a="Bad record MAC.";break;case g.Alert.Description.decryption_failed:a="Decryption failed.";break;case g.Alert.Description.record_overflow:a="Record overflow.";break;case g.Alert.Description.decompression_failure:a="Decompression failed.";break;case g.Alert.Description.handshake_failure:a="Handshake failure.";break;case g.Alert.Description.bad_certificate:a="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:a="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:a="Certificate revoked.";break;case g.Alert.Description.certificate_expired:a="Certificate expired.";break;case g.Alert.Description.certificate_unknown:a="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:a="Illegal parameter.";break;case g.Alert.Description.unknown_ca:a="Unknown certificate authority.";break;case g.Alert.Description.access_denied:a="Access denied.";break;case g.Alert.Description.decode_error:a="Decode error.";break;case g.Alert.Description.decrypt_error:a="Decrypt error.";break;case g.Alert.Description.export_restriction:a="Export restriction.";break;case g.Alert.Description.protocol_version:a="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:a="Insufficient security.";break;case g.Alert.Description.internal_error:a="Internal error.";break;case g.Alert.Description.user_canceled:a="User canceled.";break;case g.Alert.Description.no_renegotiation:a="Renegotiation not supported.";break;default:a="Unknown error.";break}if(r.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:a,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:r}),e.process()};g.handleHandshake=function(e,t){var i=t.fragment,r=i.getByte(),a=i.getInt24();if(a>i.length())return e.fragmented=t,t.fragment=k.util.createBuffer(),i.read-=4,e.process();e.fragmented=null,i.read-=4;var n=i.bytes(a+4);i.read+=4,r in en[e.entity][e.expect]?(e.entity===g.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:k.md.md5.create(),sha1:k.md.sha1.create()}),r!==g.HandshakeType.hello_request&&r!==g.HandshakeType.certificate_verify&&r!==g.HandshakeType.finished&&(e.session.md5.update(n),e.session.sha1.update(n)),en[e.entity][e.expect][r](e,t,a)):g.handleUnexpected(e,t)};g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};g.handleHeartbeat=function(e,t){var i=t.fragment,r=i.getByte(),a=i.getInt16(),n=i.getBytes(a);if(r===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>n.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,n)})),g.flush(e)}else if(r===g.HeartbeatMessageType.heartbeat_response){if(n!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,k.util.createBuffer(n))}e.process()};var rm=0,im=1,r0=2,am=3,nm=4,a0=5,sm=6,om=7,um=8,lm=0,fm=1,_s=2,cm=3,Ns=4,hm=5,pm=6,d=g.handleUnexpected,n0=g.handleChangeCipherSpec,We=g.handleAlert,At=g.handleHandshake,s0=g.handleApplicationData,Xe=g.handleHeartbeat,ks=[];ks[g.ConnectionEnd.client]=[[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[n0,We,d,d,Xe],[d,We,At,d,Xe],[d,We,At,s0,Xe],[d,We,At,d,Xe]];ks[g.ConnectionEnd.server]=[[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[n0,We,d,d,Xe],[d,We,At,d,Xe],[d,We,At,s0,Xe],[d,We,At,d,Xe]];var Nr=g.handleHelloRequest,dm=g.handleServerHello,o0=g.handleCertificate,i0=g.handleServerKeyExchange,Ts=g.handleCertificateRequest,$a=g.handleServerHelloDone,u0=g.handleFinished,en=[];en[g.ConnectionEnd.client]=[[d,d,dm,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,o0,i0,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,i0,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,u0],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d]];var gm=g.handleClientHello,vm=g.handleClientKeyExchange,ym=g.handleCertificateVerify;en[g.ConnectionEnd.server]=[[d,gm,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,o0,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,vm,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,ym,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,u0],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d]];g.generateKeys=function(e,t){var i=tn,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=i(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,n=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;n&&(a+=2*t.fixed_iv_length);var s=i(t.master_secret,"key expansion",r,a),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return n&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o};g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,i=function(){var n={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){n.sequenceNumber[1]===4294967295?(n.sequenceNumber[1]=0,++n.sequenceNumber[0]):++n.sequenceNumber[1]}};return n},r={read:i(),write:i()};if(r.read.update=function(n,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(n,s,r.read)||n.error(n,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):n.error(n,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!n.fail},r.write.update=function(n,s){return r.write.compressFunction(n,s,r.write)?r.write.cipherFunction(s,r.write)||n.error(n,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):n.error(n,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!n.fail},e.session){var a=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(a),a.keys=g.generateKeys(e,a),r.read.macKey=t?a.keys.server_write_MAC_key:a.keys.client_write_MAC_key,r.write.macKey=t?a.keys.client_write_MAC_key:a.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,a),a.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:r.read.compressFunction=tm,r.write.compressFunction=em;break;default:throw new Error("Unsupported compression algorithm.")}}return r};g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,i=k.util.createBuffer();return i.putInt32(t),i.putBytes(k.random.getBytes(28)),i};g.createRecord=function(e,t){if(!t.data)return null;var i={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return i};g.createAlert=function(e,t){var i=k.util.createBuffer();return i.putByte(t.level),i.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:i})};g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=k.util.createBuffer(),i=0;i<e.cipherSuites.length;++i){var r=e.cipherSuites[i];t.putByte(r.id[0]),t.putByte(r.id[1])}var a=t.length(),n=k.util.createBuffer();n.putByte(g.CompressionMethod.none);var s=n.length(),o=k.util.createBuffer();if(e.virtualHost){var u=k.util.createBuffer();u.putByte(0),u.putByte(0);var l=k.util.createBuffer();l.putByte(0),Vt(l,2,k.util.createBuffer(e.virtualHost));var f=k.util.createBuffer();Vt(f,2,l),Vt(u,2,f),o.putBuffer(u)}var c=o.length();c>0&&(c+=2);var p=e.session.id,m=p.length+1+2+4+28+2+a+1+s+c,v=k.util.createBuffer();return v.putByte(g.HandshakeType.client_hello),v.putInt24(m),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),Vt(v,1,k.util.createBuffer(p)),Vt(v,2,t),Vt(v,1,n),c>0&&Vt(v,2,o),v};g.createServerHello=function(e){var t=e.session.id,i=t.length+1+2+4+28+2+1,r=k.util.createBuffer();return r.putByte(g.HandshakeType.server_hello),r.putInt24(i),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Vt(r,1,k.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,i=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,r)}var a=k.util.createBuffer();if(i!==null)try{k.util.isArray(i)||(i=[i]);for(var n=null,s=0;s<i.length;++s){var o=k.pem.decode(i[s])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var u=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw u.headerType=o.type,u}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=k.util.createBuffer(o.body);n===null&&(n=k.asn1.fromDer(l.bytes(),!1));var f=k.util.createBuffer();Vt(f,3,l),a.putBuffer(f)}i=k.pki.certificateFromAsn1(n),t?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(m){return e.error(e,{message:"Could not send certificate list.",cause:m,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var c=3+a.length(),p=k.util.createBuffer();return p.putByte(g.HandshakeType.certificate),p.putInt24(c),Vt(p,3,a),p};g.createClientKeyExchange=function(e){var t=k.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(k.random.getBytes(46));var i=e.session.sp;i.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(i.pre_master_secret);var a=t.length+2,n=k.util.createBuffer();return n.putByte(g.HandshakeType.client_key_exchange),n.putInt24(a),n.putInt16(t.length),n.putBytes(t),n};g.createServerKeyExchange=function(e){var t=0,i=k.util.createBuffer();return t>0&&(i.putByte(g.HandshakeType.server_key_exchange),i.putInt24(t)),i};g.getClientSignature=function(e,t){var i=k.util.createBuffer();i.putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest()),i=i.getBytes(),e.getSignature=e.getSignature||function(r,a,n){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=k.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):a=s.sign(a,null),n(r,a)},e.getSignature(e,i,t)};g.createCertificateVerify=function(e,t){var i=t.length+2,r=k.util.createBuffer();return r.putByte(g.HandshakeType.certificate_verify),r.putInt24(i),r.putInt16(t.length),r.putBytes(t),r};g.createCertificateRequest=function(e){var t=k.util.createBuffer();t.putByte(1);var i=k.util.createBuffer();for(var r in e.caStore.certs){var a=e.caStore.certs[r],n=k.pki.distinguishedNameToAsn1(a.subject),s=k.asn1.toDer(n);i.putInt16(s.length()),i.putBuffer(s)}var o=1+t.length()+2+i.length(),u=k.util.createBuffer();return u.putByte(g.HandshakeType.certificate_request),u.putInt24(o),Vt(u,1,t),Vt(u,2,i),u};g.createServerHelloDone=function(e){var t=k.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t};g.createChangeCipherSpec=function(){var e=k.util.createBuffer();return e.putByte(1),e};g.createFinished=function(e){var t=k.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var i=e.entity===g.ConnectionEnd.client,r=e.session.sp,a=12,n=tn,s=i?"client finished":"server finished";t=n(r.master_secret,s,t.getBytes(),a);var o=k.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};g.createHeartbeat=function(e,t,i){typeof i>"u"&&(i=t.length);var r=k.util.createBuffer();r.putByte(e),r.putInt16(i),r.putBytes(t);var a=r.length(),n=Math.max(16,a-i-3);return r.putBytes(k.random.getBytes(n)),r};g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var i=t.fragment.bytes();e.session.md5.update(i),e.session.sha1.update(i),i=null}var r;if(t.fragment.length()<=g.MaxFragment)r=[t];else{r=[];for(var a=t.fragment.bytes();a.length>g.MaxFragment;)r.push(g.createRecord(e,{type:t.type,data:k.util.createBuffer(a.slice(0,g.MaxFragment))})),a=a.slice(g.MaxFragment);a.length>0&&r.push(g.createRecord(e,{type:t.type,data:k.util.createBuffer(a)}))}for(var n=0;n<r.length&&!e.fail;++n){var s=r[n],o=e.state.current.write;o.update(e,s)&&e.records.push(s)}}};g.flush=function(e){for(var t=0;t<e.records.length;++t){var i=e.records[t];e.tlsData.putByte(i.type),e.tlsData.putByte(i.version.major),e.tlsData.putByte(i.version.minor),e.tlsData.putInt16(i.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var ws=function(e){switch(e){case!0:return!0;case k.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case k.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case k.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case k.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case k.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case k.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},mm=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return k.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return k.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return k.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return k.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return k.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return k.pki.certificateError.unknown_ca;default:return k.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var i={};for(var r in e.verifyOptions)i[r]=e.verifyOptions[r];i.verify=function(n,s,o){var u=ws(n),l=e.verify(e,n,s,o);if(l!==!0){if(typeof l=="object"&&!k.util.isArray(l)){var f=new Error("The application rejected the certificate.");throw f.send=!0,f.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},l.message&&(f.message=l.message),l.alert&&(f.alert.description=l.alert),f}l!==n&&(l=mm(l))}return l},k.pki.verifyCertificateChain(e.caStore,t,i)}catch(n){var a=n;(typeof a!="object"||k.util.isArray(a))&&(a={send:!0,alert:{level:g.Alert.Level.fatal,description:ws(n)}}),"send"in a||(a.send=!0),"alert"in a||(a.alert={level:g.Alert.Level.fatal,description:ws(a.error)}),e.error(e,a)}return!e.fail};g.createSessionCache=function(e,t){var i=null;if(e&&e.getSession&&e.setSession&&e.order)i=e;else{i={},i.cache=e||{},i.capacity=Math.max(t||100,1),i.order=[];for(var r in e)i.order.length<=t?i.order.push(r):delete e[r];i.getSession=function(a){var n=null,s=null;if(a?s=k.util.bytesToHex(a):i.order.length>0&&(s=i.order[0]),s!==null&&s in i.cache){n=i.cache[s],delete i.cache[s];for(var o in i.order)if(i.order[o]===s){i.order.splice(o,1);break}}return n},i.setSession=function(a,n){if(i.order.length===i.capacity){var s=i.order.shift();delete i.cache[s]}var s=k.util.bytesToHex(a);i.order.push(s),i.cache[s]=n}}return i};g.createConnection=function(e){var t=null;e.caStore?k.util.isArray(e.caStore)?t=k.pki.createCaStore(e.caStore):t=e.caStore:t=k.pki.createCaStore();var i=e.cipherSuites||null;if(i===null){i=[];for(var r in g.CipherSuites)i.push(g.CipherSuites[r])}var a=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,n=e.sessionCache?g.createSessionCache(e.sessionCache):null,s={version:{major:g.Version.major,minor:g.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:n,cipherSuites:i,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(f,c,p,m){return c},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:k.util.createBuffer(),tlsData:k.util.createBuffer(),data:k.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(f,c){c.origin=c.origin||(f.entity===g.ConnectionEnd.client?"client":"server"),c.send&&(g.queue(f,g.createAlert(f,c.alert)),g.flush(f));var p=c.fatal!==!1;p&&(f.fail=!0),e.error(f,c),p&&f.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(f){s.version={major:g.Version.major,minor:g.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===g.ConnectionEnd.client?rm:lm,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(f||typeof f>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=g.createConnectionState(s)},s.reset();var o=function(f,c){var p=c.type-g.ContentType.change_cipher_spec,m=ks[f.entity][f.expect];p in m?m[p](f,c):g.handleUnexpected(f,c)},u=function(f){var c=0,p=f.input,m=p.length();if(m<5)c=5-m;else{f.record={type:p.getByte(),version:{major:p.getByte(),minor:p.getByte()},length:p.getInt16(),fragment:k.util.createBuffer(),ready:!1};var v=f.record.version.major===f.version.major;v&&f.session&&f.session.version&&(v=f.record.version.minor===f.version.minor),v||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return c},l=function(f){var c=0,p=f.input,m=p.length();if(m<f.record.length)c=f.record.length-m;else{f.record.fragment.putBytes(p.getBytes(f.record.length)),p.compact();var v=f.state.current.read;v.update(f,f.record)&&(f.fragmented!==null&&(f.fragmented.type===f.record.type?(f.fragmented.fragment.putBuffer(f.record.fragment),f.record=f.fragmented):f.error(f,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),f.record.ready=!0)}return c};return s.handshake=function(f){if(s.entity!==g.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,f=f||"";var c=null;f.length>0&&(s.sessionCache&&(c=s.sessionCache.getSession(f)),c===null&&(f="")),f.length===0&&s.sessionCache&&(c=s.sessionCache.getSession(),c!==null&&(f=c.id)),s.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:k.md.md5.create(),sha1:k.md.sha1.create()},c&&(s.version=c.version,s.session.sp=c.sp),s.session.sp.client_random=g.createRandom().getBytes(),s.open=!0,g.queue(s,g.createRecord(s,{type:g.ContentType.handshake,data:g.createClientHello(s)})),g.flush(s)}},s.process=function(f){var c=0;return f&&s.input.putBytes(f),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(c=u(s)),!s.fail&&s.record!==null&&!s.record.ready&&(c=l(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),c},s.prepare=function(f){return g.queue(s,g.createRecord(s,{type:g.ContentType.application_data,data:k.util.createBuffer(f)})),g.flush(s)},s.prepareHeartbeatRequest=function(f,c){return f instanceof k.util.ByteBuffer&&(f=f.bytes()),typeof c>"u"&&(c=f.length),s.expectedHeartbeatPayload=f,g.queue(s,g.createRecord(s,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,f,c)})),g.flush(s)},s.close=function(f){if(!s.fail&&s.sessionCache&&s.session){var c={id:s.session.id,version:s.session.version,sp:s.session.sp};c.sp.keys=null,s.sessionCache.setSession(c.id,c)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,g.queue(s,g.createAlert(s,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(s)),s.closed(s)),s.reset(f)},s};l0.exports=k.tls=k.tls||{};for(Za in g)typeof g[Za]!="function"&&(k.tls[Za]=g[Za]);var Za;k.tls.prf_tls1=tn;k.tls.hmac_sha1=Zy;k.tls.createSessionCache=g.createSessionCache;k.tls.createConnection=g.createConnection});var h0=F((wE,c0)=>{"use strict";S();var kr=oe();Ir();Ls();var Ft=c0.exports=kr.tls;Ft.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Ft.BulkCipherAlgorithm.aes,e.cipher_type=Ft.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Ft.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:f0};Ft.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Ft.BulkCipherAlgorithm.aes,e.cipher_type=Ft.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Ft.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:f0};function f0(e,t,i){var r=t.entity===kr.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:kr.cipher.createDecipher("AES-CBC",r?i.keys.server_write_key:i.keys.client_write_key),iv:r?i.keys.server_write_IV:i.keys.client_write_IV},e.write.cipherState={init:!1,cipher:kr.cipher.createCipher("AES-CBC",r?i.keys.client_write_key:i.keys.server_write_key),iv:r?i.keys.client_write_IV:i.keys.server_write_IV},e.read.cipherFunction=xm,e.write.cipherFunction=Am,e.read.macLength=e.write.macLength=i.mac_length,e.read.macFunction=e.write.macFunction=Ft.hmac_sha1}function Am(e,t){var i=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var a;e.version.minor===Ft.Versions.TLS_1_0.minor?a=t.cipherState.init?null:t.cipherState.iv:a=kr.random.getBytesSync(16),t.cipherState.init=!0;var n=t.cipherState.cipher;return n.start({iv:a}),e.version.minor>=Ft.Versions.TLS_1_1.minor&&n.output.putBytes(a),n.update(e.fragment),n.finish(Cm)&&(e.fragment=n.output,e.length=e.fragment.length(),i=!0),i}function Cm(e,t,i){if(!i){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function Em(e,t,i){var r=!0;if(i){for(var a=t.length(),n=t.last(),s=a-1-n;s<a-1;++s)r=r&&t.at(s)==n;r&&t.truncate(n+1)}return r}function xm(e,t){var i=!1,r;e.version.minor===Ft.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var a=t.cipherState.cipher;a.start({iv:r}),a.update(e.fragment),i=a.finish(Em);var n=t.macLength,s=kr.random.getBytesSync(n),o=a.output.length();o>=n?(e.fragment=a.output.getBytes(o-n),s=a.output.getBytes(n)):e.fragment=a.output.getBytes(),e.fragment=kr.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=Sm(t.macKey,s,u)&&i,i}function Sm(e,t,i){var r=kr.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(i),i=r.digest().getBytes(),t===i}});var Ps=F((NE,v0)=>{"use strict";S();var ke=oe();Jt();Ae();var Xi=v0.exports=ke.sha512=ke.sha512||{};ke.md.sha512=ke.md.algorithms.sha512=Xi;var d0=ke.sha384=ke.sha512.sha384=ke.sha512.sha384||{};d0.create=function(){return Xi.create("SHA-384")};ke.md.sha384=ke.md.algorithms.sha384=d0;ke.sha512.sha256=ke.sha512.sha256||{create:function(){return Xi.create("SHA-512/256")}};ke.md["sha512/256"]=ke.md.algorithms["sha512/256"]=ke.sha512.sha256;ke.sha512.sha224=ke.sha512.sha224||{create:function(){return Xi.create("SHA-512/224")}};ke.md["sha512/224"]=ke.md.algorithms["sha512/224"]=ke.sha512.sha224;Xi.create=function(e){if(g0||Im(),typeof e>"u"&&(e="SHA-512"),!(e in Kr))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Kr[e],i=null,r=ke.util.createBuffer(),a=new Array(80),n=0;n<80;++n)a[n]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var u=o.messageLengthSize/4,l=0;l<u;++l)o.fullMessageLength.push(0);r=ke.util.createBuffer(),i=new Array(t.length);for(var l=0;l<t.length;++l)i[l]=t[l].slice(0);return o},o.start(),o.update=function(u,l){l==="utf8"&&(u=ke.util.encodeUtf8(u));var f=u.length;o.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var c=o.fullMessageLength.length-1;c>=0;--c)o.fullMessageLength[c]+=f[1],f[1]=f[0]+(o.fullMessageLength[c]/4294967296>>>0),o.fullMessageLength[c]=o.fullMessageLength[c]>>>0,f[0]=f[1]/4294967296>>>0;return r.putBytes(u),p0(i,a,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var u=ke.util.createBuffer();u.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,f=l&o.blockLength-1;u.putBytes(Rs.substr(0,o.blockLength-f));for(var c,p,m=o.fullMessageLength[0]*8,v=0;v<o.fullMessageLength.length-1;++v)c=o.fullMessageLength[v+1]*8,p=c/4294967296>>>0,m+=p,u.putInt32(m>>>0),m=c>>>0;u.putInt32(m);for(var C=new Array(i.length),v=0;v<i.length;++v)C[v]=i[v].slice(0);p0(C,a,u);var E=ke.util.createBuffer(),B;e==="SHA-512"?B=C.length:e==="SHA-384"?B=C.length-2:B=C.length-4;for(var v=0;v<B;++v)E.putInt32(C[v][0]),(v!==B-1||e!=="SHA-512/224")&&E.putInt32(C[v][1]);return E},o};var Rs=null,g0=!1,Ds=null,Kr=null;function Im(){Rs="\x80",Rs+=ke.util.fillString("\0",128),Ds=[[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]],Kr={},Kr["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Kr["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Kr["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Kr["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],g0=!0}function p0(e,t,i){for(var r,a,n,s,o,u,l,f,c,p,m,v,C,E,B,w,T,U,P,Q,te,ne,H,z,Y,re,ye,Ee,$,ie,V,_e,xe,Oe,Ve,qe=i.length();qe>=128;){for($=0;$<16;++$)t[$][0]=i.getInt32()>>>0,t[$][1]=i.getInt32()>>>0;for(;$<80;++$)_e=t[$-2],ie=_e[0],V=_e[1],r=((ie>>>19|V<<13)^(V>>>29|ie<<3)^ie>>>6)>>>0,a=((ie<<13|V>>>19)^(V<<3|ie>>>29)^(ie<<26|V>>>6))>>>0,Oe=t[$-15],ie=Oe[0],V=Oe[1],n=((ie>>>1|V<<31)^(ie>>>8|V<<24)^ie>>>7)>>>0,s=((ie<<31|V>>>1)^(ie<<24|V>>>8)^(ie<<25|V>>>7))>>>0,xe=t[$-7],Ve=t[$-16],V=a+xe[1]+s+Ve[1],t[$][0]=r+xe[0]+n+Ve[0]+(V/4294967296>>>0)>>>0,t[$][1]=V>>>0;for(C=e[0][0],E=e[0][1],B=e[1][0],w=e[1][1],T=e[2][0],U=e[2][1],P=e[3][0],Q=e[3][1],te=e[4][0],ne=e[4][1],H=e[5][0],z=e[5][1],Y=e[6][0],re=e[6][1],ye=e[7][0],Ee=e[7][1],$=0;$<80;++$)l=((te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23))>>>0,f=((te<<18|ne>>>14)^(te<<14|ne>>>18)^(ne<<23|te>>>9))>>>0,c=(Y^te&(H^Y))>>>0,p=(re^ne&(z^re))>>>0,o=((C>>>28|E<<4)^(E>>>2|C<<30)^(E>>>7|C<<25))>>>0,u=((C<<4|E>>>28)^(E<<30|C>>>2)^(E<<25|C>>>7))>>>0,m=(C&B|T&(C^B))>>>0,v=(E&w|U&(E^w))>>>0,V=Ee+f+p+Ds[$][1]+t[$][1],r=ye+l+c+Ds[$][0]+t[$][0]+(V/4294967296>>>0)>>>0,a=V>>>0,V=u+v,n=o+m+(V/4294967296>>>0)>>>0,s=V>>>0,ye=Y,Ee=re,Y=H,re=z,H=te,z=ne,V=Q+a,te=P+r+(V/4294967296>>>0)>>>0,ne=V>>>0,P=T,Q=U,T=B,U=w,B=C,w=E,V=a+s,C=r+n+(V/4294967296>>>0)>>>0,E=V>>>0;V=e[0][1]+E,e[0][0]=e[0][0]+C+(V/4294967296>>>0)>>>0,e[0][1]=V>>>0,V=e[1][1]+w,e[1][0]=e[1][0]+B+(V/4294967296>>>0)>>>0,e[1][1]=V>>>0,V=e[2][1]+U,e[2][0]=e[2][0]+T+(V/4294967296>>>0)>>>0,e[2][1]=V>>>0,V=e[3][1]+Q,e[3][0]=e[3][0]+P+(V/4294967296>>>0)>>>0,e[3][1]=V>>>0,V=e[4][1]+ne,e[4][0]=e[4][0]+te+(V/4294967296>>>0)>>>0,e[4][1]=V>>>0,V=e[5][1]+z,e[5][0]=e[5][0]+H+(V/4294967296>>>0)>>>0,e[5][1]=V>>>0,V=e[6][1]+re,e[6][0]=e[6][0]+Y+(V/4294967296>>>0)>>>0,e[6][1]=V>>>0,V=e[7][1]+Ee,e[7][0]=e[7][0]+ye+(V/4294967296>>>0)>>>0,e[7][1]=V>>>0,qe-=128}}});var y0=F(Qs=>{"use strict";S();var Bm=oe();Gt();var Ye=Bm.asn1;Qs.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Qs.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var N0=F((DE,_0)=>{"use strict";S();var $e=oe();Yi();Pt();Ps();Ae();var S0=y0(),bm=S0.publicKeyValidator,Tm=S0.privateKeyValidator;typeof m0>"u"&&(m0=$e.jsbn.BigInteger);var m0,Vs=$e.util.ByteBuffer,bt=typeof Buffer>"u"?Uint8Array:Buffer;$e.pki=$e.pki||{};_0.exports=$e.pki.ed25519=$e.ed25519=$e.ed25519||{};var ce=$e.ed25519;ce.constants={};ce.constants.PUBLIC_KEY_BYTE_LENGTH=32;ce.constants.PRIVATE_KEY_BYTE_LENGTH=64;ce.constants.SEED_BYTE_LENGTH=32;ce.constants.SIGN_BYTE_LENGTH=64;ce.constants.HASH_BYTE_LENGTH=64;ce.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=$e.random.getBytesSync(ce.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==ce.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ce.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=cr({message:t,encoding:"binary"});for(var i=new bt(ce.constants.PUBLIC_KEY_BYTE_LENGTH),r=new bt(ce.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)r[a]=t[a];return km(i,r),{publicKey:i,privateKey:r}};ce.privateKeyFromAsn1=function(e){var t={},i=[],r=$e.asn1.validate(e,Tm,t,i);if(!r){var a=new Error("Invalid Key.");throw a.errors=i,a}var n=$e.asn1.derToOid(t.privateKeyOid),s=$e.oids.EdDSA25519;if(n!==s)throw new Error('Invalid OID "'+n+'"; OID must be "'+s+'".');var o=t.privateKey,u=cr({message:$e.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:u}};ce.publicKeyFromAsn1=function(e){var t={},i=[],r=$e.asn1.validate(e,bm,t,i);if(!r){var a=new Error("Invalid Key.");throw a.errors=i,a}var n=$e.asn1.derToOid(t.publicKeyOid),s=$e.oids.EdDSA25519;if(n!==s)throw new Error('Invalid OID "'+n+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==ce.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return cr({message:o,encoding:"binary"})};ce.publicKeyFromPrivateKey=function(e){e=e||{};var t=cr({message:e.privateKey,encoding:"binary"});if(t.length!==ce.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ce.constants.PRIVATE_KEY_BYTE_LENGTH);for(var i=new bt(ce.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<i.length;++r)i[r]=t[32+r];return i};ce.sign=function(e){e=e||{};var t=cr(e),i=cr({message:e.privateKey,encoding:"binary"});if(i.length===ce.constants.SEED_BYTE_LENGTH){var r=ce.generateKeyPair({seed:i});i=r.privateKey}else if(i.length!==ce.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ce.constants.SEED_BYTE_LENGTH+" or "+ce.constants.PRIVATE_KEY_BYTE_LENGTH);var a=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length);Lm(a,t,t.length,i);for(var n=new bt(ce.constants.SIGN_BYTE_LENGTH),s=0;s<n.length;++s)n[s]=a[s];return n};ce.verify=function(e){e=e||{};var t=cr(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var i=cr({message:e.signature,encoding:"binary"});if(i.length!==ce.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+ce.constants.SIGN_BYTE_LENGTH);var r=cr({message:e.publicKey,encoding:"binary"});if(r.length!==ce.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+ce.constants.PUBLIC_KEY_BYTE_LENGTH);var a=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length),n=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length),s;for(s=0;s<ce.constants.SIGN_BYTE_LENGTH;++s)a[s]=i[s];for(s=0;s<t.length;++s)a[s+ce.constants.SIGN_BYTE_LENGTH]=t[s];return Rm(n,a,a.length,r)>=0};function cr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof bt)return t;var i=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),i="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!i)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,i);t=new Vs(t,i)}else if(!(t instanceof Vs))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new bt(t.length()),a=0;a<r.length;++a)r[a]=t.at(a);return r}var Fs=Z(),rn=Z([1]),wm=Z([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),_m=Z([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),A0=Z([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),C0=Z([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Us=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),Nm=Z([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function $i(e,t){var i=$e.md.sha512.create(),r=new Vs(e);i.update(r.getBytes(t),"binary");var a=i.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(a,"binary");for(var n=new bt(ce.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)n[s]=a.charCodeAt(s);return n}function km(e,t){var i=[Z(),Z(),Z(),Z()],r,a=$i(t,32);for(a[0]&=248,a[31]&=127,a[31]|=64,Hs(i,a),Ks(e,i),r=0;r<32;++r)t[r+32]=e[r];return 0}function Lm(e,t,i,r){var a,n,s=new Float64Array(64),o=[Z(),Z(),Z(),Z()],u=$i(r,32);u[0]&=248,u[31]&=127,u[31]|=64;var l=i+64;for(a=0;a<i;++a)e[64+a]=t[a];for(a=0;a<32;++a)e[32+a]=u[32+a];var f=$i(e.subarray(32),i+32);for(Ms(f),Hs(o,f),Ks(e,o),a=32;a<64;++a)e[a]=r[a];var c=$i(e,i+64);for(Ms(c),a=32;a<64;++a)s[a]=0;for(a=0;a<32;++a)s[a]=f[a];for(a=0;a<32;++a)for(n=0;n<32;n++)s[a+n]+=c[a]*u[n];return I0(e.subarray(32),s),l}function Rm(e,t,i,r){var a,n,s=new bt(32),o=[Z(),Z(),Z(),Z()],u=[Z(),Z(),Z(),Z()];if(n=-1,i<64||Dm(u,r))return-1;for(a=0;a<i;++a)e[a]=t[a];for(a=0;a<32;++a)e[a+32]=r[a];var l=$i(e,i);if(Ms(l),T0(o,u,l),Hs(u,t.subarray(32)),qs(o,u),Ks(s,o),i-=64,B0(t,0,s,0)){for(a=0;a<i;++a)e[a]=0;return-1}for(a=0;a<i;++a)e[a]=t[a+64];return n=i,n}function I0(e,t){var i,r,a,n;for(r=63;r>=32;--r){for(i=0,a=r-32,n=r-12;a<n;++a)t[a]+=i-16*t[r]*Us[a-(r-32)],i=t[a]+128>>8,t[a]-=i*256;t[a]+=i,t[r]=0}for(i=0,a=0;a<32;++a)t[a]+=i-(t[31]>>4)*Us[a],i=t[a]>>8,t[a]&=255;for(a=0;a<32;++a)t[a]-=i*Us[a];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function Ms(e){for(var t=new Float64Array(64),i=0;i<64;++i)t[i]=e[i],e[i]=0;I0(e,t)}function qs(e,t){var i=Z(),r=Z(),a=Z(),n=Z(),s=Z(),o=Z(),u=Z(),l=Z(),f=Z();di(i,e[1],e[0]),di(f,t[1],t[0]),be(i,i,f),pi(r,e[0],e[1]),pi(f,t[0],t[1]),be(r,r,f),be(a,e[3],t[3]),be(a,a,_m),be(n,e[2],t[2]),pi(n,n,n),di(s,r,i),di(o,n,a),pi(u,n,a),pi(l,r,i),be(e[0],s,o),be(e[1],l,u),be(e[2],u,o),be(e[3],s,l)}function E0(e,t,i){for(var r=0;r<4;++r)w0(e[r],t[r],i)}function Ks(e,t){var i=Z(),r=Z(),a=Z();Om(a,t[2]),be(i,t[0],a),be(r,t[1],a),an(e,r),e[31]^=b0(i)<<7}function an(e,t){var i,r,a,n=Z(),s=Z();for(i=0;i<16;++i)s[i]=t[i];for(Os(s),Os(s),Os(s),r=0;r<2;++r){for(n[0]=s[0]-65517,i=1;i<15;++i)n[i]=s[i]-65535-(n[i-1]>>16&1),n[i-1]&=65535;n[15]=s[15]-32767-(n[14]>>16&1),a=n[15]>>16&1,n[14]&=65535,w0(s,n,1-a)}for(i=0;i<16;i++)e[2*i]=s[i]&255,e[2*i+1]=s[i]>>8}function Dm(e,t){var i=Z(),r=Z(),a=Z(),n=Z(),s=Z(),o=Z(),u=Z();return Lr(e[2],rn),Pm(e[1],t),Hr(a,e[1]),be(n,a,wm),di(a,a,e[2]),pi(n,e[2],n),Hr(s,n),Hr(o,s),be(u,o,s),be(i,u,a),be(i,i,n),Qm(i,i),be(i,i,a),be(i,i,n),be(i,i,n),be(e[0],i,n),Hr(r,e[0]),be(r,r,n),x0(r,a)&&be(e[0],e[0],Nm),Hr(r,e[0]),be(r,r,n),x0(r,a)?-1:(b0(e[0])===t[31]>>7&&di(e[0],Fs,e[0]),be(e[3],e[0],e[1]),0)}function Pm(e,t){var i;for(i=0;i<16;++i)e[i]=t[2*i]+(t[2*i+1]<<8);e[15]&=32767}function Qm(e,t){var i=Z(),r;for(r=0;r<16;++r)i[r]=t[r];for(r=250;r>=0;--r)Hr(i,i),r!==1&&be(i,i,t);for(r=0;r<16;++r)e[r]=i[r]}function x0(e,t){var i=new bt(32),r=new bt(32);return an(i,e),an(r,t),B0(i,0,r,0)}function B0(e,t,i,r){return Um(e,t,i,r,32)}function Um(e,t,i,r,a){var n,s=0;for(n=0;n<a;++n)s|=e[t+n]^i[r+n];return(1&s-1>>>8)-1}function b0(e){var t=new bt(32);return an(t,e),t[0]&1}function T0(e,t,i){var r,a;for(Lr(e[0],Fs),Lr(e[1],rn),Lr(e[2],rn),Lr(e[3],Fs),a=255;a>=0;--a)r=i[a/8|0]>>(a&7)&1,E0(e,t,r),qs(t,e),qs(e,e),E0(e,t,r)}function Hs(e,t){var i=[Z(),Z(),Z(),Z()];Lr(i[0],A0),Lr(i[1],C0),Lr(i[2],rn),be(i[3],A0,C0),T0(e,i,t)}function Lr(e,t){var i;for(i=0;i<16;i++)e[i]=t[i]|0}function Om(e,t){var i=Z(),r;for(r=0;r<16;++r)i[r]=t[r];for(r=253;r>=0;--r)Hr(i,i),r!==2&&r!==4&&be(i,i,t);for(r=0;r<16;++r)e[r]=i[r]}function Os(e){var t,i,r=1;for(t=0;t<16;++t)i=e[t]+r+65535,r=Math.floor(i/65536),e[t]=i-r*65536;e[0]+=r-1+37*(r-1)}function w0(e,t,i){for(var r,a=~(i-1),n=0;n<16;++n)r=a&(e[n]^t[n]),e[n]^=r,t[n]^=r}function Z(e){var t,i=new Float64Array(16);if(e)for(t=0;t<e.length;++t)i[t]=e[t];return i}function pi(e,t,i){for(var r=0;r<16;++r)e[r]=t[r]+i[r]}function di(e,t,i){for(var r=0;r<16;++r)e[r]=t[r]-i[r]}function Hr(e,t){be(e,t,t)}function be(e,t,i){var r,a,n=0,s=0,o=0,u=0,l=0,f=0,c=0,p=0,m=0,v=0,C=0,E=0,B=0,w=0,T=0,U=0,P=0,Q=0,te=0,ne=0,H=0,z=0,Y=0,re=0,ye=0,Ee=0,$=0,ie=0,V=0,_e=0,xe=0,Oe=i[0],Ve=i[1],qe=i[2],Ze=i[3],et=i[4],tt=i[5],rt=i[6],it=i[7],at=i[8],nt=i[9],st=i[10],ot=i[11],ut=i[12],lt=i[13],ft=i[14],ct=i[15];r=t[0],n+=r*Oe,s+=r*Ve,o+=r*qe,u+=r*Ze,l+=r*et,f+=r*tt,c+=r*rt,p+=r*it,m+=r*at,v+=r*nt,C+=r*st,E+=r*ot,B+=r*ut,w+=r*lt,T+=r*ft,U+=r*ct,r=t[1],s+=r*Oe,o+=r*Ve,u+=r*qe,l+=r*Ze,f+=r*et,c+=r*tt,p+=r*rt,m+=r*it,v+=r*at,C+=r*nt,E+=r*st,B+=r*ot,w+=r*ut,T+=r*lt,U+=r*ft,P+=r*ct,r=t[2],o+=r*Oe,u+=r*Ve,l+=r*qe,f+=r*Ze,c+=r*et,p+=r*tt,m+=r*rt,v+=r*it,C+=r*at,E+=r*nt,B+=r*st,w+=r*ot,T+=r*ut,U+=r*lt,P+=r*ft,Q+=r*ct,r=t[3],u+=r*Oe,l+=r*Ve,f+=r*qe,c+=r*Ze,p+=r*et,m+=r*tt,v+=r*rt,C+=r*it,E+=r*at,B+=r*nt,w+=r*st,T+=r*ot,U+=r*ut,P+=r*lt,Q+=r*ft,te+=r*ct,r=t[4],l+=r*Oe,f+=r*Ve,c+=r*qe,p+=r*Ze,m+=r*et,v+=r*tt,C+=r*rt,E+=r*it,B+=r*at,w+=r*nt,T+=r*st,U+=r*ot,P+=r*ut,Q+=r*lt,te+=r*ft,ne+=r*ct,r=t[5],f+=r*Oe,c+=r*Ve,p+=r*qe,m+=r*Ze,v+=r*et,C+=r*tt,E+=r*rt,B+=r*it,w+=r*at,T+=r*nt,U+=r*st,P+=r*ot,Q+=r*ut,te+=r*lt,ne+=r*ft,H+=r*ct,r=t[6],c+=r*Oe,p+=r*Ve,m+=r*qe,v+=r*Ze,C+=r*et,E+=r*tt,B+=r*rt,w+=r*it,T+=r*at,U+=r*nt,P+=r*st,Q+=r*ot,te+=r*ut,ne+=r*lt,H+=r*ft,z+=r*ct,r=t[7],p+=r*Oe,m+=r*Ve,v+=r*qe,C+=r*Ze,E+=r*et,B+=r*tt,w+=r*rt,T+=r*it,U+=r*at,P+=r*nt,Q+=r*st,te+=r*ot,ne+=r*ut,H+=r*lt,z+=r*ft,Y+=r*ct,r=t[8],m+=r*Oe,v+=r*Ve,C+=r*qe,E+=r*Ze,B+=r*et,w+=r*tt,T+=r*rt,U+=r*it,P+=r*at,Q+=r*nt,te+=r*st,ne+=r*ot,H+=r*ut,z+=r*lt,Y+=r*ft,re+=r*ct,r=t[9],v+=r*Oe,C+=r*Ve,E+=r*qe,B+=r*Ze,w+=r*et,T+=r*tt,U+=r*rt,P+=r*it,Q+=r*at,te+=r*nt,ne+=r*st,H+=r*ot,z+=r*ut,Y+=r*lt,re+=r*ft,ye+=r*ct,r=t[10],C+=r*Oe,E+=r*Ve,B+=r*qe,w+=r*Ze,T+=r*et,U+=r*tt,P+=r*rt,Q+=r*it,te+=r*at,ne+=r*nt,H+=r*st,z+=r*ot,Y+=r*ut,re+=r*lt,ye+=r*ft,Ee+=r*ct,r=t[11],E+=r*Oe,B+=r*Ve,w+=r*qe,T+=r*Ze,U+=r*et,P+=r*tt,Q+=r*rt,te+=r*it,ne+=r*at,H+=r*nt,z+=r*st,Y+=r*ot,re+=r*ut,ye+=r*lt,Ee+=r*ft,$+=r*ct,r=t[12],B+=r*Oe,w+=r*Ve,T+=r*qe,U+=r*Ze,P+=r*et,Q+=r*tt,te+=r*rt,ne+=r*it,H+=r*at,z+=r*nt,Y+=r*st,re+=r*ot,ye+=r*ut,Ee+=r*lt,$+=r*ft,ie+=r*ct,r=t[13],w+=r*Oe,T+=r*Ve,U+=r*qe,P+=r*Ze,Q+=r*et,te+=r*tt,ne+=r*rt,H+=r*it,z+=r*at,Y+=r*nt,re+=r*st,ye+=r*ot,Ee+=r*ut,$+=r*lt,ie+=r*ft,V+=r*ct,r=t[14],T+=r*Oe,U+=r*Ve,P+=r*qe,Q+=r*Ze,te+=r*et,ne+=r*tt,H+=r*rt,z+=r*it,Y+=r*at,re+=r*nt,ye+=r*st,Ee+=r*ot,$+=r*ut,ie+=r*lt,V+=r*ft,_e+=r*ct,r=t[15],U+=r*Oe,P+=r*Ve,Q+=r*qe,te+=r*Ze,ne+=r*et,H+=r*tt,z+=r*rt,Y+=r*it,re+=r*at,ye+=r*nt,Ee+=r*st,$+=r*ot,ie+=r*ut,V+=r*lt,_e+=r*ft,xe+=r*ct,n+=38*P,s+=38*Q,o+=38*te,u+=38*ne,l+=38*H,f+=38*z,c+=38*Y,p+=38*re,m+=38*ye,v+=38*Ee,C+=38*$,E+=38*ie,B+=38*V,w+=38*_e,T+=38*xe,a=1,r=n+a+65535,a=Math.floor(r/65536),n=r-a*65536,r=s+a+65535,a=Math.floor(r/65536),s=r-a*65536,r=o+a+65535,a=Math.floor(r/65536),o=r-a*65536,r=u+a+65535,a=Math.floor(r/65536),u=r-a*65536,r=l+a+65535,a=Math.floor(r/65536),l=r-a*65536,r=f+a+65535,a=Math.floor(r/65536),f=r-a*65536,r=c+a+65535,a=Math.floor(r/65536),c=r-a*65536,r=p+a+65535,a=Math.floor(r/65536),p=r-a*65536,r=m+a+65535,a=Math.floor(r/65536),m=r-a*65536,r=v+a+65535,a=Math.floor(r/65536),v=r-a*65536,r=C+a+65535,a=Math.floor(r/65536),C=r-a*65536,r=E+a+65535,a=Math.floor(r/65536),E=r-a*65536,r=B+a+65535,a=Math.floor(r/65536),B=r-a*65536,r=w+a+65535,a=Math.floor(r/65536),w=r-a*65536,r=T+a+65535,a=Math.floor(r/65536),T=r-a*65536,r=U+a+65535,a=Math.floor(r/65536),U=r-a*65536,n+=a-1+37*(a-1),a=1,r=n+a+65535,a=Math.floor(r/65536),n=r-a*65536,r=s+a+65535,a=Math.floor(r/65536),s=r-a*65536,r=o+a+65535,a=Math.floor(r/65536),o=r-a*65536,r=u+a+65535,a=Math.floor(r/65536),u=r-a*65536,r=l+a+65535,a=Math.floor(r/65536),l=r-a*65536,r=f+a+65535,a=Math.floor(r/65536),f=r-a*65536,r=c+a+65535,a=Math.floor(r/65536),c=r-a*65536,r=p+a+65535,a=Math.floor(r/65536),p=r-a*65536,r=m+a+65535,a=Math.floor(r/65536),m=r-a*65536,r=v+a+65535,a=Math.floor(r/65536),v=r-a*65536,r=C+a+65535,a=Math.floor(r/65536),C=r-a*65536,r=E+a+65535,a=Math.floor(r/65536),E=r-a*65536,r=B+a+65535,a=Math.floor(r/65536),B=r-a*65536,r=w+a+65535,a=Math.floor(r/65536),w=r-a*65536,r=T+a+65535,a=Math.floor(r/65536),T=r-a*65536,r=U+a+65535,a=Math.floor(r/65536),U=r-a*65536,n+=a-1+37*(a-1),e[0]=n,e[1]=s,e[2]=o,e[3]=u,e[4]=l,e[5]=f,e[6]=c,e[7]=p,e[8]=m,e[9]=v,e[10]=C,e[11]=E,e[12]=B,e[13]=w,e[14]=T,e[15]=U}});var D0=F((QE,R0)=>{"use strict";S();var wt=oe();Ae();Pt();Yi();R0.exports=wt.kem=wt.kem||{};var k0=wt.jsbn.BigInteger;wt.kem.rsa={};wt.kem.rsa.create=function(e,t){t=t||{};var i=t.prng||wt.random,r={};return r.encrypt=function(a,n){var s=Math.ceil(a.n.bitLength()/8),o;do o=new k0(wt.util.bytesToHex(i.getBytesSync(s)),16).mod(a.n);while(o.compareTo(k0.ONE)<=0);o=wt.util.hexToBytes(o.toString(16));var u=s-o.length;u>0&&(o=wt.util.fillString("\0",u)+o);var l=a.encrypt(o,"NONE"),f=e.generate(o,n);return{encapsulation:l,key:f}},r.decrypt=function(a,n,s){var o=a.decrypt(n,"NONE");return e.generate(o,s)},r};wt.kem.kdf1=function(e,t){L0(this,e,0,t||e.digestLength)};wt.kem.kdf2=function(e,t){L0(this,e,1,t||e.digestLength)};function L0(e,t,i,r){e.generate=function(a,n){for(var s=new wt.util.ByteBuffer,o=Math.ceil(n/r)+i,u=new wt.util.ByteBuffer,l=i;l<o;++l){u.putInt32(l),t.start(),t.update(a+u.getBytes());var f=t.digest();s.putBytes(f.getBytes(r))}return s.truncate(s.length()-n),s.getBytes()}}});var O0=F((OE,U0)=>{"use strict";S();var pe=oe();Ae();U0.exports=pe.log=pe.log||{};pe.log.levels=["none","error","warning","info","debug","verbose","max"];var nn={},Ys=[],ea=null;pe.log.LEVEL_LOCKED=2;pe.log.NO_LEVEL_CHECK=4;pe.log.INTERPOLATE=8;for(ir=0;ir<pe.log.levels.length;++ir)Gs=pe.log.levels[ir],nn[Gs]={index:ir,name:Gs.toUpperCase()};var Gs,ir;pe.log.logMessage=function(e){for(var t=nn[e.level].index,i=0;i<Ys.length;++i){var r=Ys[i];if(r.flags&pe.log.NO_LEVEL_CHECK)r.f(e);else{var a=nn[r.level].index;t<=a&&r.f(r,e)}}};pe.log.prepareStandard=function(e){"standard"in e||(e.standard=nn[e.level].name+" ["+e.category+"] "+e.message)};pe.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=pe.util.format.apply(this,t)}};pe.log.prepareStandardFull=function(e){"standardFull"in e||(pe.log.prepareStandard(e),e.standardFull=e.standard)};for(js=["error","warning","info","debug","verbose"],ir=0;ir<js.length;++ir)(function(t){pe.log[t]=function(i,r){var a=Array.prototype.slice.call(arguments).slice(2),n={timestamp:new Date,level:t,category:i,message:r,arguments:a};pe.log.logMessage(n)}})(js[ir]);var js,ir;pe.log.makeLogger=function(e){var t={flags:0,f:e};return pe.log.setLevel(t,"none"),t};pe.log.setLevel=function(e,t){var i=!1;if(e&&!(e.flags&pe.log.LEVEL_LOCKED))for(var r=0;r<pe.log.levels.length;++r){var a=pe.log.levels[r];if(t==a){e.level=t,i=!0;break}}return i};pe.log.lock=function(e,t){typeof t>"u"||t?e.flags|=pe.log.LEVEL_LOCKED:e.flags&=~pe.log.LEVEL_LOCKED};pe.log.addLogger=function(e){Ys.push(e)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(P0={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},ta=function(e,t){pe.log.prepareStandard(t);var i=P0[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),i.apply(console,r)},gi=pe.log.makeLogger(ta)):(ta=function(t,i){pe.log.prepareStandardFull(i),console.log(i.standardFull)},gi=pe.log.makeLogger(ta)),pe.log.setLevel(gi,"debug"),pe.log.addLogger(gi),ea=gi):console={log:function(){}};var gi,P0,ta;ea!==null&&typeof window<"u"&&window.location&&(Zi=new URL(window.location.href).searchParams,Zi.has("console.level")&&pe.log.setLevel(ea,Zi.get("console.level").slice(-1)[0]),Zi.has("console.lock")&&(Q0=Zi.get("console.lock").slice(-1)[0],Q0=="true"&&pe.log.lock(ea)));var Zi,Q0;pe.log.consoleLogger=ea});var F0=F((FE,V0)=>{"use strict";S();V0.exports=Jt();Ua();ui();ss();Ps()});var K0=F((qE,q0)=>{"use strict";S();var M=oe();Ir();Gt();Gi();Br();Ur();Cs();Pt();Ae();Xa();var x=M.asn1,Ct=q0.exports=M.pkcs7=M.pkcs7||{};Ct.messageFromPem=function(e){var t=M.pem.decode(e)[0];if(t.type!=="PKCS7"){var i=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=x.fromDer(t.body);return Ct.messageFromAsn1(r)};Ct.messageToPem=function(e,t){var i={type:"PKCS7",body:x.toDer(e.toAsn1()).getBytes()};return M.pem.encode(i,{maxline:t})};Ct.messageFromAsn1=function(e){var t={},i=[];if(!x.validate(e,Ct.asn1.contentInfoValidator,t,i)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=i,r}var a=x.derToOid(t.contentType),n;switch(a){case M.pki.oids.envelopedData:n=Ct.createEnvelopedData();break;case M.pki.oids.encryptedData:n=Ct.createEncryptedData();break;case M.pki.oids.signedData:n=Ct.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+a+" is not (yet) supported.")}return n.fromAsn1(t.content.value[0]),n};Ct.createSignedData=function(){var e=null;return e={type:M.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Js(e,r,Ct.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var a=e.rawCapture.certificates.value,n=0;n<a.length;++n)e.certificates.push(M.pki.certificateFromAsn1(a[n]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],a=0;a<e.certificates.length;++a)r.push(M.pki.certificateToAsn1(e.certificates[a]));var n=[],s=x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&s.value[0].value.push(x.create(x.Class.CONTEXT_SPECIFIC,0,!0,r)),n.length>0&&s.value[0].value.push(x.create(x.Class.CONTEXT_SPECIFIC,1,!0,n)),s.value[0].value.push(x.create(x.Class.UNIVERSAL,x.Type.SET,!0,e.signerInfos)),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var a=r.issuer,n=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=M.pki.certificateFromPem(s)),a=s.issuer.attributes,n=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=M.pki.privateKeyFromPem(o));var u=r.digestAlgorithm||M.pki.oids.sha1;switch(u){case M.pki.oids.sha1:case M.pki.oids.sha256:case M.pki.oids.sha384:case M.pki.oids.sha512:case M.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var f=!1,c=!1,p=0;p<l.length;++p){var m=l[p];if(!f&&m.type===M.pki.oids.contentType){if(f=!0,c)break;continue}if(!c&&m.type===M.pki.oids.messageDigest){if(c=!0,f)break;continue}}if(!f||!c)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:a,serialNumber:n,digestAlgorithm:u,signatureAlgorithm:M.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(M.pki.oids.data).getBytes())]),"content"in e)){var a;e.content instanceof M.util.ByteBuffer?a=e.content.bytes():typeof e.content=="string"&&(a=M.util.encodeUtf8(e.content)),r.detached?e.detachedContent=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,a):e.contentInfo.value.push(x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,a)]))}if(e.signers.length!==0){var n=t();i(n)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=M.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},a=0;a<e.signers.length;++a){var n=e.signers[a],s=n.digestAlgorithm;s in r||(r[s]=M.md[M.pki.oids[s]].create()),n.authenticatedAttributes.length===0?n.md=r[s]:n.md=M.md[M.pki.oids[s]].create()}e.digestAlgorithmIdentifiers=[];for(var s in r)e.digestAlgorithmIdentifiers.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(s).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]));return r}function i(r){var a;if(e.detachedContent?a=e.detachedContent:(a=e.contentInfo.value[1],a=a.value[0]),!a)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var n=x.derToOid(e.contentInfo.value[0].value),s=x.toDer(a);s.getByte(),x.getBerValueLength(s),s=s.getBytes();for(var o in r)r[o].start().update(s);for(var u=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(f.authenticatedAttributes.length===0){if(n!==M.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var c=x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var m=f.authenticatedAttributes[p];m.type===M.pki.oids.messageDigest?m.value=r[f.digestAlgorithm].digest():m.type===M.pki.oids.signingTime&&(m.value||(m.value=u)),c.value.push(zs(m)),f.authenticatedAttributesAsn1.value.push(zs(m))}s=x.toDer(c).getBytes(),f.md.start().update(s)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=Hm(e.signers)}};Ct.createEncryptedData=function(){var e=null;return e={type:M.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){Js(e,t,Ct.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),M0(e)}},e};Ct.createEnvelopedData=function(){var e=null;return e={type:M.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){var i=Js(e,t,Ct.asn1.envelopedDataValidator);e.recipients=Mm(i.recipientInfos.value)},toAsn1:function(){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,qm(e.recipients)),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,Gm(e.encryptedContent))])])])},findRecipient:function(t){for(var i=t.issuer.attributes,r=0;r<e.recipients.length;++r){var a=e.recipients[r],n=a.issuer;if(a.serialNumber===t.serialNumber&&n.length===i.length){for(var s=!0,o=0;o<i.length;++o)if(n[o].type!==i[o].type||n[o].value!==i[o].value){s=!1;break}if(s)return a}}return null},decrypt:function(t,i){if(e.encryptedContent.key===void 0&&t!==void 0&&i!==void 0)switch(t.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:case M.pki.oids.desCBC:var r=i.decrypt(t.encryptedContent.content);e.encryptedContent.key=M.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}M0(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:M.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,i){if(e.encryptedContent.content===void 0){i=i||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,a,n;switch(i){case M.pki.oids["aes128-CBC"]:r=16,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["aes192-CBC"]:r=24,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["aes256-CBC"]:r=32,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["des-EDE3-CBC"]:r=24,a=8,n=M.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+i)}if(t===void 0)t=M.util.createBuffer(M.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=i,e.encryptedContent.key=t,e.encryptedContent.parameter=M.util.createBuffer(M.random.getBytes(a));var s=n(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var u=e.recipients[o];if(u.encryptedContent.content===void 0)switch(u.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}},e};function Vm(e){var t={},i=[];if(!x.validate(e,Ct.asn1.recipientInfoValidator,t,i)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=i,r}return{version:t.version.charCodeAt(0),issuer:M.pki.RDNAttributesAsArray(t.issuer),serialNumber:M.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:x.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function Fm(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.encryptedContent.algorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function Mm(e){for(var t=[],i=0;i<e.length;++i)t.push(Vm(e[i]));return t}function qm(e){for(var t=[],i=0;i<e.length;++i)t.push(Fm(e[i]));return t}function Km(e){var t=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.digestAlgorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.signatureAlgorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")])),t.value.push(x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var i=x.create(x.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var a=e.unauthenticatedAttributes[r];i.values.push(zs(a))}t.value.push(i)}return t}function Hm(e){for(var t=[],i=0;i<e.length;++i)t.push(Km(e[i]));return t}function zs(e){var t;if(e.type===M.pki.oids.contentType)t=x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.value).getBytes());else if(e.type===M.pki.oids.messageDigest)t=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===M.pki.oids.signingTime){var i=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),a=e.value;if(typeof a=="string"){var n=Date.parse(a);isNaN(n)?a.length===13?a=x.utcTimeToDate(a):a=x.generalizedTimeToDate(a):a=new Date(n)}a>=i&&a<r?t=x.create(x.Class.UNIVERSAL,x.Type.UTCTIME,!1,x.dateToUtcTime(a)):t=x.create(x.Class.UNIVERSAL,x.Type.GENERALIZEDTIME,!1,x.dateToGeneralizedTime(a))}return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[t])])}function Gm(e){return[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(M.pki.oids.data).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.algorithm).getBytes()),e.parameter?x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Js(e,t,i){var r={},a=[];if(!x.validate(t,i,r,a)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw n.errors=n,n}var s=x.derToOid(r.contentType);if(s!==M.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(M.util.isArray(r.encryptedContent))for(var u=0;u<r.encryptedContent.length;++u){if(r.encryptedContent[u].type!==x.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[u].value}else o=r.encryptedContent;e.encryptedContent={algorithm:x.derToOid(r.encAlgorithm),parameter:M.util.createBuffer(r.encParameter.value),content:M.util.createBuffer(o)}}if(r.content){var o="";if(M.util.isArray(r.content))for(var u=0;u<r.content.length;++u){if(r.content[u].type!==x.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[u].value}else o=r.content;e.content=M.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function M0(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case M.pki.oids["aes128-CBC"]:case M.pki.oids["aes192-CBC"]:case M.pki.oids["aes256-CBC"]:t=M.aes.createDecryptionCipher(e.encryptedContent.key);break;case M.pki.oids.desCBC:case M.pki.oids["des-EDE3-CBC"]:t=M.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}});var G0=F((HE,H0)=>{"use strict";S();var Me=oe();Ir();ai();Ua();ui();Ae();var on=H0.exports=Me.ssh=Me.ssh||{};on.privateKeyToPutty=function(e,t,i){i=i||"",t=t||"";var r="ssh-rsa",a=t===""?"none":"aes256-cbc",n="PuTTY-User-Key-File-2: "+r+`\r
22
+ `+o+t.substr(s+1),n=a-s-1,s=-1,++a}else(t[a]===" "||t[a]===" "||t[a]===",")&&(s=a);return t}function Cg(e){return e.replace(/^\s+/,"")}});var Gi=F((KC,ac)=>{"use strict";S();var Pe=oe();Na();Zn();Ae();ac.exports=Pe.des=Pe.des||{};Pe.des.startEncrypting=function(e,t,i,r){var a=Fa({key:e,output:i,decrypt:!1,mode:r||(t===null?"ECB":"CBC")});return a.start(t),a};Pe.des.createEncryptionCipher=function(e,t){return Fa({key:e,output:null,decrypt:!1,mode:t})};Pe.des.startDecrypting=function(e,t,i,r){var a=Fa({key:e,output:i,decrypt:!0,mode:r||(t===null?"ECB":"CBC")});return a.start(t),a};Pe.des.createDecryptionCipher=function(e,t){return Fa({key:e,output:null,decrypt:!0,mode:t})};Pe.des.Algorithm=function(e,t){var i=this;i.name=e,i.mode=new t({blockSize:8,cipher:{encrypt:function(r,a){return ic(i._keys,r,a,!1)},decrypt:function(r,a){return ic(i._keys,r,a,!0)}}}),i._init=!1};Pe.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=Pe.util.createBuffer(e.key);if(this.name.indexOf("3DES")===0&&t.length()!==24)throw new Error("Invalid Triple-DES key size: "+t.length()*8);this._keys=_g(t),this._init=!0}};Xt("DES-ECB",Pe.cipher.modes.ecb);Xt("DES-CBC",Pe.cipher.modes.cbc);Xt("DES-CFB",Pe.cipher.modes.cfb);Xt("DES-OFB",Pe.cipher.modes.ofb);Xt("DES-CTR",Pe.cipher.modes.ctr);Xt("3DES-ECB",Pe.cipher.modes.ecb);Xt("3DES-CBC",Pe.cipher.modes.cbc);Xt("3DES-CFB",Pe.cipher.modes.cfb);Xt("3DES-OFB",Pe.cipher.modes.ofb);Xt("3DES-CTR",Pe.cipher.modes.ctr);function Xt(e,t){var i=function(){return new Pe.des.Algorithm(e,t)};Pe.cipher.registerAlgorithm(e,i)}var Eg=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],xg=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],Sg=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],Ig=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],Bg=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],bg=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],Tg=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],wg=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function _g(e){for(var t=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],i=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],r=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],n=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],c=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],m=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],v=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=e.length()>8?3:1,E=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,T,U=0;U<C;U++){var P=e.getInt32(),Q=e.getInt32();T=(P>>>4^Q)&252645135,Q^=T,P^=T<<4,T=(Q>>>-16^P)&65535,P^=T,Q^=T<<-16,T=(P>>>2^Q)&858993459,Q^=T,P^=T<<2,T=(Q>>>-16^P)&65535,P^=T,Q^=T<<-16,T=(P>>>1^Q)&1431655765,Q^=T,P^=T<<1,T=(Q>>>8^P)&16711935,P^=T,Q^=T<<8,T=(P>>>1^Q)&1431655765,Q^=T,P^=T<<1,T=P<<8|Q>>>20&240,P=Q<<24|Q<<8&16711680|Q>>>8&65280|Q>>>24&240,Q=T;for(var te=0;te<B.length;++te){B[te]?(P=P<<2|P>>>26,Q=Q<<2|Q>>>26):(P=P<<1|P>>>27,Q=Q<<1|Q>>>27),P&=-15,Q&=-15;var ne=t[P>>>28]|i[P>>>24&15]|r[P>>>20&15]|a[P>>>16&15]|n[P>>>12&15]|s[P>>>8&15]|o[P>>>4&15],H=u[Q>>>28]|l[Q>>>24&15]|f[Q>>>20&15]|c[Q>>>16&15]|p[Q>>>12&15]|m[Q>>>8&15]|v[Q>>>4&15];T=(H>>>16^ne)&65535,E[w++]=ne^T,E[w++]=H^T<<16}}return E}function ic(e,t,i,r){var a=e.length===32?3:9,n;a===3?n=r?[30,-2,-2]:[0,32,2]:n=r?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var s,o=t[0],u=t[1];s=(o>>>4^u)&252645135,u^=s,o^=s<<4,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,o=o<<1|o>>>31,u=u<<1|u>>>31;for(var l=0;l<a;l+=3){for(var f=n[l+1],c=n[l+2],p=n[l];p!=f;p+=c){var m=u^e[p],v=(u>>>4|u<<28)^e[p+1];s=o,o=u,u=s^(xg[m>>>24&63]|Ig[m>>>16&63]|bg[m>>>8&63]|wg[m&63]|Eg[v>>>24&63]|Sg[v>>>16&63]|Bg[v>>>8&63]|Tg[v&63])}s=o,o=u,u=s}o=o>>>1|o<<31,u=u>>>1|u<<31,s=(o>>>1^u)&1431655765,u^=s,o^=s<<1,s=(u>>>8^o)&16711935,o^=s,u^=s<<8,s=(u>>>2^o)&858993459,o^=s,u^=s<<2,s=(o>>>16^u)&65535,u^=s,o^=s<<16,s=(o>>>4^u)&252645135,u^=s,o^=s<<4,i[0]=o,i[1]=u}function Fa(e){e=e||{};var t=(e.mode||"CBC").toUpperCase(),i="DES-"+t,r;e.decrypt?r=Pe.cipher.createDecipher(i,e.key):r=Pe.cipher.createCipher(i,e.key);var a=r.start;return r.start=function(n,s){var o=null;s instanceof Pe.util.ByteBuffer&&(o=s,s={}),s=s||{},s.output=o,s.iv=n,a.call(r,s)},r}});var Ma=F((GC,nc)=>{"use strict";S();var mt=oe();ai();Jt();Ae();var Ng=mt.pkcs5=mt.pkcs5||{},lr;mt.util.isNodejs&&!mt.options.usePureJavaScript&&(lr=Le("crypto"));nc.exports=mt.pbkdf2=Ng.pbkdf2=function(e,t,i,r,a,n){if(typeof a=="function"&&(n=a,a=null),mt.util.isNodejs&&!mt.options.usePureJavaScript&&lr.pbkdf2&&(a===null||typeof a!="object")&&(lr.pbkdf2Sync.length>4||!a||a==="sha1"))return typeof a!="string"&&(a="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),n?lr.pbkdf2Sync.length===4?lr.pbkdf2(e,t,i,r,function(T,U){if(T)return n(T);n(null,U.toString("binary"))}):lr.pbkdf2(e,t,i,r,a,function(T,U){if(T)return n(T);n(null,U.toString("binary"))}):lr.pbkdf2Sync.length===4?lr.pbkdf2Sync(e,t,i,r).toString("binary"):lr.pbkdf2Sync(e,t,i,r,a).toString("binary");if((typeof a>"u"||a===null)&&(a="sha1"),typeof a=="string"){if(!(a in mt.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=mt.md[a].create()}var s=a.digestLength;if(r>4294967295*s){var o=new Error("Derived key is too long.");if(n)return n(o);throw o}var u=Math.ceil(r/s),l=r-(u-1)*s,f=mt.hmac.create();f.start(a,e);var c="",p,m,v;if(!n){for(var C=1;C<=u;++C){f.start(null,null),f.update(t),f.update(mt.util.int32ToBytes(C)),p=v=f.digest().getBytes();for(var E=2;E<=i;++E)f.start(null,null),f.update(v),m=f.digest().getBytes(),p=mt.util.xorBytes(p,m,s),v=m;c+=C<u?p:p.substr(0,l)}return c}var C=1,E;function B(){if(C>u)return n(null,c);f.start(null,null),f.update(t),f.update(mt.util.int32ToBytes(C)),p=v=f.digest().getBytes(),E=2,w()}function w(){if(E<=i)return f.start(null,null),f.update(v),m=f.digest().getBytes(),p=mt.util.xorBytes(p,m,s),v=m,++E,mt.util.setImmediate(w);c+=C<u?p:p.substr(0,l),++C,B()}B()}});var ss=F((YC,fc)=>{"use strict";S();var $t=oe();Jt();Ae();var oc=fc.exports=$t.sha256=$t.sha256||{};$t.md.sha256=$t.md.algorithms.sha256=oc;oc.create=function(){uc||kg();var e=null,t=$t.util.createBuffer(),i=new Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=$t.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=$t.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),sc(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=$t.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(ns.substr(0,r.blockLength-s));for(var o,u,l=r.fullMessageLength[0]*8,f=0;f<r.fullMessageLength.length-1;++f)o=r.fullMessageLength[f+1]*8,u=o/4294967296>>>0,l+=u,a.putInt32(l>>>0),l=o>>>0;a.putInt32(l);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};sc(c,i,a);var p=$t.util.createBuffer();return p.putInt32(c.h0),p.putInt32(c.h1),p.putInt32(c.h2),p.putInt32(c.h3),p.putInt32(c.h4),p.putInt32(c.h5),p.putInt32(c.h6),p.putInt32(c.h7),p},r};var ns=null,uc=!1,lc=null;function kg(){ns="\x80",ns+=$t.util.fillString("\0",64),lc=[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],uc=!0}function sc(e,t,i){for(var r,a,n,s,o,u,l,f,c,p,m,v,C,E,B,w=i.length();w>=64;){for(l=0;l<16;++l)t[l]=i.getInt32();for(;l<64;++l)r=t[l-2],r=(r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10,a=t[l-15],a=(a>>>7|a<<25)^(a>>>18|a<<14)^a>>>3,t[l]=r+t[l-7]+a+t[l-16]|0;for(f=e.h0,c=e.h1,p=e.h2,m=e.h3,v=e.h4,C=e.h5,E=e.h6,B=e.h7,l=0;l<64;++l)s=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),o=E^v&(C^E),n=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&c|p&(f^c),r=B+s+o+lc[l]+t[l],a=n+u,B=E,E=C,C=v,v=m+r>>>0,m=p,p=c,c=f,f=r+a>>>0;e.h0=e.h0+f|0,e.h1=e.h1+c|0,e.h2=e.h2+p|0,e.h3=e.h3+m|0,e.h4=e.h4+v|0,e.h5=e.h5+C|0,e.h6=e.h6+E|0,e.h7=e.h7+B|0,w-=64}}});var os=F((JC,cc)=>{"use strict";S();var Zt=oe();Ae();var qa=null;Zt.util.isNodejs&&!Zt.options.usePureJavaScript&&!process.versions["node-webkit"]&&(qa=Le("crypto"));var Lg=cc.exports=Zt.prng=Zt.prng||{};Lg.create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},i=e.md,r=new Array(32),a=0;a<32;++a)r[a]=i.create();t.pools=r,t.pool=0,t.generate=function(l,f){if(!f)return t.generateSync(l);var c=t.plugin.cipher,p=t.plugin.increment,m=t.plugin.formatKey,v=t.plugin.formatSeed,C=Zt.util.createBuffer();t.key=null,E();function E(B){if(B)return f(B);if(C.length()>=l)return f(null,C.getBytes(l));if(t.generated>1048575&&(t.key=null),t.key===null)return Zt.util.nextTick(function(){n(E)});var w=c(t.key,t.seed);t.generated+=w.length,C.putBytes(w),t.key=m(c(t.key,p(t.seed))),t.seed=v(c(t.key,t.seed)),Zt.util.setImmediate(E)}},t.generateSync=function(l){var f=t.plugin.cipher,c=t.plugin.increment,p=t.plugin.formatKey,m=t.plugin.formatSeed;t.key=null;for(var v=Zt.util.createBuffer();v.length()<l;){t.generated>1048575&&(t.key=null),t.key===null&&s();var C=f(t.key,t.seed);t.generated+=C.length,v.putBytes(C),t.key=p(f(t.key,c(t.seed))),t.seed=m(f(t.key,t.seed))}return v.getBytes(l)};function n(l){if(t.pools[0].messageLength>=32)return o(),l();var f=32-t.pools[0].messageLength<<5;t.seedFile(f,function(c,p){if(c)return l(c);t.collect(p),o(),l()})}function s(){if(t.pools[0].messageLength>=32)return o();var l=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(l)),o()}function o(){t.reseeds=t.reseeds===4294967295?0:t.reseeds+1;var l=t.plugin.md.create();l.update(t.keyBytes);for(var f=1,c=0;c<32;++c)t.reseeds%f===0&&(l.update(t.pools[c].digest().getBytes()),t.pools[c].start()),f=f<<1;t.keyBytes=l.digest().getBytes(),l.start(),l.update(t.keyBytes);var p=l.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(p),t.generated=0}function u(l){var f=null,c=Zt.util.globalScope,p=c.crypto||c.msCrypto;p&&p.getRandomValues&&(f=function(P){return p.getRandomValues(P)});var m=Zt.util.createBuffer();if(f)for(;m.length()<l;){var v=Math.max(1,Math.min(l-m.length(),65536)/4),C=new Uint32Array(Math.floor(v));try{f(C);for(var E=0;E<C.length;++E)m.putInt32(C[E])}catch(P){if(!(typeof QuotaExceededError<"u"&&P instanceof QuotaExceededError))throw P}}if(m.length()<l)for(var B,w,T,U=Math.floor(Math.random()*65536);m.length()<l;){w=16807*(U&65535),B=16807*(U>>16),w+=(B&32767)<<16,w+=B>>15,w=(w&2147483647)+(w>>31),U=w&4294967295;for(var E=0;E<3;++E)T=U>>>(E<<3),T^=Math.floor(Math.random()*256),m.putByte(T&255)}return m.getBytes(l)}return qa?(t.seedFile=function(l,f){qa.randomBytes(l,function(c,p){if(c)return f(c);f(null,p.toString())})},t.seedFileSync=function(l){return qa.randomBytes(l).toString()}):(t.seedFile=function(l,f){try{f(null,u(l))}catch(c){f(c)}},t.seedFileSync=u),t.collect=function(l){for(var f=l.length,c=0;c<f;++c)t.pools[t.pool].update(l.substr(c,1)),t.pool=t.pool===31?0:t.pool+1},t.collectInt=function(l,f){for(var c="",p=0;p<f;p+=8)c+=String.fromCharCode(l>>p&255);t.collect(c)},t.registerWorker=function(l){if(l===self)t.seedFile=function(c,p){function m(v){var C=v.data;C.forge&&C.forge.prng&&(self.removeEventListener("message",m),p(C.forge.prng.err,C.forge.prng.bytes))}self.addEventListener("message",m),self.postMessage({forge:{prng:{needed:c}}})};else{var f=function(c){var p=c.data;p.forge&&p.forge.prng&&t.seedFile(p.forge.prng.needed,function(m,v){l.postMessage({forge:{prng:{err:m,bytes:v}}})})};l.addEventListener("message",f)}},t}});var Pt=F((XC,us)=>{"use strict";S();var je=oe();Ir();ss();os();Ae();(function(){if(je.random&&je.random.getBytes){us.exports=je.random;return}(function(e){var t={},i=new Array(4),r=je.util.createBuffer();t.formatKey=function(c){var p=je.util.createBuffer(c);return c=new Array(4),c[0]=p.getInt32(),c[1]=p.getInt32(),c[2]=p.getInt32(),c[3]=p.getInt32(),je.aes._expandKey(c,!1)},t.formatSeed=function(c){var p=je.util.createBuffer(c);return c=new Array(4),c[0]=p.getInt32(),c[1]=p.getInt32(),c[2]=p.getInt32(),c[3]=p.getInt32(),c},t.cipher=function(c,p){return je.aes._updateBlock(c,p,i,!1),r.putInt32(i[0]),r.putInt32(i[1]),r.putInt32(i[2]),r.putInt32(i[3]),r.getBytes()},t.increment=function(c){return++c[3],c},t.md=je.md.sha256;function a(){var c=je.prng.create(t);return c.getBytes=function(p,m){return c.generate(p,m)},c.getBytesSync=function(p){return c.generate(p)},c}var n=a(),s=null,o=je.util.globalScope,u=o.crypto||o.msCrypto;if(u&&u.getRandomValues&&(s=function(c){return u.getRandomValues(c)}),je.options.usePureJavaScript||!je.util.isNodejs&&!s){if(typeof window>"u"||window.document,n.collectInt(+new Date,32),typeof navigator<"u"){var l="";for(var f in navigator)try{typeof navigator[f]=="string"&&(l+=navigator[f])}catch{}n.collect(l),l=null}e&&(e().mousemove(function(c){n.collectInt(c.clientX,16),n.collectInt(c.clientY,16)}),e().keypress(function(c){n.collectInt(c.charCode,8)}))}if(!je.random)je.random=n;else for(var f in n)je.random[f]=n[f];je.random.createInstance=a,us.exports=je.random})(typeof jQuery<"u"?jQuery:null)})()});var fs=F((ZC,dc)=>{"use strict";S();var Bt=oe();Ae();var ls=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],hc=[1,2,3,5],Rg=function(e,t){return e<<t&65535|(e&65535)>>16-t},Dg=function(e,t){return(e&65535)>>t|e<<16-t&65535};dc.exports=Bt.rc2=Bt.rc2||{};Bt.rc2.expandKey=function(e,t){typeof e=="string"&&(e=Bt.util.createBuffer(e)),t=t||128;var i=e,r=e.length(),a=t,n=Math.ceil(a/8),s=255>>(a&7),o;for(o=r;o<128;o++)i.putByte(ls[i.at(o-1)+i.at(o-r)&255]);for(i.setAt(128-n,ls[i.at(128-n)&s]),o=127-n;o>=0;o--)i.setAt(o,ls[i.at(o+1)^i.at(o+n)]);return i};var pc=function(e,t,i){var r=!1,a=null,n=null,s=null,o,u,l,f,c=[];for(e=Bt.rc2.expandKey(e,t),l=0;l<64;l++)c.push(e.getInt16Le());i?(o=function(v){for(l=0;l<4;l++)v[l]+=c[f]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),v[l]=Rg(v[l],hc[l]),f++},u=function(v){for(l=0;l<4;l++)v[l]+=c[v[(l+3)%4]&63]}):(o=function(v){for(l=3;l>=0;l--)v[l]=Dg(v[l],hc[l]),v[l]-=c[f]+(v[(l+3)%4]&v[(l+2)%4])+(~v[(l+3)%4]&v[(l+1)%4]),f--},u=function(v){for(l=3;l>=0;l--)v[l]-=c[v[(l+3)%4]&63]});var p=function(v){var C=[];for(l=0;l<4;l++){var E=a.getInt16Le();s!==null&&(i?E^=s.getInt16Le():s.putInt16Le(E)),C.push(E&65535)}f=i?0:63;for(var B=0;B<v.length;B++)for(var w=0;w<v[B][0];w++)v[B][1](C);for(l=0;l<4;l++)s!==null&&(i?s.putInt16Le(C[l]):C[l]^=s.getInt16Le()),n.putInt16Le(C[l])},m=null;return m={start:function(v,C){v&&typeof v=="string"&&(v=Bt.util.createBuffer(v)),r=!1,a=Bt.util.createBuffer(),n=C||new Bt.util.createBuffer,s=v,m.output=n},update:function(v){for(r||a.putBuffer(v);a.length()>=8;)p([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(v){var C=!0;if(i)if(v)C=v(8,a,!i);else{var E=a.length()===8?8:8-a.length();a.fillWithByte(E,E)}if(C&&(r=!0,m.update()),!i&&(C=a.length()===0,C))if(v)C=v(8,n,!i);else{var B=n.length(),w=n.at(B-1);w>B?C=!1:n.truncate(w)}return C}},m};Bt.rc2.startEncrypting=function(e,t,i){var r=Bt.rc2.createEncryptionCipher(e,128);return r.start(t,i),r};Bt.rc2.createEncryptionCipher=function(e,t){return pc(e,t,!0)};Bt.rc2.startDecrypting=function(e,t,i){var r=Bt.rc2.createDecryptionCipher(e,128);return r.start(t,i),r};Bt.rc2.createDecryptionCipher=function(e,t){return pc(e,t,!1)}});var Yi=F((tE,xc)=>{"use strict";S();var cs=oe();xc.exports=cs.jsbn=cs.jsbn||{};var fr,Pg=0xdeadbeefcafe,gc=(Pg&16777215)==15715070;function N(e,t,i){this.data=[],e!=null&&(typeof e=="number"?this.fromNumber(e,t,i):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}cs.jsbn.BigInteger=N;function Ce(){return new N(null)}function Qg(e,t,i,r,a,n){for(;--n>=0;){var s=t*this.data[e++]+i.data[r]+a;a=Math.floor(s/67108864),i.data[r++]=s&67108863}return a}function Ug(e,t,i,r,a,n){for(var s=t&32767,o=t>>15;--n>=0;){var u=this.data[e]&32767,l=this.data[e++]>>15,f=o*u+l*s;u=s*u+((f&32767)<<15)+i.data[r]+(a&1073741823),a=(u>>>30)+(f>>>15)+o*l+(a>>>30),i.data[r++]=u&1073741823}return a}function vc(e,t,i,r,a,n){for(var s=t&16383,o=t>>14;--n>=0;){var u=this.data[e]&16383,l=this.data[e++]>>14,f=o*u+l*s;u=s*u+((f&16383)<<14)+i.data[r]+a,a=(u>>28)+(f>>14)+o*l,i.data[r++]=u&268435455}return a}typeof navigator>"u"?(N.prototype.am=vc,fr=28):gc&&navigator.appName=="Microsoft Internet Explorer"?(N.prototype.am=Ug,fr=30):gc&&navigator.appName!="Netscape"?(N.prototype.am=Qg,fr=26):(N.prototype.am=vc,fr=28);N.prototype.DB=fr;N.prototype.DM=(1<<fr)-1;N.prototype.DV=1<<fr;var hs=52;N.prototype.FV=Math.pow(2,hs);N.prototype.F1=hs-fr;N.prototype.F2=2*fr-hs;var Og="0123456789abcdefghijklmnopqrstuvwxyz",Ka=new Array,si,Qt;si=48;for(Qt=0;Qt<=9;++Qt)Ka[si++]=Qt;si=97;for(Qt=10;Qt<36;++Qt)Ka[si++]=Qt;si=65;for(Qt=10;Qt<36;++Qt)Ka[si++]=Qt;function yc(e){return Og.charAt(e)}function mc(e,t){var i=Ka[e.charCodeAt(t)];return i??-1}function Vg(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s}function Fg(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0}function br(e){var t=Ce();return t.fromInt(e),t}function Mg(e,t){var i;if(t==16)i=4;else if(t==8)i=3;else if(t==256)i=8;else if(t==2)i=1;else if(t==32)i=5;else if(t==4)i=2;else{this.fromRadix(e,t);return}this.t=0,this.s=0;for(var r=e.length,a=!1,n=0;--r>=0;){var s=i==8?e[r]&255:mc(e,r);if(s<0){e.charAt(r)=="-"&&(a=!0);continue}a=!1,n==0?this.data[this.t++]=s:n+i>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this.data[this.t++]=s>>this.DB-n):this.data[this.t-1]|=s<<n,n+=i,n>=this.DB&&(n-=this.DB)}i==8&&e[0]&128&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),a&&N.ZERO.subTo(this,this)}function qg(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t}function Kg(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(e==16)t=4;else if(e==8)t=3;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else return this.toRadix(e);var i=(1<<t)-1,r,a=!1,n="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(a=!0,n=yc(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&i,o<=0&&(o+=this.DB,--s)),r>0&&(a=!0),a&&(n+=yc(r));return a?n:"0"}function Hg(){var e=Ce();return N.ZERO.subTo(this,e),e}function Gg(){return this.s<0?this.negate():this}function jg(e){var t=this.s-e.s;if(t!=0)return t;var i=this.t;if(t=i-e.t,t!=0)return this.s<0?-t:t;for(;--i>=0;)if((t=this.data[i]-e.data[i])!=0)return t;return 0}function Ha(e){var t=1,i;return(i=e>>>16)!=0&&(e=i,t+=16),(i=e>>8)!=0&&(e=i,t+=8),(i=e>>4)!=0&&(e=i,t+=4),(i=e>>2)!=0&&(e=i,t+=2),(i=e>>1)!=0&&(e=i,t+=1),t}function Yg(){return this.t<=0?0:this.DB*(this.t-1)+Ha(this.data[this.t-1]^this.s&this.DM)}function zg(e,t){var i;for(i=this.t-1;i>=0;--i)t.data[i+e]=this.data[i];for(i=e-1;i>=0;--i)t.data[i]=0;t.t=this.t+e,t.s=this.s}function Jg(e,t){for(var i=e;i<this.t;++i)t.data[i-e]=this.data[i];t.t=Math.max(this.t-e,0),t.s=this.s}function Wg(e,t){var i=e%this.DB,r=this.DB-i,a=(1<<r)-1,n=Math.floor(e/this.DB),s=this.s<<i&this.DM,o;for(o=this.t-1;o>=0;--o)t.data[o+n+1]=this.data[o]>>r|s,s=(this.data[o]&a)<<i;for(o=n-1;o>=0;--o)t.data[o]=0;t.data[n]=s,t.t=this.t+n+1,t.s=this.s,t.clamp()}function Xg(e,t){t.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t){t.t=0;return}var r=e%this.DB,a=this.DB-r,n=(1<<r)-1;t.data[0]=this.data[i]>>r;for(var s=i+1;s<this.t;++s)t.data[s-i-1]|=(this.data[s]&n)<<a,t.data[s-i]=this.data[s]>>r;r>0&&(t.data[this.t-i-1]|=(this.s&n)<<a),t.t=this.t-i,t.clamp()}function $g(e,t){for(var i=0,r=0,a=Math.min(e.t,this.t);i<a;)r+=this.data[i]-e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;i<this.t;)r+=this.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<e.t;)r-=e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t.data[i++]=this.DV+r:r>0&&(t.data[i++]=r),t.t=i,t.clamp()}function Zg(e,t){var i=this.abs(),r=e.abs(),a=i.t;for(t.t=a+r.t;--a>=0;)t.data[a]=0;for(a=0;a<r.t;++a)t.data[a+i.t]=i.am(0,r.data[a],t,a,0,i.t);t.s=0,t.clamp(),this.s!=e.s&&N.ZERO.subTo(t,t)}function ev(e){for(var t=this.abs(),i=e.t=2*t.t;--i>=0;)e.data[i]=0;for(i=0;i<t.t-1;++i){var r=t.am(i,t.data[i],e,2*i,0,1);(e.data[i+t.t]+=t.am(i+1,2*t.data[i],e,2*i+1,r,t.t-i-1))>=t.DV&&(e.data[i+t.t]-=t.DV,e.data[i+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(i,t.data[i],e,2*i,0,1)),e.s=0,e.clamp()}function tv(e,t,i){var r=e.abs();if(!(r.t<=0)){var a=this.abs();if(a.t<r.t){t?.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=Ce());var n=Ce(),s=this.s,o=e.s,u=this.DB-Ha(r.data[r.t-1]);u>0?(r.lShiftTo(u,n),a.lShiftTo(u,i)):(r.copyTo(n),a.copyTo(i));var l=n.t,f=n.data[l-1];if(f!=0){var c=f*(1<<this.F1)+(l>1?n.data[l-2]>>this.F2:0),p=this.FV/c,m=(1<<this.F1)/c,v=1<<this.F2,C=i.t,E=C-l,B=t??Ce();for(n.dlShiftTo(E,B),i.compareTo(B)>=0&&(i.data[i.t++]=1,i.subTo(B,i)),N.ONE.dlShiftTo(l,B),B.subTo(n,n);n.t<l;)n.data[n.t++]=0;for(;--E>=0;){var w=i.data[--C]==f?this.DM:Math.floor(i.data[C]*p+(i.data[C-1]+v)*m);if((i.data[C]+=n.am(0,w,i,E,0,l))<w)for(n.dlShiftTo(E,B),i.subTo(B,i);i.data[C]<--w;)i.subTo(B,i)}t!=null&&(i.drShiftTo(l,t),s!=o&&N.ZERO.subTo(t,t)),i.t=l,i.clamp(),u>0&&i.rShiftTo(u,i),s<0&&N.ZERO.subTo(i,i)}}}function rv(e){var t=Ce();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(N.ZERO)>0&&e.subTo(t,t),t}function Or(e){this.m=e}function iv(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e}function av(e){return e}function nv(e){e.divRemTo(this.m,null,e)}function sv(e,t,i){e.multiplyTo(t,i),this.reduce(i)}function ov(e,t){e.squareTo(t),this.reduce(t)}Or.prototype.convert=iv;Or.prototype.revert=av;Or.prototype.reduce=nv;Or.prototype.mulTo=sv;Or.prototype.sqrTo=ov;function uv(){if(this.t<1)return 0;var e=this.data[0];if(!(e&1))return 0;var t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function Vr(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function lv(e){var t=Ce();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(N.ZERO)>0&&this.m.subTo(t,t),t}function fv(e){var t=Ce();return e.copyTo(t),this.reduce(t),t}function cv(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var i=e.data[t]&32767,r=i*this.mpl+((i*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(i=t+this.m.t,e.data[i]+=this.m.am(0,r,e,t,0,this.m.t);e.data[i]>=e.DV;)e.data[i]-=e.DV,e.data[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function hv(e,t){e.squareTo(t),this.reduce(t)}function pv(e,t,i){e.multiplyTo(t,i),this.reduce(i)}Vr.prototype.convert=lv;Vr.prototype.revert=fv;Vr.prototype.reduce=cv;Vr.prototype.mulTo=pv;Vr.prototype.sqrTo=hv;function dv(){return(this.t>0?this.data[0]&1:this.s)==0}function gv(e,t){if(e>4294967295||e<1)return N.ONE;var i=Ce(),r=Ce(),a=t.convert(this),n=Ha(e)-1;for(a.copyTo(i);--n>=0;)if(t.sqrTo(i,r),(e&1<<n)>0)t.mulTo(r,a,i);else{var s=i;i=r,r=s}return t.revert(i)}function vv(e,t){var i;return e<256||t.isEven()?i=new Or(t):i=new Vr(t),this.exp(e,i)}N.prototype.copyTo=Vg;N.prototype.fromInt=Fg;N.prototype.fromString=Mg;N.prototype.clamp=qg;N.prototype.dlShiftTo=zg;N.prototype.drShiftTo=Jg;N.prototype.lShiftTo=Wg;N.prototype.rShiftTo=Xg;N.prototype.subTo=$g;N.prototype.multiplyTo=Zg;N.prototype.squareTo=ev;N.prototype.divRemTo=tv;N.prototype.invDigit=uv;N.prototype.isEven=dv;N.prototype.exp=gv;N.prototype.toString=Kg;N.prototype.negate=Hg;N.prototype.abs=Gg;N.prototype.compareTo=jg;N.prototype.bitLength=Yg;N.prototype.mod=rv;N.prototype.modPowInt=vv;N.ZERO=br(0);N.ONE=br(1);function yv(){var e=Ce();return this.copyTo(e),e}function mv(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}function Av(){return this.t==0?this.s:this.data[0]<<24>>24}function Cv(){return this.t==0?this.s:this.data[0]<<16>>16}function Ev(e){return Math.floor(Math.LN2*this.DB/Math.log(e))}function xv(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}function Sv(e){if(e==null&&(e=10),this.signum()==0||e<2||e>36)return"0";var t=this.chunkSize(e),i=Math.pow(e,t),r=br(i),a=Ce(),n=Ce(),s="";for(this.divRemTo(r,a,n);a.signum()>0;)s=(i+n.intValue()).toString(e).substr(1)+s,a.divRemTo(r,a,n);return n.intValue().toString(e)+s}function Iv(e,t){this.fromInt(0),t==null&&(t=10);for(var i=this.chunkSize(t),r=Math.pow(t,i),a=!1,n=0,s=0,o=0;o<e.length;++o){var u=mc(e,o);if(u<0){e.charAt(o)=="-"&&this.signum()==0&&(a=!0);continue}s=t*s+u,++n>=i&&(this.dMultiply(r),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),a&&N.ZERO.subTo(this,this)}function Bv(e,t,i){if(typeof t=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(N.ONE.shiftLeft(e-1),ps,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(N.ONE.shiftLeft(e-1),this);else{var r=new Array,a=e&7;r.length=(e>>3)+1,t.nextBytes(r),a>0?r[0]&=(1<<a)-1:r[0]=0,this.fromString(r,256)}}function bv(){var e=this.t,t=new Array;t[0]=this.s;var i=this.DB-e*this.DB%8,r,a=0;if(e-- >0)for(i<this.DB&&(r=this.data[e]>>i)!=(this.s&this.DM)>>i&&(t[a++]=r|this.s<<this.DB-i);e>=0;)i<8?(r=(this.data[e]&(1<<i)-1)<<8-i,r|=this.data[--e]>>(i+=this.DB-8)):(r=this.data[e]>>(i-=8)&255,i<=0&&(i+=this.DB,--e)),r&128&&(r|=-256),a==0&&(this.s&128)!=(r&128)&&++a,(a>0||r!=this.s)&&(t[a++]=r);return t}function Tv(e){return this.compareTo(e)==0}function wv(e){return this.compareTo(e)<0?this:e}function _v(e){return this.compareTo(e)>0?this:e}function Nv(e,t,i){var r,a,n=Math.min(e.t,this.t);for(r=0;r<n;++r)i.data[r]=t(this.data[r],e.data[r]);if(e.t<this.t){for(a=e.s&this.DM,r=n;r<this.t;++r)i.data[r]=t(this.data[r],a);i.t=this.t}else{for(a=this.s&this.DM,r=n;r<e.t;++r)i.data[r]=t(a,e.data[r]);i.t=e.t}i.s=t(this.s,e.s),i.clamp()}function kv(e,t){return e&t}function Lv(e){var t=Ce();return this.bitwiseTo(e,kv,t),t}function ps(e,t){return e|t}function Rv(e){var t=Ce();return this.bitwiseTo(e,ps,t),t}function Ac(e,t){return e^t}function Dv(e){var t=Ce();return this.bitwiseTo(e,Ac,t),t}function Cc(e,t){return e&~t}function Pv(e){var t=Ce();return this.bitwiseTo(e,Cc,t),t}function Qv(){for(var e=Ce(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e}function Uv(e){var t=Ce();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t}function Ov(e){var t=Ce();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t}function Vv(e){if(e==0)return-1;var t=0;return e&65535||(e>>=16,t+=16),e&255||(e>>=8,t+=8),e&15||(e>>=4,t+=4),e&3||(e>>=2,t+=2),e&1||++t,t}function Fv(){for(var e=0;e<this.t;++e)if(this.data[e]!=0)return e*this.DB+Vv(this.data[e]);return this.s<0?this.t*this.DB:-1}function Mv(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function qv(){for(var e=0,t=this.s&this.DM,i=0;i<this.t;++i)e+=Mv(this.data[i]^t);return e}function Kv(e){var t=Math.floor(e/this.DB);return t>=this.t?this.s!=0:(this.data[t]&1<<e%this.DB)!=0}function Hv(e,t){var i=N.ONE.shiftLeft(e);return this.bitwiseTo(i,t,i),i}function Gv(e){return this.changeBit(e,ps)}function jv(e){return this.changeBit(e,Cc)}function Yv(e){return this.changeBit(e,Ac)}function zv(e,t){for(var i=0,r=0,a=Math.min(e.t,this.t);i<a;)r+=this.data[i]+e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;i<this.t;)r+=this.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<e.t;)r+=e.data[i],t.data[i++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t.data[i++]=r:r<-1&&(t.data[i++]=this.DV+r),t.t=i,t.clamp()}function Jv(e){var t=Ce();return this.addTo(e,t),t}function Wv(e){var t=Ce();return this.subTo(e,t),t}function Xv(e){var t=Ce();return this.multiplyTo(e,t),t}function $v(e){var t=Ce();return this.divRemTo(e,t,null),t}function Zv(e){var t=Ce();return this.divRemTo(e,null,t),t}function ey(e){var t=Ce(),i=Ce();return this.divRemTo(e,t,i),new Array(t,i)}function ty(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()}function ry(e,t){if(e!=0){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}}function ji(){}function Ec(e){return e}function iy(e,t,i){e.multiplyTo(t,i)}function ay(e,t){e.squareTo(t)}ji.prototype.convert=Ec;ji.prototype.revert=Ec;ji.prototype.mulTo=iy;ji.prototype.sqrTo=ay;function ny(e){return this.exp(e,new ji)}function sy(e,t,i){var r=Math.min(this.t+e.t,t);for(i.s=0,i.t=r;r>0;)i.data[--r]=0;var a;for(a=i.t-this.t;r<a;++r)i.data[r+this.t]=this.am(0,e.data[r],i,r,0,this.t);for(a=Math.min(e.t,t);r<a;++r)this.am(0,e.data[r],i,r,0,t-r);i.clamp()}function oy(e,t,i){--t;var r=i.t=this.t+e.t-t;for(i.s=0;--r>=0;)i.data[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)i.data[this.t+r-t]=this.am(t-r,e.data[r],i,0,0,this.t+r-t);i.clamp(),i.drShiftTo(1,i)}function oi(e){this.r2=Ce(),this.q3=Ce(),N.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function uy(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=Ce();return e.copyTo(t),this.reduce(t),t}function ly(e){return e}function fy(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)}function cy(e,t){e.squareTo(t),this.reduce(t)}function hy(e,t,i){e.multiplyTo(t,i),this.reduce(i)}oi.prototype.convert=uy;oi.prototype.revert=ly;oi.prototype.reduce=fy;oi.prototype.mulTo=hy;oi.prototype.sqrTo=cy;function py(e,t){var i=e.bitLength(),r,a=br(1),n;if(i<=0)return a;i<18?r=1:i<48?r=3:i<144?r=4:i<768?r=5:r=6,i<8?n=new Or(t):t.isEven()?n=new oi(t):n=new Vr(t);var s=new Array,o=3,u=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=Ce();for(n.sqrTo(s[1],f);o<=l;)s[o]=Ce(),n.mulTo(f,s[o-2],s[o]),o+=2}var c=e.t-1,p,m=!0,v=Ce(),C;for(i=Ha(e.data[c])-1;c>=0;){for(i>=u?p=e.data[c]>>i-u&l:(p=(e.data[c]&(1<<i+1)-1)<<u-i,c>0&&(p|=e.data[c-1]>>this.DB+i-u)),o=r;!(p&1);)p>>=1,--o;if((i-=o)<0&&(i+=this.DB,--c),m)s[p].copyTo(a),m=!1;else{for(;o>1;)n.sqrTo(a,v),n.sqrTo(v,a),o-=2;o>0?n.sqrTo(a,v):(C=a,a=v,v=C),n.mulTo(v,s[p],a)}for(;c>=0&&!(e.data[c]&1<<i);)n.sqrTo(a,v),C=a,a=v,v=C,--i<0&&(i=this.DB-1,--c)}return n.revert(a)}function dy(e){var t=this.s<0?this.negate():this.clone(),i=e.s<0?e.negate():e.clone();if(t.compareTo(i)<0){var r=t;t=i,i=r}var a=t.getLowestSetBit(),n=i.getLowestSetBit();if(n<0)return t;for(a<n&&(n=a),n>0&&(t.rShiftTo(n,t),i.rShiftTo(n,i));t.signum()>0;)(a=t.getLowestSetBit())>0&&t.rShiftTo(a,t),(a=i.getLowestSetBit())>0&&i.rShiftTo(a,i),t.compareTo(i)>=0?(t.subTo(i,t),t.rShiftTo(1,t)):(i.subTo(t,i),i.rShiftTo(1,i));return n>0&&i.lShiftTo(n,i),i}function gy(e){if(e<=0)return 0;var t=this.DV%e,i=this.s<0?e-1:0;if(this.t>0)if(t==0)i=this.data[0]%e;else for(var r=this.t-1;r>=0;--r)i=(t*i+this.data[r])%e;return i}function vy(e){var t=e.isEven();if(this.isEven()&&t||e.signum()==0)return N.ZERO;for(var i=e.clone(),r=this.clone(),a=br(1),n=br(0),s=br(0),o=br(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),t?((!a.isEven()||!n.isEven())&&(a.addTo(this,a),n.subTo(e,n)),a.rShiftTo(1,a)):n.isEven()||n.subTo(e,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),t?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);i.compareTo(r)>=0?(i.subTo(r,i),t&&a.subTo(s,a),n.subTo(o,n)):(r.subTo(i,r),t&&s.subTo(a,s),o.subTo(n,o))}if(r.compareTo(N.ONE)!=0)return N.ZERO;if(o.compareTo(e)>=0)return o.subtract(e);if(o.signum()<0)o.addTo(e,o);else return o;return o.signum()<0?o.add(e):o}var jt=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],yy=(1<<26)/jt[jt.length-1];function my(e){var t,i=this.abs();if(i.t==1&&i.data[0]<=jt[jt.length-1]){for(t=0;t<jt.length;++t)if(i.data[0]==jt[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<jt.length;){for(var r=jt[t],a=t+1;a<jt.length&&r<yy;)r*=jt[a++];for(r=i.modInt(r);t<a;)if(r%jt[t++]==0)return!1}return i.millerRabin(e)}function Ay(e){var t=this.subtract(N.ONE),i=t.getLowestSetBit();if(i<=0)return!1;for(var r=t.shiftRight(i),a=Cy(),n,s=0;s<e;++s){do n=new N(this.bitLength(),a);while(n.compareTo(N.ONE)<=0||n.compareTo(t)>=0);var o=n.modPow(r,this);if(o.compareTo(N.ONE)!=0&&o.compareTo(t)!=0){for(var u=1;u++<i&&o.compareTo(t)!=0;)if(o=o.modPowInt(2,this),o.compareTo(N.ONE)==0)return!1;if(o.compareTo(t)!=0)return!1}}return!0}function Cy(){return{nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(Math.random()*256)}}}N.prototype.chunkSize=Ev;N.prototype.toRadix=Sv;N.prototype.fromRadix=Iv;N.prototype.fromNumber=Bv;N.prototype.bitwiseTo=Nv;N.prototype.changeBit=Hv;N.prototype.addTo=zv;N.prototype.dMultiply=ty;N.prototype.dAddOffset=ry;N.prototype.multiplyLowerTo=sy;N.prototype.multiplyUpperTo=oy;N.prototype.modInt=gy;N.prototype.millerRabin=Ay;N.prototype.clone=yv;N.prototype.intValue=mv;N.prototype.byteValue=Av;N.prototype.shortValue=Cv;N.prototype.signum=xv;N.prototype.toByteArray=bv;N.prototype.equals=Tv;N.prototype.min=wv;N.prototype.max=_v;N.prototype.and=Lv;N.prototype.or=Rv;N.prototype.xor=Dv;N.prototype.andNot=Pv;N.prototype.not=Qv;N.prototype.shiftLeft=Uv;N.prototype.shiftRight=Ov;N.prototype.getLowestSetBit=Fv;N.prototype.bitCount=qv;N.prototype.testBit=Kv;N.prototype.setBit=Gv;N.prototype.clearBit=jv;N.prototype.flipBit=Yv;N.prototype.add=Jv;N.prototype.subtract=Wv;N.prototype.multiply=Xv;N.prototype.divide=$v;N.prototype.remainder=Zv;N.prototype.divideAndRemainder=ey;N.prototype.modPow=py;N.prototype.modInverse=vy;N.prototype.pow=ny;N.prototype.gcd=dy;N.prototype.isProbablePrime=my});var ui=F((iE,bc)=>{"use strict";S();var er=oe();Jt();Ae();var Ic=bc.exports=er.sha1=er.sha1||{};er.md.sha1=er.md.algorithms.sha1=Ic;Ic.create=function(){Bc||Ey();var e=null,t=er.util.createBuffer(),i=new Array(80),r={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return r.start=function(){r.messageLength=0,r.fullMessageLength=r.messageLength64=[];for(var a=r.messageLengthSize/4,n=0;n<a;++n)r.fullMessageLength.push(0);return t=er.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},r},r.start(),r.update=function(a,n){n==="utf8"&&(a=er.util.encodeUtf8(a));var s=a.length;r.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=r.fullMessageLength.length-1;o>=0;--o)r.fullMessageLength[o]+=s[1],s[1]=s[0]+(r.fullMessageLength[o]/4294967296>>>0),r.fullMessageLength[o]=r.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),Sc(e,i,t),(t.read>2048||t.length()===0)&&t.compact(),r},r.digest=function(){var a=er.util.createBuffer();a.putBytes(t.bytes());var n=r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize,s=n&r.blockLength-1;a.putBytes(ds.substr(0,r.blockLength-s));for(var o,u,l=r.fullMessageLength[0]*8,f=0;f<r.fullMessageLength.length-1;++f)o=r.fullMessageLength[f+1]*8,u=o/4294967296>>>0,l+=u,a.putInt32(l>>>0),l=o>>>0;a.putInt32(l);var c={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};Sc(c,i,a);var p=er.util.createBuffer();return p.putInt32(c.h0),p.putInt32(c.h1),p.putInt32(c.h2),p.putInt32(c.h3),p.putInt32(c.h4),p},r};var ds=null,Bc=!1;function Ey(){ds="\x80",ds+=er.util.fillString("\0",64),Bc=!0}function Sc(e,t,i){for(var r,a,n,s,o,u,l,f,c=i.length();c>=64;){for(a=e.h0,n=e.h1,s=e.h2,o=e.h3,u=e.h4,f=0;f<16;++f)r=i.getInt32(),t[f]=r,l=o^n&(s^o),r=(a<<5|a>>>27)+l+u+1518500249+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<20;++f)r=t[f-3]^t[f-8]^t[f-14]^t[f-16],r=r<<1|r>>>31,t[f]=r,l=o^n&(s^o),r=(a<<5|a>>>27)+l+u+1518500249+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<32;++f)r=t[f-3]^t[f-8]^t[f-14]^t[f-16],r=r<<1|r>>>31,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+1859775393+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<40;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+1859775393+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<60;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n&s|o&(n^s),r=(a<<5|a>>>27)+l+u+2400959708+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;for(;f<80;++f)r=t[f-6]^t[f-16]^t[f-28]^t[f-32],r=r<<2|r>>>30,t[f]=r,l=n^s^o,r=(a<<5|a>>>27)+l+u+3395469782+r,u=o,o=s,s=(n<<30|n>>>2)>>>0,n=a,a=r;e.h0=e.h0+a|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+u|0,c-=64}}});var gs=F((nE,wc)=>{"use strict";S();var tr=oe();Ae();Pt();ui();var Tc=wc.exports=tr.pkcs1=tr.pkcs1||{};Tc.encode_rsa_oaep=function(e,t,i){var r,a,n,s;typeof i=="string"?(r=i,a=arguments[3]||void 0,n=arguments[4]||void 0):i&&(r=i.label||void 0,a=i.seed||void 0,n=i.md||void 0,i.mgf1&&i.mgf1.md&&(s=i.mgf1.md)),n?n.start():n=tr.md.sha1.create(),s||(s=n);var o=Math.ceil(e.n.bitLength()/8),u=o-2*n.digestLength-2;if(t.length>u){var l=new Error("RSAES-OAEP input message length is too long.");throw l.length=t.length,l.maxLength=u,l}r||(r=""),n.update(r,"raw");for(var f=n.digest(),c="",p=u-t.length,m=0;m<p;m++)c+="\0";var v=f.getBytes()+c+""+t;if(!a)a=tr.random.getBytes(n.digestLength);else if(a.length!==n.digestLength){var l=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw l.seedLength=a.length,l.digestLength=n.digestLength,l}var C=Ga(a,o-n.digestLength-1,s),E=tr.util.xorBytes(v,C,v.length),B=Ga(E,n.digestLength,s),w=tr.util.xorBytes(a,B,a.length);return"\0"+w+E};Tc.decode_rsa_oaep=function(e,t,i){var r,a,n;typeof i=="string"?(r=i,a=arguments[3]||void 0):i&&(r=i.label||void 0,a=i.md||void 0,i.mgf1&&i.mgf1.md&&(n=i.mgf1.md));var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=t.length,E.expectedLength=s,E}if(a===void 0?a=tr.md.sha1.create():a.start(),n||(n=a),s<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");r||(r=""),a.update(r,"raw");for(var o=a.digest().getBytes(),u=t.charAt(0),l=t.substring(1,a.digestLength+1),f=t.substring(1+a.digestLength),c=Ga(f,a.digestLength,n),p=tr.util.xorBytes(l,c,l.length),m=Ga(p,s-a.digestLength-1,n),v=tr.util.xorBytes(f,m,f.length),C=v.substring(0,a.digestLength),E=u!=="\0",B=0;B<a.digestLength;++B)E|=o.charAt(B)!==C.charAt(B);for(var w=1,T=a.digestLength,U=a.digestLength;U<v.length;U++){var P=v.charCodeAt(U),Q=P&1^1,te=w?65534:0;E|=P&te,w=w&Q,T+=w}if(E||v.charCodeAt(T)!==1)throw new Error("Invalid RSAES-OAEP padding.");return v.substring(T+1)};function Ga(e,t,i){i||(i=tr.md.sha1.create());for(var r="",a=Math.ceil(t/i.digestLength),n=0;n<a;++n){var s=String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255);i.start(),i.update(e+s),r+=i.digest().getBytes()}return r.substring(0,t)}});var ys=F((oE,vs)=>{"use strict";S();var Tr=oe();Ae();Yi();Pt();(function(){if(Tr.prime){vs.exports=Tr.prime;return}var e=vs.exports=Tr.prime=Tr.prime||{},t=Tr.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],r=new t(null);r.fromInt(30);var a=function(c,p){return c|p};e.generateProbablePrime=function(c,p,m){typeof p=="function"&&(m=p,p={}),p=p||{};var v=p.algorithm||"PRIMEINC";typeof v=="string"&&(v={name:v}),v.options=v.options||{};var C=p.prng||Tr.random,E={nextBytes:function(B){for(var w=C.getBytesSync(B.length),T=0;T<B.length;++T)B[T]=w.charCodeAt(T)}};if(v.name==="PRIMEINC")return n(c,E,v.options,m);throw new Error("Invalid prime generation algorithm: "+v.name)};function n(c,p,m,v){return"workers"in m?u(c,p,m,v):s(c,p,m,v)}function s(c,p,m,v){var C=l(c,p),E=0,B=f(C.bitLength());"millerRabinTests"in m&&(B=m.millerRabinTests);var w=10;"maxBlockTime"in m&&(w=m.maxBlockTime),o(C,c,p,E,B,w,v)}function o(c,p,m,v,C,E,B){var w=+new Date;do{if(c.bitLength()>p&&(c=l(p,m)),c.isProbablePrime(C))return B(null,c);c.dAddOffset(i[v++%8],0)}while(E<0||+new Date-w<E);Tr.util.setImmediate(function(){o(c,p,m,v,C,E,B)})}function u(c,p,m,v){if(typeof Worker>"u")return s(c,p,m,v);var C=l(c,p),E=m.workers,B=m.workLoad||100,w=B*30/8,T=m.workerScript||"forge/prime.worker.js";if(E===-1)return Tr.util.estimateCores(function(P,Q){P&&(Q=2),E=Q-1,U()});U();function U(){E=Math.max(1,E);for(var P=[],Q=0;Q<E;++Q)P[Q]=new Worker(T);for(var te=E,Q=0;Q<E;++Q)P[Q].addEventListener("message",H);var ne=!1;function H(z){if(!ne){--te;var Y=z.data;if(Y.found){for(var re=0;re<P.length;++re)P[re].terminate();return ne=!0,v(null,new t(Y.prime,16))}C.bitLength()>c&&(C=l(c,p));var ye=C.toString(16);z.target.postMessage({hex:ye,workLoad:B}),C.dAddOffset(w,0)}}}}function l(c,p){var m=new t(c,p),v=c-1;return m.testBit(v)||m.bitwiseTo(t.ONE.shiftLeft(v),a,m),m.dAddOffset(31-m.mod(r).byteValue(),0),m}function f(c){return c<=100?27:c<=150?18:c<=200?15:c<=250?12:c<=300?9:c<=350?8:c<=400?7:c<=500?6:c<=600?5:c<=800?4:c<=1250?3:2}})()});var zi=F((lE,Pc)=>{"use strict";S();var W=oe();Gt();Yi();Br();gs();ys();Pt();Ae();typeof ge>"u"&&(ge=W.jsbn.BigInteger);var ge,ms=W.util.isNodejs?Le("crypto"):null,b=W.asn1,Ut=W.util;W.pki=W.pki||{};Pc.exports=W.pki.rsa=W.rsa=W.rsa||{};var ae=W.pki,xy=[6,4,2,4,2,4,6,2],Sy={name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},Iy={name:"RSAPrivateKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},By={name:"RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},by=W.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},Ty={name:"DigestInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:b.Class.UNIVERSAL,type:b.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},wy=function(e){var t;if(e.algorithm in ae.oids)t=ae.oids[e.algorithm];else{var i=new Error("Unknown message digest algorithm.");throw i.algorithm=e.algorithm,i}var r=b.oidToDer(t).getBytes(),a=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]),n=b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[]);n.value.push(b.create(b.Class.UNIVERSAL,b.Type.OID,!1,r)),n.value.push(b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,""));var s=b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,e.digest().getBytes());return a.value.push(n),a.value.push(s),b.toDer(a).getBytes()},Rc=function(e,t,i){if(i)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(ge.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(ge.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));var r;do r=new ge(W.util.bytesToHex(W.random.getBytes(t.n.bitLength()/8)),16);while(r.compareTo(t.n)>=0||!r.gcd(t.n).equals(ge.ONE));e=e.multiply(r.modPow(t.e,t.n)).mod(t.n);for(var a=e.mod(t.p).modPow(t.dP,t.p),n=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(n)<0;)a=a.add(t.p);var s=a.subtract(n).multiply(t.qInv).mod(t.p).multiply(t.q).add(n);return s=s.multiply(r.modInverse(t.n)).mod(t.n),s};ae.rsa.encrypt=function(e,t,i){var r=i,a,n=Math.ceil(t.n.bitLength()/8);i!==!1&&i!==!0?(r=i===2,a=Dc(e,t,i)):(a=W.util.createBuffer(),a.putBytes(e));for(var s=new ge(a.toHex(),16),o=Rc(s,t,r),u=o.toString(16),l=W.util.createBuffer(),f=n-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return l.putBytes(W.util.hexToBytes(u)),l.getBytes()};ae.rsa.decrypt=function(e,t,i,r){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var n=new Error("Encrypted message length is invalid.");throw n.length=e.length,n.expected=a,n}var s=new ge(W.util.createBuffer(e).toHex(),16);if(s.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=Rc(s,t,i),u=o.toString(16),l=W.util.createBuffer(),f=a-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return l.putBytes(W.util.hexToBytes(u)),r!==!1?ja(l.getBytes(),t,i):l.getBytes()};ae.rsa.createKeyPairGenerationState=function(e,t,i){typeof e=="string"&&(e=parseInt(e,10)),e=e||2048,i=i||{};var r=i.prng||W.random,a={nextBytes:function(o){for(var u=r.getBytesSync(o.length),l=0;l<o.length;++l)o[l]=u.charCodeAt(l)}},n=i.algorithm||"PRIMEINC",s;if(n==="PRIMEINC")s={algorithm:n,state:0,bits:e,rng:a,eInt:t||65537,e:new ge(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null},s.e.fromInt(s.eInt);else throw new Error("Invalid key generation algorithm: "+n);return s};ae.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var i=new ge(null);i.fromInt(30);for(var r=0,a=function(c,p){return c|p},n=+new Date,s,o=0;e.keys===null&&(t<=0||o<t);){if(e.state===0){var u=e.p===null?e.pBits:e.qBits,l=u-1;e.pqState===0?(e.num=new ge(u,e.rng),e.num.testBit(l)||e.num.bitwiseTo(ge.ONE.shiftLeft(l),a,e.num),e.num.dAddOffset(31-e.num.mod(i).byteValue(),0),r=0,++e.pqState):e.pqState===1?e.num.bitLength()>u?e.pqState=0:e.num.isProbablePrime(Ny(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(xy[r++%8],0):e.pqState===2?e.pqState=e.num.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)===0?3:0:e.pqState===3&&(e.pqState=0,e.p===null?e.p=e.num:e.q=e.num,e.p!==null&&e.q!==null&&++e.state,e.num=null)}else if(e.state===1)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(e.state===2)e.p1=e.p.subtract(ge.ONE),e.q1=e.q.subtract(ge.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(e.state===3)e.phi.gcd(e.e).compareTo(ge.ONE)===0?++e.state:(e.p=null,e.q=null,e.state=0);else if(e.state===4)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(e.state===5){var f=e.e.modInverse(e.phi);e.keys={privateKey:ae.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:ae.rsa.setPublicKey(e.n,e.e)}}s=+new Date,o+=s-n,n=s}return e.keys!==null};ae.rsa.generateKeyPair=function(e,t,i,r){if(arguments.length===1?typeof e=="object"?(i=e,e=void 0):typeof e=="function"&&(r=e,e=void 0):arguments.length===2?typeof e=="number"?typeof t=="function"?(r=t,t=void 0):typeof t!="number"&&(i=t,t=void 0):(i=e,r=t,e=void 0,t=void 0):arguments.length===3&&(typeof t=="number"?typeof i=="function"&&(r=i,i=void 0):(r=i,i=t,t=void 0)),i=i||{},e===void 0&&(e=i.bits||2048),t===void 0&&(t=i.e||65537),!W.options.usePureJavaScript&&!i.prng&&e>=256&&e<=16384&&(t===65537||t===3)){if(r){if(_c("generateKeyPair"))return ms.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,u,l){if(o)return r(o);r(null,{privateKey:ae.privateKeyFromPem(l),publicKey:ae.publicKeyFromPem(u)})});if(Nc("generateKey")&&Nc("exportKey"))return Ut.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:Lc(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ut.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){r(o)}).then(function(o){if(o){var u=ae.privateKeyFromAsn1(b.fromDer(W.util.createBuffer(o)));r(null,{privateKey:u,publicKey:ae.setRsaPublicKey(u.n,u.e)})}});if(kc("generateKey")&&kc("exportKey")){var a=Ut.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:Lc(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);a.oncomplete=function(o){var u=o.target.result,l=Ut.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);l.oncomplete=function(f){var c=f.target.result,p=ae.privateKeyFromAsn1(b.fromDer(W.util.createBuffer(c)));r(null,{privateKey:p,publicKey:ae.setRsaPublicKey(p.n,p.e)})},l.onerror=function(f){r(f)}},a.onerror=function(o){r(o)};return}}else if(_c("generateKeyPairSync")){var n=ms.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:ae.privateKeyFromPem(n.privateKey),publicKey:ae.publicKeyFromPem(n.publicKey)}}}var s=ae.rsa.createKeyPairGenerationState(e,t,i);if(!r)return ae.rsa.stepKeyPairGenerationState(s,0),s.keys;_y(s,i,r)};ae.setRsaPublicKey=ae.rsa.setPublicKey=function(e,t){var i={n:e,e:t};return i.encrypt=function(r,a,n){if(typeof a=="string"?a=a.toUpperCase():a===void 0&&(a="RSAES-PKCS1-V1_5"),a==="RSAES-PKCS1-V1_5")a={encode:function(o,u,l){return Dc(o,u,2).getBytes()}};else if(a==="RSA-OAEP"||a==="RSAES-OAEP")a={encode:function(o,u){return W.pkcs1.encode_rsa_oaep(u,o,n)}};else if(["RAW","NONE","NULL",null].indexOf(a)!==-1)a={encode:function(o){return o}};else if(typeof a=="string")throw new Error('Unsupported encryption scheme: "'+a+'".');var s=a.encode(r,i,!0);return ae.rsa.encrypt(s,i,!0)},i.verify=function(r,a,n,s){typeof n=="string"?n=n.toUpperCase():n===void 0&&(n="RSASSA-PKCS1-V1_5"),s===void 0&&(s={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),n==="RSASSA-PKCS1-V1_5"?n={verify:function(u,l){l=ja(l,i,!0);var f=b.fromDer(l,{parseAllBytes:s._parseAllDigestBytes}),c={},p=[];if(!b.validate(f,Ty,c,p)){var m=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw m.errors=p,m}var v=b.derToOid(c.algorithmIdentifier);if(!(v===W.oids.md2||v===W.oids.md5||v===W.oids.sha1||v===W.oids.sha224||v===W.oids.sha256||v===W.oids.sha384||v===W.oids.sha512||v===W.oids["sha512-224"]||v===W.oids["sha512-256"])){var m=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw m.oid=v,m}if((v===W.oids.md2||v===W.oids.md5)&&!("parameters"in c))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return u===c.digest}}:(n==="NONE"||n==="NULL"||n===null)&&(n={verify:function(u,l){return l=ja(l,i,!0),u===l}});var o=ae.rsa.decrypt(a,i,!0,!1);return n.verify(r,o,i.n.bitLength())},i};ae.setRsaPrivateKey=ae.rsa.setPrivateKey=function(e,t,i,r,a,n,s,o){var u={n:e,e:t,d:i,p:r,q:a,dP:n,dQ:s,qInv:o};return u.decrypt=function(l,f,c){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var p=ae.rsa.decrypt(l,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:ja};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:function(m,v){return W.pkcs1.decode_rsa_oaep(v,m,c)}};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:function(m){return m}};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(p,u,!1)},u.sign=function(l,f){var c=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:wy},c=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:function(){return l}},c=1);var p=f.encode(l,u.n.bitLength());return ae.rsa.encrypt(p,u,c)},u};ae.wrapRsaPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ae.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.OCTETSTRING,!1,b.toDer(e).getBytes())])};ae.privateKeyFromAsn1=function(e){var t={},i=[];if(b.validate(e,Sy,t,i)&&(e=b.fromDer(W.util.createBuffer(t.privateKey))),t={},i=[],!b.validate(e,Iy,t,i)){var r=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw r.errors=i,r}var a,n,s,o,u,l,f,c;return a=W.util.createBuffer(t.privateKeyModulus).toHex(),n=W.util.createBuffer(t.privateKeyPublicExponent).toHex(),s=W.util.createBuffer(t.privateKeyPrivateExponent).toHex(),o=W.util.createBuffer(t.privateKeyPrime1).toHex(),u=W.util.createBuffer(t.privateKeyPrime2).toHex(),l=W.util.createBuffer(t.privateKeyExponent1).toHex(),f=W.util.createBuffer(t.privateKeyExponent2).toHex(),c=W.util.createBuffer(t.privateKeyCoefficient).toHex(),ae.setRsaPrivateKey(new ge(a,16),new ge(n,16),new ge(s,16),new ge(o,16),new ge(u,16),new ge(l,16),new ge(f,16),new ge(c,16))};ae.privateKeyToAsn1=ae.privateKeyToRSAPrivateKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,b.integerToDer(0).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.e)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.d)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.p)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.q)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.dP)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.dQ)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.qInv))])};ae.publicKeyFromAsn1=function(e){var t={},i=[];if(b.validate(e,by,t,i)){var r=b.derToOid(t.publicKeyOid);if(r!==ae.oids.rsaEncryption){var a=new Error("Cannot read public key. Unknown OID.");throw a.oid=r,a}e=t.rsaPublicKey}if(i=[],!b.validate(e,By,t,i)){var a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw a.errors=i,a}var n=W.util.createBuffer(t.publicKeyModulus).toHex(),s=W.util.createBuffer(t.publicKeyExponent).toHex();return ae.setRsaPublicKey(new ge(n,16),new ge(s,16))};ae.publicKeyToAsn1=ae.publicKeyToSubjectPublicKeyInfo=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.OID,!1,b.oidToDer(ae.oids.rsaEncryption).getBytes()),b.create(b.Class.UNIVERSAL,b.Type.NULL,!1,"")]),b.create(b.Class.UNIVERSAL,b.Type.BITSTRING,!1,[ae.publicKeyToRSAPublicKey(e)])])};ae.publicKeyToRSAPublicKey=function(e){return b.create(b.Class.UNIVERSAL,b.Type.SEQUENCE,!0,[b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.n)),b.create(b.Class.UNIVERSAL,b.Type.INTEGER,!1,rr(e.e))])};function Dc(e,t,i){var r=W.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var n=new Error("Message is too long for PKCS#1 v1.5 padding.");throw n.length=e.length,n.max=a-11,n}r.putByte(0),r.putByte(i);var s=a-3-e.length,o;if(i===0||i===1){o=i===0?0:255;for(var u=0;u<s;++u)r.putByte(o)}else for(;s>0;){for(var l=0,f=W.random.getBytes(s),u=0;u<s;++u)o=f.charCodeAt(u),o===0?++l:r.putByte(o);s=l}return r.putByte(0),r.putBytes(e),r}function ja(e,t,i,r){var a=Math.ceil(t.n.bitLength()/8),n=W.util.createBuffer(e),s=n.getByte(),o=n.getByte();if(s!==0||i&&o!==0&&o!==1||!i&&o!=2||i&&o===0&&typeof r>"u")throw new Error("Encryption block is invalid.");var u=0;if(o===0){u=a-3-r;for(var l=0;l<u;++l)if(n.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(o===1)for(u=0;n.length()>1;){if(n.getByte()!==255){--n.read;break}++u}else if(o===2)for(u=0;n.length()>1;){if(n.getByte()===0){--n.read;break}++u}var f=n.getByte();if(f!==0||u!==a-3-n.length())throw new Error("Encryption block is invalid.");return n.getBytes()}function _y(e,t,i){typeof t=="function"&&(i=t,t={}),t=t||{};var r={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(r.prng=t.prng),a();function a(){n(e.pBits,function(o,u){if(o)return i(o);if(e.p=u,e.q!==null)return s(o,e.q);n(e.qBits,s)})}function n(o,u){W.prime.generateProbablePrime(o,r,u)}function s(o,u){if(o)return i(o);if(e.q=u,e.p.compareTo(e.q)<0){var l=e.p;e.p=e.q,e.q=l}if(e.p.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)!==0){e.p=null,a();return}if(e.q.subtract(ge.ONE).gcd(e.e).compareTo(ge.ONE)!==0){e.q=null,n(e.qBits,s);return}if(e.p1=e.p.subtract(ge.ONE),e.q1=e.q.subtract(ge.ONE),e.phi=e.p1.multiply(e.q1),e.phi.gcd(e.e).compareTo(ge.ONE)!==0){e.p=e.q=null,a();return}if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits){e.q=null,n(e.qBits,s);return}var f=e.e.modInverse(e.phi);e.keys={privateKey:ae.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:ae.rsa.setPublicKey(e.n,e.e)},i(null,e.keys)}}function rr(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var i=W.util.hexToBytes(t);return i.length>1&&(i.charCodeAt(0)===0&&!(i.charCodeAt(1)&128)||i.charCodeAt(0)===255&&(i.charCodeAt(1)&128)===128)?i.substr(1):i}function Ny(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function _c(e){return W.util.isNodejs&&typeof ms[e]=="function"}function Nc(e){return typeof Ut.globalScope<"u"&&typeof Ut.globalScope.crypto=="object"&&typeof Ut.globalScope.crypto.subtle=="object"&&typeof Ut.globalScope.crypto.subtle[e]=="function"}function kc(e){return typeof Ut.globalScope<"u"&&typeof Ut.globalScope.msCrypto=="object"&&typeof Ut.globalScope.msCrypto.subtle=="object"&&typeof Ut.globalScope.msCrypto.subtle[e]=="function"}function Lc(e){for(var t=W.util.hexToBytes(e.toString(16)),i=new Uint8Array(t.length),r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}});var As=F((cE,Fc)=>{"use strict";S();var G=oe();Ir();Gt();Gi();Jt();Br();Ma();Ur();Pt();fs();zi();Ae();typeof Qc>"u"&&(Qc=G.jsbn.BigInteger);var Qc,_=G.asn1,se=G.pki=G.pki||{};Fc.exports=se.pbe=G.pbe=G.pbe||{};var Fr=se.oids,ky={name:"EncryptedPrivateKeyInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},Ly={name:"PBES2Algorithms",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},Ry={name:"pkcs-12PbeParams",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:_.Class.UNIVERSAL,type:_.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"iterations"}]};se.encryptPrivateKeyInfo=function(e,t,i){i=i||{},i.saltSize=i.saltSize||8,i.count=i.count||2048,i.algorithm=i.algorithm||"aes128",i.prfAlgorithm=i.prfAlgorithm||"sha1";var r=G.random.getBytesSync(i.saltSize),a=i.count,n=_.integerToDer(a),s,o,u;if(i.algorithm.indexOf("aes")===0||i.algorithm==="des"){var l,f,c;switch(i.algorithm){case"aes128":s=16,l=16,f=Fr["aes128-CBC"],c=G.aes.createEncryptionCipher;break;case"aes192":s=24,l=16,f=Fr["aes192-CBC"],c=G.aes.createEncryptionCipher;break;case"aes256":s=32,l=16,f=Fr["aes256-CBC"],c=G.aes.createEncryptionCipher;break;case"des":s=8,l=8,f=Fr.desCBC,c=G.des.createEncryptionCipher;break;default:var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=i.algorithm,p}var m="hmacWith"+i.prfAlgorithm.toUpperCase(),v=Vc(m),C=G.pkcs5.pbkdf2(t,r,a,s,v),E=G.random.getBytesSync(l),B=c(C);B.start(E),B.update(_.toDer(e)),B.finish(),u=B.output.getBytes();var w=Dy(r,n,s,m);o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr.pkcs5PBES2).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr.pkcs5PBKDF2).getBytes()),w]),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(f).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,E)])])])}else if(i.algorithm==="3des"){s=24;var T=new G.util.ByteBuffer(r),C=se.pbe.generatePkcs12Key(t,T,1,a,s),E=se.pbe.generatePkcs12Key(t,T,2,a,s),B=G.des.createEncryptionCipher(C);B.start(E),B.update(_.toDer(e)),B.finish(),u=B.output.getBytes(),o=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Fr["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,r),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,n.getBytes())])])}else{var p=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw p.algorithm=i.algorithm,p}var U=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[o,_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,u)]);return U};se.decryptPrivateKeyInfo=function(e,t){var i=null,r={},a=[];if(!_.validate(e,ky,r,a)){var n=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}var s=_.derToOid(r.encryptionOid),o=se.pbe.getCipher(s,r.encryptionParams,t),u=G.util.createBuffer(r.encryptedData);return o.update(u),o.finish()&&(i=_.fromDer(o.output)),i};se.encryptedPrivateKeyToPem=function(e,t){var i={type:"ENCRYPTED PRIVATE KEY",body:_.toDer(e).getBytes()};return G.pem.encode(i,{maxline:t})};se.encryptedPrivateKeyFromPem=function(e){var t=G.pem.decode(e)[0];if(t.type!=="ENCRYPTED PRIVATE KEY"){var i=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return _.fromDer(t.body)};se.encryptRsaPrivateKey=function(e,t,i){if(i=i||{},!i.legacy){var r=se.wrapRsaPrivateKey(se.privateKeyToAsn1(e));return r=se.encryptPrivateKeyInfo(r,t,i),se.encryptedPrivateKeyToPem(r)}var a,n,s,o;switch(i.algorithm){case"aes128":a="AES-128-CBC",s=16,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"aes192":a="AES-192-CBC",s=24,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"aes256":a="AES-256-CBC",s=32,n=G.random.getBytesSync(16),o=G.aes.createEncryptionCipher;break;case"3des":a="DES-EDE3-CBC",s=24,n=G.random.getBytesSync(8),o=G.des.createEncryptionCipher;break;case"des":a="DES-CBC",s=8,n=G.random.getBytesSync(8),o=G.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+i.algorithm+'".');throw u.algorithm=i.algorithm,u}var l=G.pbe.opensslDeriveBytes(t,n.substr(0,8),s),f=o(l);f.start(n),f.update(_.toDer(se.privateKeyToAsn1(e))),f.finish();var c={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:a,parameters:G.util.bytesToHex(n).toUpperCase()},body:f.output.getBytes()};return G.pem.encode(c)};se.decryptRsaPrivateKey=function(e,t){var i=null,r=G.pem.decode(e)[0];if(r.type!=="ENCRYPTED PRIVATE KEY"&&r.type!=="PRIVATE KEY"&&r.type!=="RSA PRIVATE KEY"){var a=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw a.headerType=a,a}if(r.procType&&r.procType.type==="ENCRYPTED"){var n,s;switch(r.dekInfo.algorithm){case"DES-CBC":n=8,s=G.des.createDecryptionCipher;break;case"DES-EDE3-CBC":n=24,s=G.des.createDecryptionCipher;break;case"AES-128-CBC":n=16,s=G.aes.createDecryptionCipher;break;case"AES-192-CBC":n=24,s=G.aes.createDecryptionCipher;break;case"AES-256-CBC":n=32,s=G.aes.createDecryptionCipher;break;case"RC2-40-CBC":n=5,s=function(c){return G.rc2.createDecryptionCipher(c,40)};break;case"RC2-64-CBC":n=8,s=function(c){return G.rc2.createDecryptionCipher(c,64)};break;case"RC2-128-CBC":n=16,s=function(c){return G.rc2.createDecryptionCipher(c,128)};break;default:var a=new Error('Could not decrypt private key; unsupported encryption algorithm "'+r.dekInfo.algorithm+'".');throw a.algorithm=r.dekInfo.algorithm,a}var o=G.util.hexToBytes(r.dekInfo.parameters),u=G.pbe.opensslDeriveBytes(t,o.substr(0,8),n),l=s(u);if(l.start(o),l.update(G.util.createBuffer(r.body)),l.finish())i=l.output.getBytes();else return i}else i=r.body;return r.type==="ENCRYPTED PRIVATE KEY"?i=se.decryptPrivateKeyInfo(_.fromDer(i),t):i=_.fromDer(i),i!==null&&(i=se.privateKeyFromAsn1(i)),i};se.pbe.generatePkcs12Key=function(e,t,i,r,a,n){var s,o;if(typeof n>"u"||n===null){if(!("sha1"in G.md))throw new Error('"sha1" hash algorithm unavailable.');n=G.md.sha1.create()}var u=n.digestLength,l=n.blockLength,f=new G.util.ByteBuffer,c=new G.util.ByteBuffer;if(e!=null){for(o=0;o<e.length;o++)c.putInt16(e.charCodeAt(o));c.putInt16(0)}var p=c.length(),m=t.length(),v=new G.util.ByteBuffer;v.fillWithByte(i,l);var C=l*Math.ceil(m/l),E=new G.util.ByteBuffer;for(o=0;o<C;o++)E.putByte(t.at(o%m));var B=l*Math.ceil(p/l),w=new G.util.ByteBuffer;for(o=0;o<B;o++)w.putByte(c.at(o%p));var T=E;T.putBuffer(w);for(var U=Math.ceil(a/u),P=1;P<=U;P++){var Q=new G.util.ByteBuffer;Q.putBytes(v.bytes()),Q.putBytes(T.bytes());for(var te=0;te<r;te++)n.start(),n.update(Q.getBytes()),Q=n.digest();var ne=new G.util.ByteBuffer;for(o=0;o<l;o++)ne.putByte(Q.at(o%u));var H=Math.ceil(m/l)+Math.ceil(p/l),z=new G.util.ByteBuffer;for(s=0;s<H;s++){var Y=new G.util.ByteBuffer(T.getBytes(l)),re=511;for(o=ne.length()-1;o>=0;o--)re=re>>8,re+=ne.at(o)+Y.at(o),Y.setAt(o,re&255);z.putBuffer(Y)}T=z,f.putBuffer(Q)}return f.truncate(f.length()-a),f};se.pbe.getCipher=function(e,t,i){switch(e){case se.oids.pkcs5PBES2:return se.pbe.getCipherForPBES2(e,t,i);case se.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case se.oids["pbewithSHAAnd40BitRC2-CBC"]:return se.pbe.getCipherForPKCS12PBE(e,t,i);default:var r=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw r.oid=e,r.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],r}};se.pbe.getCipherForPBES2=function(e,t,i){var r={},a=[];if(!_.validate(t,Ly,r,a)){var n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}if(e=_.derToOid(r.kdfOid),e!==se.oids.pkcs5PBKDF2){var n=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw n.oid=e,n.supportedOids=["pkcs5PBKDF2"],n}if(e=_.derToOid(r.encOid),e!==se.oids["aes128-CBC"]&&e!==se.oids["aes192-CBC"]&&e!==se.oids["aes256-CBC"]&&e!==se.oids["des-EDE3-CBC"]&&e!==se.oids.desCBC){var n=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw n.oid=e,n.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],n}var s=r.kdfSalt,o=G.util.createBuffer(r.kdfIterationCount);o=o.getInt(o.length()<<3);var u,l;switch(se.oids[e]){case"aes128-CBC":u=16,l=G.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,l=G.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,l=G.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,l=G.des.createDecryptionCipher;break;case"desCBC":u=8,l=G.des.createDecryptionCipher;break}var f=Oc(r.prfOid),c=G.pkcs5.pbkdf2(i,s,o,u,f),p=r.encIv,m=l(c);return m.start(p),m};se.pbe.getCipherForPKCS12PBE=function(e,t,i){var r={},a=[];if(!_.validate(t,Ry,r,a)){var n=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw n.errors=a,n}var s=G.util.createBuffer(r.salt),o=G.util.createBuffer(r.iterations);o=o.getInt(o.length()<<3);var u,l,f;switch(e){case se.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=G.des.startDecrypting;break;case se.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(C,E){var B=G.rc2.createDecryptionCipher(C,40);return B.start(E,null),B};break;default:var n=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw n.oid=e,n}var c=Oc(r.prfOid),p=se.pbe.generatePkcs12Key(i,s,1,o,u,c);c.start();var m=se.pbe.generatePkcs12Key(i,s,2,o,l,c);return f(p,m)};se.pbe.opensslDeriveBytes=function(e,t,i,r){if(typeof r>"u"||r===null){if(!("md5"in G.md))throw new Error('"md5" hash algorithm unavailable.');r=G.md.md5.create()}t===null&&(t="");for(var a=[Uc(r,e+t)],n=16,s=1;n<i;++s,n+=16)a.push(Uc(r,a[s-1]+e+t));return a.join("").substr(0,i)};function Uc(e,t){return e.start().update(t).digest().getBytes()}function Oc(e){var t;if(!e)t="hmacWithSHA1";else if(t=se.oids[_.derToOid(e)],!t){var i=new Error("Unsupported PRF OID.");throw i.oid=e,i.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],i}return Vc(t)}function Vc(e){var t=G.md;switch(e){case"hmacWithSHA224":t=G.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var i=new Error("Unsupported PRF algorithm.");throw i.algorithm=e,i.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],i}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}function Dy(e,t,i,r){var a=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,e),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,t.getBytes())]);return r!=="hmacWithSHA1"&&a.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,G.util.hexToBytes(i.toString(16))),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(se.oids[r]).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])),a}});var Cs=F((pE,Kc)=>{"use strict";S();var li=oe();Gt();Ae();var K=li.asn1,fi=Kc.exports=li.pkcs7asn1=li.pkcs7asn1||{};li.pkcs7=li.pkcs7||{};li.pkcs7.asn1=fi;var Mc={name:"ContentInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};fi.contentInfoValidator=Mc;var qc={name:"EncryptedContentInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};fi.envelopedDataValidator={name:"EnvelopedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(qc)};fi.encryptedDataValidator={name:"EncryptedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"}].concat(qc)};var Py={name:"SignerInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:K.Class.UNIVERSAL,type:K.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:K.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};fi.signedDataValidator={name:"SignedData",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},Mc,{name:"SignedData.Certificates",tagClass:K.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:K.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:K.Class.UNIVERSAL,type:K.Type.SET,capture:"signerInfos",optional:!0,value:[Py]}]};fi.recipientInfoValidator={name:"RecipientInfo",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:K.Class.UNIVERSAL,type:K.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:K.Class.UNIVERSAL,type:K.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:K.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:K.Class.UNIVERSAL,type:K.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Es=F((gE,Hc)=>{"use strict";S();var Mr=oe();Ae();Mr.mgf=Mr.mgf||{};var Qy=Hc.exports=Mr.mgf.mgf1=Mr.mgf1=Mr.mgf1||{};Qy.create=function(e){var t={generate:function(i,r){for(var a=new Mr.util.ByteBuffer,n=Math.ceil(r/e.digestLength),s=0;s<n;s++){var o=new Mr.util.ByteBuffer;o.putInt32(s),e.start(),e.update(i+o.getBytes()),a.putBuffer(e.digest())}return a.truncate(a.length()-r),a.getBytes()}};return t}});var jc=F((yE,Gc)=>{"use strict";S();var Ya=oe();Es();Gc.exports=Ya.mgf=Ya.mgf||{};Ya.mgf.mgf1=Ya.mgf1});var za=F((AE,Yc)=>{"use strict";S();var qr=oe();Pt();Ae();var Uy=Yc.exports=qr.pss=qr.pss||{};Uy.create=function(e){arguments.length===3&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t=e.md,i=e.mgf,r=t.digestLength,a=e.salt||null;typeof a=="string"&&(a=qr.util.createBuffer(a));var n;if("saltLength"in e)n=e.saltLength;else if(a!==null)n=a.length();else throw new Error("Salt length not specified or specific salt not given.");if(a!==null&&a.length()!==n)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||qr.random,o={};return o.encode=function(u,l){var f,c=l-1,p=Math.ceil(c/8),m=u.digest().getBytes();if(p<r+n+2)throw new Error("Message is too long to encrypt.");var v;a===null?v=s.getBytesSync(n):v=a.bytes();var C=new qr.util.ByteBuffer;C.fillWithByte(0,8),C.putBytes(m),C.putBytes(v),t.start(),t.update(C.getBytes());var E=t.digest().getBytes(),B=new qr.util.ByteBuffer;B.fillWithByte(0,p-n-r-2),B.putByte(1),B.putBytes(v);var w=B.getBytes(),T=p-r-1,U=i.generate(E,T),P="";for(f=0;f<T;f++)P+=String.fromCharCode(w.charCodeAt(f)^U.charCodeAt(f));var Q=65280>>8*p-c&255;return P=String.fromCharCode(P.charCodeAt(0)&~Q)+P.substr(1),P+E+"\xBC"},o.verify=function(u,l,f){var c,p=f-1,m=Math.ceil(p/8);if(l=l.substr(-m),m<r+n+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(l.charCodeAt(m-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var v=m-r-1,C=l.substr(0,v),E=l.substr(v,r),B=65280>>8*m-p&255;if(C.charCodeAt(0)&B)throw new Error("Bits beyond keysize not zero as expected.");var w=i.generate(E,v),T="";for(c=0;c<v;c++)T+=String.fromCharCode(C.charCodeAt(c)^w.charCodeAt(c));T=String.fromCharCode(T.charCodeAt(0)&~B)+T.substr(1);var U=m-r-n-2;for(c=0;c<U;c++)if(T.charCodeAt(c)!==0)throw new Error("Leftmost octets not zero as expected");if(T.charCodeAt(U)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var P=T.substr(-n),Q=new qr.util.ByteBuffer;Q.fillWithByte(0,8),Q.putBytes(u),Q.putBytes(P),t.start(),t.update(Q.getBytes());var te=t.digest().getBytes();return E===te},o}});var Xa=F((EE,$c)=>{"use strict";S();var X=oe();Ir();Gt();Gi();Jt();jc();Br();Ur();za();zi();Ae();var h=X.asn1,O=$c.exports=X.pki=X.pki||{},ve=O.oids,Ue={};Ue.CN=ve.commonName;Ue.commonName="CN";Ue.C=ve.countryName;Ue.countryName="C";Ue.L=ve.localityName;Ue.localityName="L";Ue.ST=ve.stateOrProvinceName;Ue.stateOrProvinceName="ST";Ue.O=ve.organizationName;Ue.organizationName="O";Ue.OU=ve.organizationalUnitName;Ue.organizationalUnitName="OU";Ue.E=ve.emailAddress;Ue.emailAddress="E";var Jc=X.pki.rsa.publicKeyValidator,Oy={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},Jc,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},Vy={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},Fy={name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},Jc,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},My={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[Fy,{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};O.RDNAttributesAsArray=function(e,t){for(var i=[],r,a,n,s=0;s<e.value.length;++s){r=e.value[s];for(var o=0;o<r.value.length;++o)n={},a=r.value[o],n.type=h.derToOid(a.value[0].value),n.value=a.value[1].value,n.valueTagClass=a.value[1].type,n.type in ve&&(n.name=ve[n.type],n.name in Ue&&(n.shortName=Ue[n.name])),t&&(t.update(n.type),t.update(n.value)),i.push(n)}return i};O.CRIAttributesAsArray=function(e){for(var t=[],i=0;i<e.length;++i)for(var r=e[i],a=h.derToOid(r.value[0].value),n=r.value[1].value,s=0;s<n.length;++s){var o={};if(o.type=a,o.value=n[s].value,o.valueTagClass=n[s].type,o.type in ve&&(o.name=ve[o.type],o.name in Ue&&(o.shortName=Ue[o.name])),o.type===ve.extensionRequest){o.extensions=[];for(var u=0;u<o.value.length;++u)o.extensions.push(O.certificateExtensionFromAsn1(o.value[u]))}t.push(o)}return t};function wr(e,t){typeof t=="string"&&(t={shortName:t});for(var i=null,r,a=0;i===null&&a<e.attributes.length;++a)r=e.attributes[a],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(i=r);return i}var Ja=function(e,t,i){var r={};if(e!==ve["RSASSA-PSS"])return r;i&&(r={hash:{algorithmOid:ve.sha1},mgf:{algorithmOid:ve.mgf1,hash:{algorithmOid:ve.sha1}},saltLength:20});var a={},n=[];if(!h.validate(t,Vy,a,n)){var s=new Error("Cannot read RSASSA-PSS parameter block.");throw s.errors=n,s}return a.hashOid!==void 0&&(r.hash=r.hash||{},r.hash.algorithmOid=h.derToOid(a.hashOid)),a.maskGenOid!==void 0&&(r.mgf=r.mgf||{},r.mgf.algorithmOid=h.derToOid(a.maskGenOid),r.mgf.hash=r.mgf.hash||{},r.mgf.hash.algorithmOid=h.derToOid(a.maskGenHashOid)),a.saltLength!==void 0&&(r.saltLength=a.saltLength.charCodeAt(0)),r},Wa=function(e){switch(ve[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return X.md.sha1.create();case"md5WithRSAEncryption":return X.md.md5.create();case"sha256WithRSAEncryption":return X.md.sha256.create();case"sha384WithRSAEncryption":return X.md.sha384.create();case"sha512WithRSAEncryption":return X.md.sha512.create();case"RSASSA-PSS":return X.md.sha256.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},Wc=function(e){var t=e.certificate,i;switch(t.signatureOid){case ve.sha1WithRSAEncryption:case ve.sha1WithRSASignature:break;case ve["RSASSA-PSS"]:var r,a;if(r=ve[t.signatureParameters.mgf.hash.algorithmOid],r===void 0||X.md[r]===void 0){var n=new Error("Unsupported MGF hash function.");throw n.oid=t.signatureParameters.mgf.hash.algorithmOid,n.name=r,n}if(a=ve[t.signatureParameters.mgf.algorithmOid],a===void 0||X.mgf[a]===void 0){var n=new Error("Unsupported MGF function.");throw n.oid=t.signatureParameters.mgf.algorithmOid,n.name=a,n}if(a=X.mgf[a].create(X.md[r].create()),r=ve[t.signatureParameters.hash.algorithmOid],r===void 0||X.md[r]===void 0){var n=new Error("Unsupported RSASSA-PSS hash function.");throw n.oid=t.signatureParameters.hash.algorithmOid,n.name=r,n}i=X.pss.create(X.md[r].create(),a,t.signatureParameters.saltLength);break}return t.publicKey.verify(e.md.digest().getBytes(),e.signature,i)};O.certificateFromPem=function(e,t,i){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE"&&r.type!=="X509 CERTIFICATE"&&r.type!=="TRUSTED CERTIFICATE"){var a=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw a.headerType=r.type,a}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var n=h.fromDer(r.body,i);return O.certificateFromAsn1(n,t)};O.certificateToPem=function(e,t){var i={type:"CERTIFICATE",body:h.toDer(O.certificateToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.publicKeyFromPem=function(e){var t=X.pem.decode(e)[0];if(t.type!=="PUBLIC KEY"&&t.type!=="RSA PUBLIC KEY"){var i=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var r=h.fromDer(t.body);return O.publicKeyFromAsn1(r)};O.publicKeyToPem=function(e,t){var i={type:"PUBLIC KEY",body:h.toDer(O.publicKeyToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.publicKeyToRSAPublicKeyPem=function(e,t){var i={type:"RSA PUBLIC KEY",body:h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.getPublicKeyFingerprint=function(e,t){t=t||{};var i=t.md||X.md.sha1.create(),r=t.type||"RSAPublicKey",a;switch(r){case"RSAPublicKey":a=h.toDer(O.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":a=h.toDer(O.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}i.start(),i.update(a);var n=i.digest();if(t.encoding==="hex"){var s=n.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return n.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return n};O.certificationRequestFromPem=function(e,t,i){var r=X.pem.decode(e)[0];if(r.type!=="CERTIFICATE REQUEST"){var a=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw a.headerType=r.type,a}if(r.procType&&r.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var n=h.fromDer(r.body,i);return O.certificationRequestFromAsn1(n,t)};O.certificationRequestToPem=function(e,t){var i={type:"CERTIFICATE REQUEST",body:h.toDer(O.certificationRequestToAsn1(e)).getBytes()};return X.pem.encode(i,{maxline:t})};O.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return wr(e.issuer,t)},e.issuer.addField=function(t){Ot([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return wr(e.subject,t)},e.subject.addField=function(t){Ot([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,i){Ot(t),e.subject.attributes=t,delete e.subject.uniqueId,i&&(e.subject.uniqueId=i),e.subject.hash=null},e.setIssuer=function(t,i){Ot(t),e.issuer.attributes=t,delete e.issuer.uniqueId,i&&(e.issuer.uniqueId=i),e.issuer.hash=null},e.setExtensions=function(t){for(var i=0;i<t.length;++i)Xc(t[i],{cert:e});e.extensions=t},e.getExtension=function(t){typeof t=="string"&&(t={name:t});for(var i=null,r,a=0;i===null&&a<e.extensions.length;++a)r=e.extensions[a],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(i=r);return i},e.sign=function(t,i){e.md=i||X.md.sha1.create();var r=ve[e.md.algorithm+"WithRSAEncryption"];if(!r){var a=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw a.algorithm=e.md.algorithm,a}e.signatureOid=e.siginfo.algorithmOid=r,e.tbsCertificate=O.getTBSCertificate(e);var n=h.toDer(e.tbsCertificate);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var i=!1;if(!e.issued(t)){var r=t.issuer,a=e.subject,n=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw n.expectedIssuer=a.attributes,n.actualIssuer=r.attributes,n}var s=t.md;if(s===null){s=Wa({signatureOid:t.signatureOid,type:"certificate"});var o=t.tbsCertificate||O.getTBSCertificate(t),u=h.toDer(o);s.update(u.getBytes())}return s!==null&&(i=Wc({certificate:e,md:s,signature:t.signature})),i},e.isIssuer=function(t){var i=!1,r=e.issuer,a=t.subject;if(r.hash&&a.hash)i=r.hash===a.hash;else if(r.attributes.length===a.attributes.length){i=!0;for(var n,s,o=0;i&&o<r.attributes.length;++o)n=r.attributes[o],s=a.attributes[o],(n.type!==s.type||n.value!==s.value)&&(i=!1)}return i},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return O.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=ve.subjectKeyIdentifier,i=0;i<e.extensions.length;++i){var r=e.extensions[i];if(r.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return X.util.hexToBytes(r.subjectKeyIdentifier)===a}}return!1},e};O.certificateFromAsn1=function(e,t){var i={},r=[];if(!h.validate(e,Oy,i,r)){var a=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw a.errors=r,a}var n=h.derToOid(i.publicKeyOid);if(n!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificate();s.version=i.certVersion?i.certVersion.charCodeAt(0):0;var o=X.util.createBuffer(i.certSerialNumber);s.serialNumber=o.toHex(),s.signatureOid=X.asn1.derToOid(i.certSignatureOid),s.signatureParameters=Ja(s.signatureOid,i.certSignatureParams,!0),s.siginfo.algorithmOid=X.asn1.derToOid(i.certinfoSignatureOid),s.siginfo.parameters=Ja(s.siginfo.algorithmOid,i.certinfoSignatureParams,!1),s.signature=i.certSignature;var u=[];if(i.certValidity1UTCTime!==void 0&&u.push(h.utcTimeToDate(i.certValidity1UTCTime)),i.certValidity2GeneralizedTime!==void 0&&u.push(h.generalizedTimeToDate(i.certValidity2GeneralizedTime)),i.certValidity3UTCTime!==void 0&&u.push(h.utcTimeToDate(i.certValidity3UTCTime)),i.certValidity4GeneralizedTime!==void 0&&u.push(h.generalizedTimeToDate(i.certValidity4GeneralizedTime)),u.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(s.validity.notBefore=u[0],s.validity.notAfter=u[1],s.tbsCertificate=i.tbsCertificate,t){s.md=Wa({signatureOid:s.signatureOid,type:"certificate"});var l=h.toDer(s.tbsCertificate);s.md.update(l.getBytes())}var f=X.md.sha1.create(),c=h.toDer(i.certIssuer);f.update(c.getBytes()),s.issuer.getField=function(v){return wr(s.issuer,v)},s.issuer.addField=function(v){Ot([v]),s.issuer.attributes.push(v)},s.issuer.attributes=O.RDNAttributesAsArray(i.certIssuer),i.certIssuerUniqueId&&(s.issuer.uniqueId=i.certIssuerUniqueId),s.issuer.hash=f.digest().toHex();var p=X.md.sha1.create(),m=h.toDer(i.certSubject);return p.update(m.getBytes()),s.subject.getField=function(v){return wr(s.subject,v)},s.subject.addField=function(v){Ot([v]),s.subject.attributes.push(v)},s.subject.attributes=O.RDNAttributesAsArray(i.certSubject),i.certSubjectUniqueId&&(s.subject.uniqueId=i.certSubjectUniqueId),s.subject.hash=p.digest().toHex(),i.certExtensions?s.extensions=O.certificateExtensionsFromAsn1(i.certExtensions):s.extensions=[],s.publicKey=O.publicKeyFromAsn1(i.subjectPublicKeyInfo),s};O.certificateExtensionsFromAsn1=function(e){for(var t=[],i=0;i<e.value.length;++i)for(var r=e.value[i],a=0;a<r.value.length;++a)t.push(O.certificateExtensionFromAsn1(r.value[a]));return t};O.certificateExtensionFromAsn1=function(e){var t={};if(t.id=h.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===h.Type.BOOLEAN?(t.critical=e.value[1].value.charCodeAt(0)!==0,t.value=e.value[2].value):t.value=e.value[1].value,t.id in ve){if(t.name=ve[t.id],t.name==="keyUsage"){var i=h.fromDer(t.value),r=0,a=0;i.value.length>1&&(r=i.value.charCodeAt(1),a=i.value.length>2?i.value.charCodeAt(2):0),t.digitalSignature=(r&128)===128,t.nonRepudiation=(r&64)===64,t.keyEncipherment=(r&32)===32,t.dataEncipherment=(r&16)===16,t.keyAgreement=(r&8)===8,t.keyCertSign=(r&4)===4,t.cRLSign=(r&2)===2,t.encipherOnly=(r&1)===1,t.decipherOnly=(a&128)===128}else if(t.name==="basicConstraints"){var i=h.fromDer(t.value);i.value.length>0&&i.value[0].type===h.Type.BOOLEAN?t.cA=i.value[0].value.charCodeAt(0)!==0:t.cA=!1;var n=null;i.value.length>0&&i.value[0].type===h.Type.INTEGER?n=i.value[0].value:i.value.length>1&&(n=i.value[1].value),n!==null&&(t.pathLenConstraint=h.derToInteger(n))}else if(t.name==="extKeyUsage")for(var i=h.fromDer(t.value),s=0;s<i.value.length;++s){var o=h.derToOid(i.value[s].value);o in ve?t[ve[o]]=!0:t[o]=!0}else if(t.name==="nsCertType"){var i=h.fromDer(t.value),r=0;i.value.length>1&&(r=i.value.charCodeAt(1)),t.client=(r&128)===128,t.server=(r&64)===64,t.email=(r&32)===32,t.objsign=(r&16)===16,t.reserved=(r&8)===8,t.sslCA=(r&4)===4,t.emailCA=(r&2)===2,t.objCA=(r&1)===1}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.altNames=[];for(var u,i=h.fromDer(t.value),l=0;l<i.value.length;++l){u=i.value[l];var f={type:u.type,value:u.value};switch(t.altNames.push(f),u.type){case 1:case 2:case 6:break;case 7:f.ip=X.util.bytesToIP(u.value);break;case 8:f.oid=h.derToOid(u.value);break;default:}}}else if(t.name==="subjectKeyIdentifier"){var i=h.fromDer(t.value);t.subjectKeyIdentifier=X.util.bytesToHex(i.value)}}return t};O.certificationRequestFromAsn1=function(e,t){var i={},r=[];if(!h.validate(e,My,i,r)){var a=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw a.errors=r,a}var n=h.derToOid(i.publicKeyOid);if(n!==O.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var s=O.createCertificationRequest();if(s.version=i.csrVersion?i.csrVersion.charCodeAt(0):0,s.signatureOid=X.asn1.derToOid(i.csrSignatureOid),s.signatureParameters=Ja(s.signatureOid,i.csrSignatureParams,!0),s.siginfo.algorithmOid=X.asn1.derToOid(i.csrSignatureOid),s.siginfo.parameters=Ja(s.siginfo.algorithmOid,i.csrSignatureParams,!1),s.signature=i.csrSignature,s.certificationRequestInfo=i.certificationRequestInfo,t){s.md=Wa({signatureOid:s.signatureOid,type:"certification request"});var o=h.toDer(s.certificationRequestInfo);s.md.update(o.getBytes())}var u=X.md.sha1.create();return s.subject.getField=function(l){return wr(s.subject,l)},s.subject.addField=function(l){Ot([l]),s.subject.attributes.push(l)},s.subject.attributes=O.RDNAttributesAsArray(i.certificationRequestInfoSubject,u),s.subject.hash=u.digest().toHex(),s.publicKey=O.publicKeyFromAsn1(i.subjectPublicKeyInfo),s.getAttribute=function(l){return wr(s,l)},s.addAttribute=function(l){Ot([l]),s.attributes.push(l)},s.attributes=O.CRIAttributesAsArray(i.certificationRequestInfoAttributes||[]),s};O.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return wr(e.subject,t)},e.subject.addField=function(t){Ot([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return wr(e,t)},e.addAttribute=function(t){Ot([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){Ot(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){Ot(t),e.attributes=t},e.sign=function(t,i){e.md=i||X.md.sha1.create();var r=ve[e.md.algorithm+"WithRSAEncryption"];if(!r){var a=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw a.algorithm=e.md.algorithm,a}e.signatureOid=e.siginfo.algorithmOid=r,e.certificationRequestInfo=O.getCertificationRequestInfo(e);var n=h.toDer(e.certificationRequestInfo);e.md.update(n.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,i=e.md;if(i===null){i=Wa({signatureOid:e.signatureOid,type:"certification request"});var r=e.certificationRequestInfo||O.getCertificationRequestInfo(e),a=h.toDer(r);i.update(a.getBytes())}return i!==null&&(t=Wc({certificate:e,md:i,signature:e.signature})),t},e};function ci(e){for(var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),i,r,a=e.attributes,n=0;n<a.length;++n){i=a[n];var s=i.value,o=h.Type.PRINTABLESTRING;"valueTagClass"in i&&(o=i.valueTagClass,o===h.Type.UTF8&&(s=X.util.encodeUtf8(s))),r=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(i.type).getBytes()),h.create(h.Class.UNIVERSAL,o,!1,s)])]),t.value.push(r)}return t}function Ot(e){for(var t,i=0;i<e.length;++i){if(t=e[i],typeof t.name>"u"&&(t.type&&t.type in O.oids?t.name=O.oids[t.type]:t.shortName&&t.shortName in Ue&&(t.name=O.oids[Ue[t.shortName]])),typeof t.type>"u")if(t.name&&t.name in O.oids)t.type=O.oids[t.name];else{var r=new Error("Attribute type not specified.");throw r.attribute=t,r}if(typeof t.shortName>"u"&&t.name&&t.name in Ue&&(t.shortName=Ue[t.name]),t.type===ve.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=h.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var a=0;a<t.extensions.length;++a)t.value.push(O.certificateExtensionToAsn1(Xc(t.extensions[a])))}if(typeof t.value>"u"){var r=new Error("Attribute value not specified.");throw r.attribute=t,r}}}function Xc(e,t){if(t=t||{},typeof e.name>"u"&&e.id&&e.id in O.oids&&(e.name=O.oids[e.id]),typeof e.id>"u")if(e.name&&e.name in O.oids)e.id=O.oids[e.name];else{var i=new Error("Extension ID not specified.");throw i.extension=e,i}if(typeof e.value<"u")return e;if(e.name==="keyUsage"){var r=0,a=0,n=0;e.digitalSignature&&(a|=128,r=7),e.nonRepudiation&&(a|=64,r=6),e.keyEncipherment&&(a|=32,r=5),e.dataEncipherment&&(a|=16,r=4),e.keyAgreement&&(a|=8,r=3),e.keyCertSign&&(a|=4,r=2),e.cRLSign&&(a|=2,r=1),e.encipherOnly&&(a|=1,r=0),e.decipherOnly&&(n|=128,r=7);var s=String.fromCharCode(r);n!==0?s+=String.fromCharCode(a)+String.fromCharCode(n):a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="basicConstraints")e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in e&&e.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.pathLenConstraint).getBytes()));else if(e.name==="extKeyUsage"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;for(var u in e)e[u]===!0&&(u in ve?o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(ve[u]).getBytes())):u.indexOf(".")!==-1&&o.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(u).getBytes())))}else if(e.name==="nsCertType"){var r=0,a=0;e.client&&(a|=128,r=7),e.server&&(a|=64,r=6),e.email&&(a|=32,r=5),e.objsign&&(a|=16,r=4),e.reserved&&(a|=8,r=3),e.sslCA&&(a|=4,r=2),e.emailCA&&(a|=2,r=1),e.objCA&&(a|=1,r=0);var s=String.fromCharCode(r);a!==0&&(s+=String.fromCharCode(a)),e.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,s)}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var l,f=0;f<e.altNames.length;++f){l=e.altNames[f];var s=l.value;if(l.type===7&&l.ip){if(s=X.util.bytesFromIP(l.ip),s===null){var i=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw i.extension=e,i}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));e.value.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}}else if(e.name==="nsComment"&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=h.create(h.Class.UNIVERSAL,h.Type.IA5STRING,!1,e.comment)}else if(e.name==="subjectKeyIdentifier"&&t.cert){var c=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=c.toHex(),e.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,c.getBytes())}else if(e.name==="authorityKeyIdentifier"&&t.cert){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var o=e.value.value;if(e.keyIdentifier){var p=e.keyIdentifier===!0?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;o.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var m=[h.create(h.Class.CONTEXT_SPECIFIC,4,!0,[ci(e.authorityCertIssuer===!0?t.cert.issuer:e.authorityCertIssuer)])];o.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,m))}if(e.serialNumber){var v=X.util.hexToBytes(e.serialNumber===!0?t.cert.serialNumber:e.serialNumber);o.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if(e.name==="cRLDistributionPoints"){e.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);for(var o=e.value.value,C=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),E=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]),l,f=0;f<e.altNames.length;++f){l=e.altNames[f];var s=l.value;if(l.type===7&&l.ip){if(s=X.util.bytesFromIP(l.ip),s===null){var i=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw i.extension=e,i}}else l.type===8&&(l.oid?s=h.oidToDer(h.oidToDer(l.oid)):s=h.oidToDer(s));E.value.push(h.create(h.Class.CONTEXT_SPECIFIC,l.type,!1,s))}C.value.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[E])),o.push(C)}if(typeof e.value>"u"){var i=new Error("Extension value not specified.");throw i.extension=e,i}return e}function xs(e,t){switch(e){case ve["RSASSA-PSS"]:var i=[];return t.hash.algorithmOid!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])),t.mgf.algorithmOid!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(t.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])])),t.saltLength!==void 0&&i.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(t.saltLength).getBytes())])),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,i);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")}}function qy(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(e.attributes.length===0)return t;for(var i=e.attributes,r=0;r<i.length;++r){var a=i[r],n=a.value,s=h.Type.UTF8;"valueTagClass"in a&&(s=a.valueTagClass),s===h.Type.UTF8&&(n=X.util.encodeUtf8(n));var o=!1;"valueConstructed"in a&&(o=a.valueConstructed);var u=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,s,o,n)])]);t.value.push(u)}return t}var Ky=new Date("1950-01-01T00:00:00Z"),Hy=new Date("2050-01-01T00:00:00Z");function zc(e){return e>=Ky&&e<Hy?h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(e)):h.create(h.Class.UNIVERSAL,h.Type.GENERALIZEDTIME,!1,h.dateToGeneralizedTime(e))}O.getTBSCertificate=function(e){var t=zc(e.validity.notBefore),i=zc(e.validity.notAfter),r=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,X.util.hexToBytes(e.serialNumber)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.siginfo.algorithmOid).getBytes()),xs(e.siginfo.algorithmOid,e.siginfo.parameters)]),ci(e.issuer),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,i]),ci(e.subject),O.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&r.value.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&r.value.push(O.certificateExtensionsToAsn1(e.extensions)),r};O.getCertificationRequestInfo=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e.version).getBytes()),ci(e.subject),O.publicKeyToAsn1(e.publicKey),qy(e)]);return t};O.distinguishedNameToAsn1=function(e){return ci(e)};O.certificateToAsn1=function(e){var t=e.tbsCertificate||O.getTBSCertificate(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),xs(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])};O.certificateExtensionsToAsn1=function(e){var t=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),i=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(i);for(var r=0;r<e.length;++r)i.value.push(O.certificateExtensionToAsn1(e[r]));return t};O.certificateExtensionToAsn1=function(e){var t=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.id).getBytes())),e.critical&&t.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,"\xFF"));var i=e.value;return typeof e.value!="string"&&(i=h.toDer(i).getBytes()),t.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,i)),t};O.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||O.getCertificationRequestInfo(e);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[t,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.signatureOid).getBytes()),xs(e.signatureOid,e.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,"\0"+e.signature)])};O.createCaStore=function(e){var t={certs:{}};t.getIssuer=function(s){var o=i(s.issuer);return o},t.addCertificate=function(s){if(typeof s=="string"&&(s=X.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))if(s.subject.hash in t.certs){var o=t.certs[s.subject.hash];X.util.isArray(o)||(o=[o]),o.push(s),t.certs[s.subject.hash]=o}else t.certs[s.subject.hash]=s},t.hasCertificate=function(s){typeof s=="string"&&(s=X.pki.certificateFromPem(s));var o=i(s.subject);if(!o)return!1;X.util.isArray(o)||(o=[o]);for(var u=h.toDer(O.certificateToAsn1(s)).getBytes(),l=0;l<o.length;++l){var f=h.toDer(O.certificateToAsn1(o[l])).getBytes();if(u===f)return!0}return!1},t.listAllCertificates=function(){var s=[];for(var o in t.certs)if(t.certs.hasOwnProperty(o)){var u=t.certs[o];if(!X.util.isArray(u))s.push(u);else for(var l=0;l<u.length;++l)s.push(u[l])}return s},t.removeCertificate=function(s){var o;if(typeof s=="string"&&(s=X.pki.certificateFromPem(s)),r(s.subject),!t.hasCertificate(s))return null;var u=i(s.subject);if(!X.util.isArray(u))return o=t.certs[s.subject.hash],delete t.certs[s.subject.hash],o;for(var l=h.toDer(O.certificateToAsn1(s)).getBytes(),f=0;f<u.length;++f){var c=h.toDer(O.certificateToAsn1(u[f])).getBytes();l===c&&(o=u[f],u.splice(f,1))}return u.length===0&&delete t.certs[s.subject.hash],o};function i(s){return r(s),t.certs[s.hash]||null}function r(s){if(!s.hash){var o=X.md.sha1.create();s.attributes=O.RDNAttributesAsArray(ci(s),o),s.hash=o.digest().toHex()}}if(e)for(var a=0;a<e.length;++a){var n=e[a];t.addCertificate(n)}return t};O.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};O.verifyCertificateChain=function(e,t,i){typeof i=="function"&&(i={verify:i}),i=i||{},t=t.slice(0);var r=t.slice(0),a=i.validityCheckDate;typeof a>"u"&&(a=new Date);var n=!0,s=null,o=0;do{var u=t.shift(),l=null,f=!1;if(a&&(a<u.validity.notBefore||a>u.validity.notAfter)&&(s={message:"Certificate is not valid yet or has expired.",error:O.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:a}),s===null){if(l=t[0]||e.getIssuer(u),l===null&&u.isIssuer(u)&&(f=!0,l=u),l){var c=l;X.util.isArray(c)||(c=[c]);for(var p=!1;!p&&c.length>0;){l=c.shift();try{p=l.verify(u)}catch{}}p||(s={message:"Certificate signature is invalid.",error:O.certificateError.bad_certificate})}s===null&&(!l||f)&&!e.hasCertificate(u)&&(s={message:"Certificate is not trusted.",error:O.certificateError.unknown_ca})}if(s===null&&l&&!u.isIssuer(l)&&(s={message:"Certificate issuer is invalid.",error:O.certificateError.bad_certificate}),s===null)for(var m={keyUsage:!0,basicConstraints:!0},v=0;s===null&&v<u.extensions.length;++v){var C=u.extensions[v];C.critical&&!(C.name in m)&&(s={message:"Certificate has an unsupported critical extension.",error:O.certificateError.unsupported_certificate})}if(s===null&&(!n||t.length===0&&(!l||f))){var E=u.getExtension("basicConstraints"),B=u.getExtension("keyUsage");if(B!==null&&(!B.keyCertSign||E===null)&&(s={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:O.certificateError.bad_certificate}),s===null&&E!==null&&!E.cA&&(s={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:O.certificateError.bad_certificate}),s===null&&B!==null&&"pathLenConstraint"in E){var w=o-1;w>E.pathLenConstraint&&(s={message:"Certificate basicConstraints pathLenConstraint violated.",error:O.certificateError.bad_certificate})}}var T=s===null?!0:s.error,U=i.verify?i.verify(T,o,r):T;if(U===!0)s=null;else throw T===!0&&(s={message:"The application rejected the certificate.",error:O.certificateError.bad_certificate}),(U||U===0)&&(typeof U=="object"&&!X.util.isArray(U)?(U.message&&(s.message=U.message),U.error&&(s.error=U.error)):typeof U=="string"&&(s.error=U)),s;n=!1,++o}while(t.length>0);return!0}});var Is=F((SE,e0)=>{"use strict";S();var we=oe();Gt();ai();Br();Cs();As();Pt();zi();ui();Ae();Xa();var A=we.asn1,fe=we.pki,Wi=e0.exports=we.pkcs12=we.pkcs12||{},Zc={name:"ContentInfo",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},Gy={name:"PFX",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,capture:"version"},Zc,{name:"PFX.macData",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:A.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:A.Class.UNIVERSAL,type:A.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:A.Class.UNIVERSAL,type:A.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},jy={name:"SafeBag",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:A.Class.UNIVERSAL,type:A.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},Yy={name:"Attribute",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:A.Class.UNIVERSAL,type:A.Type.SET,constructed:!0,capture:"values"}]},zy={name:"CertBag",tagClass:A.Class.UNIVERSAL,type:A.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:A.Class.UNIVERSAL,type:A.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:A.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:A.Class.UNIVERSAL,type:A.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Ji(e,t,i,r){for(var a=[],n=0;n<e.length;n++)for(var s=0;s<e[n].safeBags.length;s++){var o=e[n].safeBags[s];if(!(r!==void 0&&o.type!==r)){if(t===null){a.push(o);continue}o.attributes[t]!==void 0&&o.attributes[t].indexOf(i)>=0&&a.push(o)}}return a}Wi.pkcs12FromAsn1=function(e,t,i){typeof t=="string"?(i=t,t=!0):t===void 0&&(t=!0);var r={},a=[];if(!A.validate(e,Gy,r,a)){var n=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw n.errors=n,n}var s={version:r.version.charCodeAt(0),safeContents:[],getBags:function(E){var B={},w;return"localKeyId"in E?w=E.localKeyId:"localKeyIdHex"in E&&(w=we.util.hexToBytes(E.localKeyIdHex)),w===void 0&&!("friendlyName"in E)&&"bagType"in E&&(B[E.bagType]=Ji(s.safeContents,null,null,E.bagType)),w!==void 0&&(B.localKeyId=Ji(s.safeContents,"localKeyId",w,E.bagType)),"friendlyName"in E&&(B.friendlyName=Ji(s.safeContents,"friendlyName",E.friendlyName,E.bagType)),B},getBagsByFriendlyName:function(E,B){return Ji(s.safeContents,"friendlyName",E,B)},getBagsByLocalKeyId:function(E,B){return Ji(s.safeContents,"localKeyId",E,B)}};if(r.version.charCodeAt(0)!==3){var n=new Error("PKCS#12 PFX of version other than 3 not supported.");throw n.version=r.version.charCodeAt(0),n}if(A.derToOid(r.contentType)!==fe.oids.data){var n=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw n.oid=A.derToOid(r.contentType),n}var o=r.content.value[0];if(o.tagClass!==A.Class.UNIVERSAL||o.type!==A.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=Ss(o),r.mac){var u=null,l=0,f=A.derToOid(r.macAlgorithm);switch(f){case fe.oids.sha1:u=we.md.sha1.create(),l=20;break;case fe.oids.sha256:u=we.md.sha256.create(),l=32;break;case fe.oids.sha384:u=we.md.sha384.create(),l=48;break;case fe.oids.sha512:u=we.md.sha512.create(),l=64;break;case fe.oids.md5:u=we.md.md5.create(),l=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var c=new we.util.ByteBuffer(r.macSalt),p="macIterations"in r?parseInt(we.util.bytesToHex(r.macIterations),16):1,m=Wi.generateKey(i,c,3,p,l,u),v=we.hmac.create();v.start(u,m),v.update(o.value);var C=v.getMac();if(C.getBytes()!==r.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return Jy(s,o.value,t,i),s};function Ss(e){if(e.composed||e.constructed){for(var t=we.util.createBuffer(),i=0;i<e.value.length;++i)t.putBytes(e.value[i].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function Jy(e,t,i,r){if(t=A.fromDer(t,i),t.tagClass!==A.Class.UNIVERSAL||t.type!==A.Type.SEQUENCE||t.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var n=t.value[a],s={},o=[];if(!A.validate(n,Zc,s,o)){var u=new Error("Cannot read ContentInfo.");throw u.errors=o,u}var l={encrypted:!1},f=null,c=s.content.value[0];switch(A.derToOid(s.contentType)){case fe.oids.data:if(c.tagClass!==A.Class.UNIVERSAL||c.type!==A.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");f=Ss(c).value;break;case fe.oids.encryptedData:f=Wy(c,r),l.encrypted=!0;break;default:var u=new Error("Unsupported PKCS#12 contentType.");throw u.contentType=A.derToOid(s.contentType),u}l.safeBags=Xy(f,i,r),e.safeContents.push(l)}}function Wy(e,t){var i={},r=[];if(!A.validate(e,we.pkcs7.asn1.encryptedDataValidator,i,r)){var a=new Error("Cannot read EncryptedContentInfo.");throw a.errors=r,a}var n=A.derToOid(i.contentType);if(n!==fe.oids.data){var a=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw a.oid=n,a}n=A.derToOid(i.encAlgorithm);var s=fe.pbe.getCipher(n,i.encParameter,t),o=Ss(i.encryptedContentAsn1),u=we.util.createBuffer(o.value);if(s.update(u),!s.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return s.output.getBytes()}function Xy(e,t,i){if(!t&&e.length===0)return[];if(e=A.fromDer(e,t),e.tagClass!==A.Class.UNIVERSAL||e.type!==A.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var r=[],a=0;a<e.value.length;a++){var n=e.value[a],s={},o=[];if(!A.validate(n,jy,s,o)){var u=new Error("Cannot read SafeBag.");throw u.errors=o,u}var l={type:A.derToOid(s.bagId),attributes:$y(s.bagAttributes)};r.push(l);var f,c,p=s.bagValue.value[0];switch(l.type){case fe.oids.pkcs8ShroudedKeyBag:if(p=fe.decryptPrivateKeyInfo(p,i),p===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case fe.oids.keyBag:try{l.key=fe.privateKeyFromAsn1(p)}catch{l.key=null,l.asn1=p}continue;case fe.oids.certBag:f=zy,c=function(){if(A.derToOid(s.certId)!==fe.oids.x509Certificate){var v=new Error("Unsupported certificate type, only X.509 supported.");throw v.oid=A.derToOid(s.certId),v}var C=A.fromDer(s.cert,t);try{l.cert=fe.certificateFromAsn1(C,!0)}catch{l.cert=null,l.asn1=C}};break;default:var u=new Error("Unsupported PKCS#12 SafeBag type.");throw u.oid=l.type,u}if(f!==void 0&&!A.validate(p,f,s,o)){var u=new Error("Cannot read PKCS#12 "+f.name);throw u.errors=o,u}c()}return r}function $y(e){var t={};if(e!==void 0)for(var i=0;i<e.length;++i){var r={},a=[];if(!A.validate(e[i],Yy,r,a)){var n=new Error("Cannot read PKCS#12 BagAttribute.");throw n.errors=a,n}var s=A.derToOid(r.oid);if(fe.oids[s]!==void 0){t[fe.oids[s]]=[];for(var o=0;o<r.values.length;++o)t[fe.oids[s]].push(r.values[o].value)}}return t}Wi.toPkcs12Asn1=function(e,t,i,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||r.encAlgorithm||"aes128","useMac"in r||(r.useMac=!0),"localKeyId"in r||(r.localKeyId=null),"generateLocalKeyId"in r||(r.generateLocalKeyId=!0);var a=r.localKeyId,n;if(a!==null)a=we.util.hexToBytes(a);else if(r.generateLocalKeyId)if(t){var s=we.util.isArray(t)?t[0]:t;typeof s=="string"&&(s=fe.certificateFromPem(s));var o=we.md.sha1.create();o.update(A.toDer(fe.certificateToAsn1(s)).getBytes()),a=o.digest().getBytes()}else a=we.random.getBytes(20);var u=[];a!==null&&u.push(A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.localKeyId).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SET,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,a)])])),"friendlyName"in r&&u.push(A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.friendlyName).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SET,!0,[A.create(A.Class.UNIVERSAL,A.Type.BMPSTRING,!1,r.friendlyName)])])),u.length>0&&(n=A.create(A.Class.UNIVERSAL,A.Type.SET,!0,u));var l=[],f=[];t!==null&&(we.util.isArray(t)?f=t:f=[t]);for(var c=[],p=0;p<f.length;++p){t=f[p],typeof t=="string"&&(t=fe.certificateFromPem(t));var m=p===0?n:void 0,v=fe.certificateToAsn1(t),C=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.certBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.x509Certificate).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(v).getBytes())])])]),m]);c.push(C)}if(c.length>0){var E=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,c),B=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(E).getBytes())])]);l.push(B)}var w=null;if(e!==null){var T=fe.wrapRsaPrivateKey(fe.privateKeyToAsn1(e));i===null?w=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.keyBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[T]),n]):w=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.pkcs8ShroudedKeyBag).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[fe.encryptPrivateKeyInfo(T,i,r)]),n]);var U=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[w]),P=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(U).getBytes())])]);l.push(P)}var Q=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,l),te;if(r.useMac){var o=we.md.sha1.create(),ne=new we.util.ByteBuffer(we.random.getBytes(r.saltSize)),H=r.count,e=Wi.generateKey(i,ne,3,H,20),z=we.hmac.create();z.start(o,e),z.update(A.toDer(Q).getBytes());var Y=z.getMac();te=A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.sha1).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.NULL,!1,"")]),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,Y.getBytes())]),A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,ne.getBytes()),A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,A.integerToDer(H).getBytes())])}return A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.INTEGER,!1,A.integerToDer(3).getBytes()),A.create(A.Class.UNIVERSAL,A.Type.SEQUENCE,!0,[A.create(A.Class.UNIVERSAL,A.Type.OID,!1,A.oidToDer(fe.oids.data).getBytes()),A.create(A.Class.CONTEXT_SPECIFIC,0,!0,[A.create(A.Class.UNIVERSAL,A.Type.OCTETSTRING,!1,A.toDer(Q).getBytes())])]),te])};Wi.generateKey=we.pbe.generatePkcs12Key});var bs=F((BE,t0)=>{"use strict";S();var _r=oe();Gt();Br();As();Ur();Ma();Is();za();zi();Ae();Xa();var Bs=_r.asn1,hi=t0.exports=_r.pki=_r.pki||{};hi.pemToDer=function(e){var t=_r.pem.decode(e)[0];if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return _r.util.createBuffer(t.body)};hi.privateKeyFromPem=function(e){var t=_r.pem.decode(e)[0];if(t.type!=="PRIVATE KEY"&&t.type!=="RSA PRIVATE KEY"){var i=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var r=Bs.fromDer(t.body);return hi.privateKeyFromAsn1(r)};hi.privateKeyToPem=function(e,t){var i={type:"RSA PRIVATE KEY",body:Bs.toDer(hi.privateKeyToAsn1(e)).getBytes()};return _r.pem.encode(i,{maxline:t})};hi.privateKeyInfoToPem=function(e,t){var i={type:"PRIVATE KEY",body:Bs.toDer(e).getBytes()};return _r.pem.encode(i,{maxline:t})}});var Ls=F((TE,l0)=>{"use strict";S();var k=oe();Gt();ai();Ua();Ur();bs();Pt();ui();Ae();var tn=function(e,t,i,r){var a=k.util.createBuffer(),n=e.length>>1,s=n+(e.length&1),o=e.substr(0,s),u=e.substr(n,s),l=k.util.createBuffer(),f=k.hmac.create();i=t+i;var c=Math.ceil(r/16),p=Math.ceil(r/20);f.start("MD5",o);var m=k.util.createBuffer();l.putBytes(i);for(var v=0;v<c;++v)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+i),m.putBuffer(f.digest());f.start("SHA1",u);var C=k.util.createBuffer();l.clear(),l.putBytes(i);for(var v=0;v<p;++v)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+i),C.putBuffer(f.digest());return a.putBytes(k.util.xorBytes(m.getBytes(),C.getBytes(),r)),a},Zy=function(e,t,i){var r=k.hmac.create();r.start("SHA1",e);var a=k.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(i.type),a.putByte(i.version.major),a.putByte(i.version.minor),a.putInt16(i.length),a.putBytes(i.fragment.bytes()),r.update(a.getBytes()),r.digest().getBytes()},em=function(e,t,i){var r=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=k.util.createBuffer(a),t.length=a.length,r=!0}catch{}return r},tm=function(e,t,i){var r=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=k.util.createBuffer(a),t.length=a.length,r=!0}catch{}return r},Tt=function(e,t){var i=0;switch(t){case 1:i=e.getByte();break;case 2:i=e.getInt16();break;case 3:i=e.getInt24();break;case 4:i=e.getInt32();break}return k.util.createBuffer(e.getBytes(i))},Vt=function(e,t,i){e.putInt(i.length(),t<<3),e.putBuffer(i)},g={};g.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};g.SupportedVersions=[g.Versions.TLS_1_1,g.Versions.TLS_1_0];g.Version=g.SupportedVersions[0];g.MaxFragment=15360;g.ConnectionEnd={server:0,client:1};g.PRFAlgorithm={tls_prf_sha256:0};g.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};g.CipherType={stream:0,block:1,aead:2};g.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};g.CompressionMethod={none:0,deflate:1};g.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};g.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};g.Alert={};g.Alert.Level={warning:1,fatal:2};g.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};g.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};g.CipherSuites={};g.getCipherSuite=function(e){var t=null;for(var i in g.CipherSuites){var r=g.CipherSuites[i];if(r.id[0]===e.charCodeAt(0)&&r.id[1]===e.charCodeAt(1)){t=r;break}}return t};g.handleUnexpected=function(e,t){var i=!e.open&&e.entity===g.ConnectionEnd.client;i||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})};g.handleHelloRequest=function(e,t,i){!e.handshaking&&e.handshakes>0&&(g.queue(e,g.createAlert(e,{level:g.Alert.Level.warning,description:g.Alert.Description.no_renegotiation})),g.flush(e)),e.process()};g.parseHelloMessage=function(e,t,i){var r=null,a=e.entity===g.ConnectionEnd.client;if(i<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});else{var n=t.fragment,s=n.length();if(r={version:{major:n.getByte(),minor:n.getByte()},random:k.util.createBuffer(n.getBytes(32)),session_id:Tt(n,1),extensions:[]},a?(r.cipher_suite=n.getBytes(2),r.compression_method=n.getByte()):(r.cipher_suites=Tt(n,2),r.compression_methods=Tt(n,1)),s=i-(s-n.length()),s>0){for(var o=Tt(n,2);o.length()>0;)r.extensions.push({type:[o.getByte(),o.getByte()],data:Tt(o,2)});if(!a)for(var u=0;u<r.extensions.length;++u){var l=r.extensions[u];if(l.type[0]===0&&l.type[1]===0)for(var f=Tt(l.data,2);f.length()>0;){var c=f.getByte();if(c!==0)break;e.session.extensions.server_name.serverNameList.push(Tt(f,2).getBytes())}}}if(e.session.version&&(r.version.major!==e.session.version.major||r.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=g.getCipherSuite(r.cipher_suite);else for(var p=k.util.createBuffer(r.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=g.getCipherSuite(p.getBytes(2)),e.session.cipherSuite===null););if(e.session.cipherSuite===null)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure},cipherSuite:k.util.bytesToHex(r.cipher_suite)});a?e.session.compressionMethod=r.compression_method:e.session.compressionMethod=g.CompressionMethod.none}return r};g.createSecurityParameters=function(e,t){var i=e.entity===g.ConnectionEnd.client,r=t.random.bytes(),a=i?e.session.sp.client_random:r,n=i?r:g.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:g.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:a,server_random:n}};g.handleServerHello=function(e,t,i){var r=g.parseHelloMessage(e,t,i);if(!e.fail){if(r.version.minor<=e.version.minor)e.version.minor=r.version.minor;else return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}});e.session.version=e.version;var a=r.session_id.bytes();a.length>0&&a===e.session.id?(e.expect=a0,e.session.resuming=!0,e.session.sp.server_random=r.random.bytes()):(e.expect=im,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.session.id=a,e.process()}};g.handleClientHello=function(e,t,i){var r=g.parseHelloMessage(e,t,i);if(!e.fail){var a=r.session_id.bytes(),n=null;if(e.sessionCache&&(n=e.sessionCache.getSession(a),n===null?a="":(n.version.major!==r.version.major||n.version.minor>r.version.minor)&&(n=null,a="")),a.length===0&&(a=k.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=r.version,e.session.sp={},n)e.version=e.session.version=n.version,e.session.sp=n.sp;else{for(var s,o=1;o<g.SupportedVersions.length&&(s=g.SupportedVersions[o],!(s.minor<=r.version.minor));++o);e.version={major:s.major,minor:s.minor},e.session.version=e.version}n!==null?(e.expect=Ns,e.session.resuming=!0,e.session.sp.client_random=r.random.bytes()):(e.expect=e.verifyClient!==!1?fm:_s,e.session.resuming=!1,g.createSecurityParameters(e,r)),e.open=!0,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHello(e)})),e.session.resuming?(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.pending=g.createConnectionState(e),e.state.current.write=e.state.pending.write,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))):(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)})),e.fail||(g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerKeyExchange(e)})),e.verifyClient!==!1&&g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificateRequest(e)})),g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createServerHelloDone(e)})))),g.flush(e),e.process()}};g.handleCertificate=function(e,t,i){if(i<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,a={certificate_list:Tt(r,3)},n,s,o=[];try{for(;a.certificate_list.length()>0;)n=Tt(a.certificate_list,3),s=k.asn1.fromDer(n),n=k.pki.certificateFromAsn1(s,!0),o.push(n)}catch(l){return e.error(e,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var u=e.entity===g.ConnectionEnd.client;(u||e.verifyClient===!0)&&o.length===0?e.error(e,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}}):o.length===0?e.expect=u?r0:_s:(u?e.session.serverCertificate=o[0]:e.session.clientCertificate=o[0],g.verifyCertificateChain(e,o)&&(e.expect=u?r0:_s)),e.process()};g.handleServerKeyExchange=function(e,t,i){if(i>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});e.expect=am,e.process()};g.handleClientKeyExchange=function(e,t,i){if(i<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unsupported_certificate}});var r=t.fragment,a={enc_pre_master_secret:Tt(r,2).getBytes()},n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.serverCertificate),n=k.pki.privateKeyFromPem(n)}catch(u){e.error(e,{message:"Could not get private key.",cause:u,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}if(n===null)return e.error(e,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=n.decrypt(a.enc_pre_master_secret);var o=e.session.clientHelloVersion;if(o.major!==s.pre_master_secret.charCodeAt(0)||o.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{s.pre_master_secret=k.random.getBytes(48)}e.expect=Ns,e.session.clientCertificate!==null&&(e.expect=cm),e.process()};g.handleCertificateRequest=function(e,t,i){if(i<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment,a={certificate_types:Tt(r,1),certificate_authorities:Tt(r,2)};e.session.certificateRequest=a,e.expect=nm,e.process()};g.handleCertificateVerify=function(e,t,i){if(i<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var n={signature:Tt(r,2).getBytes()},s=k.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{var o=e.session.clientCertificate;if(!o.publicKey.verify(s,n.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch{return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.handshake_failure}})}e.expect=Ns,e.process()};g.handleServerHelloDone=function(e,t,i){if(i>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.record_overflow}});if(e.serverCertificate===null){var r={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.insufficient_security}},a=0,n=e.verify(e,r.alert.description,a,[]);if(n!==!0)return(n||n===0)&&(typeof n=="object"&&!k.util.isArray(n)?(n.message&&(r.message=n.message),n.alert&&(r.alert.description=n.alert)):typeof n=="number"&&(r.alert.description=n)),e.error(e,r)}e.session.certificateRequest!==null&&(t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createCertificate(e)}),g.queue(e,t)),t=g.createRecord(e,{type:g.ContentType.handshake,data:g.createClientKeyExchange(e)}),g.queue(e,t),e.expect=um;var s=function(o,u){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createCertificateVerify(o,u)})),g.queue(o,g.createRecord(o,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),o.state.pending=g.createConnectionState(o),o.state.current.write=o.state.pending.write,g.queue(o,g.createRecord(o,{type:g.ContentType.handshake,data:g.createFinished(o)})),o.expect=a0,g.flush(o),o.process()};if(e.session.certificateRequest===null||e.session.clientCertificate===null)return s(e,null);g.getClientSignature(e,s)};g.handleChangeCipherSpec=function(e,t){if(t.fragment.getByte()!==1)return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.illegal_parameter}});var i=e.entity===g.ConnectionEnd.client;(e.session.resuming&&i||!e.session.resuming&&!i)&&(e.state.pending=g.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&i||e.session.resuming&&!i)&&(e.state.pending=null),e.expect=i?sm:hm,e.process()};g.handleFinished=function(e,t,i){var r=t.fragment;r.read-=4;var a=r.bytes();r.read+=4;var n=t.fragment.getBytes();r=k.util.createBuffer(),r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest());var s=e.entity===g.ConnectionEnd.client,o=s?"server finished":"client finished",u=e.session.sp,l=12,f=tn;if(r=f(u.master_secret,o,r.getBytes(),l),r.getBytes()!==n)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&s||!e.session.resuming&&!s)&&(g.queue(e,g.createRecord(e,{type:g.ContentType.change_cipher_spec,data:g.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,g.queue(e,g.createRecord(e,{type:g.ContentType.handshake,data:g.createFinished(e)}))),e.expect=s?om:pm,e.handshaking=!1,++e.handshakes,e.peerCertificate=s?e.session.serverCertificate:e.session.clientCertificate,g.flush(e),e.isConnected=!0,e.connected(e),e.process()};g.handleAlert=function(e,t){var i=t.fragment,r={level:i.getByte(),description:i.getByte()},a;switch(r.description){case g.Alert.Description.close_notify:a="Connection closed.";break;case g.Alert.Description.unexpected_message:a="Unexpected message.";break;case g.Alert.Description.bad_record_mac:a="Bad record MAC.";break;case g.Alert.Description.decryption_failed:a="Decryption failed.";break;case g.Alert.Description.record_overflow:a="Record overflow.";break;case g.Alert.Description.decompression_failure:a="Decompression failed.";break;case g.Alert.Description.handshake_failure:a="Handshake failure.";break;case g.Alert.Description.bad_certificate:a="Bad certificate.";break;case g.Alert.Description.unsupported_certificate:a="Unsupported certificate.";break;case g.Alert.Description.certificate_revoked:a="Certificate revoked.";break;case g.Alert.Description.certificate_expired:a="Certificate expired.";break;case g.Alert.Description.certificate_unknown:a="Certificate unknown.";break;case g.Alert.Description.illegal_parameter:a="Illegal parameter.";break;case g.Alert.Description.unknown_ca:a="Unknown certificate authority.";break;case g.Alert.Description.access_denied:a="Access denied.";break;case g.Alert.Description.decode_error:a="Decode error.";break;case g.Alert.Description.decrypt_error:a="Decrypt error.";break;case g.Alert.Description.export_restriction:a="Export restriction.";break;case g.Alert.Description.protocol_version:a="Unsupported protocol version.";break;case g.Alert.Description.insufficient_security:a="Insufficient security.";break;case g.Alert.Description.internal_error:a="Internal error.";break;case g.Alert.Description.user_canceled:a="User canceled.";break;case g.Alert.Description.no_renegotiation:a="Renegotiation not supported.";break;default:a="Unknown error.";break}if(r.description===g.Alert.Description.close_notify)return e.close();e.error(e,{message:a,send:!1,origin:e.entity===g.ConnectionEnd.client?"server":"client",alert:r}),e.process()};g.handleHandshake=function(e,t){var i=t.fragment,r=i.getByte(),a=i.getInt24();if(a>i.length())return e.fragmented=t,t.fragment=k.util.createBuffer(),i.read-=4,e.process();e.fragmented=null,i.read-=4;var n=i.bytes(a+4);i.read+=4,r in en[e.entity][e.expect]?(e.entity===g.ConnectionEnd.server&&!e.open&&!e.fail&&(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:k.md.md5.create(),sha1:k.md.sha1.create()}),r!==g.HandshakeType.hello_request&&r!==g.HandshakeType.certificate_verify&&r!==g.HandshakeType.finished&&(e.session.md5.update(n),e.session.sha1.update(n)),en[e.entity][e.expect][r](e,t,a)):g.handleUnexpected(e,t)};g.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()};g.handleHeartbeat=function(e,t){var i=t.fragment,r=i.getByte(),a=i.getInt16(),n=i.getBytes(a);if(r===g.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>n.length)return e.process();g.queue(e,g.createRecord(e,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_response,n)})),g.flush(e)}else if(r===g.HeartbeatMessageType.heartbeat_response){if(n!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,k.util.createBuffer(n))}e.process()};var rm=0,im=1,r0=2,am=3,nm=4,a0=5,sm=6,om=7,um=8,lm=0,fm=1,_s=2,cm=3,Ns=4,hm=5,pm=6,d=g.handleUnexpected,n0=g.handleChangeCipherSpec,We=g.handleAlert,At=g.handleHandshake,s0=g.handleApplicationData,Xe=g.handleHeartbeat,ks=[];ks[g.ConnectionEnd.client]=[[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[n0,We,d,d,Xe],[d,We,At,d,Xe],[d,We,At,s0,Xe],[d,We,At,d,Xe]];ks[g.ConnectionEnd.server]=[[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[d,We,At,d,Xe],[n0,We,d,d,Xe],[d,We,At,d,Xe],[d,We,At,s0,Xe],[d,We,At,d,Xe]];var Nr=g.handleHelloRequest,dm=g.handleServerHello,o0=g.handleCertificate,i0=g.handleServerKeyExchange,Ts=g.handleCertificateRequest,$a=g.handleServerHelloDone,u0=g.handleFinished,en=[];en[g.ConnectionEnd.client]=[[d,d,dm,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,o0,i0,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,i0,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,Ts,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,$a,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,u0],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[Nr,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d]];var gm=g.handleClientHello,vm=g.handleClientKeyExchange,ym=g.handleCertificateVerify;en[g.ConnectionEnd.server]=[[d,gm,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,o0,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,vm,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,ym,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,u0],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d],[d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d]];g.generateKeys=function(e,t){var i=tn,r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=i(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,n=e.version.major===g.Versions.TLS_1_0.major&&e.version.minor===g.Versions.TLS_1_0.minor;n&&(a+=2*t.fixed_iv_length);var s=i(t.master_secret,"key expansion",r,a),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return n&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o};g.createConnectionState=function(e){var t=e.entity===g.ConnectionEnd.client,i=function(){var n={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(s){return!0},compressionState:null,compressFunction:function(s){return!0},updateSequenceNumber:function(){n.sequenceNumber[1]===4294967295?(n.sequenceNumber[1]=0,++n.sequenceNumber[0]):++n.sequenceNumber[1]}};return n},r={read:i(),write:i()};if(r.read.update=function(n,s){return r.read.cipherFunction(s,r.read)?r.read.compressFunction(n,s,r.read)||n.error(n,{message:"Could not decompress record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.decompression_failure}}):n.error(n,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_record_mac}}),!n.fail},r.write.update=function(n,s){return r.write.compressFunction(n,s,r.write)?r.write.cipherFunction(s,r.write)||n.error(n,{message:"Could not encrypt record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):n.error(n,{message:"Could not compress record.",send:!1,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}),!n.fail},e.session){var a=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(a),a.keys=g.generateKeys(e,a),r.read.macKey=t?a.keys.server_write_MAC_key:a.keys.client_write_MAC_key,r.write.macKey=t?a.keys.client_write_MAC_key:a.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(r,e,a),a.compression_algorithm){case g.CompressionMethod.none:break;case g.CompressionMethod.deflate:r.read.compressFunction=tm,r.write.compressFunction=em;break;default:throw new Error("Unsupported compression algorithm.")}}return r};g.createRandom=function(){var e=new Date,t=+e+e.getTimezoneOffset()*6e4,i=k.util.createBuffer();return i.putInt32(t),i.putBytes(k.random.getBytes(28)),i};g.createRecord=function(e,t){if(!t.data)return null;var i={type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data};return i};g.createAlert=function(e,t){var i=k.util.createBuffer();return i.putByte(t.level),i.putByte(t.description),g.createRecord(e,{type:g.ContentType.alert,data:i})};g.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=k.util.createBuffer(),i=0;i<e.cipherSuites.length;++i){var r=e.cipherSuites[i];t.putByte(r.id[0]),t.putByte(r.id[1])}var a=t.length(),n=k.util.createBuffer();n.putByte(g.CompressionMethod.none);var s=n.length(),o=k.util.createBuffer();if(e.virtualHost){var u=k.util.createBuffer();u.putByte(0),u.putByte(0);var l=k.util.createBuffer();l.putByte(0),Vt(l,2,k.util.createBuffer(e.virtualHost));var f=k.util.createBuffer();Vt(f,2,l),Vt(u,2,f),o.putBuffer(u)}var c=o.length();c>0&&(c+=2);var p=e.session.id,m=p.length+1+2+4+28+2+a+1+s+c,v=k.util.createBuffer();return v.putByte(g.HandshakeType.client_hello),v.putInt24(m),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),Vt(v,1,k.util.createBuffer(p)),Vt(v,2,t),Vt(v,1,n),c>0&&Vt(v,2,o),v};g.createServerHello=function(e){var t=e.session.id,i=t.length+1+2+4+28+2+1,r=k.util.createBuffer();return r.putByte(g.HandshakeType.server_hello),r.putInt24(i),r.putByte(e.version.major),r.putByte(e.version.minor),r.putBytes(e.session.sp.server_random),Vt(r,1,k.util.createBuffer(t)),r.putByte(e.session.cipherSuite.id[0]),r.putByte(e.session.cipherSuite.id[1]),r.putByte(e.session.compressionMethod),r};g.createCertificate=function(e){var t=e.entity===g.ConnectionEnd.client,i=null;if(e.getCertificate){var r;t?r=e.session.certificateRequest:r=e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,r)}var a=k.util.createBuffer();if(i!==null)try{k.util.isArray(i)||(i=[i]);for(var n=null,s=0;s<i.length;++s){var o=k.pem.decode(i[s])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var u=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw u.headerType=o.type,u}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var l=k.util.createBuffer(o.body);n===null&&(n=k.asn1.fromDer(l.bytes(),!1));var f=k.util.createBuffer();Vt(f,3,l),a.putBuffer(f)}i=k.pki.certificateFromAsn1(n),t?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(m){return e.error(e,{message:"Could not send certificate list.",cause:m,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate}})}var c=3+a.length(),p=k.util.createBuffer();return p.putByte(g.HandshakeType.certificate),p.putInt24(c),Vt(p,3,a),p};g.createClientKeyExchange=function(e){var t=k.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(k.random.getBytes(46));var i=e.session.sp;i.pre_master_secret=t.getBytes();var r=e.session.serverCertificate.publicKey;t=r.encrypt(i.pre_master_secret);var a=t.length+2,n=k.util.createBuffer();return n.putByte(g.HandshakeType.client_key_exchange),n.putInt24(a),n.putInt16(t.length),n.putBytes(t),n};g.createServerKeyExchange=function(e){var t=0,i=k.util.createBuffer();return t>0&&(i.putByte(g.HandshakeType.server_key_exchange),i.putInt24(t)),i};g.getClientSignature=function(e,t){var i=k.util.createBuffer();i.putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest()),i=i.getBytes(),e.getSignature=e.getSignature||function(r,a,n){var s=null;if(r.getPrivateKey)try{s=r.getPrivateKey(r,r.session.clientCertificate),s=k.pki.privateKeyFromPem(s)}catch(o){r.error(r,{message:"Could not get private key.",cause:o,send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}})}s===null?r.error(r,{message:"No private key set.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.internal_error}}):a=s.sign(a,null),n(r,a)},e.getSignature(e,i,t)};g.createCertificateVerify=function(e,t){var i=t.length+2,r=k.util.createBuffer();return r.putByte(g.HandshakeType.certificate_verify),r.putInt24(i),r.putInt16(t.length),r.putBytes(t),r};g.createCertificateRequest=function(e){var t=k.util.createBuffer();t.putByte(1);var i=k.util.createBuffer();for(var r in e.caStore.certs){var a=e.caStore.certs[r],n=k.pki.distinguishedNameToAsn1(a.subject),s=k.asn1.toDer(n);i.putInt16(s.length()),i.putBuffer(s)}var o=1+t.length()+2+i.length(),u=k.util.createBuffer();return u.putByte(g.HandshakeType.certificate_request),u.putInt24(o),Vt(u,1,t),Vt(u,2,i),u};g.createServerHelloDone=function(e){var t=k.util.createBuffer();return t.putByte(g.HandshakeType.server_hello_done),t.putInt24(0),t};g.createChangeCipherSpec=function(){var e=k.util.createBuffer();return e.putByte(1),e};g.createFinished=function(e){var t=k.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var i=e.entity===g.ConnectionEnd.client,r=e.session.sp,a=12,n=tn,s=i?"client finished":"server finished";t=n(r.master_secret,s,t.getBytes(),a);var o=k.util.createBuffer();return o.putByte(g.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o};g.createHeartbeat=function(e,t,i){typeof i>"u"&&(i=t.length);var r=k.util.createBuffer();r.putByte(e),r.putInt16(i),r.putBytes(t);var a=r.length(),n=Math.max(16,a-i-3);return r.putBytes(k.random.getBytes(n)),r};g.queue=function(e,t){if(t&&!(t.fragment.length()===0&&(t.type===g.ContentType.handshake||t.type===g.ContentType.alert||t.type===g.ContentType.change_cipher_spec))){if(t.type===g.ContentType.handshake){var i=t.fragment.bytes();e.session.md5.update(i),e.session.sha1.update(i),i=null}var r;if(t.fragment.length()<=g.MaxFragment)r=[t];else{r=[];for(var a=t.fragment.bytes();a.length>g.MaxFragment;)r.push(g.createRecord(e,{type:t.type,data:k.util.createBuffer(a.slice(0,g.MaxFragment))})),a=a.slice(g.MaxFragment);a.length>0&&r.push(g.createRecord(e,{type:t.type,data:k.util.createBuffer(a)}))}for(var n=0;n<r.length&&!e.fail;++n){var s=r[n],o=e.state.current.write;o.update(e,s)&&e.records.push(s)}}};g.flush=function(e){for(var t=0;t<e.records.length;++t){var i=e.records[t];e.tlsData.putByte(i.type),e.tlsData.putByte(i.version.major),e.tlsData.putByte(i.version.minor),e.tlsData.putInt16(i.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var ws=function(e){switch(e){case!0:return!0;case k.pki.certificateError.bad_certificate:return g.Alert.Description.bad_certificate;case k.pki.certificateError.unsupported_certificate:return g.Alert.Description.unsupported_certificate;case k.pki.certificateError.certificate_revoked:return g.Alert.Description.certificate_revoked;case k.pki.certificateError.certificate_expired:return g.Alert.Description.certificate_expired;case k.pki.certificateError.certificate_unknown:return g.Alert.Description.certificate_unknown;case k.pki.certificateError.unknown_ca:return g.Alert.Description.unknown_ca;default:return g.Alert.Description.bad_certificate}},mm=function(e){switch(e){case!0:return!0;case g.Alert.Description.bad_certificate:return k.pki.certificateError.bad_certificate;case g.Alert.Description.unsupported_certificate:return k.pki.certificateError.unsupported_certificate;case g.Alert.Description.certificate_revoked:return k.pki.certificateError.certificate_revoked;case g.Alert.Description.certificate_expired:return k.pki.certificateError.certificate_expired;case g.Alert.Description.certificate_unknown:return k.pki.certificateError.certificate_unknown;case g.Alert.Description.unknown_ca:return k.pki.certificateError.unknown_ca;default:return k.pki.certificateError.bad_certificate}};g.verifyCertificateChain=function(e,t){try{var i={};for(var r in e.verifyOptions)i[r]=e.verifyOptions[r];i.verify=function(n,s,o){var u=ws(n),l=e.verify(e,n,s,o);if(l!==!0){if(typeof l=="object"&&!k.util.isArray(l)){var f=new Error("The application rejected the certificate.");throw f.send=!0,f.alert={level:g.Alert.Level.fatal,description:g.Alert.Description.bad_certificate},l.message&&(f.message=l.message),l.alert&&(f.alert.description=l.alert),f}l!==n&&(l=mm(l))}return l},k.pki.verifyCertificateChain(e.caStore,t,i)}catch(n){var a=n;(typeof a!="object"||k.util.isArray(a))&&(a={send:!0,alert:{level:g.Alert.Level.fatal,description:ws(n)}}),"send"in a||(a.send=!0),"alert"in a||(a.alert={level:g.Alert.Level.fatal,description:ws(a.error)}),e.error(e,a)}return!e.fail};g.createSessionCache=function(e,t){var i=null;if(e&&e.getSession&&e.setSession&&e.order)i=e;else{i={},i.cache=e||{},i.capacity=Math.max(t||100,1),i.order=[];for(var r in e)i.order.length<=t?i.order.push(r):delete e[r];i.getSession=function(a){var n=null,s=null;if(a?s=k.util.bytesToHex(a):i.order.length>0&&(s=i.order[0]),s!==null&&s in i.cache){n=i.cache[s],delete i.cache[s];for(var o in i.order)if(i.order[o]===s){i.order.splice(o,1);break}}return n},i.setSession=function(a,n){if(i.order.length===i.capacity){var s=i.order.shift();delete i.cache[s]}var s=k.util.bytesToHex(a);i.order.push(s),i.cache[s]=n}}return i};g.createConnection=function(e){var t=null;e.caStore?k.util.isArray(e.caStore)?t=k.pki.createCaStore(e.caStore):t=e.caStore:t=k.pki.createCaStore();var i=e.cipherSuites||null;if(i===null){i=[];for(var r in g.CipherSuites)i.push(g.CipherSuites[r])}var a=e.server?g.ConnectionEnd.server:g.ConnectionEnd.client,n=e.sessionCache?g.createSessionCache(e.sessionCache):null,s={version:{major:g.Version.major,minor:g.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:n,cipherSuites:i,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(f,c,p,m){return c},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:k.util.createBuffer(),tlsData:k.util.createBuffer(),data:k.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(f,c){c.origin=c.origin||(f.entity===g.ConnectionEnd.client?"client":"server"),c.send&&(g.queue(f,g.createAlert(f,c.alert)),g.flush(f));var p=c.fatal!==!1;p&&(f.fail=!0),e.error(f,c),p&&f.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};s.reset=function(f){s.version={major:g.Version.major,minor:g.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=s.entity===g.ConnectionEnd.client?rm:lm,s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(f||typeof f>"u"),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=g.createConnectionState(s)},s.reset();var o=function(f,c){var p=c.type-g.ContentType.change_cipher_spec,m=ks[f.entity][f.expect];p in m?m[p](f,c):g.handleUnexpected(f,c)},u=function(f){var c=0,p=f.input,m=p.length();if(m<5)c=5-m;else{f.record={type:p.getByte(),version:{major:p.getByte(),minor:p.getByte()},length:p.getInt16(),fragment:k.util.createBuffer(),ready:!1};var v=f.record.version.major===f.version.major;v&&f.session&&f.session.version&&(v=f.record.version.minor===f.version.minor),v||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.protocol_version}})}return c},l=function(f){var c=0,p=f.input,m=p.length();if(m<f.record.length)c=f.record.length-m;else{f.record.fragment.putBytes(p.getBytes(f.record.length)),p.compact();var v=f.state.current.read;v.update(f,f.record)&&(f.fragmented!==null&&(f.fragmented.type===f.record.type?(f.fragmented.fragment.putBuffer(f.record.fragment),f.record=f.fragmented):f.error(f,{message:"Invalid fragmented record.",send:!0,alert:{level:g.Alert.Level.fatal,description:g.Alert.Description.unexpected_message}})),f.record.ready=!0)}return c};return s.handshake=function(f){if(s.entity!==g.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&s.handshakes===0&&(s.fail=!1),s.handshaking=!0,f=f||"";var c=null;f.length>0&&(s.sessionCache&&(c=s.sessionCache.getSession(f)),c===null&&(f="")),f.length===0&&s.sessionCache&&(c=s.sessionCache.getSession(),c!==null&&(f=c.id)),s.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:k.md.md5.create(),sha1:k.md.sha1.create()},c&&(s.version=c.version,s.session.sp=c.sp),s.session.sp.client_random=g.createRandom().getBytes(),s.open=!0,g.queue(s,g.createRecord(s,{type:g.ContentType.handshake,data:g.createClientHello(s)})),g.flush(s)}},s.process=function(f){var c=0;return f&&s.input.putBytes(f),s.fail||(s.record!==null&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),s.record===null&&(c=u(s)),!s.fail&&s.record!==null&&!s.record.ready&&(c=l(s)),!s.fail&&s.record!==null&&s.record.ready&&o(s,s.record)),c},s.prepare=function(f){return g.queue(s,g.createRecord(s,{type:g.ContentType.application_data,data:k.util.createBuffer(f)})),g.flush(s)},s.prepareHeartbeatRequest=function(f,c){return f instanceof k.util.ByteBuffer&&(f=f.bytes()),typeof c>"u"&&(c=f.length),s.expectedHeartbeatPayload=f,g.queue(s,g.createRecord(s,{type:g.ContentType.heartbeat,data:g.createHeartbeat(g.HeartbeatMessageType.heartbeat_request,f,c)})),g.flush(s)},s.close=function(f){if(!s.fail&&s.sessionCache&&s.session){var c={id:s.session.id,version:s.session.version,sp:s.session.sp};c.sp.keys=null,s.sessionCache.setSession(c.id,c)}s.open&&(s.open=!1,s.input.clear(),(s.isConnected||s.handshaking)&&(s.isConnected=s.handshaking=!1,g.queue(s,g.createAlert(s,{level:g.Alert.Level.warning,description:g.Alert.Description.close_notify})),g.flush(s)),s.closed(s)),s.reset(f)},s};l0.exports=k.tls=k.tls||{};for(Za in g)typeof g[Za]!="function"&&(k.tls[Za]=g[Za]);var Za;k.tls.prf_tls1=tn;k.tls.hmac_sha1=Zy;k.tls.createSessionCache=g.createSessionCache;k.tls.createConnection=g.createConnection});var h0=F((_E,c0)=>{"use strict";S();var kr=oe();Ir();Ls();var Ft=c0.exports=kr.tls;Ft.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Ft.BulkCipherAlgorithm.aes,e.cipher_type=Ft.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Ft.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:f0};Ft.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=Ft.BulkCipherAlgorithm.aes,e.cipher_type=Ft.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=Ft.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:f0};function f0(e,t,i){var r=t.entity===kr.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:kr.cipher.createDecipher("AES-CBC",r?i.keys.server_write_key:i.keys.client_write_key),iv:r?i.keys.server_write_IV:i.keys.client_write_IV},e.write.cipherState={init:!1,cipher:kr.cipher.createCipher("AES-CBC",r?i.keys.client_write_key:i.keys.server_write_key),iv:r?i.keys.client_write_IV:i.keys.server_write_IV},e.read.cipherFunction=xm,e.write.cipherFunction=Am,e.read.macLength=e.write.macLength=i.mac_length,e.read.macFunction=e.write.macFunction=Ft.hmac_sha1}function Am(e,t){var i=!1,r=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(r),t.updateSequenceNumber();var a;e.version.minor===Ft.Versions.TLS_1_0.minor?a=t.cipherState.init?null:t.cipherState.iv:a=kr.random.getBytesSync(16),t.cipherState.init=!0;var n=t.cipherState.cipher;return n.start({iv:a}),e.version.minor>=Ft.Versions.TLS_1_1.minor&&n.output.putBytes(a),n.update(e.fragment),n.finish(Cm)&&(e.fragment=n.output,e.length=e.fragment.length(),i=!0),i}function Cm(e,t,i){if(!i){var r=e-t.length()%e;t.fillWithByte(r-1,r)}return!0}function Em(e,t,i){var r=!0;if(i){for(var a=t.length(),n=t.last(),s=a-1-n;s<a-1;++s)r=r&&t.at(s)==n;r&&t.truncate(n+1)}return r}function xm(e,t){var i=!1,r;e.version.minor===Ft.Versions.TLS_1_0.minor?r=t.cipherState.init?null:t.cipherState.iv:r=e.fragment.getBytes(16),t.cipherState.init=!0;var a=t.cipherState.cipher;a.start({iv:r}),a.update(e.fragment),i=a.finish(Em);var n=t.macLength,s=kr.random.getBytesSync(n),o=a.output.length();o>=n?(e.fragment=a.output.getBytes(o-n),s=a.output.getBytes(n)):e.fragment=a.output.getBytes(),e.fragment=kr.util.createBuffer(e.fragment),e.length=e.fragment.length();var u=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),i=Sm(t.macKey,s,u)&&i,i}function Sm(e,t,i){var r=kr.hmac.create();return r.start("SHA1",e),r.update(t),t=r.digest().getBytes(),r.start(null,null),r.update(i),i=r.digest().getBytes(),t===i}});var Ps=F((kE,v0)=>{"use strict";S();var ke=oe();Jt();Ae();var Xi=v0.exports=ke.sha512=ke.sha512||{};ke.md.sha512=ke.md.algorithms.sha512=Xi;var d0=ke.sha384=ke.sha512.sha384=ke.sha512.sha384||{};d0.create=function(){return Xi.create("SHA-384")};ke.md.sha384=ke.md.algorithms.sha384=d0;ke.sha512.sha256=ke.sha512.sha256||{create:function(){return Xi.create("SHA-512/256")}};ke.md["sha512/256"]=ke.md.algorithms["sha512/256"]=ke.sha512.sha256;ke.sha512.sha224=ke.sha512.sha224||{create:function(){return Xi.create("SHA-512/224")}};ke.md["sha512/224"]=ke.md.algorithms["sha512/224"]=ke.sha512.sha224;Xi.create=function(e){if(g0||Im(),typeof e>"u"&&(e="SHA-512"),!(e in Kr))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=Kr[e],i=null,r=ke.util.createBuffer(),a=new Array(80),n=0;n<80;++n)a[n]=new Array(2);var s=64;switch(e){case"SHA-384":s=48;break;case"SHA-512/256":s=32;break;case"SHA-512/224":s=28;break}var o={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:s,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var u=o.messageLengthSize/4,l=0;l<u;++l)o.fullMessageLength.push(0);r=ke.util.createBuffer(),i=new Array(t.length);for(var l=0;l<t.length;++l)i[l]=t[l].slice(0);return o},o.start(),o.update=function(u,l){l==="utf8"&&(u=ke.util.encodeUtf8(u));var f=u.length;o.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var c=o.fullMessageLength.length-1;c>=0;--c)o.fullMessageLength[c]+=f[1],f[1]=f[0]+(o.fullMessageLength[c]/4294967296>>>0),o.fullMessageLength[c]=o.fullMessageLength[c]>>>0,f[0]=f[1]/4294967296>>>0;return r.putBytes(u),p0(i,a,r),(r.read>2048||r.length()===0)&&r.compact(),o},o.digest=function(){var u=ke.util.createBuffer();u.putBytes(r.bytes());var l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,f=l&o.blockLength-1;u.putBytes(Rs.substr(0,o.blockLength-f));for(var c,p,m=o.fullMessageLength[0]*8,v=0;v<o.fullMessageLength.length-1;++v)c=o.fullMessageLength[v+1]*8,p=c/4294967296>>>0,m+=p,u.putInt32(m>>>0),m=c>>>0;u.putInt32(m);for(var C=new Array(i.length),v=0;v<i.length;++v)C[v]=i[v].slice(0);p0(C,a,u);var E=ke.util.createBuffer(),B;e==="SHA-512"?B=C.length:e==="SHA-384"?B=C.length-2:B=C.length-4;for(var v=0;v<B;++v)E.putInt32(C[v][0]),(v!==B-1||e!=="SHA-512/224")&&E.putInt32(C[v][1]);return E},o};var Rs=null,g0=!1,Ds=null,Kr=null;function Im(){Rs="\x80",Rs+=ke.util.fillString("\0",128),Ds=[[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]],Kr={},Kr["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],Kr["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],Kr["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],Kr["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],g0=!0}function p0(e,t,i){for(var r,a,n,s,o,u,l,f,c,p,m,v,C,E,B,w,T,U,P,Q,te,ne,H,z,Y,re,ye,Ee,$,ie,V,_e,xe,Oe,Ve,qe=i.length();qe>=128;){for($=0;$<16;++$)t[$][0]=i.getInt32()>>>0,t[$][1]=i.getInt32()>>>0;for(;$<80;++$)_e=t[$-2],ie=_e[0],V=_e[1],r=((ie>>>19|V<<13)^(V>>>29|ie<<3)^ie>>>6)>>>0,a=((ie<<13|V>>>19)^(V<<3|ie>>>29)^(ie<<26|V>>>6))>>>0,Oe=t[$-15],ie=Oe[0],V=Oe[1],n=((ie>>>1|V<<31)^(ie>>>8|V<<24)^ie>>>7)>>>0,s=((ie<<31|V>>>1)^(ie<<24|V>>>8)^(ie<<25|V>>>7))>>>0,xe=t[$-7],Ve=t[$-16],V=a+xe[1]+s+Ve[1],t[$][0]=r+xe[0]+n+Ve[0]+(V/4294967296>>>0)>>>0,t[$][1]=V>>>0;for(C=e[0][0],E=e[0][1],B=e[1][0],w=e[1][1],T=e[2][0],U=e[2][1],P=e[3][0],Q=e[3][1],te=e[4][0],ne=e[4][1],H=e[5][0],z=e[5][1],Y=e[6][0],re=e[6][1],ye=e[7][0],Ee=e[7][1],$=0;$<80;++$)l=((te>>>14|ne<<18)^(te>>>18|ne<<14)^(ne>>>9|te<<23))>>>0,f=((te<<18|ne>>>14)^(te<<14|ne>>>18)^(ne<<23|te>>>9))>>>0,c=(Y^te&(H^Y))>>>0,p=(re^ne&(z^re))>>>0,o=((C>>>28|E<<4)^(E>>>2|C<<30)^(E>>>7|C<<25))>>>0,u=((C<<4|E>>>28)^(E<<30|C>>>2)^(E<<25|C>>>7))>>>0,m=(C&B|T&(C^B))>>>0,v=(E&w|U&(E^w))>>>0,V=Ee+f+p+Ds[$][1]+t[$][1],r=ye+l+c+Ds[$][0]+t[$][0]+(V/4294967296>>>0)>>>0,a=V>>>0,V=u+v,n=o+m+(V/4294967296>>>0)>>>0,s=V>>>0,ye=Y,Ee=re,Y=H,re=z,H=te,z=ne,V=Q+a,te=P+r+(V/4294967296>>>0)>>>0,ne=V>>>0,P=T,Q=U,T=B,U=w,B=C,w=E,V=a+s,C=r+n+(V/4294967296>>>0)>>>0,E=V>>>0;V=e[0][1]+E,e[0][0]=e[0][0]+C+(V/4294967296>>>0)>>>0,e[0][1]=V>>>0,V=e[1][1]+w,e[1][0]=e[1][0]+B+(V/4294967296>>>0)>>>0,e[1][1]=V>>>0,V=e[2][1]+U,e[2][0]=e[2][0]+T+(V/4294967296>>>0)>>>0,e[2][1]=V>>>0,V=e[3][1]+Q,e[3][0]=e[3][0]+P+(V/4294967296>>>0)>>>0,e[3][1]=V>>>0,V=e[4][1]+ne,e[4][0]=e[4][0]+te+(V/4294967296>>>0)>>>0,e[4][1]=V>>>0,V=e[5][1]+z,e[5][0]=e[5][0]+H+(V/4294967296>>>0)>>>0,e[5][1]=V>>>0,V=e[6][1]+re,e[6][0]=e[6][0]+Y+(V/4294967296>>>0)>>>0,e[6][1]=V>>>0,V=e[7][1]+Ee,e[7][0]=e[7][0]+ye+(V/4294967296>>>0)>>>0,e[7][1]=V>>>0,qe-=128}}});var y0=F(Qs=>{"use strict";S();var Bm=oe();Gt();var Ye=Bm.asn1;Qs.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Qs.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var N0=F((PE,_0)=>{"use strict";S();var $e=oe();Yi();Pt();Ps();Ae();var S0=y0(),bm=S0.publicKeyValidator,Tm=S0.privateKeyValidator;typeof m0>"u"&&(m0=$e.jsbn.BigInteger);var m0,Vs=$e.util.ByteBuffer,bt=typeof Buffer>"u"?Uint8Array:Buffer;$e.pki=$e.pki||{};_0.exports=$e.pki.ed25519=$e.ed25519=$e.ed25519||{};var ce=$e.ed25519;ce.constants={};ce.constants.PUBLIC_KEY_BYTE_LENGTH=32;ce.constants.PRIVATE_KEY_BYTE_LENGTH=64;ce.constants.SEED_BYTE_LENGTH=32;ce.constants.SIGN_BYTE_LENGTH=64;ce.constants.HASH_BYTE_LENGTH=64;ce.generateKeyPair=function(e){e=e||{};var t=e.seed;if(t===void 0)t=$e.random.getBytesSync(ce.constants.SEED_BYTE_LENGTH);else if(typeof t=="string"){if(t.length!==ce.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+ce.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=cr({message:t,encoding:"binary"});for(var i=new bt(ce.constants.PUBLIC_KEY_BYTE_LENGTH),r=new bt(ce.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)r[a]=t[a];return km(i,r),{publicKey:i,privateKey:r}};ce.privateKeyFromAsn1=function(e){var t={},i=[],r=$e.asn1.validate(e,Tm,t,i);if(!r){var a=new Error("Invalid Key.");throw a.errors=i,a}var n=$e.asn1.derToOid(t.privateKeyOid),s=$e.oids.EdDSA25519;if(n!==s)throw new Error('Invalid OID "'+n+'"; OID must be "'+s+'".');var o=t.privateKey,u=cr({message:$e.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:u}};ce.publicKeyFromAsn1=function(e){var t={},i=[],r=$e.asn1.validate(e,bm,t,i);if(!r){var a=new Error("Invalid Key.");throw a.errors=i,a}var n=$e.asn1.derToOid(t.publicKeyOid),s=$e.oids.EdDSA25519;if(n!==s)throw new Error('Invalid OID "'+n+'"; OID must be "'+s+'".');var o=t.ed25519PublicKey;if(o.length!==ce.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return cr({message:o,encoding:"binary"})};ce.publicKeyFromPrivateKey=function(e){e=e||{};var t=cr({message:e.privateKey,encoding:"binary"});if(t.length!==ce.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ce.constants.PRIVATE_KEY_BYTE_LENGTH);for(var i=new bt(ce.constants.PUBLIC_KEY_BYTE_LENGTH),r=0;r<i.length;++r)i[r]=t[32+r];return i};ce.sign=function(e){e=e||{};var t=cr(e),i=cr({message:e.privateKey,encoding:"binary"});if(i.length===ce.constants.SEED_BYTE_LENGTH){var r=ce.generateKeyPair({seed:i});i=r.privateKey}else if(i.length!==ce.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+ce.constants.SEED_BYTE_LENGTH+" or "+ce.constants.PRIVATE_KEY_BYTE_LENGTH);var a=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length);Lm(a,t,t.length,i);for(var n=new bt(ce.constants.SIGN_BYTE_LENGTH),s=0;s<n.length;++s)n[s]=a[s];return n};ce.verify=function(e){e=e||{};var t=cr(e);if(e.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var i=cr({message:e.signature,encoding:"binary"});if(i.length!==ce.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+ce.constants.SIGN_BYTE_LENGTH);var r=cr({message:e.publicKey,encoding:"binary"});if(r.length!==ce.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+ce.constants.PUBLIC_KEY_BYTE_LENGTH);var a=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length),n=new bt(ce.constants.SIGN_BYTE_LENGTH+t.length),s;for(s=0;s<ce.constants.SIGN_BYTE_LENGTH;++s)a[s]=i[s];for(s=0;s<t.length;++s)a[s+ce.constants.SIGN_BYTE_LENGTH]=t[s];return Rm(n,a,a.length,r)>=0};function cr(e){var t=e.message;if(t instanceof Uint8Array||t instanceof bt)return t;var i=e.encoding;if(t===void 0)if(e.md)t=e.md.digest().getBytes(),i="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof t=="string"&&!i)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof t=="string"){if(typeof Buffer<"u")return Buffer.from(t,i);t=new Vs(t,i)}else if(!(t instanceof Vs))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var r=new bt(t.length()),a=0;a<r.length;++a)r[a]=t.at(a);return r}var Fs=Z(),rn=Z([1]),wm=Z([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),_m=Z([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),A0=Z([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),C0=Z([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Us=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),Nm=Z([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function $i(e,t){var i=$e.md.sha512.create(),r=new Vs(e);i.update(r.getBytes(t),"binary");var a=i.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(a,"binary");for(var n=new bt(ce.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)n[s]=a.charCodeAt(s);return n}function km(e,t){var i=[Z(),Z(),Z(),Z()],r,a=$i(t,32);for(a[0]&=248,a[31]&=127,a[31]|=64,Hs(i,a),Ks(e,i),r=0;r<32;++r)t[r+32]=e[r];return 0}function Lm(e,t,i,r){var a,n,s=new Float64Array(64),o=[Z(),Z(),Z(),Z()],u=$i(r,32);u[0]&=248,u[31]&=127,u[31]|=64;var l=i+64;for(a=0;a<i;++a)e[64+a]=t[a];for(a=0;a<32;++a)e[32+a]=u[32+a];var f=$i(e.subarray(32),i+32);for(Ms(f),Hs(o,f),Ks(e,o),a=32;a<64;++a)e[a]=r[a];var c=$i(e,i+64);for(Ms(c),a=32;a<64;++a)s[a]=0;for(a=0;a<32;++a)s[a]=f[a];for(a=0;a<32;++a)for(n=0;n<32;n++)s[a+n]+=c[a]*u[n];return I0(e.subarray(32),s),l}function Rm(e,t,i,r){var a,n,s=new bt(32),o=[Z(),Z(),Z(),Z()],u=[Z(),Z(),Z(),Z()];if(n=-1,i<64||Dm(u,r))return-1;for(a=0;a<i;++a)e[a]=t[a];for(a=0;a<32;++a)e[a+32]=r[a];var l=$i(e,i);if(Ms(l),T0(o,u,l),Hs(u,t.subarray(32)),qs(o,u),Ks(s,o),i-=64,B0(t,0,s,0)){for(a=0;a<i;++a)e[a]=0;return-1}for(a=0;a<i;++a)e[a]=t[a+64];return n=i,n}function I0(e,t){var i,r,a,n;for(r=63;r>=32;--r){for(i=0,a=r-32,n=r-12;a<n;++a)t[a]+=i-16*t[r]*Us[a-(r-32)],i=t[a]+128>>8,t[a]-=i*256;t[a]+=i,t[r]=0}for(i=0,a=0;a<32;++a)t[a]+=i-(t[31]>>4)*Us[a],i=t[a]>>8,t[a]&=255;for(a=0;a<32;++a)t[a]-=i*Us[a];for(r=0;r<32;++r)t[r+1]+=t[r]>>8,e[r]=t[r]&255}function Ms(e){for(var t=new Float64Array(64),i=0;i<64;++i)t[i]=e[i],e[i]=0;I0(e,t)}function qs(e,t){var i=Z(),r=Z(),a=Z(),n=Z(),s=Z(),o=Z(),u=Z(),l=Z(),f=Z();di(i,e[1],e[0]),di(f,t[1],t[0]),be(i,i,f),pi(r,e[0],e[1]),pi(f,t[0],t[1]),be(r,r,f),be(a,e[3],t[3]),be(a,a,_m),be(n,e[2],t[2]),pi(n,n,n),di(s,r,i),di(o,n,a),pi(u,n,a),pi(l,r,i),be(e[0],s,o),be(e[1],l,u),be(e[2],u,o),be(e[3],s,l)}function E0(e,t,i){for(var r=0;r<4;++r)w0(e[r],t[r],i)}function Ks(e,t){var i=Z(),r=Z(),a=Z();Om(a,t[2]),be(i,t[0],a),be(r,t[1],a),an(e,r),e[31]^=b0(i)<<7}function an(e,t){var i,r,a,n=Z(),s=Z();for(i=0;i<16;++i)s[i]=t[i];for(Os(s),Os(s),Os(s),r=0;r<2;++r){for(n[0]=s[0]-65517,i=1;i<15;++i)n[i]=s[i]-65535-(n[i-1]>>16&1),n[i-1]&=65535;n[15]=s[15]-32767-(n[14]>>16&1),a=n[15]>>16&1,n[14]&=65535,w0(s,n,1-a)}for(i=0;i<16;i++)e[2*i]=s[i]&255,e[2*i+1]=s[i]>>8}function Dm(e,t){var i=Z(),r=Z(),a=Z(),n=Z(),s=Z(),o=Z(),u=Z();return Lr(e[2],rn),Pm(e[1],t),Hr(a,e[1]),be(n,a,wm),di(a,a,e[2]),pi(n,e[2],n),Hr(s,n),Hr(o,s),be(u,o,s),be(i,u,a),be(i,i,n),Qm(i,i),be(i,i,a),be(i,i,n),be(i,i,n),be(e[0],i,n),Hr(r,e[0]),be(r,r,n),x0(r,a)&&be(e[0],e[0],Nm),Hr(r,e[0]),be(r,r,n),x0(r,a)?-1:(b0(e[0])===t[31]>>7&&di(e[0],Fs,e[0]),be(e[3],e[0],e[1]),0)}function Pm(e,t){var i;for(i=0;i<16;++i)e[i]=t[2*i]+(t[2*i+1]<<8);e[15]&=32767}function Qm(e,t){var i=Z(),r;for(r=0;r<16;++r)i[r]=t[r];for(r=250;r>=0;--r)Hr(i,i),r!==1&&be(i,i,t);for(r=0;r<16;++r)e[r]=i[r]}function x0(e,t){var i=new bt(32),r=new bt(32);return an(i,e),an(r,t),B0(i,0,r,0)}function B0(e,t,i,r){return Um(e,t,i,r,32)}function Um(e,t,i,r,a){var n,s=0;for(n=0;n<a;++n)s|=e[t+n]^i[r+n];return(1&s-1>>>8)-1}function b0(e){var t=new bt(32);return an(t,e),t[0]&1}function T0(e,t,i){var r,a;for(Lr(e[0],Fs),Lr(e[1],rn),Lr(e[2],rn),Lr(e[3],Fs),a=255;a>=0;--a)r=i[a/8|0]>>(a&7)&1,E0(e,t,r),qs(t,e),qs(e,e),E0(e,t,r)}function Hs(e,t){var i=[Z(),Z(),Z(),Z()];Lr(i[0],A0),Lr(i[1],C0),Lr(i[2],rn),be(i[3],A0,C0),T0(e,i,t)}function Lr(e,t){var i;for(i=0;i<16;i++)e[i]=t[i]|0}function Om(e,t){var i=Z(),r;for(r=0;r<16;++r)i[r]=t[r];for(r=253;r>=0;--r)Hr(i,i),r!==2&&r!==4&&be(i,i,t);for(r=0;r<16;++r)e[r]=i[r]}function Os(e){var t,i,r=1;for(t=0;t<16;++t)i=e[t]+r+65535,r=Math.floor(i/65536),e[t]=i-r*65536;e[0]+=r-1+37*(r-1)}function w0(e,t,i){for(var r,a=~(i-1),n=0;n<16;++n)r=a&(e[n]^t[n]),e[n]^=r,t[n]^=r}function Z(e){var t,i=new Float64Array(16);if(e)for(t=0;t<e.length;++t)i[t]=e[t];return i}function pi(e,t,i){for(var r=0;r<16;++r)e[r]=t[r]+i[r]}function di(e,t,i){for(var r=0;r<16;++r)e[r]=t[r]-i[r]}function Hr(e,t){be(e,t,t)}function be(e,t,i){var r,a,n=0,s=0,o=0,u=0,l=0,f=0,c=0,p=0,m=0,v=0,C=0,E=0,B=0,w=0,T=0,U=0,P=0,Q=0,te=0,ne=0,H=0,z=0,Y=0,re=0,ye=0,Ee=0,$=0,ie=0,V=0,_e=0,xe=0,Oe=i[0],Ve=i[1],qe=i[2],Ze=i[3],et=i[4],tt=i[5],rt=i[6],it=i[7],at=i[8],nt=i[9],st=i[10],ot=i[11],ut=i[12],lt=i[13],ft=i[14],ct=i[15];r=t[0],n+=r*Oe,s+=r*Ve,o+=r*qe,u+=r*Ze,l+=r*et,f+=r*tt,c+=r*rt,p+=r*it,m+=r*at,v+=r*nt,C+=r*st,E+=r*ot,B+=r*ut,w+=r*lt,T+=r*ft,U+=r*ct,r=t[1],s+=r*Oe,o+=r*Ve,u+=r*qe,l+=r*Ze,f+=r*et,c+=r*tt,p+=r*rt,m+=r*it,v+=r*at,C+=r*nt,E+=r*st,B+=r*ot,w+=r*ut,T+=r*lt,U+=r*ft,P+=r*ct,r=t[2],o+=r*Oe,u+=r*Ve,l+=r*qe,f+=r*Ze,c+=r*et,p+=r*tt,m+=r*rt,v+=r*it,C+=r*at,E+=r*nt,B+=r*st,w+=r*ot,T+=r*ut,U+=r*lt,P+=r*ft,Q+=r*ct,r=t[3],u+=r*Oe,l+=r*Ve,f+=r*qe,c+=r*Ze,p+=r*et,m+=r*tt,v+=r*rt,C+=r*it,E+=r*at,B+=r*nt,w+=r*st,T+=r*ot,U+=r*ut,P+=r*lt,Q+=r*ft,te+=r*ct,r=t[4],l+=r*Oe,f+=r*Ve,c+=r*qe,p+=r*Ze,m+=r*et,v+=r*tt,C+=r*rt,E+=r*it,B+=r*at,w+=r*nt,T+=r*st,U+=r*ot,P+=r*ut,Q+=r*lt,te+=r*ft,ne+=r*ct,r=t[5],f+=r*Oe,c+=r*Ve,p+=r*qe,m+=r*Ze,v+=r*et,C+=r*tt,E+=r*rt,B+=r*it,w+=r*at,T+=r*nt,U+=r*st,P+=r*ot,Q+=r*ut,te+=r*lt,ne+=r*ft,H+=r*ct,r=t[6],c+=r*Oe,p+=r*Ve,m+=r*qe,v+=r*Ze,C+=r*et,E+=r*tt,B+=r*rt,w+=r*it,T+=r*at,U+=r*nt,P+=r*st,Q+=r*ot,te+=r*ut,ne+=r*lt,H+=r*ft,z+=r*ct,r=t[7],p+=r*Oe,m+=r*Ve,v+=r*qe,C+=r*Ze,E+=r*et,B+=r*tt,w+=r*rt,T+=r*it,U+=r*at,P+=r*nt,Q+=r*st,te+=r*ot,ne+=r*ut,H+=r*lt,z+=r*ft,Y+=r*ct,r=t[8],m+=r*Oe,v+=r*Ve,C+=r*qe,E+=r*Ze,B+=r*et,w+=r*tt,T+=r*rt,U+=r*it,P+=r*at,Q+=r*nt,te+=r*st,ne+=r*ot,H+=r*ut,z+=r*lt,Y+=r*ft,re+=r*ct,r=t[9],v+=r*Oe,C+=r*Ve,E+=r*qe,B+=r*Ze,w+=r*et,T+=r*tt,U+=r*rt,P+=r*it,Q+=r*at,te+=r*nt,ne+=r*st,H+=r*ot,z+=r*ut,Y+=r*lt,re+=r*ft,ye+=r*ct,r=t[10],C+=r*Oe,E+=r*Ve,B+=r*qe,w+=r*Ze,T+=r*et,U+=r*tt,P+=r*rt,Q+=r*it,te+=r*at,ne+=r*nt,H+=r*st,z+=r*ot,Y+=r*ut,re+=r*lt,ye+=r*ft,Ee+=r*ct,r=t[11],E+=r*Oe,B+=r*Ve,w+=r*qe,T+=r*Ze,U+=r*et,P+=r*tt,Q+=r*rt,te+=r*it,ne+=r*at,H+=r*nt,z+=r*st,Y+=r*ot,re+=r*ut,ye+=r*lt,Ee+=r*ft,$+=r*ct,r=t[12],B+=r*Oe,w+=r*Ve,T+=r*qe,U+=r*Ze,P+=r*et,Q+=r*tt,te+=r*rt,ne+=r*it,H+=r*at,z+=r*nt,Y+=r*st,re+=r*ot,ye+=r*ut,Ee+=r*lt,$+=r*ft,ie+=r*ct,r=t[13],w+=r*Oe,T+=r*Ve,U+=r*qe,P+=r*Ze,Q+=r*et,te+=r*tt,ne+=r*rt,H+=r*it,z+=r*at,Y+=r*nt,re+=r*st,ye+=r*ot,Ee+=r*ut,$+=r*lt,ie+=r*ft,V+=r*ct,r=t[14],T+=r*Oe,U+=r*Ve,P+=r*qe,Q+=r*Ze,te+=r*et,ne+=r*tt,H+=r*rt,z+=r*it,Y+=r*at,re+=r*nt,ye+=r*st,Ee+=r*ot,$+=r*ut,ie+=r*lt,V+=r*ft,_e+=r*ct,r=t[15],U+=r*Oe,P+=r*Ve,Q+=r*qe,te+=r*Ze,ne+=r*et,H+=r*tt,z+=r*rt,Y+=r*it,re+=r*at,ye+=r*nt,Ee+=r*st,$+=r*ot,ie+=r*ut,V+=r*lt,_e+=r*ft,xe+=r*ct,n+=38*P,s+=38*Q,o+=38*te,u+=38*ne,l+=38*H,f+=38*z,c+=38*Y,p+=38*re,m+=38*ye,v+=38*Ee,C+=38*$,E+=38*ie,B+=38*V,w+=38*_e,T+=38*xe,a=1,r=n+a+65535,a=Math.floor(r/65536),n=r-a*65536,r=s+a+65535,a=Math.floor(r/65536),s=r-a*65536,r=o+a+65535,a=Math.floor(r/65536),o=r-a*65536,r=u+a+65535,a=Math.floor(r/65536),u=r-a*65536,r=l+a+65535,a=Math.floor(r/65536),l=r-a*65536,r=f+a+65535,a=Math.floor(r/65536),f=r-a*65536,r=c+a+65535,a=Math.floor(r/65536),c=r-a*65536,r=p+a+65535,a=Math.floor(r/65536),p=r-a*65536,r=m+a+65535,a=Math.floor(r/65536),m=r-a*65536,r=v+a+65535,a=Math.floor(r/65536),v=r-a*65536,r=C+a+65535,a=Math.floor(r/65536),C=r-a*65536,r=E+a+65535,a=Math.floor(r/65536),E=r-a*65536,r=B+a+65535,a=Math.floor(r/65536),B=r-a*65536,r=w+a+65535,a=Math.floor(r/65536),w=r-a*65536,r=T+a+65535,a=Math.floor(r/65536),T=r-a*65536,r=U+a+65535,a=Math.floor(r/65536),U=r-a*65536,n+=a-1+37*(a-1),a=1,r=n+a+65535,a=Math.floor(r/65536),n=r-a*65536,r=s+a+65535,a=Math.floor(r/65536),s=r-a*65536,r=o+a+65535,a=Math.floor(r/65536),o=r-a*65536,r=u+a+65535,a=Math.floor(r/65536),u=r-a*65536,r=l+a+65535,a=Math.floor(r/65536),l=r-a*65536,r=f+a+65535,a=Math.floor(r/65536),f=r-a*65536,r=c+a+65535,a=Math.floor(r/65536),c=r-a*65536,r=p+a+65535,a=Math.floor(r/65536),p=r-a*65536,r=m+a+65535,a=Math.floor(r/65536),m=r-a*65536,r=v+a+65535,a=Math.floor(r/65536),v=r-a*65536,r=C+a+65535,a=Math.floor(r/65536),C=r-a*65536,r=E+a+65535,a=Math.floor(r/65536),E=r-a*65536,r=B+a+65535,a=Math.floor(r/65536),B=r-a*65536,r=w+a+65535,a=Math.floor(r/65536),w=r-a*65536,r=T+a+65535,a=Math.floor(r/65536),T=r-a*65536,r=U+a+65535,a=Math.floor(r/65536),U=r-a*65536,n+=a-1+37*(a-1),e[0]=n,e[1]=s,e[2]=o,e[3]=u,e[4]=l,e[5]=f,e[6]=c,e[7]=p,e[8]=m,e[9]=v,e[10]=C,e[11]=E,e[12]=B,e[13]=w,e[14]=T,e[15]=U}});var D0=F((UE,R0)=>{"use strict";S();var wt=oe();Ae();Pt();Yi();R0.exports=wt.kem=wt.kem||{};var k0=wt.jsbn.BigInteger;wt.kem.rsa={};wt.kem.rsa.create=function(e,t){t=t||{};var i=t.prng||wt.random,r={};return r.encrypt=function(a,n){var s=Math.ceil(a.n.bitLength()/8),o;do o=new k0(wt.util.bytesToHex(i.getBytesSync(s)),16).mod(a.n);while(o.compareTo(k0.ONE)<=0);o=wt.util.hexToBytes(o.toString(16));var u=s-o.length;u>0&&(o=wt.util.fillString("\0",u)+o);var l=a.encrypt(o,"NONE"),f=e.generate(o,n);return{encapsulation:l,key:f}},r.decrypt=function(a,n,s){var o=a.decrypt(n,"NONE");return e.generate(o,s)},r};wt.kem.kdf1=function(e,t){L0(this,e,0,t||e.digestLength)};wt.kem.kdf2=function(e,t){L0(this,e,1,t||e.digestLength)};function L0(e,t,i,r){e.generate=function(a,n){for(var s=new wt.util.ByteBuffer,o=Math.ceil(n/r)+i,u=new wt.util.ByteBuffer,l=i;l<o;++l){u.putInt32(l),t.start(),t.update(a+u.getBytes());var f=t.digest();s.putBytes(f.getBytes(r))}return s.truncate(s.length()-n),s.getBytes()}}});var O0=F((VE,U0)=>{"use strict";S();var pe=oe();Ae();U0.exports=pe.log=pe.log||{};pe.log.levels=["none","error","warning","info","debug","verbose","max"];var nn={},Ys=[],ea=null;pe.log.LEVEL_LOCKED=2;pe.log.NO_LEVEL_CHECK=4;pe.log.INTERPOLATE=8;for(ir=0;ir<pe.log.levels.length;++ir)Gs=pe.log.levels[ir],nn[Gs]={index:ir,name:Gs.toUpperCase()};var Gs,ir;pe.log.logMessage=function(e){for(var t=nn[e.level].index,i=0;i<Ys.length;++i){var r=Ys[i];if(r.flags&pe.log.NO_LEVEL_CHECK)r.f(e);else{var a=nn[r.level].index;t<=a&&r.f(r,e)}}};pe.log.prepareStandard=function(e){"standard"in e||(e.standard=nn[e.level].name+" ["+e.category+"] "+e.message)};pe.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=pe.util.format.apply(this,t)}};pe.log.prepareStandardFull=function(e){"standardFull"in e||(pe.log.prepareStandard(e),e.standardFull=e.standard)};for(js=["error","warning","info","debug","verbose"],ir=0;ir<js.length;++ir)(function(t){pe.log[t]=function(i,r){var a=Array.prototype.slice.call(arguments).slice(2),n={timestamp:new Date,level:t,category:i,message:r,arguments:a};pe.log.logMessage(n)}})(js[ir]);var js,ir;pe.log.makeLogger=function(e){var t={flags:0,f:e};return pe.log.setLevel(t,"none"),t};pe.log.setLevel=function(e,t){var i=!1;if(e&&!(e.flags&pe.log.LEVEL_LOCKED))for(var r=0;r<pe.log.levels.length;++r){var a=pe.log.levels[r];if(t==a){e.level=t,i=!0;break}}return i};pe.log.lock=function(e,t){typeof t>"u"||t?e.flags|=pe.log.LEVEL_LOCKED:e.flags&=~pe.log.LEVEL_LOCKED};pe.log.addLogger=function(e){Ys.push(e)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(P0={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},ta=function(e,t){pe.log.prepareStandard(t);var i=P0[t.level],r=[t.standard];r=r.concat(t.arguments.slice()),i.apply(console,r)},gi=pe.log.makeLogger(ta)):(ta=function(t,i){pe.log.prepareStandardFull(i),console.log(i.standardFull)},gi=pe.log.makeLogger(ta)),pe.log.setLevel(gi,"debug"),pe.log.addLogger(gi),ea=gi):console={log:function(){}};var gi,P0,ta;ea!==null&&typeof window<"u"&&window.location&&(Zi=new URL(window.location.href).searchParams,Zi.has("console.level")&&pe.log.setLevel(ea,Zi.get("console.level").slice(-1)[0]),Zi.has("console.lock")&&(Q0=Zi.get("console.lock").slice(-1)[0],Q0=="true"&&pe.log.lock(ea)));var Zi,Q0;pe.log.consoleLogger=ea});var F0=F((ME,V0)=>{"use strict";S();V0.exports=Jt();Ua();ui();ss();Ps()});var K0=F((KE,q0)=>{"use strict";S();var M=oe();Ir();Gt();Gi();Br();Ur();Cs();Pt();Ae();Xa();var x=M.asn1,Ct=q0.exports=M.pkcs7=M.pkcs7||{};Ct.messageFromPem=function(e){var t=M.pem.decode(e)[0];if(t.type!=="PKCS7"){var i=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw i.headerType=t.type,i}if(t.procType&&t.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var r=x.fromDer(t.body);return Ct.messageFromAsn1(r)};Ct.messageToPem=function(e,t){var i={type:"PKCS7",body:x.toDer(e.toAsn1()).getBytes()};return M.pem.encode(i,{maxline:t})};Ct.messageFromAsn1=function(e){var t={},i=[];if(!x.validate(e,Ct.asn1.contentInfoValidator,t,i)){var r=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw r.errors=i,r}var a=x.derToOid(t.contentType),n;switch(a){case M.pki.oids.envelopedData:n=Ct.createEnvelopedData();break;case M.pki.oids.encryptedData:n=Ct.createEncryptedData();break;case M.pki.oids.signedData:n=Ct.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+a+" is not (yet) supported.")}return n.fromAsn1(t.content.value[0]),n};Ct.createSignedData=function(){var e=null;return e={type:M.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(r){if(Js(e,r,Ct.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var a=e.rawCapture.certificates.value,n=0;n<a.length;++n)e.certificates.push(M.pki.certificateFromAsn1(a[n]))},toAsn1:function(){e.contentInfo||e.sign();for(var r=[],a=0;a<e.certificates.length;++a)r.push(M.pki.certificateToAsn1(e.certificates[a]));var n=[],s=x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return r.length>0&&s.value[0].value.push(x.create(x.Class.CONTEXT_SPECIFIC,0,!0,r)),n.length>0&&s.value[0].value.push(x.create(x.Class.CONTEXT_SPECIFIC,1,!0,n)),s.value[0].value.push(x.create(x.Class.UNIVERSAL,x.Type.SET,!0,e.signerInfos)),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),s])},addSigner:function(r){var a=r.issuer,n=r.serialNumber;if(r.certificate){var s=r.certificate;typeof s=="string"&&(s=M.pki.certificateFromPem(s)),a=s.issuer.attributes,n=s.serialNumber}var o=r.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=M.pki.privateKeyFromPem(o));var u=r.digestAlgorithm||M.pki.oids.sha1;switch(u){case M.pki.oids.sha1:case M.pki.oids.sha256:case M.pki.oids.sha384:case M.pki.oids.sha512:case M.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var l=r.authenticatedAttributes||[];if(l.length>0){for(var f=!1,c=!1,p=0;p<l.length;++p){var m=l[p];if(!f&&m.type===M.pki.oids.contentType){if(f=!0,c)break;continue}if(!c&&m.type===M.pki.oids.messageDigest){if(c=!0,f)break;continue}}if(!f||!c)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:a,serialNumber:n,digestAlgorithm:u,signatureAlgorithm:M.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:l,unauthenticatedAttributes:[]})},sign:function(r){if(r=r||{},(typeof e.content!="object"||e.contentInfo===null)&&(e.contentInfo=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(M.pki.oids.data).getBytes())]),"content"in e)){var a;e.content instanceof M.util.ByteBuffer?a=e.content.bytes():typeof e.content=="string"&&(a=M.util.encodeUtf8(e.content)),r.detached?e.detachedContent=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,a):e.contentInfo.value.push(x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,a)]))}if(e.signers.length!==0){var n=t();i(n)}},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(r){typeof r=="string"&&(r=M.pki.certificateFromPem(r)),e.certificates.push(r)},addCertificateRevokationList:function(r){throw new Error("PKCS#7 CRL support not yet implemented.")}},e;function t(){for(var r={},a=0;a<e.signers.length;++a){var n=e.signers[a],s=n.digestAlgorithm;s in r||(r[s]=M.md[M.pki.oids[s]].create()),n.authenticatedAttributes.length===0?n.md=r[s]:n.md=M.md[M.pki.oids[s]].create()}e.digestAlgorithmIdentifiers=[];for(var s in r)e.digestAlgorithmIdentifiers.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(s).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]));return r}function i(r){var a;if(e.detachedContent?a=e.detachedContent:(a=e.contentInfo.value[1],a=a.value[0]),!a)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var n=x.derToOid(e.contentInfo.value[0].value),s=x.toDer(a);s.getByte(),x.getBerValueLength(s),s=s.getBytes();for(var o in r)r[o].start().update(s);for(var u=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(f.authenticatedAttributes.length===0){if(n!==M.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var c=x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[]),p=0;p<f.authenticatedAttributes.length;++p){var m=f.authenticatedAttributes[p];m.type===M.pki.oids.messageDigest?m.value=r[f.digestAlgorithm].digest():m.type===M.pki.oids.signingTime&&(m.value||(m.value=u)),c.value.push(zs(m)),f.authenticatedAttributesAsn1.value.push(zs(m))}s=x.toDer(c).getBytes(),f.md.start().update(s)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=Hm(e.signers)}};Ct.createEncryptedData=function(){var e=null;return e={type:M.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){Js(e,t,Ct.asn1.encryptedDataValidator)},decrypt:function(t){t!==void 0&&(e.encryptedContent.key=t),M0(e)}},e};Ct.createEnvelopedData=function(){var e=null;return e={type:M.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:M.pki.oids["aes256-CBC"]},fromAsn1:function(t){var i=Js(e,t,Ct.asn1.envelopedDataValidator);e.recipients=Mm(i.recipientInfos.value)},toAsn1:function(){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,qm(e.recipients)),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,Gm(e.encryptedContent))])])])},findRecipient:function(t){for(var i=t.issuer.attributes,r=0;r<e.recipients.length;++r){var a=e.recipients[r],n=a.issuer;if(a.serialNumber===t.serialNumber&&n.length===i.length){for(var s=!0,o=0;o<i.length;++o)if(n[o].type!==i[o].type||n[o].value!==i[o].value){s=!1;break}if(s)return a}}return null},decrypt:function(t,i){if(e.encryptedContent.key===void 0&&t!==void 0&&i!==void 0)switch(t.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:case M.pki.oids.desCBC:var r=i.decrypt(t.encryptedContent.content);e.encryptedContent.key=M.util.createBuffer(r);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}M0(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:M.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,i){if(e.encryptedContent.content===void 0){i=i||e.encryptedContent.algorithm,t=t||e.encryptedContent.key;var r,a,n;switch(i){case M.pki.oids["aes128-CBC"]:r=16,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["aes192-CBC"]:r=24,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["aes256-CBC"]:r=32,a=16,n=M.aes.createEncryptionCipher;break;case M.pki.oids["des-EDE3-CBC"]:r=24,a=8,n=M.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+i)}if(t===void 0)t=M.util.createBuffer(M.random.getBytes(r));else if(t.length()!=r)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+r+".");e.encryptedContent.algorithm=i,e.encryptedContent.key=t,e.encryptedContent.parameter=M.util.createBuffer(M.random.getBytes(a));var s=n(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var o=0;o<e.recipients.length;++o){var u=e.recipients[o];if(u.encryptedContent.content===void 0)switch(u.encryptedContent.algorithm){case M.pki.oids.rsaEncryption:u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}},e};function Vm(e){var t={},i=[];if(!x.validate(e,Ct.asn1.recipientInfoValidator,t,i)){var r=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw r.errors=i,r}return{version:t.version.charCodeAt(0),issuer:M.pki.RDNAttributesAsArray(t.issuer),serialNumber:M.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:x.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function Fm(e){return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.encryptedContent.algorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")]),x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function Mm(e){for(var t=[],i=0;i<e.length;++i)t.push(Vm(e[i]));return t}function qm(e){for(var t=[],i=0;i<e.length;++i)t.push(Fm(e[i]));return t}function Km(e){var t=x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,x.integerToDer(e.version).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[M.pki.distinguishedNameToAsn1({attributes:e.issuer}),x.create(x.Class.UNIVERSAL,x.Type.INTEGER,!1,M.util.hexToBytes(e.serialNumber))]),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.digestAlgorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.signatureAlgorithm).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.NULL,!1,"")])),t.value.push(x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var i=x.create(x.Class.CONTEXT_SPECIFIC,1,!0,[]),r=0;r<e.unauthenticatedAttributes.length;++r){var a=e.unauthenticatedAttributes[r];i.values.push(zs(a))}t.value.push(i)}return t}function Hm(e){for(var t=[],i=0;i<e.length;++i)t.push(Km(e[i]));return t}function zs(e){var t;if(e.type===M.pki.oids.contentType)t=x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.value).getBytes());else if(e.type===M.pki.oids.messageDigest)t=x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===M.pki.oids.signingTime){var i=new Date("1950-01-01T00:00:00Z"),r=new Date("2050-01-01T00:00:00Z"),a=e.value;if(typeof a=="string"){var n=Date.parse(a);isNaN(n)?a.length===13?a=x.utcTimeToDate(a):a=x.generalizedTimeToDate(a):a=new Date(n)}a>=i&&a<r?t=x.create(x.Class.UNIVERSAL,x.Type.UTCTIME,!1,x.dateToUtcTime(a)):t=x.create(x.Class.UNIVERSAL,x.Type.GENERALIZEDTIME,!1,x.dateToGeneralizedTime(a))}return x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.type).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SET,!0,[t])])}function Gm(e){return[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(M.pki.oids.data).getBytes()),x.create(x.Class.UNIVERSAL,x.Type.SEQUENCE,!0,[x.create(x.Class.UNIVERSAL,x.Type.OID,!1,x.oidToDer(e.algorithm).getBytes()),e.parameter?x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.parameter.getBytes()):void 0]),x.create(x.Class.CONTEXT_SPECIFIC,0,!0,[x.create(x.Class.UNIVERSAL,x.Type.OCTETSTRING,!1,e.content.getBytes())])]}function Js(e,t,i){var r={},a=[];if(!x.validate(t,i,r,a)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw n.errors=n,n}var s=x.derToOid(r.contentType);if(s!==M.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(r.encryptedContent){var o="";if(M.util.isArray(r.encryptedContent))for(var u=0;u<r.encryptedContent.length;++u){if(r.encryptedContent[u].type!==x.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=r.encryptedContent[u].value}else o=r.encryptedContent;e.encryptedContent={algorithm:x.derToOid(r.encAlgorithm),parameter:M.util.createBuffer(r.encParameter.value),content:M.util.createBuffer(o)}}if(r.content){var o="";if(M.util.isArray(r.content))for(var u=0;u<r.content.length;++u){if(r.content[u].type!==x.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=r.content[u].value}else o=r.content;e.content=M.util.createBuffer(o)}return e.version=r.version.charCodeAt(0),e.rawCapture=r,r}function M0(e){if(e.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(e.content===void 0){var t;switch(e.encryptedContent.algorithm){case M.pki.oids["aes128-CBC"]:case M.pki.oids["aes192-CBC"]:case M.pki.oids["aes256-CBC"]:t=M.aes.createDecryptionCipher(e.encryptedContent.key);break;case M.pki.oids.desCBC:case M.pki.oids["des-EDE3-CBC"]:t=M.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}});var G0=F((GE,H0)=>{"use strict";S();var Me=oe();Ir();ai();Ua();ui();Ae();var on=H0.exports=Me.ssh=Me.ssh||{};on.privateKeyToPutty=function(e,t,i){i=i||"",t=t||"";var r="ssh-rsa",a=t===""?"none":"aes256-cbc",n="PuTTY-User-Key-File-2: "+r+`\r
23
23
  `;n+="Encryption: "+a+`\r
24
24
  `,n+="Comment: "+i+`\r
25
25
  `;var s=Me.util.createBuffer();vi(s,r),ar(s,e.e),ar(s,e.n);var o=Me.util.encode64(s.bytes(),64),u=Math.floor(o.length/66)+1;n+="Public-Lines: "+u+`\r
@@ -27,7 +27,7 @@ GFS4: `),console.error(e)});Qe[Je]||(Co=global[Je]||[],xo(Qe,Co),Qe.close=functi
27
27
  Private-Lines: `+u+`\r
28
28
  `,n+=f;var E=sn("putty-private-key-file-mac-key",t),B=Me.util.createBuffer();vi(B,r),vi(B,a),vi(B,i),B.putInt32(s.length()),B.putBuffer(s),B.putInt32(l.length()),B.putBuffer(l);var w=Me.hmac.create();return w.start("sha1",E),w.update(B.bytes()),n+=`\r
29
29
  Private-MAC: `+w.digest().toHex()+`\r
30
- `,n};on.publicKeyToOpenSSH=function(e,t){var i="ssh-rsa";t=t||"";var r=Me.util.createBuffer();return vi(r,i),ar(r,e.e),ar(r,e.n),i+" "+Me.util.encode64(r.bytes())+" "+t};on.privateKeyToOpenSSH=function(e,t){return t?Me.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Me.pki.privateKeyToPem(e)};on.getPublicKeyFingerprint=function(e,t){t=t||{};var i=t.md||Me.md.md5.create(),r="ssh-rsa",a=Me.util.createBuffer();vi(a,r),ar(a,e.e),ar(a,e.n),i.start(),i.update(a.getBytes());var n=i.digest();if(t.encoding==="hex"){var s=n.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return n.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return n};function ar(e,t){var i=t.toString(16);i[0]>="8"&&(i="00"+i);var r=Me.util.hexToBytes(i);e.putInt32(r.length),e.putBytes(r)}function vi(e,t){e.putInt32(t.length),e.putString(t)}function sn(){for(var e=Me.md.sha1.create(),t=arguments.length,i=0;i<t;++i)e.update(arguments[i]);return e.digest()}});var Y0=F((jE,j0)=>{"use strict";S();j0.exports=oe();Ir();h0();Gt();Na();Gi();N0();ai();D0();O0();F0();Es();Ma();Ur();gs();Is();K0();bs();ys();os();za();Pt();fs();G0();Ls();Ae()});var W0=F(J0=>{"use strict";S();var Ie=Y0();function z0(e){var t=parseInt(e[0],16);return t<8?e:(t-=8,t.toString()+e.substring(1))}function jm(e){switch(e){case"sha256":return Ie.md.sha256.create();default:return Ie.md.sha1.create()}}J0.generate=function(t,i,r){typeof t=="function"?(r=t,t=void 0):typeof i=="function"&&(r=i,i={}),i=i||{};var a=function(o){var u=Ie.pki.createCertificate();u.serialNumber=z0(Ie.util.bytesToHex(Ie.random.getBytesSync(9))),u.validity.notBefore=i.notBeforeDate||new Date;var l=new Date;u.validity.notAfter=l,u.validity.notAfter.setDate(l.getDate()+(i.days||365)),t=t||[{name:"commonName",value:"example.org"},{name:"countryName",value:"US"},{shortName:"ST",value:"Virginia"},{name:"localityName",value:"Blacksburg"},{name:"organizationName",value:"Test"},{shortName:"OU",value:"Test"}],u.setSubject(t),u.setIssuer(t),u.publicKey=o.publicKey,u.setExtensions(i.extensions||[{name:"basicConstraints",cA:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},{name:"subjectAltName",altNames:[{type:6,value:"http://example.org/webid#me"}]}]),u.sign(o.privateKey,jm(i&&i.algorithm));let f=Ie.md.sha1.create().update(Ie.asn1.toDer(Ie.pki.certificateToAsn1(u)).getBytes()).digest().toHex().match(/.{2}/g).join(":");var c={private:Ie.pki.privateKeyToPem(o.privateKey),public:Ie.pki.publicKeyToPem(o.publicKey),cert:Ie.pki.certificateToPem(u),fingerprint:f};if(i&&i.pkcs7){var p=Ie.pkcs7.createSignedData();p.addCertificate(u),c.pkcs7=Ie.pkcs7.messageToPem(p)}if(i&&i.clientCertificate){var m=Ie.pki.rsa.generateKeyPair(i.clientCertificateKeySize||1024),v=Ie.pki.createCertificate();v.serialNumber=z0(Ie.util.bytesToHex(Ie.random.getBytesSync(9))),v.validity.notBefore=new Date,v.validity.notAfter=new Date,v.validity.notAfter.setFullYear(v.validity.notBefore.getFullYear()+1);for(var C=JSON.parse(JSON.stringify(t)),E=0;E<C.length;E++)C[E].name==="commonName"&&(i.clientCertificateCN?C[E]={name:"commonName",value:i.clientCertificateCN}:C[E]={name:"commonName",value:"John Doe jdoe123"});if(v.setSubject(C),v.setIssuer(t),v.publicKey=m.publicKey,v.sign(o.privateKey),c.clientprivate=Ie.pki.privateKeyToPem(m.privateKey),c.clientpublic=Ie.pki.publicKeyToPem(m.publicKey),c.clientcert=Ie.pki.certificateToPem(v),i.pkcs7){var B=Ie.pkcs7.createSignedData();B.addCertificate(v),c.clientpkcs7=Ie.pkcs7.messageToPem(B)}}var w=Ie.pki.createCaStore();w.addCertificate(u);try{Ie.pki.verifyCertificateChain(w,[u],function(T,U,P){if(T!==!0)throw new Error("Certificate could not be verified.");return!0})}catch(T){throw new Error(T)}return c},n=i.keySize||1024;if(r)return Ie.pki.rsa.generateKeyPair({bits:n},function(o,u){if(o)return r(o);try{return r(null,a(u))}catch(l){return r(l)}});var s=i.keyPair?{privateKey:Ie.pki.privateKeyFromPem(i.keyPair.privateKey),publicKey:Ie.pki.publicKeyFromPem(i.keyPair.publicKey)}:Ie.pki.rsa.generateKeyPair(n);return a(s)}});S();S();S();S();var sh={},cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(Ei=0;Ei<cn.length;Ei++)sh[cn.charCodeAt(Ei)]=Ei;var Ei;function oo(e){for(var t=0,i=0,r=0,a=0,n="",s=0;s<e.length;s++){var o=e[s];if(s>0&&(n+=";"),o.length!==0){for(var u=0,l=[],f=0,c=o;f<c.length;f++){var p=c[f],m=xi(p[0]-u);u=p[0],p.length>1&&(m+=xi(p[1]-t)+xi(p[2]-i)+xi(p[3]-r),t=p[1],i=p[2],r=p[3]),p.length===5&&(m+=xi(p[4]-a),a=p[4]),l.push(m)}n+=l.join(",")}}return n}function xi(e){var t="";e=e<0?-e<<1|1:e<<1;do{var i=e&31;e>>>=5,e>0&&(i|=32),t+=cn[i]}while(e>0);return t}var ia=function e(t){this.bits=t instanceof e?t.bits.slice():[]};ia.prototype.add=function(t){this.bits[t>>5]|=1<<(t&31)};ia.prototype.has=function(t){return!!(this.bits[t>>5]&1<<(t&31))};var ze=function(t,i,r){this.start=t,this.end=i,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};ze.prototype.appendLeft=function(t){this.outro+=t};ze.prototype.appendRight=function(t){this.intro=this.intro+t};ze.prototype.clone=function(){var t=new ze(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t};ze.prototype.contains=function(t){return this.start<t&&t<this.end};ze.prototype.eachNext=function(t){for(var i=this;i;)t(i),i=i.next};ze.prototype.eachPrevious=function(t){for(var i=this;i;)t(i),i=i.previous};ze.prototype.edit=function(t,i,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=i,this.edited=!0,this};ze.prototype.prependLeft=function(t){this.outro=t+this.outro};ze.prototype.prependRight=function(t){this.intro=t+this.intro};ze.prototype.split=function(t){var i=t-this.start,r=this.original.slice(0,i),a=this.original.slice(i);this.original=r;var n=new ze(t,this.end,a);return n.outro=this.outro,this.outro="",this.end=t,this.edited?(n.edit("",!1),this.content=""):this.content=r,n.next=this.next,n.next&&(n.next.previous=n),n.previous=this,this.next=n,n};ze.prototype.toString=function(){return this.intro+this.content+this.outro};ze.prototype.trimEnd=function(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var i=this.content.replace(t,"");if(i.length)return i!==this.content&&this.split(this.start+i.length).edit("",void 0,!0),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0};ze.prototype.trimStart=function(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var i=this.content.replace(t,"");if(i.length)return i!==this.content&&(this.split(this.end-i.length),this.edit("",void 0,!0)),!0;if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0};var hn=function(){throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};typeof window<"u"&&typeof window.btoa=="function"?hn=function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer=="function"&&(hn=function(e){return Buffer.from(e,"utf-8").toString("base64")});var aa=function(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=oo(t.mappings)};aa.prototype.toString=function(){return JSON.stringify(this)};aa.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+hn(this.toString())};function oh(e){var t=e.split(`
30
+ `,n};on.publicKeyToOpenSSH=function(e,t){var i="ssh-rsa";t=t||"";var r=Me.util.createBuffer();return vi(r,i),ar(r,e.e),ar(r,e.n),i+" "+Me.util.encode64(r.bytes())+" "+t};on.privateKeyToOpenSSH=function(e,t){return t?Me.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Me.pki.privateKeyToPem(e)};on.getPublicKeyFingerprint=function(e,t){t=t||{};var i=t.md||Me.md.md5.create(),r="ssh-rsa",a=Me.util.createBuffer();vi(a,r),ar(a,e.e),ar(a,e.n),i.start(),i.update(a.getBytes());var n=i.digest();if(t.encoding==="hex"){var s=n.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return n.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return n};function ar(e,t){var i=t.toString(16);i[0]>="8"&&(i="00"+i);var r=Me.util.hexToBytes(i);e.putInt32(r.length),e.putBytes(r)}function vi(e,t){e.putInt32(t.length),e.putString(t)}function sn(){for(var e=Me.md.sha1.create(),t=arguments.length,i=0;i<t;++i)e.update(arguments[i]);return e.digest()}});var Y0=F((YE,j0)=>{"use strict";S();j0.exports=oe();Ir();h0();Gt();Na();Gi();N0();ai();D0();O0();F0();Es();Ma();Ur();gs();Is();K0();bs();ys();os();za();Pt();fs();G0();Ls();Ae()});var W0=F(J0=>{"use strict";S();var Ie=Y0();function z0(e){var t=parseInt(e[0],16);return t<8?e:(t-=8,t.toString()+e.substring(1))}function jm(e){switch(e){case"sha256":return Ie.md.sha256.create();default:return Ie.md.sha1.create()}}J0.generate=function(t,i,r){typeof t=="function"?(r=t,t=void 0):typeof i=="function"&&(r=i,i={}),i=i||{};var a=function(o){var u=Ie.pki.createCertificate();u.serialNumber=z0(Ie.util.bytesToHex(Ie.random.getBytesSync(9))),u.validity.notBefore=i.notBeforeDate||new Date;var l=new Date;u.validity.notAfter=l,u.validity.notAfter.setDate(l.getDate()+(i.days||365)),t=t||[{name:"commonName",value:"example.org"},{name:"countryName",value:"US"},{shortName:"ST",value:"Virginia"},{name:"localityName",value:"Blacksburg"},{name:"organizationName",value:"Test"},{shortName:"OU",value:"Test"}],u.setSubject(t),u.setIssuer(t),u.publicKey=o.publicKey,u.setExtensions(i.extensions||[{name:"basicConstraints",cA:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},{name:"subjectAltName",altNames:[{type:6,value:"http://example.org/webid#me"}]}]),u.sign(o.privateKey,jm(i&&i.algorithm));let f=Ie.md.sha1.create().update(Ie.asn1.toDer(Ie.pki.certificateToAsn1(u)).getBytes()).digest().toHex().match(/.{2}/g).join(":");var c={private:Ie.pki.privateKeyToPem(o.privateKey),public:Ie.pki.publicKeyToPem(o.publicKey),cert:Ie.pki.certificateToPem(u),fingerprint:f};if(i&&i.pkcs7){var p=Ie.pkcs7.createSignedData();p.addCertificate(u),c.pkcs7=Ie.pkcs7.messageToPem(p)}if(i&&i.clientCertificate){var m=Ie.pki.rsa.generateKeyPair(i.clientCertificateKeySize||1024),v=Ie.pki.createCertificate();v.serialNumber=z0(Ie.util.bytesToHex(Ie.random.getBytesSync(9))),v.validity.notBefore=new Date,v.validity.notAfter=new Date,v.validity.notAfter.setFullYear(v.validity.notBefore.getFullYear()+1);for(var C=JSON.parse(JSON.stringify(t)),E=0;E<C.length;E++)C[E].name==="commonName"&&(i.clientCertificateCN?C[E]={name:"commonName",value:i.clientCertificateCN}:C[E]={name:"commonName",value:"John Doe jdoe123"});if(v.setSubject(C),v.setIssuer(t),v.publicKey=m.publicKey,v.sign(o.privateKey),c.clientprivate=Ie.pki.privateKeyToPem(m.privateKey),c.clientpublic=Ie.pki.publicKeyToPem(m.publicKey),c.clientcert=Ie.pki.certificateToPem(v),i.pkcs7){var B=Ie.pkcs7.createSignedData();B.addCertificate(v),c.clientpkcs7=Ie.pkcs7.messageToPem(B)}}var w=Ie.pki.createCaStore();w.addCertificate(u);try{Ie.pki.verifyCertificateChain(w,[u],function(T,U,P){if(T!==!0)throw new Error("Certificate could not be verified.");return!0})}catch(T){throw new Error(T)}return c},n=i.keySize||1024;if(r)return Ie.pki.rsa.generateKeyPair({bits:n},function(o,u){if(o)return r(o);try{return r(null,a(u))}catch(l){return r(l)}});var s=i.keyPair?{privateKey:Ie.pki.privateKeyFromPem(i.keyPair.privateKey),publicKey:Ie.pki.publicKeyFromPem(i.keyPair.publicKey)}:Ie.pki.rsa.generateKeyPair(n);return a(s)}});S();S();S();S();var sh={},cn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(Ei=0;Ei<cn.length;Ei++)sh[cn.charCodeAt(Ei)]=Ei;var Ei;function oo(e){for(var t=0,i=0,r=0,a=0,n="",s=0;s<e.length;s++){var o=e[s];if(s>0&&(n+=";"),o.length!==0){for(var u=0,l=[],f=0,c=o;f<c.length;f++){var p=c[f],m=xi(p[0]-u);u=p[0],p.length>1&&(m+=xi(p[1]-t)+xi(p[2]-i)+xi(p[3]-r),t=p[1],i=p[2],r=p[3]),p.length===5&&(m+=xi(p[4]-a),a=p[4]),l.push(m)}n+=l.join(",")}}return n}function xi(e){var t="";e=e<0?-e<<1|1:e<<1;do{var i=e&31;e>>>=5,e>0&&(i|=32),t+=cn[i]}while(e>0);return t}var ia=function e(t){this.bits=t instanceof e?t.bits.slice():[]};ia.prototype.add=function(t){this.bits[t>>5]|=1<<(t&31)};ia.prototype.has=function(t){return!!(this.bits[t>>5]&1<<(t&31))};var ze=function(t,i,r){this.start=t,this.end=i,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})};ze.prototype.appendLeft=function(t){this.outro+=t};ze.prototype.appendRight=function(t){this.intro=this.intro+t};ze.prototype.clone=function(){var t=new ze(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t};ze.prototype.contains=function(t){return this.start<t&&t<this.end};ze.prototype.eachNext=function(t){for(var i=this;i;)t(i),i=i.next};ze.prototype.eachPrevious=function(t){for(var i=this;i;)t(i),i=i.previous};ze.prototype.edit=function(t,i,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=i,this.edited=!0,this};ze.prototype.prependLeft=function(t){this.outro=t+this.outro};ze.prototype.prependRight=function(t){this.intro=t+this.intro};ze.prototype.split=function(t){var i=t-this.start,r=this.original.slice(0,i),a=this.original.slice(i);this.original=r;var n=new ze(t,this.end,a);return n.outro=this.outro,this.outro="",this.end=t,this.edited?(n.edit("",!1),this.content=""):this.content=r,n.next=this.next,n.next&&(n.next.previous=n),n.previous=this,this.next=n,n};ze.prototype.toString=function(){return this.intro+this.content+this.outro};ze.prototype.trimEnd=function(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;var i=this.content.replace(t,"");if(i.length)return i!==this.content&&this.split(this.start+i.length).edit("",void 0,!0),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0};ze.prototype.trimStart=function(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;var i=this.content.replace(t,"");if(i.length)return i!==this.content&&(this.split(this.end-i.length),this.edit("",void 0,!0)),!0;if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0};var hn=function(){throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};typeof window<"u"&&typeof window.btoa=="function"?hn=function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer=="function"&&(hn=function(e){return Buffer.from(e,"utf-8").toString("base64")});var aa=function(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=oo(t.mappings)};aa.prototype.toString=function(){return JSON.stringify(this)};aa.prototype.toUrl=function(){return"data:application/json;charset=utf-8;base64,"+hn(this.toString())};function oh(e){var t=e.split(`
31
31
  `),i=t.filter(function(n){return/^\t+/.test(n)}),r=t.filter(function(n){return/^ {2,}/.test(n)});if(i.length===0&&r.length===0)return null;if(i.length>=r.length)return" ";var a=r.reduce(function(n,s){var o=/^ +/.exec(s)[0].length;return Math.min(o,n)},1/0);return new Array(a+1).join(" ")}function lo(e,t){var i=e.split(/[/\\]/),r=t.split(/[/\\]/);for(i.pop();i[0]===r[0];)i.shift(),r.shift();if(i.length)for(var a=i.length;a--;)i[a]="..";return i.concat(r).join("/")}var uh=Object.prototype.toString;function fo(e){return uh.call(e)==="[object Object]"}function pn(e){for(var t=e.split(`
32
32
  `),i=[],r=0,a=0;r<t.length;r++)i.push(a),a+=t[r].length+1;return function(s){for(var o=0,u=i.length;o<u;){var l=o+u>>1;s<i[l]?u=l:o=l+1}var f=o-1,c=s-i[f];return{line:f,column:c}}}var Ii=function(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null};Ii.prototype.addEdit=function(t,i,r,a){if(i.length){var n=[this.generatedCodeColumn,t,r.line,r.column];a>=0&&n.push(a),this.rawSegments.push(n)}else this.pending&&this.rawSegments.push(this.pending);this.advance(i),this.pending=null};Ii.prototype.addUneditedChunk=function(t,i,r,a,n){for(var s=i.start,o=!0;s<i.end;)(this.hires||o||n.has(s))&&this.rawSegments.push([this.generatedCodeColumn,t,a.line,a.column]),r[s]===`
33
33
  `?(a.line+=1,a.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,o=!0):(a.column+=1,this.generatedCodeColumn+=1,o=!1),s+=1;this.pending=null};Ii.prototype.advance=function(t){if(t){var i=t.split(`
@@ -172,5 +172,5 @@ export default createComponentHmrWrapper(OriginalComponent, import.meta.hot.data
172
172
  Wix CLI dev server is up and running.<br>
173
173
  You can close this browser tab and return to the terminal to continue working.
174
174
  </body>
175
- </html>`}S();var th="__WIX_ORIGIN_PLACEHOLDER__";function rh(){let e=null;return{name:"wix:auto-origin",apply:"serve",config:()=>({server:{origin:th}}),configureServer:t=>{t.middlewares.use((i,r,a)=>{e=e??wa(t),a()})},transform:(t,i)=>{if(i.match(/.*\.(m?jsx?|tsx?)$/))return t;if(!e)throw new Gr({code:jr.FailedToResolveViteOrigin()});return t.replaceAll(th,e)}}}S();import{dirname as iA,isAbsolute as aA,join as nA}from"node:path";import{URL as ih}from"node:url";function sA(e,t,i){let r=new ih(t,i).href;if(t.startsWith("/@vite"))return r;if(!aA(t)){let a=nA(iA(e),t);r=new ih(a,i).href}return r}function ah(){let e;return{name:"wix:absolute-html-url",apply:"serve",configureServer(t){e=t},transformIndexHtml:{order:"post",handler(t,{originalUrl:i}){if(!i)throw new Error("Cannot find asset URL.");let r=e.resolvedUrls?.local?.[0],a=(n,s,o,u)=>{let l=sA(i,o,r);return`${s}${l}${u}`};return t.replace(/(<script [^><]*src=["'])((?!http)[^"']+)(["'][^><]*>[\r\n]*<\/script>)/g,a).replace(/(<link [^><]*href=["'])((?!http)[^"']+)(["'][^><]*>)/g,a).replace(/(\r\n|\n|\r)/gm,"")}}}}async function Nx(e,t){let{https:i}=t,r=[...yi(e)].map(([u,l])=>[`html-asset-${l.id}`,u]),a=[...mi(e)].map(([u,l])=>[`script-asset-${l.id}`,u]),n=e.components.filter((0,nh.isType)(eo.EmbeddedScript)).map(u=>[u.id,oA(e.projectFolder,u.relativePath)]),s=[...Ai(e)].map(([u,l])=>[`html-asset-${l.id}`,u]),o=[...Ci(e)].map(([u,l])=>[`script-asset-${l.id}`,u]);return{configFile:!1,root:e.projectFolder,customLogger:t.customLogger,clearScreen:!1,logLevel:"info",optimizeDeps:{entries:[ro,io,ao,no,so]},server:{},build:{sourcemap:!0,outDir:Zs(e.projectFolder),rollupOptions:{input:Object.fromEntries([...r,...a,...n,...s,...o])}},plugins:[kf(),...i?[eh()]:[],_f({initialModel:e,...t}),mf(),Cf(),vf({react:"React","react-dom":"ReactDOM"}),If({initialModel:e,...t}),rh(),ah()],experimental:{renderBuiltUrl(u,{hostType:l,hostId:f}){return l==="html"&&!f.includes("wix/html")?"__STATICS_BASE_URL_PLACEHOLDER__"+u:l!=="js"?{relative:!0}:{runtime:`import.meta.url.replace(${`"${f}"`}, ${`"${u}"`})`}}}}}export{wa as a,Nx as b};
176
- //# sourceMappingURL=chunk-7TOOBLT6.js.map
175
+ </html>`}S();var th="__WIX_ORIGIN_PLACEHOLDER__";function rh(){let e=null;return{name:"wix:auto-origin",apply:"serve",config:()=>({server:{origin:th}}),configureServer:t=>{t.middlewares.use((i,r,a)=>{e=e??wa(t),a()})},transform:(t,i)=>{if(i.match(/.*\.(m?jsx?|tsx?)$/))return t;if(!e)throw new Gr({code:jr.FailedToResolveViteOrigin()});return t.replaceAll(th,e)}}}S();import{dirname as iA,isAbsolute as aA,join as nA}from"node:path";import{URL as ih}from"node:url";function sA(e,t,i){let r=new ih(t,i).href;if(t.startsWith("/@vite"))return r;if(!aA(t)){let a=nA(iA(e),t);r=new ih(a,i).href}return r}function ah(){let e;return{name:"wix:absolute-html-url",apply:"serve",configureServer(t){e=t},transformIndexHtml:{order:"post",handler(t,{originalUrl:i}){if(!i)throw new Error("Cannot find asset URL.");let r=e.resolvedUrls?.local?.[0],a=(n,s,o,u)=>{let l=sA(i,o,r);return`${s}${l}${u}`};return t.replace(/(<script [^><]*src=["'])((?!http)[^"']+)(["'][^><]*>[\r\n]*<\/script>)/g,a).replace(/(<link [^><]*href=["'])((?!http)[^"']+)(["'][^><]*>)/g,a).replace(/(\r\n|\n|\r)/gm,"")}}}}async function uA(e,t){let{https:i}=t,r=[...yi(e)].map(([u,l])=>[`html-asset-${l.id}`,u]),a=[...mi(e)].map(([u,l])=>[`script-asset-${l.id}`,u]),n=e.components.filter((0,nh.isType)(eo.EmbeddedScript)).map(u=>[u.id,oA(e.projectFolder,u.relativePath)]),s=[...Ai(e)].map(([u,l])=>[`html-asset-${l.id}`,u]),o=[...Ci(e)].map(([u,l])=>[`script-asset-${l.id}`,u]);return{configFile:!1,root:e.projectFolder,customLogger:t.customLogger,clearScreen:!1,logLevel:"info",optimizeDeps:{entries:[ro,io,ao,no,so]},server:{},build:{sourcemap:!0,outDir:Zs(e.projectFolder),rollupOptions:{input:Object.fromEntries([...r,...a,...n,...s,...o])}},plugins:[kf(),...i?[eh()]:[],_f({initialModel:e,...t}),mf(),Cf(),vf({react:"React","react-dom":"ReactDOM"}),If({initialModel:e,...t}),rh(),ah()],experimental:{renderBuiltUrl(u,{hostType:l,hostId:f}){return l==="html"&&!f.includes("wix/html")?"__STATICS_BASE_URL_PLACEHOLDER__"+u:l!=="js"?{relative:!0}:{runtime:`import.meta.url.replace(${`"${f}"`}, ${`"${u}"`})`}}}}}S();export{wa as a,uA as b};
176
+ //# sourceMappingURL=chunk-POJEX3XJ.js.map