@stacks/storage 4.0.2 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/umd/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StacksStorage=e():t.StacksStorage=e()}(this,(()=>(()=>{var t={625:function(t,e,r){t=r.nmd(t);var n=r(4406);!function(e){"use strict";function i(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i<r;i++)n[i]=t[e+i];return n}var o=function(t){var e=i(arguments,1);return function(){var r=i(arguments);return t.apply(null,e.concat(r))}},a=function(t){return function(){var e=i(arguments),r=e.pop();t.call(this,e,r)}};function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var f="function"==typeof setImmediate&&setImmediate,u="object"==typeof n&&"function"==typeof n.nextTick;function c(t){setTimeout(t,0)}function h(t){return function(e){var r=i(arguments,1);t((function(){e.apply(null,r)}))}}var d=h(f?setImmediate:u?n.nextTick:c);function l(t){return a((function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}s(n)&&"function"==typeof n.then?n.then((function(t){p(r,null,t)}),(function(t){p(r,t.message?t:new Error(t))})):r(null,n)}))}function p(t,e,r){try{t(e,r)}catch(t){d(b,t)}}function b(t){throw t}var y="function"==typeof Symbol;function g(t){return y&&"AsyncFunction"===t[Symbol.toStringTag]}function m(t){return g(t)?l(t):t}function v(t){return function(e){var r=i(arguments,1),n=a((function(r,n){var i=this;return t(e,(function(t,e){m(t).apply(i,r.concat(e))}),n)}));return r.length?n.apply(this,r):n}}var w="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,_="object"==typeof self&&self&&self.Object===Object&&self,S=w||_||Function("return this")(),E=S.Symbol,A=Object.prototype,x=A.hasOwnProperty,M=A.toString,k=E?E.toStringTag:void 0;var I=Object.prototype.toString;var B=E?E.toStringTag:void 0;function O(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=x.call(t,k),r=t[k];try{t[k]=void 0;var n=!0}catch(t){}var i=M.call(t);return n&&(e?t[k]=r:delete t[k]),i}(t):function(t){return I.call(t)}(t)}function T(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function U(t){return null!=t&&T(t.length)&&!function(t){if(!s(t))return!1;var e=O(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)}var j={};function L(){}function R(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var P="function"==typeof Symbol&&Symbol.iterator;function F(t){return null!=t&&"object"==typeof t}function N(t){return F(t)&&"[object Arguments]"==O(t)}var z=Object.prototype,C=z.hasOwnProperty,$=z.propertyIsEnumerable,D=N(function(){return arguments}())?N:function(t){return F(t)&&C.call(t,"callee")&&!$.call(t,"callee")},q=Array.isArray;var H="object"==typeof e&&e&&!e.nodeType&&e,V=H&&t&&!t.nodeType&&t,K=V&&V.exports===H?S.Buffer:void 0,J=(K?K.isBuffer:void 0)||function(){return!1},G=/^(?:0|[1-9]\d*)$/;function W(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&G.test(t))&&t>-1&&t%1==0&&t<e}var Z={};Z["[object Float32Array]"]=Z["[object Float64Array]"]=Z["[object Int8Array]"]=Z["[object Int16Array]"]=Z["[object Int32Array]"]=Z["[object Uint8Array]"]=Z["[object Uint8ClampedArray]"]=Z["[object Uint16Array]"]=Z["[object Uint32Array]"]=!0,Z["[object Arguments]"]=Z["[object Array]"]=Z["[object ArrayBuffer]"]=Z["[object Boolean]"]=Z["[object DataView]"]=Z["[object Date]"]=Z["[object Error]"]=Z["[object Function]"]=Z["[object Map]"]=Z["[object Number]"]=Z["[object Object]"]=Z["[object RegExp]"]=Z["[object Set]"]=Z["[object String]"]=Z["[object WeakMap]"]=!1;var X,Y="object"==typeof e&&e&&!e.nodeType&&e,Q=Y&&t&&!t.nodeType&&t,tt=Q&&Q.exports===Y&&w.process,et=function(){try{return Q&&Q.require&&Q.require("util").types||tt&&tt.binding&&tt.binding("util")}catch(t){}}(),rt=et&&et.isTypedArray,nt=rt?(X=rt,function(t){return X(t)}):function(t){return F(t)&&T(t.length)&&!!Z[O(t)]},it=Object.prototype.hasOwnProperty;function ot(t,e){var r=q(t),n=!r&&D(t),i=!r&&!n&&J(t),o=!r&&!n&&!i&&nt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],f=s.length;for(var u in t)!e&&!it.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||W(u,f))||s.push(u);return s}var at=Object.prototype;var st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ft=Object.prototype.hasOwnProperty;function ut(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||at))return st(t);var e,r,n=[];for(var i in Object(t))ft.call(t,i)&&"constructor"!=i&&n.push(i);return n}function ct(t){return U(t)?ot(t):ut(t)}function ht(t){if(U(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e,r,n,i,o=function(t){return P&&t[P]&&t[P]()}(t);return o?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(o):(r=ct(e=t),n=-1,i=r.length,function t(){var o=r[++n];return"__proto__"===o?t():n<i?{value:e[o],key:o}:null})}function dt(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function lt(t){return function(e,r,n){if(n=R(n||L),t<=0||!e)return n(null);var i=ht(e),o=!1,a=0,s=!1;function f(t,e){if(a-=1,t)o=!0,n(t);else{if(e===j||o&&a<=0)return o=!0,n(null);s||u()}}function u(){for(s=!0;a<t&&!o;){var e=i();if(null===e)return o=!0,void(a<=0&&n(null));a+=1,r(e.value,e.key,dt(f))}s=!1}u()}}function pt(t,e,r,n){lt(e)(t,m(r),n)}function bt(t,e){return function(r,n,i){return t(r,e,n,i)}}function yt(t,e,r){r=R(r||L);var n=0,i=0,o=t.length;function a(t,e){t?r(t):++i!==o&&e!==j||r(null)}for(0===o&&r(null);n<o;n++)e(t[n],n,dt(a))}var gt=bt(pt,1/0),mt=function(t,e,r){(U(t)?yt:gt)(t,m(e),r)};function vt(t){return function(e,r,n){return t(mt,e,m(r),n)}}function wt(t,e,r,n){n=n||L,e=e||[];var i=[],o=0,a=m(r);t(e,(function(t,e,r){var n=o++;a(t,(function(t,e){i[n]=e,r(t)}))}),(function(t){n(t,i)}))}var _t=vt(wt),St=v(_t);function Et(t){return function(e,r,n,i){return t(lt(r),e,m(n),i)}}var At=Et(wt),xt=bt(At,1),Mt=v(xt);function kt(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var It,Bt=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),a=o.length;a--;){var s=o[It?a:++n];if(!1===e(i[s],s,i))break}return t};function Ot(t,e){return t&&Bt(t,e,ct)}function Tt(t){return t!=t}function Ut(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Tt,r)}var jt=function(t,e,r){"function"==typeof e&&(r=e,e=null),r=R(r||L);var n=ct(t).length;if(!n)return r(null);e||(e=n);var o={},a=0,s=!1,f=Object.create(null),u=[],c=[],h={};function d(t,e){u.push((function(){!function(t,e){if(!s){var n=dt((function(e,n){if(a--,arguments.length>2&&(n=i(arguments,1)),e){var u={};Ot(o,(function(t,e){u[e]=t})),u[t]=n,s=!0,f=Object.create(null),r(e,u)}else o[t]=n,p(t)}));a++;var u=m(e[e.length-1]);e.length>1?u(o,n):u(n)}}(t,e)}))}function l(){if(0===u.length&&0===a)return r(null,o);for(;u.length&&a<e;)u.shift()()}function p(t){kt(f[t]||[],(function(t){t()})),l()}function b(e){var r=[];return Ot(t,(function(t,n){q(t)&&Ut(t,e,0)>=0&&r.push(n)})),r}Ot(t,(function(e,r){if(!q(e))return d(r,[e]),void c.push(r);var n=e.slice(0,e.length-1),i=n.length;if(0===i)return d(r,e),void c.push(r);h[r]=i,kt(n,(function(o){if(!t[o])throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var a,s,u;s=function(){0==--i&&d(r,e)},(u=f[a=o])||(u=f[a]=[]),u.push(s)}))})),function(){for(var t=0;c.length;)t++,kt(b(c.pop()),(function(t){0==--h[t]&&c.push(t)}));if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),l()};function Lt(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Rt=E?E.prototype:void 0,Pt=Rt?Rt.toString:void 0;function Ft(t){if("string"==typeof t)return t;if(q(t))return Lt(t,Ft)+"";if(function(t){return"symbol"==typeof t||F(t)&&"[object Symbol]"==O(t)}(t))return Pt?Pt.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Nt(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}(t,e,r)}var zt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Ct="[\\ud800-\\udfff]",$t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Dt="\\ud83c[\\udffb-\\udfff]",qt="[^\\ud800-\\udfff]",Ht="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Kt="(?:"+$t+"|"+Dt+")?",Jt="[\\ufe0e\\ufe0f]?",Gt=Jt+Kt+("(?:\\u200d(?:"+[qt,Ht,Vt].join("|")+")"+Jt+Kt+")*"),Wt="(?:"+[qt+$t+"?",$t,Ht,Vt,Ct].join("|")+")",Zt=RegExp(Dt+"(?="+Dt+")|"+Wt+Gt,"g");function Xt(t){return function(t){return zt.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}var Yt=/^\s+|\s+$/g;function Qt(t,e,r){if((t=null==(n=t)?"":Ft(n))&&(r||void 0===e))return t.replace(Yt,"");var n;if(!t||!(e=Ft(e)))return t;var i=Xt(t),o=Xt(e);return Nt(i,function(t,e){for(var r=-1,n=t.length;++r<n&&Ut(e,t[r],0)>-1;);return r}(i,o),function(t,e){for(var r=t.length;r--&&Ut(e,t[r],0)>-1;);return r}(i,o)+1).join("")}var te=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,ee=/,/,re=/(=.+)?(\s*)$/,ne=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;function ie(t,e){var r={};Ot(t,(function(t,e){var n,i=g(t),o=!i&&1===t.length||i&&0===t.length;if(q(t))n=t.slice(0,-1),t=t[t.length-1],r[e]=n.concat(n.length>0?a:t);else if(o)r[e]=t;else{if(n=function(t){return(t=(t=(t=t.toString().replace(ne,"")).match(te)[2].replace(" ",""))?t.split(ee):[]).map((function(t){return Qt(t.replace(re,""))}))}(t),0===t.length&&!i&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");i||n.pop(),r[e]=n.concat(a)}function a(e,r){var i=Lt(n,(function(t){return e[t]}));i.push(r),m(t).apply(null,i)}})),jt(r,e)}function oe(){this.head=this.tail=null,this.length=0}function ae(t,e){t.length=1,t.head=t.tail=e}function se(t,e,r){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var n=m(t),i=0,o=[],a=!1;function s(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(c.started=!0,q(t)||(t=[t]),0===t.length&&c.idle())return d((function(){c.drain()}));for(var n=0,i=t.length;n<i;n++){var o={data:t[n],callback:r||L};e?c._tasks.unshift(o):c._tasks.push(o)}a||(a=!0,d((function(){a=!1,c.process()})))}function f(t){return function(e){i-=1;for(var r=0,n=t.length;r<n;r++){var a=t[r],s=Ut(o,a,0);0===s?o.shift():s>0&&o.splice(s,1),a.callback.apply(a,arguments),null!=e&&c.error(e,a.data)}i<=c.concurrency-c.buffer&&c.unsaturated(),c.idle()&&c.drain(),c.process()}}var u=!1,c={_tasks:new oe,concurrency:e,payload:r,saturated:L,unsaturated:L,buffer:e/4,empty:L,drain:L,error:L,started:!1,paused:!1,push:function(t,e){s(t,!1,e)},kill:function(){c.drain=L,c._tasks.empty()},unshift:function(t,e){s(t,!0,e)},remove:function(t){c._tasks.remove(t)},process:function(){if(!u){for(u=!0;!c.paused&&i<c.concurrency&&c._tasks.length;){var t=[],e=[],r=c._tasks.length;c.payload&&(r=Math.min(r,c.payload));for(var a=0;a<r;a++){var s=c._tasks.shift();t.push(s),o.push(s),e.push(s.data)}i+=1,0===c._tasks.length&&c.empty(),i===c.concurrency&&c.saturated();var h=dt(f(t));n(e,h)}u=!1}},length:function(){return c._tasks.length},running:function(){return i},workersList:function(){return o},idle:function(){return c._tasks.length+i===0},pause:function(){c.paused=!0},resume:function(){!1!==c.paused&&(c.paused=!1,d(c.process))}};return c}function fe(t,e){return se(t,1,e)}oe.prototype.removeLink=function(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t},oe.prototype.empty=function(){for(;this.head;)this.shift();return this},oe.prototype.insertAfter=function(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1},oe.prototype.insertBefore=function(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1},oe.prototype.unshift=function(t){this.head?this.insertBefore(this.head,t):ae(this,t)},oe.prototype.push=function(t){this.tail?this.insertAfter(this.tail,t):ae(this,t)},oe.prototype.shift=function(){return this.head&&this.removeLink(this.head)},oe.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},oe.prototype.toArray=function(){for(var t=Array(this.length),e=this.head,r=0;r<this.length;r++)t[r]=e.data,e=e.next;return t},oe.prototype.remove=function(t){for(var e=this.head;e;){var r=e.next;t(e)&&this.removeLink(e),e=r}return this};var ue=bt(pt,1);function ce(t,e,r,n){n=R(n||L);var i=m(r);ue(t,(function(t,r,n){i(e,t,(function(t,r){e=r,n(t)}))}),(function(t){n(t,e)}))}function he(){var t=Lt(arguments,m);return function(){var e=i(arguments),r=this,n=e[e.length-1];"function"==typeof n?e.pop():n=L,ce(t,e,(function(t,e,n){e.apply(r,t.concat((function(t){var e=i(arguments,1);n(t,e)})))}),(function(t,e){n.apply(r,[t].concat(e))}))}}var de=function(){return he.apply(null,i(arguments).reverse())},le=Array.prototype.concat,pe=function(t,e,r,n){n=n||L;var o=m(r);At(t,e,(function(t,e){o(t,(function(t){return t?e(t):e(null,i(arguments,1))}))}),(function(t,e){for(var r=[],i=0;i<e.length;i++)e[i]&&(r=le.apply(r,e[i]));return n(t,r)}))},be=bt(pe,1/0),ye=bt(pe,1),ge=function(){var t=i(arguments),e=[null].concat(t);return function(){return arguments[arguments.length-1].apply(this,e)}};function me(t){return t}function ve(t,e){return function(r,n,i,o){o=o||L;var a,s=!1;r(n,(function(r,n,o){i(r,(function(n,i){n?o(n):t(i)&&!a?(s=!0,a=e(!0,r),o(null,j)):o()}))}),(function(t){t?o(t):o(null,s?a:e(!1))}))}}function we(t,e){return e}var _e=vt(ve(me,we)),Se=Et(ve(me,we)),Ee=bt(Se,1);function Ae(t){return function(e){var r=i(arguments,1);r.push((function(e){var r=i(arguments,1);"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&kt(r,(function(e){console[t](e)})))})),m(e).apply(null,r)}}var xe=Ae("dir");function Me(t,e,r){r=dt(r||L);var n=m(t),o=m(e);function a(t){if(t)return r(t);var e=i(arguments,1);e.push(s),o.apply(this,e)}function s(t,e){return t?r(t):e?void n(a):r(null)}s(null,!0)}function ke(t,e,r){r=dt(r||L);var n=m(t),o=function(t){if(t)return r(t);var a=i(arguments,1);if(e.apply(this,a))return n(o);r.apply(null,[null].concat(a))};n(o)}function Ie(t,e,r){ke(t,(function(){return!e.apply(this,arguments)}),r)}function Be(t,e,r){r=dt(r||L);var n=m(e),i=m(t);function o(t){if(t)return r(t);i(a)}function a(t,e){return t?r(t):e?void n(o):r(null)}i(a)}function Oe(t){return function(e,r,n){return t(e,n)}}function Te(t,e,r){mt(t,Oe(m(e)),r)}function Ue(t,e,r,n){lt(e)(t,Oe(m(r)),n)}var je=bt(Ue,1);function Le(t){return g(t)?t:a((function(e,r){var n=!0;e.push((function(){var t=arguments;n?d((function(){r.apply(null,t)})):r.apply(null,t)})),t.apply(this,e),n=!1}))}function Re(t){return!t}var Pe=vt(ve(Re,Re)),Fe=Et(ve(Re,Re)),Ne=bt(Fe,1);function ze(t){return function(e){return null==e?void 0:e[t]}}function Ce(t,e,r,n){var i=new Array(e.length);t(e,(function(t,e,n){r(t,(function(t,r){i[e]=!!r,n(t)}))}),(function(t){if(t)return n(t);for(var r=[],o=0;o<e.length;o++)i[o]&&r.push(e[o]);n(null,r)}))}function $e(t,e,r,n){var i=[];t(e,(function(t,e,n){r(t,(function(r,o){r?n(r):(o&&i.push({index:e,value:t}),n())}))}),(function(t){t?n(t):n(null,Lt(i.sort((function(t,e){return t.index-e.index})),ze("value")))}))}function De(t,e,r,n){(U(e)?Ce:$e)(t,e,m(r),n||L)}var qe=vt(De),He=Et(De),Ve=bt(He,1);function Ke(t,e){var r=dt(e||L),n=m(Le(t));!function t(e){if(e)return r(e);n(t)}()}var Je=function(t,e,r,n){n=n||L;var i=m(r);At(t,e,(function(t,e){i(t,(function(r,n){return r?e(r):e(null,{key:n,val:t})}))}),(function(t,e){for(var r={},i=Object.prototype.hasOwnProperty,o=0;o<e.length;o++)if(e[o]){var a=e[o].key,s=e[o].val;i.call(r,a)?r[a].push(s):r[a]=[s]}return n(t,r)}))},Ge=bt(Je,1/0),We=bt(Je,1),Ze=Ae("log");function Xe(t,e,r,n){n=R(n||L);var i={},o=m(r);pt(t,e,(function(t,e,r){o(t,e,(function(t,n){if(t)return r(t);i[e]=n,r()}))}),(function(t){n(t,i)}))}var Ye=bt(Xe,1/0),Qe=bt(Xe,1);function tr(t,e){return e in t}function er(t,e){var r=Object.create(null),n=Object.create(null);e=e||me;var o=m(t),s=a((function(t,a){var s=e.apply(null,t);tr(r,s)?d((function(){a.apply(null,r[s])})):tr(n,s)?n[s].push(a):(n[s]=[a],o.apply(null,t.concat((function(){var t=i(arguments);r[s]=t;var e=n[s];delete n[s];for(var o=0,a=e.length;o<a;o++)e[o].apply(null,t)}))))}));return s.memo=r,s.unmemoized=t,s}var rr=h(u?n.nextTick:f?setImmediate:c);function nr(t,e,r){r=r||L;var n=U(e)?[]:{};t(e,(function(t,e,r){m(t)((function(t,o){arguments.length>2&&(o=i(arguments,1)),n[e]=o,r(t)}))}),(function(t){r(t,n)}))}function ir(t,e){nr(mt,t,e)}function or(t,e,r){nr(lt(e),t,r)}var ar=function(t,e){var r=m(t);return se((function(t,e){r(t[0],e)}),e,1)},sr=function(t,e){var r=ar(t,e);return r.push=function(t,e,n){if(null==n&&(n=L),"function"!=typeof n)throw new Error("task callback must be a function");if(r.started=!0,q(t)||(t=[t]),0===t.length)return d((function(){r.drain()}));e=e||0;for(var i=r._tasks.head;i&&e>=i.priority;)i=i.next;for(var o=0,a=t.length;o<a;o++){var s={data:t[o],priority:e,callback:n};i?r._tasks.insertBefore(i,s):r._tasks.push(s)}d(r.process)},delete r.unshift,r};function fr(t,e){if(e=R(e||L),!q(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var r=0,n=t.length;r<n;r++)m(t[r])(e)}function ur(t,e,r,n){ce(i(t).reverse(),e,r,n)}function cr(t){var e=m(t);return a((function(t,r){return t.push((function(t,e){var n;t?r(null,{error:t}):(n=arguments.length<=2?e:i(arguments,1),r(null,{value:n}))})),e.apply(this,t)}))}function hr(t){var e;return q(t)?e=Lt(t,cr):(e={},Ot(t,(function(t,r){e[r]=cr.call(this,t)}))),e}function dr(t,e,r,n){De(t,e,(function(t,e){r(t,(function(t,r){e(t,!r)}))}),n)}var lr=vt(dr),pr=Et(dr),br=bt(pr,1);function yr(t){return function(){return t}}function gr(t,e,r){var n=5,i=0,o={times:n,intervalFunc:yr(i)};function a(t,e){if("object"==typeof e)t.times=+e.times||n,t.intervalFunc="function"==typeof e.interval?e.interval:yr(+e.interval||i),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||n}}if(arguments.length<3&&"function"==typeof t?(r=e||L,e=t):(a(o,t),r=r||L),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var s=m(e),f=1;function u(){s((function(t){t&&f++<o.times&&("function"!=typeof o.errorFilter||o.errorFilter(t))?setTimeout(u,o.intervalFunc(f)):r.apply(null,arguments)}))}u()}var mr=function(t,e){e||(e=t,t=null);var r=m(e);return a((function(e,n){function i(t){r.apply(null,e.concat(t))}t?gr(t,i,n):gr(i,n)}))};function vr(t,e){nr(ue,t,e)}var wr=vt(ve(Boolean,me)),_r=Et(ve(Boolean,me)),Sr=bt(_r,1);function Er(t,e,r){var n=m(e);function i(t,e){var r=t.criteria,n=e.criteria;return r<n?-1:r>n?1:0}_t(t,(function(t,e){n(t,(function(r,n){if(r)return e(r);e(null,{value:t,criteria:n})}))}),(function(t,e){if(t)return r(t);r(null,Lt(e.sort(i),ze("value")))}))}function Ar(t,e,r){var n=m(t);return a((function(i,o){var a,s=!1;i.push((function(){s||(o.apply(null,arguments),clearTimeout(a))})),a=setTimeout((function(){var e=t.name||"anonymous",n=new Error('Callback function "'+e+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),s=!0,o(n)}),e),n.apply(null,i)}))}var xr=Math.ceil,Mr=Math.max;function kr(t,e,r,n){var i=m(r);At(function(t,e,r,n){for(var i=-1,o=Mr(xr((e-t)/(r||1)),0),a=Array(o);o--;)a[n?o:++i]=t,t+=r;return a}(0,t,1),e,i,n)}var Ir=bt(kr,1/0),Br=bt(kr,1);function Or(t,e,r,n){arguments.length<=3&&(n=r,r=e,e=q(t)?[]:{}),n=R(n||L);var i=m(r);mt(t,(function(t,r,n){i(e,t,r,n)}),(function(t){n(t,e)}))}function Tr(t,e){var r,n=null;e=e||L,je(t,(function(t,e){m(t)((function(t,o){r=arguments.length>2?i(arguments,1):o,n=t,e(!t)}))}),(function(){e(n,r)}))}function Ur(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function jr(t,e,r){r=dt(r||L);var n=m(e);if(!t())return r(null);var o=function(e){if(e)return r(e);if(t())return n(o);var a=i(arguments,1);r.apply(null,[null].concat(a))};n(o)}function Lr(t,e,r){jr((function(){return!t.apply(this,arguments)}),e,r)}var Rr=function(t,e){if(e=R(e||L),!q(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function n(e){var n=m(t[r++]);e.push(dt(o)),n.apply(null,e)}function o(o){if(o||r===t.length)return e.apply(null,arguments);n(i(arguments,1))}n([])},Pr={apply:o,applyEach:St,applyEachSeries:Mt,asyncify:l,auto:jt,autoInject:ie,cargo:fe,compose:de,concat:be,concatLimit:pe,concatSeries:ye,constant:ge,detect:_e,detectLimit:Se,detectSeries:Ee,dir:xe,doDuring:Me,doUntil:Ie,doWhilst:ke,during:Be,each:Te,eachLimit:Ue,eachOf:mt,eachOfLimit:pt,eachOfSeries:ue,eachSeries:je,ensureAsync:Le,every:Pe,everyLimit:Fe,everySeries:Ne,filter:qe,filterLimit:He,filterSeries:Ve,forever:Ke,groupBy:Ge,groupByLimit:Je,groupBySeries:We,log:Ze,map:_t,mapLimit:At,mapSeries:xt,mapValues:Ye,mapValuesLimit:Xe,mapValuesSeries:Qe,memoize:er,nextTick:rr,parallel:ir,parallelLimit:or,priorityQueue:sr,queue:ar,race:fr,reduce:ce,reduceRight:ur,reflect:cr,reflectAll:hr,reject:lr,rejectLimit:pr,rejectSeries:br,retry:gr,retryable:mr,seq:he,series:vr,setImmediate:d,some:wr,someLimit:_r,someSeries:Sr,sortBy:Er,timeout:Ar,times:Ir,timesLimit:kr,timesSeries:Br,transform:Or,tryEach:Tr,unmemoize:Ur,until:Lr,waterfall:Rr,whilst:jr,all:Pe,allLimit:Fe,allSeries:Ne,any:wr,anyLimit:_r,anySeries:Sr,find:_e,findLimit:Se,findSeries:Ee,forEach:Te,forEachSeries:je,forEachLimit:Ue,forEachOf:mt,forEachOfSeries:ue,forEachOfLimit:pt,inject:ce,foldl:ce,foldr:ur,select:qe,selectLimit:He,selectSeries:Ve,wrapSync:l};e.default=Pr,e.apply=o,e.applyEach=St,e.applyEachSeries=Mt,e.asyncify=l,e.auto=jt,e.autoInject=ie,e.cargo=fe,e.compose=de,e.concat=be,e.concatLimit=pe,e.concatSeries=ye,e.constant=ge,e.detect=_e,e.detectLimit=Se,e.detectSeries=Ee,e.dir=xe,e.doDuring=Me,e.doUntil=Ie,e.doWhilst=ke,e.during=Be,e.each=Te,e.eachLimit=Ue,e.eachOf=mt,e.eachOfLimit=pt,e.eachOfSeries=ue,e.eachSeries=je,e.ensureAsync=Le,e.every=Pe,e.everyLimit=Fe,e.everySeries=Ne,e.filter=qe,e.filterLimit=He,e.filterSeries=Ve,e.forever=Ke,e.groupBy=Ge,e.groupByLimit=Je,e.groupBySeries=We,e.log=Ze,e.map=_t,e.mapLimit=At,e.mapSeries=xt,e.mapValues=Ye,e.mapValuesLimit=Xe,e.mapValuesSeries=Qe,e.memoize=er,e.nextTick=rr,e.parallel=ir,e.parallelLimit=or,e.priorityQueue=sr,e.queue=ar,e.race=fr,e.reduce=ce,e.reduceRight=ur,e.reflect=cr,e.reflectAll=hr,e.reject=lr,e.rejectLimit=pr,e.rejectSeries=br,e.retry=gr,e.retryable=mr,e.seq=he,e.series=vr,e.setImmediate=d,e.some=wr,e.someLimit=_r,e.someSeries=Sr,e.sortBy=Er,e.timeout=Ar,e.times=Ir,e.timesLimit=kr,e.timesSeries=Br,e.transform=Or,e.tryEach=Tr,e.unmemoize=Ur,e.until=Lr,e.waterfall=Rr,e.whilst=jr,e.all=Pe,e.allLimit=Fe,e.allSeries=Ne,e.any=wr,e.anyLimit=_r,e.anySeries=Sr,e.find=_e,e.findLimit=Se,e.findSeries=Ee,e.forEach=Te,e.forEachSeries=je,e.forEachLimit=Ue,e.forEachOf=mt,e.forEachOfSeries=ue,e.forEachOfLimit=pt,e.inject=ce,e.foldl=ce,e.foldr=ur,e.select=qe,e.selectLimit=He,e.selectSeries=Ve,e.wrapSync=l,Object.defineProperty(e,"__esModule",{value:!0})}(e)},8166:t=>{"use strict";t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw new TypeError(i+" is ambiguous");e[o]=n}var a=t.length,s=t.charAt(0),f=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===s;)n++,r++;for(var o=(t.length-r)*f+1>>>0,u=new Uint8Array(o);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var h=0,d=o-1;(0!==c||h<i)&&-1!==d;d--,h++)c+=a*u[d]>>>0,u[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");i=h,r++}for(var l=o-i;l!==o&&0===u[l];)l++;for(var p=new Uint8Array(n+(o-l)),b=n;l!==o;)p[b++]=u[l++];return p}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var f=(o-i)*u+1>>>0,c=new Uint8Array(f);i!==o;){for(var h=e[i],d=0,l=f-1;(0!==h||d<n)&&-1!==l;l--,d++)h+=256*c[l]>>>0,c[l]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var p=f-n;p!==f&&0===c[p];)p++;for(var b=s.repeat(r);p<f;++p)b+=t.charAt(c[p]);return b},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},5766:(t,e)=>{"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=f(t),a=o[0],s=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,f=n-i;s<f;s+=a)o.push(u(t,s,s+a>f?f:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2573:(t,e,r)=>{"use strict";var n=r(8834).Buffer,i=r(1329);function o(t,e){return void 0===e&&(e="utf8"),n.isBuffer(t)?s(t.toString("base64")):s(n.from(t,e).toString("base64"))}function a(t){return t=t.toString(),i.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function s(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var f=o;f.encode=o,f.decode=function(t,e){return void 0===e&&(e="utf8"),n.from(a(t),"base64").toString(e)},f.toBase64=a,f.fromBase64=s,f.toBuffer=function(t){return n.from(a(t),"base64")},e.default=f},1329:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=e%4;if(!r)return t;var i=e,o=4-r,a=e+o,s=n.alloc(a);for(s.write(t);o--;)s.write("=",i++);return s.toString()}},9487:(t,e,r)=>{t.exports=r(2573).default,t.exports.default=t.exports},2745:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},7022:(t,e,r)=>{const n=r(8166);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8834:(t,e,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;const a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);const i=function(t){if(f.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===f)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){let r=!0;for(let n=0;n<f;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(e.substr(2*a,2),16);if(Z(n))return a;t[r+a]=n}return a}function _(t,e,r,n){return G(K(e,t.length-r),t,r,n)}function S(t,e,r,n){return G(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return G(J(e),t,r,n)}function A(t,e,r,n){return G(function(t,e){let r,n,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,f;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(f=(31&e)<<6|63&r,f>127&&(o=f));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(f=(15&e)<<12|(63&r)<<6|63&n,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(f=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(W(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=f.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))i+e.length>n.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!f.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<s;++t)if(u[t]!==c[t]){o=u[t],a=c[t];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function T(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function R(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),f.prototype.readBigUInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),f.prototype.readBigInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeBigUInt64BE=Y((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeBigInt64BE=Y((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=f.isBuffer(t)?t:f.from(t,n),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%a]}return this};const z={};function C(t,e,r){z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new z.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||H(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!=typeof t)throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}C("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),C("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),C("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},8098:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32ToB58=e.b58ToC32=e.c32addressDecode=e.c32address=e.versions=void 0;var n=r(392),i=r(2716);e.versions={mainnet:{p2pkh:22,p2sh:20},testnet:{p2pkh:26,p2sh:21}};var o={};o[0]=e.versions.mainnet.p2pkh,o[5]=e.versions.mainnet.p2sh,o[111]=e.versions.testnet.p2pkh,o[196]=e.versions.testnet.p2sh;var a={};function s(t,e){if(!e.match(/^[0-9a-fA-F]{40}$/))throw new Error("Invalid argument: not a hash160 hex string");return"S"+n.c32checkEncode(t,e)}function f(t){if(t.length<=5)throw new Error("Invalid c32 address: invalid length");if("S"!=t[0])throw new Error('Invalid c32 address: must start with "S"');return n.c32checkDecode(t.slice(1))}a[e.versions.mainnet.p2pkh]=0,a[e.versions.mainnet.p2sh]=5,a[e.versions.testnet.p2pkh]=111,a[e.versions.testnet.p2sh]=196,e.c32address=s,e.c32addressDecode=f,e.b58ToC32=function(t,e){void 0===e&&(e=-1);var r,n=i.decode(t),a=n.data.toString("hex"),f=parseInt(n.prefix.toString("hex"),16);return e<0?(r=f,void 0!==o[f]&&(r=o[f])):r=e,s(r,a)},e.c32ToB58=function(t,e){void 0===e&&(e=-1);var r,n=f(t),o=n[0],s=n[1];e<0?(r=o,void 0!==a[o]&&(r=a[o])):r=e;var u=r.toString(16);return 1===u.length&&(u="0"+u),i.encode(s,u)}},2716:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0;var n=r(8131),i=r(9926),o=r(9805),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";e.encode=function(t,e,r){if(void 0===e&&(e="00"),void 0===r&&(r="hex"),"string"==typeof t&&(t=new n.Buffer(t,r)),!(t instanceof n.Buffer))throw new TypeError('"data" argument must be an Array of Buffers');e instanceof n.Buffer||(e=new n.Buffer(e,r));var s=n.Buffer.concat([e,t]);return s=i.hashSha256(s),s=i.hashSha256(s),s=n.Buffer.concat([e,t,s.slice(0,4)]),o(a).encode(s)},e.decode=function(t,e){var r=new n.Buffer(o(a).decode(t)),s=r.slice(0,1),f=r.slice(1,-4),u=n.Buffer.concat([s,f]);return u=i.hashSha256(u),u=i.hashSha256(u),r.slice(-4).forEach((function(t,e){if(t!==u[e])throw new Error("Invalid checksum")})),e&&(s=s.toString(e),f=f.toString(e)),{prefix:s,data:f}}},392:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32checkDecode=e.c32checkEncode=void 0;var n=r(8131),i=r(4103),o=r(9926);function a(t){return o.hashSha256(o.hashSha256(n.Buffer.from(t,"hex"))).slice(0,4).toString("hex")}e.c32checkEncode=function(t,e){if(t<0||t>=32)throw new Error("Invalid version (must be between 0 and 31)");if(!e.match(/^[0-9a-fA-F]*$/))throw new Error("Invalid data (not a hex string)");(e=e.toLowerCase()).length%2!=0&&(e="0"+e);var r=t.toString(16);1===r.length&&(r="0"+r);var n=a(""+r+e),o=i.c32encode(""+e+n);return""+i.c32[t]+o},e.c32checkDecode=function(t){t=i.c32normalize(t);var e=i.c32decode(t.slice(1)),r=t[0],n=i.c32.indexOf(r),o=e.slice(-8),s=n.toString(16);if(1===s.length&&(s="0"+s),a(""+s+e.substring(0,e.length-8))!==o)throw new Error("Invalid c32check string: checksum mismatch");return[n,e.substring(0,e.length-8)]}},4103:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32decode=e.c32normalize=e.c32encode=e.c32=void 0;var n=r(8131);e.c32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";var i="0123456789abcdef";function o(t){return t.toUpperCase().replace(/O/g,"0").replace(/L|I/g,"1")}e.c32encode=function(t,r){if(!t.match(/^[0-9a-fA-F]*$/))throw new Error("Not a hex-encoded string");t.length%2!=0&&(t="0"+t);for(var o=[],a=0,s=(t=t.toLowerCase()).length-1;s>=0;s--)if(a<4){var f=i.indexOf(t[s])>>a,u=0;0!==s&&(u=i.indexOf(t[s-1]));var c=1+a,h=u%(1<<c)<<5-c,d=e.c32[f+h];a=c,o.unshift(d)}else a=0;var l=0;for(s=0;s<o.length&&"0"===o[s];s++)l++;o=o.slice(l);var p=n.Buffer.from(t,"hex").toString().match(/^\u0000*/),b=p?p[0].length:0;for(s=0;s<b;s++)o.unshift(e.c32[0]);if(r){var y=r-o.length;for(s=0;s<y;s++)o.unshift(e.c32[0])}return o.join("")},e.c32normalize=o,e.c32decode=function(t,r){if(!(t=o(t)).match("^["+e.c32+"]*$"))throw new Error("Not a c32-encoded string");for(var n=t.match("^"+e.c32[0]+"*"),a=n?n[0].length:0,s=[],f=0,u=0,c=t.length-1;c>=0;c--){4===u&&(s.unshift(i[f]),u=0,f=0);var h=(e.c32.indexOf(t[c])<<u)+f,d=i[h%16];if((f=h>>4)>1<<(u+=1))throw new Error("Panic error in decoding.");s.unshift(d)}s.unshift(i[f]),s.length%2==1&&s.unshift("0");var l=0;for(c=0;c<s.length&&"0"===s[c];c++)l++;var p=(s=s.slice(l-l%2)).join("");for(c=0;c<a;c++)p="00"+p;if(r){var b=2*r-p.length;for(c=0;c<b;c+=2)p="00"+p}return p}},2870:(t,e,r)=>{"use strict";e.H4=void 0;r(4103),r(392);var n=r(8098);Object.defineProperty(e,"H4",{enumerable:!0,get:function(){return n.c32address}})},9805:(t,e,r)=>{"use strict";var n=r(7834).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(255!==e[a])throw new TypeError(o+" is ambiguous");e[a]=i}var s=t.length,f=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===f;)i++,r++;for(var a=(t.length-r)*u+1>>>0,c=new Uint8Array(a);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var d=0,l=a-1;(0!==h||d<o)&&-1!==l;l--,d++)h+=s*c[l]>>>0,c[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");o=d,r++}for(var p=a-o;p!==a&&0===c[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var y=i;p!==a;)b[y++]=c[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var u=(a-o)*c+1>>>0,h=new Uint8Array(u);o!==a;){for(var d=e[o],l=0,p=u-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*h[p]>>>0,h[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=u-i;b!==u&&0===h[b];)b++;for(var y=f.repeat(r);b<u;++b)y+=t.charAt(h[b]);return y},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},8131:(t,e,r)=>{"use strict";var n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){for(var e=t.length<0?0:0|p(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,d=0;d<f;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(D(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return C(N(e,t.length-r),t,r,n)}function S(t,e,r,n){return C(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return C(z(e),t,r,n)}function A(t,e,r,n){return C(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if($(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q[t[o]];return i}function T(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:f.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+/0-9A-Za-z-_]/g;function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},3616:function(){!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function b(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var t,e,r,n=l(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=p(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=c(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,i=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function _(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var S=[301,302,303,307,308];_.redirect=function(t,e){if(-1===S.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,r){return new Promise((function(n,o){var a=new v(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new _(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=d,t.Request=v,t.Response=_),e.Headers=d,e.Request=v,e.Response=_,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this)},9926:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hashSha256=e.sha256=e.sha256nodeCrypto=e.sha256js=void 0;var n=r(3878),i=function(){function t(){this._blockSize=64,this._finalSize=56,this._len=0,this._w=new Array(64),this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this._block=n.Buffer.alloc(this._blockSize)}return t.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.Buffer.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var f=a%i,u=Math.min(o-s,i-f),c=0;c<u;c++)r[f+c]=t[s+c];s+=u,(a+=u)%i==0&&this._update(r)}return this._len+=o,this},t.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,o=(r-i)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=n.Buffer.alloc(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),t?a.toString(t):a},t.prototype.ch=function(t,e,r){return r^t&(e^r)},t.prototype.maj=function(t,e,r){return t&e|r&(t|e)},t.prototype.sigma0=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},t.prototype.sigma1=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},t.prototype.gamma0=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},t.prototype.gamma1=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10},t.prototype._update=function(e){for(var r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,f=0|this._f,u=0|this._g,c=0|this._h,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<64;++h)r[h]=this.gamma1(r[h-2])+r[h-7]+this.gamma0(r[h-15])+r[h-16]|0;for(var d=0;d<64;++d){var l=c+this.sigma1(s)+this.ch(s,f,u)+t.K[d]+r[d]|0,p=this.sigma0(n)+this.maj(n,i,o)|0;c=u,u=f,f=s,s=a+l|0,a=o,o=i,i=n,n=l+p|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=f+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},t.K=[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],t}();e.sha256js=i;var o=function(){function t(){t.useCryptoModuleCache&&void 0!==t.nodeCryptoCreateHash||(t.nodeCryptoCreateHash=r(9096).createHash),this.hash=t.nodeCryptoCreateHash("sha256")}return t.prototype.update=function(t,e){return this.hash.update(t,e),this},t.prototype.digest=function(t){return t?this.hash.digest(t):this.hash.digest()},t.useCryptoModuleCache=!0,t}();e.sha256nodeCrypto=o;var a=void 0,s=function(){function t(){!function(){if(o.useCryptoModuleCache&&void 0!==a)return a;var t=!1;try{var e=r(9096);t=e&&"function"==typeof e.createHash}catch(t){}return a=t,t}()?this.instance=new i:this.instance=new o}return t.prototype.update=function(t,e){return this.instance.update(t,e),this},t.prototype.digest=function(t){return t?this.instance.digest(t):this.instance.digest()},t}();function f(t){return(new s).update(t).digest()}e.sha256=s,e.hashSha256=f,e.default=f},3878:(t,e,r)=>{"use strict";var n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){for(var e=t.length<0?0:0|p(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,d=0;d<f;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(D(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return C(N(e,t.length-r),t,r,n)}function S(t,e,r,n){return C(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return C(z(e),t,r,n)}function A(t,e,r,n){return C(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if($(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q[t[o]];return i}function T(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:f.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+/0-9A-Za-z-_]/g;function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},6120:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(2221);function o(t){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function a(t,e,r){for(var n=0;e+n<r&&0===t[e+n];)++n;return t[e+n]>=128&&--n,n}t.exports={derToJose:function(t,e){t=o(t);var r=i(e),a=r+1,s=t.length,f=0;if(48!==t[f++])throw new Error('Could not find expected "seq"');var u=t[f++];if(129===u&&(u=t[f++]),s-f<u)throw new Error('"seq" specified length of "'+u+'", only "'+(s-f)+'" remaining');if(2!==t[f++])throw new Error('Could not find expected "int" for "r"');var c=t[f++];if(s-f-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(s-f-2)+'" available');if(a<c)throw new Error('"r" specified length of "'+c+'", max of "'+a+'" is acceptable');var h=f;if(f+=c,2!==t[f++])throw new Error('Could not find expected "int" for "s"');var d=t[f++];if(s-f!==d)throw new Error('"s" specified length of "'+d+'", expected "'+(s-f)+'"');if(a<d)throw new Error('"s" specified length of "'+d+'", max of "'+a+'" is acceptable');var l=f;if((f+=d)!==s)throw new Error('Expected to consume entire buffer, but "'+(s-f)+'" bytes remain');var p=r-c,b=r-d,y=n.allocUnsafe(p+c+b+d);for(f=0;f<p;++f)y[f]=0;t.copy(y,f,h+Math.max(-p,0),h+c);for(var g=f=r;f<g+b;++f)y[f]=0;return t.copy(y,f,l+Math.max(-b,0),l+d),(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(t,e){t=o(t);var r=i(e),s=t.length;if(s!==2*r)throw new TypeError('"'+e+'" signatures must be "'+2*r+'" bytes, saw "'+s+'"');var f=a(t,0,r),u=a(t,r,t.length),c=r-f,h=r-u,d=2+c+1+1+h,l=d<128,p=n.allocUnsafe((l?2:3)+d),b=0;return p[b++]=48,l?p[b++]=d:(p[b++]=129,p[b++]=255&d),p[b++]=2,p[b++]=c,f<0?(p[b++]=0,b+=t.copy(p,b,0,r)):b+=t.copy(p,b,f,r),p[b++]=2,p[b++]=h,u<0?(p[b++]=0,t.copy(p,b,r)):t.copy(p,b,r+u),p}}},2221:t=>{"use strict";function e(t){return(t/8|0)+(t%8==0?0:1)}var r={ES256:e(256),ES384:e(384),ES512:e(521)};t.exports=function(t){var e=r[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}},7554:(t,e,r)=>{"use strict";var n=e;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(8610),n.curves=r(1479),n.ec=r(8596),n.eddsa=r(9208)},8919:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.getNAF,a=i.getJSF,s=i.assert;function f(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,f,u=[];for(a=0;a<n.length;a+=r.step){f=0;for(var c=a+r.step-1;c>=a;c--)f=(f<<1)+n[c];u.push(f)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a<u.length;a++)(f=u[a])===l?d=d.mixedAdd(r.points[a]):f===-l&&(d=d.mixedAdd(r.points[a].neg()));h=h.add(d)}return h.toP()},f.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(e,r,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var c=0;u>=0&&0===a[u];u--)c++;if(u>=0&&c++,f=f.dblp(c),u<0)break;var h=a[u];s(0!==h),f="affine"===t.type?h>0?f.mixedAdd(i[h-1>>1]):f.mixedAdd(i[-h-1>>1].neg()):h>0?f.add(i[h-1>>1]):f.add(i[-h-1>>1].neg())}return"affine"===t.type?f.toP():f},f.prototype._wnafMulAdd=function(t,e,r,n,i){var s,f,u,c=this._wnafT1,h=this._wnafT2,d=this._wnafT3,l=0;for(s=0;s<n;s++){var p=(u=e[s])._getNAFPoints(t);c[s]=p.wnd,h[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,y=s;if(1===c[b]&&1===c[y]){var g=[e[b],null,null,e[y]];0===e[b].y.cmp(e[y].y)?(g[1]=e[b].add(e[y]),g[2]=e[b].toJ().mixedAdd(e[y].neg())):0===e[b].y.cmp(e[y].y.redNeg())?(g[1]=e[b].toJ().mixedAdd(e[y]),g[2]=e[b].add(e[y].neg())):(g[1]=e[b].toJ().mixedAdd(e[y]),g[2]=e[b].toJ().mixedAdd(e[y].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[b],r[y]);for(l=Math.max(v[0].length,l),d[b]=new Array(l),d[y]=new Array(l),f=0;f<l;f++){var w=0|v[0][f],_=0|v[1][f];d[b][f]=m[3*(w+1)+(_+1)],d[y][f]=0,h[b]=g}}else d[b]=o(r[b],c[b],this._bitLength),d[y]=o(r[y],c[y],this._bitLength),l=Math.max(d[b].length,l),l=Math.max(d[y].length,l)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(s=l;s>=0;s--){for(var A=0;s>=0;){var x=!0;for(f=0;f<n;f++)E[f]=0|d[f][s],0!==E[f]&&(x=!1);if(!x)break;A++,s--}if(s>=0&&A++,S=S.dblp(A),s<0)break;for(f=0;f<n;f++){var M=E[f];0!==M&&(M>0?u=h[f][M-1>>1]:M<0&&(u=h[f][-M-1>>1].neg()),S="affine"===u.type?S.mixedAdd(u):S.add(u))}}for(s=0;s<n;s++)h[s]=null;return i?S:S.toP()},f.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},f.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?s(t[t.length-1]%2==0):7===t[0]&&s(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},7105:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),a=r(8919),s=n.assert;function f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(f,a),t.exports=f,f.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=s.fromRed().isOdd();return(e&&!f||!e&&f)&&(s=s.redNeg()),this.point(t,s)},f.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,a.BasePoint),f.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},f.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),f=i.redMul(a),u=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(f,u,h,c)},u.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(f);this.zOne?(t=a.redSub(s).redSub(f).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(f)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),t=a.redSub(s).redISub(f).redMul(o),e=u.redMul(n.redSub(f)),r=u.redMul(o))}else n=s.redAdd(f),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(f)),r=n.redMul(o);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),f=r.redAdd(e),u=o.redMul(a),c=s.redMul(f),h=o.redMul(f),d=a.redMul(s);return this.curve.point(u,c,d,h)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(f).redMul(c);return this.curve.twisted?(e=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=f.redMul(u)):(e=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(t,e,r)=>{"use strict";var n=e;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(t,e,r)=>{"use strict";var n=r(2140),i=r(1285),o=r(8919),a=r(8288);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(f,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new f(this,t,e)},s.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),f=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,f)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),a=r(8919),s=n.assert;function f(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(f,a),t.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,f,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),g=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);u=l.sub(v.mul(d)),c=y.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&u.cmp(h)<0)e=f.neg(),r=p,n=u.neg(),o=c;else if(n&&2==++m)break;f=u,l=d,d=u,y=p,p=c,g=b,b=w}a=u.neg(),s=c;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a,b:s}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),f=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:f.add(u).neg()}},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],f=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),f=f.neg(!0)),n[2*o]=s,n[2*o+1]=f,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return u},o(u,a.BasePoint),f.prototype.point=function(t,e,r){return new u(this,t,e,r)},f.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),f.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=o.redSub(a);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),d=f.redSqr().redIAdd(c).redISub(h).redISub(h),l=f.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),u=f.redMul(a),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,f=s.redSqr().redSqr(),u=a.redAdd(a);for(e=0;e<t;e++){var c=o.redSqr(),h=u.redSqr(),d=h.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),p=o.redMul(h),b=l.redSqr().redISub(p.redAdd(p)),y=p.redISub(b),g=l.redMul(y);g=g.redIAdd(g).redISub(d);var m=u.redMul(s);e+1<t&&(f=f.redMul(d)),o=b,s=m,u=g}return this.curve.jpoint(o,u.redMul(i),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),f=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=f,e=s.redMul(a.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(c).redISub(d);l=l.redIAdd(l);var p=c.redAdd(c).redIAdd(c),b=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=s.redSqr().redISub(a).redISub(a);t=f;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=s.redMul(a.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),l=this.x.redSub(c).redMul(this.x.redAdd(c));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var y=h.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=l.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e),u=(f=f.redIAdd(f)).redMul(a),c=s.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=s.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,l,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(f),c=e.redMul(u);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(s).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(f.redISub(u)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(h,d,l)},c.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(t,e,r)=>{"use strict";var n,i=e,o=r(4485),a=r(8610),s=r(8288).assert;function f(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new f(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(7983)}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},8596:(t,e,r)=>{"use strict";var n=r(2140),i=r(8873),o=r(8288),a=r(1479),s=r(2745),f=o.assert,u=r(2307),c=r(1798);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(f(Object.prototype.hasOwnProperty.call(a,t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),f=t.toArray("be",a),u=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var g=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new c({r:y,s:g,recoveryParam:m})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new c(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),u=f.mul(t).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,i){f((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var o=this.n,a=new n(t),s=e.r,u=e.s,h=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var l=e.r.invm(o),p=o.sub(a).mul(l).umod(o),b=u.mul(l).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},2307:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function f(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=f(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=f(t,r);if(!1===a)return!1;var u=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var c=f(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(u),this.s=new n(h),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,t)}},9208:(t,e,r)=>{"use strict";var n=r(4485),i=r(1479),o=r(8288),a=o.assert,s=o.parseBytes,f=r(851),u=r(6117);function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=c,c.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),f=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},c.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},851:(t,e,r)=>{"use strict";var n=r(8288),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=s},6117:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function f(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(f,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(f,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(f,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(f,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),f.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},f.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=f},7983:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},8288:(t,e,r)=>{"use strict";var n=e,i=r(2140),o=r(9561),a=r(3022);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<n.length;a++){var s,f=o.andln(i-1);o.isOdd()?(s=f>(i>>1)-1?(i>>1)-f:f,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,f=t.andln(3)+i&3,u=e.andln(3)+o&3;3===f&&(f=-1),3===u&&(u=-1),a=0==(1&f)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==u?f:-f,r[0].push(a),s=0==(1&u)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==f?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},2140:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(488).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function f(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c<s;c+=n)f=u(t,c,c+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var h=1;for(f=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=f>>>26,h=67108863&f,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],f=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?c[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:c[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===e,u=new t(o),c=this.clone();if(f){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-i;s++)u[s]=0;for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a<n.length;a++)o=(e=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,a=t.words,s=e.words,f=r.words,u=0,c=0|a[0],h=8191&c,d=c>>>13,l=0|a[1],p=8191&l,b=l>>>13,y=0|a[2],g=8191&y,m=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,S=0|a[4],E=8191&S,A=S>>>13,x=0|a[5],M=8191&x,k=x>>>13,I=0|a[6],B=8191&I,O=I>>>13,T=0|a[7],U=8191&T,j=T>>>13,L=0|a[8],R=8191&L,P=L>>>13,F=0|a[9],N=8191&F,z=F>>>13,C=0|s[0],$=8191&C,D=C>>>13,q=0|s[1],H=8191&q,V=q>>>13,K=0|s[2],J=8191&K,G=K>>>13,W=0|s[3],Z=8191&W,X=W>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ft=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(h,$))|0)+((8191&(i=(i=Math.imul(h,D))+Math.imul(d,$)|0))<<13)|0;u=((o=Math.imul(d,D))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,D))+Math.imul(b,$)|0,o=Math.imul(b,D);var gt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,D))+Math.imul(m,$)|0,o=Math.imul(m,D),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var mt=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,D))+Math.imul(_,$)|0,o=Math.imul(_,D),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,G)|0;var vt=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,Z)|0))<<13)|0;u=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,$),i=(i=Math.imul(E,D))+Math.imul(A,$)|0,o=Math.imul(A,D),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,$),i=(i=Math.imul(M,D))+Math.imul(k,$)|0,o=Math.imul(k,D),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,D))+Math.imul(O,$)|0,o=Math.imul(O,D),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(u+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,D))+Math.imul(j,$)|0,o=Math.imul(j,D),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var Et=(u+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,ft)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,D))+Math.imul(P,$)|0,o=Math.imul(P,D),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ut)|0;var At=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,D))+Math.imul(z,$)|0,o=Math.imul(z,D),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(U,J)|0,i=(i=i+Math.imul(U,G)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var xt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,V))+Math.imul(z,H)|0,o=Math.imul(z,V),n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var Mt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,G))+Math.imul(z,J)|0,o=Math.imul(z,G),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,ut)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var kt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,X))+Math.imul(z,Z)|0,o=Math.imul(z,X),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,tt))+Math.imul(z,Q)|0,o=Math.imul(z,tt),n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ut)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(z,rt)|0,o=Math.imul(z,nt),n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(U,ft)|0,i=(i=i+Math.imul(U,ut)|0)+Math.imul(j,ft)|0,o=o+Math.imul(j,ut)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Ot=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(N,ot),i=(i=Math.imul(N,at))+Math.imul(z,ot)|0,o=Math.imul(z,at),n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ut)|0,n=n+Math.imul(U,ht)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ut))+Math.imul(z,ft)|0,o=Math.imul(z,ut),n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Ut=(u+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,bt)|0)+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,n=Math.imul(N,ht),i=(i=Math.imul(N,dt))+Math.imul(z,ht)|0,o=Math.imul(z,dt);var jt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Lt=(u+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,bt))+Math.imul(z,pt)|0))<<13)|0;return u=((o=Math.imul(z,bt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,f[0]=yt,f[1]=gt,f[2]=mt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=St,f[7]=Et,f[8]=At,f[9]=xt,f[10]=Mt,f[11]=kt,f[12]=It,f[13]=Bt,f[14]=Ot,f[15]=Tt,f[16]=Ut,f[17]=jt,f[18]=Lt,0!==u&&(f[19]=u,r.length++),r};function b(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(p=l),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?l(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,f=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=f;u++){var c=o-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;s=67108863&(d=d+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):b(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a<o;a++)n[a]=e[t[a]],i[a]=r[t[a]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,f=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=f,d=u,l=0;l<a;l++){var p=r[c+l],b=n[c+l],y=r[c+l+a],g=n[c+l+a],m=h*y-d*g;g=h*g+d*y,y=m,r[c+l]=p+y,n[c+l]=b+g,r[c+l+a]=p-y,n[c+l+a]=b-g,l!==s&&(m=f*h-u*d,d=f*d+u*h,h=m)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,e,r,i){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,u,n),this.transform(a,o,s,f,n,i),this.transform(u,o,c,h,n,i);for(var l=0;l<n;l++){var p=s[l]*c[l]-f[l]*h[l];f[l]=s[l]*h[l]+f[l]*c[l],s[l]=p}return this.conjugate(s,f,n),this.transform(s,f,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,f=(0|this.words[e])-s<<r;this.words[e]=f|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,f=r;if(i-=a,i=Math.max(0,i),f){for(var u=0;u<a;u++)f.words[u]=this.words[u];f.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var f=(0|t.words[i])*e;s=((o-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==e){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,f);0===c.negative&&(n=c,s&&(s.words[f]=1));for(var h=f-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(f)):(r.isub(e),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(v,m),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,m),i(_,m),i(S,m),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return g[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y<p);var g=this.pow(h,new o(1).iushln(p-y-1));d=d.redMul(g),h=g.redSqr(),l=l.redMul(h),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],a=0,s=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,E),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},4485:(t,e,r)=>{var n=e;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},4495:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1396:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,a=n.sum32,s=n.sum32_3,f=n.sum32_4,u=i.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,u),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],c=this.h[4],m=r,v=n,w=i,_=u,S=c,E=0;E<80;E++){var A=a(o(f(r,h(E,n,i,u),t[p[E]+e],d(E)),y[E]),c);r=c,c=u,u=o(i,10),i=n,n=A,A=a(o(f(m,h(79-E,v,w,_),t[b[E]+e],l(E)),g[E]),S),m=S,S=_,_=o(w,10),w=v,v=A}A=s(this.h[1],i,_),this.h[1]=s(this.h[2],u,S),this.h[2]=s(this.h[3],c,m),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=A},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5530:(t,e,r)=>{"use strict";e.sha1=r(5079),e.sha224=r(3823),e.sha256=r(8032),e.sha384=r(5328),e.sha512=r(168)},5079:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),a=n.rotl32,s=n.sum32,f=n.sum32_5,u=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=f(a(i,5),u(p,o,c,d),l,r[n],h[p]);l=d,d=c,c=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(t,e,r)=>{"use strict";var n=r(212),i=r(8032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8032:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),a=r(9561),s=n.sum32,f=n.sum32_4,u=n.sum32_5,c=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,g=[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];function m(){if(!(this instanceof m))return new m;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(m,y),t.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=f(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],g=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var S=u(_,l(m),c(m,v,w),this.k[n],r[n]),E=s(d(i),h(i,o,y));_=w,w=v,v=m,m=s(g,S),g=y,y=o,o=i,i=s(S,E)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],y),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],m),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},m.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(t,e,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),a=n.rotr64_hi,s=n.rotr64_lo,f=n.shr64_hi,u=n.shr64_lo,c=n.sum64,h=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,y=n.sum64_5_lo,g=i.BlockHash,m=[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];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var a=e&n^~e&o;return a<0&&(a+=4294967296),a}function S(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var a=e&n^e&o^n&o;return a<0&&(a+=4294967296),a}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,1)^a(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(y=r[n-4],g=r[n-3],m=void 0,(m=a(y,g,19)^a(g,y,29)^f(y,g,6))<0&&(m+=4294967296),m),o=B(r[n-4],r[n-3]),s=r[n-14],u=r[n-13],c=k(r[n-30],r[n-29]),h=I(r[n-30],r[n-29]),d=r[n-32],b=r[n-31];r[n]=l(i,o,s,u,c,h,d,b),r[n+1]=p(i,o,s,u,c,h,d,b)}var y,g,m},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,s=this.W,f=this.h[0],u=this.h[1],l=this.h[2],p=this.h[3],g=this.h[4],m=this.h[5],v=this.h[6],k=this.h[7],I=this.h[8],B=this.h[9],O=this.h[10],T=this.h[11],U=this.h[12],j=this.h[13],L=this.h[14],R=this.h[15];o(this.k.length===s.length);for(var P=0;P<s.length;P+=2){var F=L,N=R,z=(i=void 0,(i=a(r=I,n=B,14)^a(r,n,18)^a(n,r,9))<0&&(i+=4294967296),i),C=M(I,B),$=w(I,0,O,0,U),D=_(0,B,0,T,0,j),q=this.k[P],H=this.k[P+1],V=s[P],K=s[P+1],J=b(F,N,z,C,$,D,q,H,V,K),G=y(F,N,z,C,$,D,q,H,V,K);F=A(f,u),N=x(f,u),z=S(f,0,l,0,g),C=E(0,u,0,p,0,m);var W=h(F,N,z,C),Z=d(F,N,z,C);L=U,R=j,U=O,j=T,O=I,T=B,I=h(v,k,J,G),B=d(k,k,J,G),v=g,k=m,g=l,m=p,l=f,p=u,f=h(J,G,W,Z),u=d(J,G,W,Z)}c(this.h,0,f,u),c(this.h,2,l,p),c(this.h,4,g,m),c(this.h,6,v,k),c(this.h,8,I,B),c(this.h,10,O,T),c(this.h,12,U,j),c(this.h,14,L,R)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(t,e,r)=>{"use strict";var n=r(212).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?a(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},212:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=a(i)),r+=f(i.toString(16))}return r},e.zero2=s,e.zero8=f,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var a=new Array(o/4),s=0,f=e;s<a.length;s++,f+=4){var u;u="big"===i?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],a[s]=u>>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var f=0,u=e;return f+=(u=u+n>>>0)<e?1:0,f+=(u=u+o>>>0)<o?1:0,t+r+i+a+(f+=(u=u+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,f,u){var c=0,h=e;return c+=(h=h+n>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+s>>>0)<s?1:0,t+r+i+a+f+(c+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,f,u){return e+n+o+s+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8873:(t,e,r)=>{"use strict";var n=r(4485),i=r(3022),o=r(9561);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(r),this._reseed++,i.encode(a,e)}},2333:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=u}return(l?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+h>=1?d/f:d*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*f-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+l]=255&a,l+=p,a/=256,u-=8);t[r+l-p]|=128*b}},1285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9996:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7650);e.SECP256K1Client=n.SECP256K1Client;const i={ES256K:n.SECP256K1Client};e.cryptoClients=i},7650:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=r(7554),o=r(6120),a=r(8643);class s{constructor(){}static loadPrivateKey(t){return 66===t.length&&(t=t.slice(0,64)),s.ec.keyFromPrivate(t)}static loadPublicKey(t){return s.ec.keyFromPublic(t,"hex")}static derivePublicKey(t,e=!0){if("string"!=typeof t)throw Error("private key must be a string");if(!/^[0-9A-F]+$/i.test(t))throw Error("private key must be a hex string");if(66==t.length)t=t.slice(0,64);else if(!(t.length<=64))throw Error("private key must be 66 characters or less");return s.ec.keyFromPrivate(t).getPublic(e,"hex")}static signHash(t,e,r="jose"){if(!t||!e)throw new a.MissingParametersError("a signing input hash and private key are all required");const i=s.loadPrivateKey(e).sign(t),f=n.from(i.toDER());if("der"===r)return f.toString("hex");if("jose"===r)return o.derToJose(f,"ES256");throw Error("Invalid signature format")}static loadSignature(t){return o.joseToDer(t,"ES256")}static verifyHash(t,e,r){if(!(t&&e&&r))throw new a.MissingParametersError("a signing input hash, der signature, and public key are all required");return s.loadPublicKey(r).verify(t,e)}}e.SECP256K1Client=s,s.ec=new i.ec("secp256k1"),s.algorithmName="ES256K"},874:function(t,e,r){"use strict";var n=r(8834).Buffer,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=r(9065);function a(t){return(new o.sha256).update(t).digest()}e.hashSha256=a,e.hashSha256Async=function(t){return i(this,void 0,void 0,(function*(){try{if("undefined"!=typeof crypto&&void 0!==crypto.subtle){const e="string"==typeof t?n.from(t):t,r=yield crypto.subtle.digest("SHA-256",e);return n.from(r)}{const e=r(1812);if(!e.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(e.createHash("sha256").update(t).digest())}}catch(e){return console.log(e),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(a(t))}}))}},8917:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(9487);e.decodeToken=function(t){if("string"==typeof t){const e=t.split(".");return{header:JSON.parse(n.default.decode(e[0])),payload:JSON.parse(n.default.decode(e[1])),signature:e[2]}}if("object"==typeof t){if("string"!=typeof t.payload)throw new Error("Expected token payload to be a base64 or json string");let e=t.payload;"{"!==t.payload[0]&&(e=n.default.decode(e));const r=[];return t.header.map((t=>{const e=JSON.parse(n.default.decode(t));r.push(e)})),{header:r,payload:JSON.parse(e),signature:t.signature}}}},8643:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r extends Error{constructor(t){super(),this.name="MissingParametersError",this.message=t||""}}e.MissingParametersError=r;class n extends Error{constructor(t){super(),this.name="InvalidTokenError",this.message=t||""}}e.InvalidTokenError=n},7474:(t,e,r)=>{"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5650)),n(r(7458)),n(r(8917)),n(r(8643)),n(r(9996))},5650:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=r(9487),o=r(9996),a=r(8643),s=r(874);function f(t,e){const r=[],n=i.default.encode(JSON.stringify(e));r.push(n);const o=i.default.encode(JSON.stringify(t));return r.push(o),r.join(".")}e.createUnsecuredToken=function(t){return f(t,{typ:"JWT",alg:"none"})+"."},e.TokenSigner=class{constructor(t,e){if(!t||!e)throw new a.MissingParametersError("a signing algorithm and private key are required");if("string"!=typeof t)throw new Error("signing algorithm parameter must be a string");if(t=t.toUpperCase(),!o.cryptoClients.hasOwnProperty(t))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=o.cryptoClients[t],this.rawPrivateKey=e}header(t={}){const e={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},e,t)}sign(t,e=!1,r={}){const n=this.header(r),i=f(t,n),o=s.hashSha256(i);return this.createWithSignedHash(t,e,n,i,o)}signAsync(t,e=!1,r={}){return n(this,void 0,void 0,(function*(){const n=this.header(r),i=f(t,n),o=yield s.hashSha256Async(i);return this.createWithSignedHash(t,e,n,i,o)}))}createWithSignedHash(t,e,r,n,o){const a=this.cryptoClient.signHash(o,this.rawPrivateKey);return e?{header:[i.default.encode(JSON.stringify(r))],payload:JSON.stringify(t),signature:[a]}:[n,a].join(".")}}},7458:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(9487),i=r(9996),o=r(8643),a=r(874);e.TokenVerifier=class{constructor(t,e){if(!t||!e)throw new o.MissingParametersError("a signing algorithm and public key are required");if("string"!=typeof t)throw"signing algorithm parameter must be a string";if(t=t.toUpperCase(),!i.cryptoClients.hasOwnProperty(t))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=i.cryptoClients[t],this.rawPublicKey=e}verify(t){return"string"==typeof t?this.verifyCompact(t,!1):"object"==typeof t?this.verifyExpanded(t,!1):void 0}verifyAsync(t){return"string"==typeof t?this.verifyCompact(t,!0):"object"==typeof t?this.verifyExpanded(t,!0):Promise.resolve(!1)}verifyCompact(t,e){const r=t.split("."),n=r[0]+"."+r[1],i=t=>{const e=this.cryptoClient.loadSignature(r[2]);return this.cryptoClient.verifyHash(t,e,this.rawPublicKey)};if(e)return a.hashSha256Async(n).then((t=>i(t)));{const t=a.hashSha256(n);return i(t)}}verifyExpanded(t,e){const r=[t.header.join("."),n.default.encode(t.payload)].join(".");let i=!0;const o=e=>(t.signature.map((t=>{const r=this.cryptoClient.loadSignature(t);this.cryptoClient.verifyHash(e,r,this.rawPublicKey)||(i=!1)})),i);if(e)return a.hashSha256Async(r).then((t=>o(t)));{const t=a.hashSha256(r);return o(t)}}}},9907:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Boolean]",s="[object Date]",f="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",d="[object Object]",l="[object Promise]",p="[object RegExp]",b="[object Set]",y="[object String]",g="[object Symbol]",m="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",M="[object Uint8Array]",k="[object Uint8ClampedArray]",I="[object Uint16Array]",B="[object Uint32Array]",O=/\w*$/,T=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,j={};j[o]=j["[object Array]"]=j[v]=j[w]=j[a]=j[s]=j[_]=j[S]=j[E]=j[A]=j[x]=j[c]=j[h]=j[d]=j[p]=j[b]=j[y]=j[g]=j[M]=j[k]=j[I]=j[B]=!0,j["[object Error]"]=j[f]=j[m]=!1;var L="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,R="object"==typeof self&&self&&self.Object===Object&&self,P=L||R||Function("return this")(),F=e&&!e.nodeType&&e,N=F&&t&&!t.nodeType&&t,z=N&&N.exports===F;function C(t,e){return t.set(e[0],e[1]),t}function $(t,e){return t.add(e),t}function D(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t,e){return function(r){return t(e(r))}}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var J,G=Array.prototype,W=Function.prototype,Z=Object.prototype,X=P["__core-js_shared__"],Y=(J=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",Q=W.toString,tt=Z.hasOwnProperty,et=Z.toString,rt=RegExp("^"+Q.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nt=z?P.Buffer:void 0,it=P.Symbol,ot=P.Uint8Array,at=V(Object.getPrototypeOf,Object),st=Object.create,ft=Z.propertyIsEnumerable,ut=G.splice,ct=Object.getOwnPropertySymbols,ht=nt?nt.isBuffer:void 0,dt=V(Object.keys,Object),lt=Pt(P,"DataView"),pt=Pt(P,"Map"),bt=Pt(P,"Promise"),yt=Pt(P,"Set"),gt=Pt(P,"WeakMap"),mt=Pt(Object,"create"),vt=$t(lt),wt=$t(pt),_t=$t(bt),St=$t(yt),Et=$t(gt),At=it?it.prototype:void 0,xt=At?At.valueOf:void 0;function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){this.__data__=new kt(t)}function Ot(t,e,r){var n=t[e];tt.call(t,e)&&Dt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Tt(t,e){for(var r=t.length;r--;)if(Dt(t[r][0],e))return r;return-1}function Ut(t,e,r,n,i,l,m){var T;if(n&&(T=l?n(t,i,l,m):n(t)),void 0!==T)return T;if(!Jt(t))return t;var U=qt(t);if(U){if(T=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,T)}else{var L=Nt(t),R=L==f||L==u;if(Vt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(L==d||L==o||R&&!l){if(q(t))return l?t:{};if(T=function(t){return"function"!=typeof t.constructor||Ct(t)?{}:Jt(e=at(t))?st(e):{};var e}(R?{}:t),!e)return function(t,e){return Lt(t,Ft(t),e)}(t,function(t,e){return t&&Lt(e,Gt(e),t)}(T,t))}else{if(!j[L])return l?t:{};T=function(t,e,r,n){var i,o=t.constructor;switch(e){case v:return jt(t);case a:case s:return new o(+t);case w:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case _:case S:case E:case A:case x:case M:case k:case I:case B:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case c:return function(t,e,r){return D(e?r(H(t),!0):H(t),C,new t.constructor)}(t,n,r);case h:case y:return new o(t);case p:return function(t){var e=new t.constructor(t.source,O.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return function(t,e,r){return D(e?r(K(t),!0):K(t),$,new t.constructor)}(t,n,r);case g:return i=t,xt?Object(xt.call(i)):{}}}(t,L,Ut,e)}}m||(m=new Bt);var P=m.get(t);if(P)return P;if(m.set(t,T),!U)var F=r?function(t){return function(t,e,r){var n=e(t);return qt(t)?n:function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}(n,r(t))}(t,Gt,Ft)}(t):Gt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r););}(F||t,(function(i,o){F&&(i=t[o=i]),Ot(T,o,Ut(i,e,r,n,o,t,m))})),T}function jt(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}function Lt(t,e,r,n){r||(r={});for(var i=-1,o=e.length;++i<o;){var a=e[i],s=n?n(r[a],t[a],a,r,t):void 0;Ot(r,a,void 0===s?t[a]:s)}return r}function Rt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Jt(t)||(e=t,Y&&Y in e))&&(Kt(t)||q(t)?rt:T).test($t(t));var e}(r)?r:void 0}Mt.prototype.clear=function(){this.__data__=mt?mt(null):{}},Mt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Mt.prototype.get=function(t){var e=this.__data__;if(mt){var r=e[t];return r===n?void 0:r}return tt.call(e,t)?e[t]:void 0},Mt.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:tt.call(e,t)},Mt.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?n:e,this},kt.prototype.clear=function(){this.__data__=[]},kt.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0||(r==e.length-1?e.pop():ut.call(e,r,1),0))},kt.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},kt.prototype.has=function(t){return Tt(this.__data__,t)>-1},kt.prototype.set=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},It.prototype.clear=function(){this.__data__={hash:new Mt,map:new(pt||kt),string:new Mt}},It.prototype.delete=function(t){return Rt(this,t).delete(t)},It.prototype.get=function(t){return Rt(this,t).get(t)},It.prototype.has=function(t){return Rt(this,t).has(t)},It.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new kt},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new It(n)}return r.set(t,e),this};var Ft=ct?V(ct,Object):function(){return[]},Nt=function(t){return et.call(t)};function zt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Z)}function $t(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Dt(t,e){return t===e||t!=t&&e!=e}(lt&&Nt(new lt(new ArrayBuffer(1)))!=w||pt&&Nt(new pt)!=c||bt&&Nt(bt.resolve())!=l||yt&&Nt(new yt)!=b||gt&&Nt(new gt)!=m)&&(Nt=function(t){var e=et.call(t),r=e==d?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case vt:return w;case wt:return c;case _t:return l;case St:return b;case Et:return m}return e});var qt=Array.isArray;function Ht(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Kt(t)}var Vt=ht||function(){return!1};function Kt(t){var e=Jt(t)?et.call(t):"";return e==f||e==u}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Gt(t){return Ht(t)?function(t,e){var r=qt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Ht(t)}(t)&&tt.call(t,"callee")&&(!ft.call(t,"callee")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var a in t)!e&&!tt.call(t,a)||i&&("length"==a||zt(a,n))||r.push(a);return r}(t):function(t){if(!Ct(t))return dt(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Ut(t,!0,!0)}},9561:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},3022:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},4406:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,f=[],u=!1,c=-1;function h(){u&&s&&(u=!1,s.length?f=s.concat(f):c=-1,f.length&&d())}function d(){if(!u){var t=a(h);u=!0;for(var e=f.length;e;){for(s=f,f=[];++c<e;)s&&s[c].run();c=-1,e=f.length}s=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new l(t,e)),1!==f.length||u||a(d)},l.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},7834:(t,e,r)=>{var n=r(8834),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},2179:(t,e,r)=>{t.exports=r(8224)},8224:(t,e,r)=>{!function(){var e={};if(e.async=r(625),"object"!=typeof e.async)throw new Error("Module async is required (https://github.com/caolan/async)");var n=e.async;function i(t,e){if(!e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function o(){var t={},e=Array.prototype.slice.call(arguments),r=null,n=null;return e.forEach((function(e){if(e&&e.constructor===Object)for(r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]]})),t}function a(){this.custom={},this.extend=function(t){return i(this.custom,t)},this.reset=function(){this.custom={}},this.remove=function(t){f.array(t)||(t=[t]),t.forEach((function(t){delete this.custom[t]}),this)}}function s(t,e){var r=["@"];if(this._schema=t,this._custom={},null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._custom["$"+n]=e[n]);this._getDepth=function(){return r.length},this._dumpStack=function(){return r.map((function(t){return t.replace(/^\[/g,"")})).join(".").replace(/\.\u001b\u001c\u001d\u001e/g,"[")},this._deeperObject=function(t){return r.push(/^[a-z$_][a-z0-9$_]*$/i.test(t)?t:'["'+t+'"]'),this},this._deeperArray=function(t){return r.push("["+t+"]"),this},this._back=function(){return r.pop(),this}}var f={function:function(t){return"function"==typeof t},string:function(t){return"string"==typeof t},number:function(t){return"number"==typeof t&&!isNaN(t)},integer:function(t){return"number"==typeof t&&t%1==0},NaN:function(t){return"number"==typeof t&&isNaN(t)},boolean:function(t){return"boolean"==typeof t},null:function(t){return null===t},date:function(t){return null!=t&&t instanceof Date},object:function(t){return"object"==typeof t&&t.constructor!==Array&&null!=t},array:function(t){return null!=t&&t.constructor===Array},any:function(){return!0}};function u(t,e){return"function"==typeof t?e instanceof t:f[t=t in f?t:"any"](e)}function c(t,e){for(var r=[],n=t.indexOf(e);-1!==n;)r.push(n),n=t.indexOf(e,n+1);return r}var h={void:/^$/,url:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)?(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,"date-time":/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z?|(-|\+)\d{2}:\d{2})$/,date:/^\d{4}-\d{2}-\d{2}$/,coolDateTime:/^\d{4}(-|\/)\d{2}(-|\/)\d{2}(T| )\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/,time:/^\d{2}\:\d{2}\:\d{2}$/,color:/^#([0-9a-f])+$/i,email:new RegExp("(?:[^\\W_](?:[\\w\\.\\+]+)@(?:localhost|(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:northwesternmutual|travelersinsurance|vermögensberatung|vermögensberater|americanexpress|kerryproperties|sandvikcoromant|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|construction|lplfinancial|scholarships|versicherung|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|university|vlaanderen|volkswagen|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|موريتانيا|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|السعودية|yokohama|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|католик|الجزائر|العليان|اتصالات|پاکستان|البحرين|كاثوليك|இந்தியா|yamaxun|youtube|zuerich|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|москва|онлайн|ファッション|भारतम्|ارامكو|امارات|الاردن|المغرب|ابوظبي|مليسيا|இலங்கை|فلسطين|yachts|yandex|zappos|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|ישראל|বাংলা|భారత్|भारोत|संगठन|ایران|بازار|بھارت|سودان|همراه|سورية|ഭാരതം|嘉里大酒店|yahoo|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|duck|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|ಭಾರತ|ଭାରତ|大众汽车|ভাৰত|ভারত|موقع|香格里拉|сайт|アマゾン|дети|ポイント|ලංකා|電訊盈科|クラウド|ભારત|भारत|عمان|بارت|ڀارت|عراق|شبكة|بيتك|组织机构|تونس|グーグル|ਭਾਰਤ|yoga|zara|zero|zone|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|कॉम|セール|คอม|我爱你|қаз|срб|бел|קום|淡马锡|орг|नेट|ストア|мкд|كوم|中文网|ком|укр|亚马逊|诺基亚|飞利浦|мон|عرب|ไทย|рус|ລາວ|みんな|天主教|مصر|قطر|հայ|新加坡|xxx|xyz|you|yun|zip|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|佛山|慈善|集团|在线|한국|点看|八卦|公益|公司|网站|移动|联通|бг|时尚|微博|삼성|商标|商店|商城|ею|新闻|家電|中信|中国|中國|娱乐|谷歌|购物|通販|网店|餐厅|网络|香港|食品|台湾|台灣|手机|澳門|닷컴|政府|გე|机构|健康|招聘|рф|大拿|ευ|ελ|世界|書籍|网址|닷넷|コム|游戏|企业|信息|嘉里|广东|政务|ye|yt|za|zm|zw))))"),numeric:/^[0-9]+$/,integer:/^\-?[0-9]+$/,decimal:/^\-?[0-9]*\.?[0-9]+$/,alpha:/^[a-z]+$/i,alphaNumeric:/^[a-z0-9]+$/i,alphaDash:/^[a-z0-9_-]+$/i,javascript:/^[a-z_\$][a-z0-9_\$]*$/i,upperString:/^[A-Z ]*$/,lowerString:/^[a-z ]*$/,v4uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/i},d={optional:function(t,e){!0!==("boolean"==typeof t.optional?t.optional:"true"===t.optional)&&void 0===e&&this.report("is missing and not optional",null,"optional")},type:function(t,e){if(void 0!==e&&("string"==typeof t.type||t.type instanceof Array||"function"==typeof t.type)){var r=f.array(t.type)?t.type:[t.type];r.some((function(t){return u(t,e)}))||(r=r.map((function(t){return"function"==typeof t?"an instance of "+t.name:t})),this.report("must be "+r.join(" or ")+", but is "+function(t){for(var e in f)if(u(e,t))return"any"===e||"object"===e&&t.constructor!==Object?"an instance of "+t.constructor.name:e}(e),null,"type"))}},uniqueness:function(t,e){if("string"==typeof t.uniqueness&&(t.uniqueness="true"===t.uniqueness),"boolean"==typeof t.uniqueness&&!1!==t.uniqueness&&(f.array(e)||"string"==typeof e))for(var r=[],n=0;n<e.length;n++)if(!(r.indexOf(e[n])>=0)){var i=c(e,e[n]);i.length>1&&(r.push(e[n]),this.report("has value ["+e[n]+"] more than once at indexes ["+i.join(", ")+"]",null,"uniqueness"))}},pattern:function(t,e){var r=t.pattern;if("string"==typeof e){var n=!1;f.array(r)||(r=[r]),r.forEach((function(t){"string"==typeof t&&t in h&&(t=h[t]),t instanceof RegExp&&t.test(e)&&(n=!0)})),n||this.report("must match ["+r.join(" or ")+'], but is equal to "'+e+'"',null,"pattern")}},validDate:function(t,e){"true"===String(t.validDate)&&e instanceof Date&&isNaN(e.getTime())&&this.report("must be a valid date",null,"validDate")},minLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.minLength);isNaN(r)||e.length<r&&this.report("must be longer than "+r+" elements, but it has "+e.length,null,"minLength")}},maxLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.maxLength);isNaN(r)||e.length>r&&this.report("must be shorter than "+r+" elements, but it has "+e.length,null,"maxLength")}},exactLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.exactLength);isNaN(r)||e.length!==r&&this.report("must have exactly "+r+" elements, but it have "+e.length,null,"exactLength")}},lt:function(t,e){var r=Number(t.lt);"number"!=typeof e||isNaN(r)||e>=r&&this.report("must be less than "+r+', but is equal to "'+e+'"',null,"lt")},lte:function(t,e){var r=Number(t.lte);"number"!=typeof e||isNaN(r)||e>r&&this.report("must be less than or equal to "+r+', but is equal to "'+e+'"',null,"lte")},gt:function(t,e){var r=Number(t.gt);"number"!=typeof e||isNaN(r)||e<=r&&this.report("must be greater than "+r+', but is equal to "'+e+'"',null,"gt")},gte:function(t,e){var r=Number(t.gte);"number"!=typeof e||isNaN(r)||e<r&&this.report("must be greater than or equal to "+r+', but is equal to "'+e+'"',null,"gte")},eq:function(t,e){if("number"==typeof e||"string"==typeof e||"boolean"==typeof e){var r=t.eq;if("number"==typeof r||"string"==typeof r||"boolean"==typeof r||f.array(r))if(f.array(r)){for(var n=0;n<r.length;n++)if(e===r[n])return;this.report("must be equal to ["+r.map((function(t){return'"'+t+'"'})).join(" or ")+'], but is equal to "'+e+'"',null,"eq")}else e!==r&&this.report('must be equal to "'+r+'", but is equal to "'+e+'"',null,"eq")}},ne:function(t,e){if("number"==typeof e||"string"==typeof e){var r=t.ne;if("number"==typeof r||"string"==typeof r||f.array(r))if(f.array(r)){for(var n=0;n<r.length;n++)if(e===r[n])return void this.report('must not be equal to "'+r[n]+'"',null,"ne")}else e===r&&this.report('must not be equal to "'+r+'"',null,"ne")}},someKeys:function(t,e){var r=t.someKeys;f.object(e)&&(r.some((function(t){return t in e}))||this.report("must have at least key "+r.map((function(t){return'"'+t+'"'})).join(" or "),null,"someKeys"))},strict:function(t,e){if("string"==typeof t.strict&&(t.strict="true"===t.strict),!0===t.strict&&f.object(e)&&f.object(t.properties)&&void 0===t.properties["*"]){var r=Object.keys(e).filter((function(e){return void 0===t.properties[e]}));if(r.length>0){var n="should not contains "+(r.length>1?"properties":"property")+" ["+r.map((function(t){return'"'+t+'"'})).join(", ")+"]";this.report(n,null,"strict")}}},exec:function(t,e,r){var n=this;if("function"==typeof r)return this.asyncExec(t,e,r);(f.array(t.exec)?t.exec:[t.exec]).forEach((function(r){"function"==typeof r&&r.call(n,t,e)}))},properties:function(t,e,r){if("function"==typeof r)return this.asyncProperties(t,e,r);if(t.properties instanceof Object&&e instanceof Object){var n,i=t.properties;if(null!=i["*"])for(n in e)n in i||(this._deeperObject(n),this._validate(i["*"],e[n]),this._back());for(n in i)"*"!==n&&(this._deeperObject(n),this._validate(i[n],e[n]),this._back())}},items:function(t,e,r){if("function"==typeof r)return this.asyncItems(t,e,r);if(t.items instanceof Object&&e instanceof Object){var n,i,o=t.items;if(f.array(o)&&f.array(e))for(n=0,i=o.length;n<i;n++)this._deeperArray(n),this._validate(o[n],e[n]),this._back();else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(this._deeperArray(a),this._validate(o,e[a]),this._back())}}},l={asyncExec:function(t,e,r){var i=this;n.eachSeries(f.array(t.exec)?t.exec:[t.exec],(function(r,o){if("function"==typeof r){if(r.length>2)return r.call(i,t,e,o);r.call(i,t,e)}n.nextTick(o)}),r)},asyncProperties:function(t,e,r){if(!(t.properties instanceof Object&&f.object(e)))return r();var i=this,o=t.properties;n.series([function(t){if(null==o["*"])return t();n.eachSeries(Object.keys(e),(function(t,r){if(t in o)return n.nextTick(r);i._deeperObject(t),i._asyncValidate(o["*"],e[t],(function(t){i._back(),r(t)}))}),t)},function(t){n.eachSeries(Object.keys(o),(function(t,r){if("*"===t)return n.nextTick(r);i._deeperObject(t),i._asyncValidate(o[t],e[t],(function(t){i._back(),r(t)}))}),t)}],r)},asyncItems:function(t,e,r){if(!(t.items instanceof Object&&e instanceof Object))return r();var i=this,o=t.items;f.array(o)&&f.array(e)?n.timesSeries(o.length,(function(t,r){i._deeperArray(t),i._asyncValidate(o[t],e[t],(function(t,e){i._back(),r(t,e)})),i._back()}),r):n.eachSeries(Object.keys(e),(function(t,r){i._deeperArray(t),i._asyncValidate(o,e[t],(function(t,e){i._back(),r(t,e)}))}),r)}};function p(t,e){s.prototype.constructor.call(this,t,o(p.custom,e));var r=[];this._basicFields=Object.keys(d),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(t,e,n){var i={code:e||this.userCode||null,reason:n||"unknown",message:this.userError||t||"is invalid",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};return r.push(i),this},this.result=function(){return{error:r,valid:0===r.length,format:function(){return!0===this.valid?"Candidate is valid":this.error.map((function(t){return"Property "+t.property+": "+t.message})).join("\n")}}}}i(p.prototype,d),i(p.prototype,l),i(p,new a),p.prototype.validate=function(t,e){if(this.origin=t,"function"==typeof e){var r=this;return n.nextTick((function(){r._asyncValidate(r._schema,t,(function(t){r.origin=null,e(t,r.result())}))}))}return this._validate(this._schema,t).result()},p.prototype._validate=function(t,e,r){return this.userCode=t.code||null,this.userError=t.error||null,this.userAlias=t.alias||null,this._basicFields.forEach((function(r){!(r in t)&&"optional"!==r||"function"!=typeof this[r]||this[r](t,e)}),this),this._customFields.forEach((function(r){r in t&&"function"==typeof this._custom[r]&&this._custom[r].call(this,t,e)}),this),this},p.prototype._asyncValidate=function(t,e,r){var i=this;this.userCode=t.code||null,this.userError=t.error||null,this.userAlias=t.alias||null,n.series([function(r){n.eachSeries(Object.keys(d),(function(r,o){n.nextTick((function(){if((r in t||"optional"===r)&&"function"==typeof i[r]){if(i[r].length>2)return i[r](t,e,o);i[r](t,e)}o()}))}),r)},function(r){n.eachSeries(Object.keys(i._custom),(function(r,o){n.nextTick((function(){if(r in t&&"function"==typeof i._custom[r]){if(i._custom[r].length>2)return i._custom[r].call(i,t,e,o);i._custom[r].call(i,t,e)}o()}))}),r)}],r)};var b={number:function(t,e){var r;if("number"==typeof t)return t;if(""===t)return void 0!==e.def?e.def:null;if("string"==typeof t){if("number"==typeof(r=parseFloat(t.replace(/,/g,".").replace(/ /g,""))))return r}else if(t instanceof Date)return+t;return null},integer:function(t,e){var r;if("number"==typeof t&&t%1==0)return t;if(""===t)return void 0!==e.def?e.def:null;if("string"==typeof t){if("number"==typeof(r=parseInt(t.replace(/ /g,""),10)))return r}else{if("number"==typeof t)return parseInt(t,10);if("boolean"==typeof t)return t?1:0;if(t instanceof Date)return+t}return null},string:function(t,e){return"boolean"==typeof t||"number"==typeof t||t instanceof Date?t.toString():f.array(t)?e.items||e.properties?t:t.join(String(e.joinWith||",")):t instanceof Object?e.items||e.properties?t:JSON.stringify(t):"string"==typeof t&&t.length?t:null},date:function(t,e){if(t instanceof Date)return t;var r=new Date(t);return isNaN(r.getTime())?null:r},boolean:function(t,e){return void 0===t?null:("string"!=typeof t||"false"!==t.toLowerCase())&&!!t},object:function(t,e){if("string"!=typeof t||f.object(t))return t;try{return JSON.parse(t)}catch(t){return null}},array:function(t,e){if(f.array(t))return t;if(void 0===t)return null;if("string"==typeof t){if("["===t.substring(0,1)&&"]"===t.slice(-1))try{return JSON.parse(t)}catch(t){return null}return t.split(String(e.splitWith||","))}return f.array(t)?null:[t]}},y={upper:function(t){return t.toUpperCase()},lower:function(t){return t.toLowerCase()},title:function(t){return t.replace(/\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},capitalize:function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()},ucfirst:function(t){return t.charAt(0).toUpperCase()+t.substr(1)},trim:function(t){return t.trim()}},g={strict:function(t,e){return"string"==typeof t.strict&&(t.strict="true"===t.strict),!0!==t.strict?e:f.object(t.properties)&&f.object(e)?(Object.keys(e).forEach((function(r){r in t.properties||delete e[r]})),e):e},optional:function(t,e){return!0===("boolean"==typeof t.optional?t.optional:"false"!==t.optional)||void 0!==e?e:(this.report(),t.def===Date?new Date:t.def)},type:function(t,e){if("string"!=typeof t.type||"function"!=typeof b[t.type])return e;var r,n="boolean"!=typeof t.optional||t.optional;return"function"==typeof b[t.type]?(null===(r=b[t.type](e,t))&&!n||!r&&isNaN(r)||null===r&&"string"===t.type)&&(r=t.def):n||(r=t.def),(null!=r||void 0!==t.def&&t.def===r)&&r!==e?(this.report(),r):e},rules:function(t,e){var r=t.rules;if("string"!=typeof e||"string"!=typeof r&&!f.array(r))return e;var n=!1;return(f.array(r)?r:[r]).forEach((function(t){"function"==typeof y[t]&&(e=y[t](e),n=!0)})),n&&this.report(),e},min:function(t,e){var r=Number(e);if(isNaN(r))return e;var n=Number(t.min);return isNaN(n)?e:r<n?(this.report(),n):e},max:function(t,e){var r=Number(e);if(isNaN(r))return e;var n=Number(t.max);return isNaN(n)?e:r>n?(this.report(),n):e},minLength:function(t,e){var r=Number(t.minLength);if("string"!=typeof e||isNaN(r)||r<0)return e;var n="",i=r-e.length;if(i>0){for(var o=0;o<i;o++)n+="-";return this.report(),e+n}return e},maxLength:function(t,e){var r=Number(t.maxLength);return"string"!=typeof e||isNaN(r)||r<0?e:e.length>r?(this.report(),e.slice(0,r)):e},properties:function(t,e,r){if("function"==typeof r)return this.asyncProperties(t,e,r);if(!e||"object"!=typeof e)return e;var n,i,o=t.properties;if(void 0!==o["*"])for(i in e)i in o||(this._deeperObject(i),void 0!==(n=this._sanitize(t.properties["*"],e[i]))&&(e[i]=n),this._back());for(i in t.properties)"*"!==i&&(this._deeperObject(i),void 0!==(n=this._sanitize(t.properties[i],e[i]))&&(e[i]=n),this._back());return e},items:function(t,e,r){if("function"==typeof r)return this.asyncItems(t,e,r);if(!(t.items instanceof Object&&e instanceof Object))return e;var n;if(f.array(t.items)&&f.array(e)){var i=t.items.length<e.length?t.items.length:e.length;for(n=0;n<i;n++)this._deeperArray(n),e[n]=this._sanitize(t.items[n],e[n]),this._back()}else for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._deeperArray(n),e[n]=this._sanitize(t.items,e[n]),this._back());return e},exec:function(t,e,r){return"function"==typeof r?this.asyncExec(t,e,r):((f.array(t.exec)?t.exec:[t.exec]).forEach((function(r){"function"==typeof r&&(e=r.call(this,t,e))}),this),e)}},m={asyncExec:function(t,e,r){var i=this,o=f.array(t.exec)?t.exec:[t.exec];n.eachSeries(o,(function(r,n){if("function"==typeof r){if(r.length>2)return r.call(i,t,e,(function(t,r){if(t)return n(t);e=r,n()}));e=r.call(i,t,e)}n()}),(function(t){r(t,e)}))},asyncProperties:function(t,e,r){if(!e||"object"!=typeof e)return r(null,e);var i=this,o=t.properties;n.series([function(t){if(null==o["*"])return t();var r=o["*"];n.eachSeries(Object.keys(e),(function(t,n){if(t in o)return n();i._deeperObject(t),i._asyncSanitize(r,e[t],(function(r,o){void 0!==o&&(e[t]=o),i._back(),n()}))}),t)},function(t){n.eachSeries(Object.keys(o),(function(t,r){if("*"===t)return r();i._deeperObject(t),i._asyncSanitize(o[t],e[t],(function(n,o){if(n)return r(n);void 0!==o&&(e[t]=o),i._back(),r()}))}),t)}],(function(t){return r(t,e)}))},asyncItems:function(t,e,r){if(!(t.items instanceof Object&&e instanceof Object))return r(null,e);var i=this,o=t.items;if(f.array(o)&&f.array(e)){var a=o.length<e.length?o.length:e.length;n.timesSeries(a,(function(t,r){i._deeperArray(t),i._asyncSanitize(o[t],e[t],(function(n,o){if(n)return r(n);e[t]=o,i._back(),r()}))}),(function(t){r(t,e)}))}else n.eachSeries(Object.keys(e),(function(t,r){i._deeperArray(t),i._asyncSanitize(o,e[t],(function(n,o){if(n)return r();e[t]=o,i._back(),r()}))}),(function(t){r(t,e)}));return e}};function v(t,e){s.prototype.constructor.call(this,t,o(v.custom,e));var r=[];this._basicFields=Object.keys(g),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(t){var e={message:t||"was sanitized",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};r.some((function(t){return t.property===e.property}))||r.push(e)},this.result=function(t){return{data:t,reporting:r,format:function(){return this.reporting.map((function(t){return"Property "+t.property+" "+t.message})).join("\n")}}}}i(v.prototype,g),i(v.prototype,m),i(v,new a),v.prototype.sanitize=function(t,e){if(this.origin=t,"function"==typeof e){var r=this;return this._asyncSanitize(this._schema,t,(function(t,n){r.origin=null,e(t,r.result(n))}))}var n=this._sanitize(this._schema,t);return this.origin=null,this.result(n)},v.prototype._sanitize=function(t,e){return this.userAlias=t.alias||null,this._basicFields.forEach((function(r){!(r in t)&&"optional"!==r||"function"!=typeof this[r]||(e=this[r](t,e))}),this),this._customFields.forEach((function(r){r in t&&"function"==typeof this._custom[r]&&(e=this._custom[r].call(this,t,e))}),this),e},v.prototype._asyncSanitize=function(t,e,r){var i=this;this.userAlias=t.alias||null,n.waterfall([function(r){n.reduce(i._basicFields,e,(function(e,r,o){n.nextTick((function(){if((r in t||"optional"===r)&&"function"==typeof i[r]){if(i[r].length>2)return i[r](t,e,o);e=i[r](t,e)}o(null,e)}))}),r)},function(e,r){n.reduce(i._customFields,e,(function(e,r,o){n.nextTick((function(){if(r in t&&"function"==typeof i._custom[r]){if(i._custom[r].length>2)return i._custom[r].call(i,t,e,o);e=i._custom[r].call(i,t,e)}o(null,e)}))}),r)}],r)};var w=2147483647,_={int:function(t,e){return t+(0|Math.random()*(e-t+1))},float:function(t,e){return Math.random()*(e-t)+t},bool:function(){return Math.random()>.5},char:function(t,e){return String.fromCharCode(this.int(t,e))},fromList:function(t){return t[this.int(0,t.length-1)]}},S={"date-time":function(){return(new Date).toISOString()},date:function(){return(new Date).toISOString().replace(/T.*$/,"")},time:function(){return(new Date).toLocaleTimeString({},{hour12:!1})},color:function(t,e){var r="#";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("0123456789abcdefABCDEF");return r},numeric:function(){return""+_.int(0,w)},integer:function(){return!0===_.bool()?"-"+this.numeric():this.numeric()},decimal:function(){return this.integer()+"."+this.numeric()},alpha:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");return r},alphaNumeric:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");return r},alphaDash:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("_-abcdefghijklmnopqrstuvwxyz_-ABCDEFGHIJKLMNOPQRSTUVWXYZ_-0123456789_-");return r},javascript:function(t,e){for(var r=_.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$"),n=0,i=_.int(t,e-1);n<i;n++)r+=_.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789_$");return r}};function E(t){var e=-2147483648,r=w;return null!=t.gte?e=t.gte:null!=t.gt&&(e=t.gt+1),null!=t.lte?r=t.lte:null!=t.lt&&(r=t.lt-1),{min:e,max:r}}var A={string:function(t){if(null!=t.eq)return t.eq;var e="",r=null!=t.minLength?t.minLength:0,n=null!=t.maxLength?t.maxLength:32;if("string"==typeof t.pattern&&"function"==typeof S[t.pattern])return S[t.pattern](r,n);for(var i=null!=t.exactLength?t.exactLength:_.int(r,n),o=0;o<i;o++)e+=_.char(32,126);return e},number:function(t){if(null!=t.eq)return t.eq;var e=E(t),r=_.float(e.min,e.max);if(null!=t.ne)for(var n=f.array(t.ne)?t.ne:[t.ne];-1!==n.indexOf(r);)r=_.float(e.min,e.max);return r},integer:function(t){if(null!=t.eq)return t.eq;var e=E(t),r=_.int(e.min,e.max);if(null!=t.ne)for(var n=f.array(t.ne)?t.ne:[t.ne];-1!==n.indexOf(r);)r=_.int(e.min,e.max);return r},boolean:function(t){return null!=t.eq?t.eq:_.bool()},null:function(t){return null},date:function(t){return null!=t.eq?t.eq:new Date},object:function(t){var e={},r=t.properties||{};for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(!0===r[n].optional&&!0===_.bool())continue;if("*"!==n)e[n]=this.generate(r[n]);else for(var i="__random_key_",o=i+0,a=_.int(1,9),s=1;s<=a;s++)o in r||(e[o]=this.generate(r[n])),o=i+s}return e},array:function(t){var e,r,n,i,o=t.items||{},a=null!=t.minLength?t.minLength:0,s=null!=t.maxLength?t.maxLength:16;if(f.array(o))for(n=o.length,null!=t.exactLength?n=t.exactLength:n<a?n=a:n>s&&(n=s),r=new Array(n),e=null,i=0;i<n;i++)e=o[i].type||"any",f.array(e)&&(e=e[_.int(0,e.length-1)]),r[i]=this[e](o[i]);else for(n=null!=t.exactLength?t.exactLength:_.int(a,s),r=new Array(n),e=o.type||"any",f.array(e)&&(e=e[_.int(0,e.length-1)]),i=0;i<n;i++)r[i]=this[e](o);return r},any:function(t){var e=Object.keys(A);return this[e[_.int(0,e.length-2)]](t)}};function x(){}i(x.prototype,A);var M=null;x.instance=function(){return M instanceof x||(M=new x),M},x.prototype.generate=function(t){var e=t.type||"any";return f.array(e)&&(e=e[_.int(0,e.length-1)]),this[e](t)};var k={};t.exports?t.exports=k:window.SchemaInspector=k,k.newSanitization=function(t,e){return new v(t,e)},k.newValidation=function(t,e){return new p(t,e)},k.Validation=p,k.Sanitization=v,k.sanitize=function(t,e,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new v(t,r).sanitize(e,n)},k.validate=function(t,e,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new p(t,r).validate(e,n)},k.generate=function(t,e){if("number"==typeof e){for(var r=new Array(e),n=0;n<e;n++)r[n]=x.instance().generate(t);return r}return x.instance().generate(t)}}()},3327:(t,e,r)=>{var n=r(7834).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var f=a%i,u=Math.min(o-s,i-f),c=0;c<u;c++)r[f+c]=t[s+c];s+=u,(a+=u)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9065:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(8820),n.sha1=r(7885),n.sha224=r(8321),n.sha256=r(4424),n.sha384=r(213),n.sha512=r(5596)},8820:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=n)<<5|e>>>27)+c(l,i,o,s)+f+r[d]+a[l];f=s,s=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=f},7885:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=u(n)+h(p,i,o,s)+f+r[l]+a[p]|0;f=s,s=o,o=c(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=f},8321:(t,e,r)=>{var n=r(1285),i=r(4424),o=r(3327),a=r(7834).Buffer,s=new Array(64);function f(){this.init(),this._w=s,o.call(this,64,56)}n(f,i),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=f},4424:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[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],s=new Array(64);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(f,i),f.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var m=0;m<64;++m){var v=y+d(f)+u(f,p,b)+a[m]+r[m]|0,w=h(n)+c(n,i,o)|0;y=b,b=p,p=f,f=s+v|0,s=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},f.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=f},213:(t,e,r)=>{var n=r(1285),i=r(5596),o=r(3327),a=r(7834).Buffer,s=new Array(160);function f(){this.init(),this._w=s,o.call(this,128,112)}n(f,i),f.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},f.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=f},5596:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[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],s=new Array(160);function f(){this.init(),this._w=s,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0<e>>>0?1:0}n(f,i),f.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},f.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,f=0|this._fh,m=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,A=0|this._el,x=0|this._fl,M=0|this._gl,k=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var B=e[I-30],O=e[I-30+1],T=l(B,O),U=p(O,B),j=b(B=e[I-4],O=e[I-4+1]),L=y(O,B),R=e[I-14],P=e[I-14+1],F=e[I-32],N=e[I-32+1],z=U+P|0,C=T+R+g(z,U)|0;C=(C=C+j+g(z=z+L|0,L)|0)+F+g(z=z+N|0,N)|0,e[I]=C,e[I+1]=z}for(var $=0;$<160;$+=2){C=e[$],z=e[$+1];var D=c(r,n,i),q=c(w,_,S),H=h(r,w),V=h(w,r),K=d(s,A),J=d(A,s),G=a[$],W=a[$+1],Z=u(s,f,m),X=u(A,x,M),Y=k+J|0,Q=v+K+g(Y,k)|0;Q=(Q=(Q=Q+Z+g(Y=Y+X|0,X)|0)+G+g(Y=Y+W|0,W)|0)+C+g(Y=Y+z|0,z)|0;var tt=V+q|0,et=H+D+g(tt,V)|0;v=m,k=M,m=f,M=x,f=s,x=A,s=o+Q+g(A=E+Y|0,E)|0,o=i,E=S,i=n,S=_,n=r,_=w,r=Q+et+g(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+x|0,this._gl=this._gl+M|0,this._hl=this._hl+k|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,A)|0,this._fh=this._fh+f+g(this._fl,x)|0,this._gh=this._gh+m+g(this._gl,M)|0,this._hh=this._hh+v+g(this._hl,k)|0},f.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=f},2377:(t,e,r)=>{"use strict";t.exports=r(8613)},8613:(t,e)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function i(t,e){return void 0===e&&(e="{$origin}\n{$ttl}\n\n; SOA Record\n{name} {ttl} IN SOA {mname}{rname}(\n{serial} ;serial\n{refresh} ;refresh\n{retry} ;retry\n{expire} ;expire\n{minimum} ;minimum ttl\n)\n\n; NS Records\n{ns}\n\n; MX Records\n{mx}\n\n; A Records\n{a}\n\n; AAAA Records\n{aaaa}\n\n; CNAME Records\n{cname}\n\n; PTR Records\n{ptr}\n\n; TXT Records\n{txt}\n\n; SRV Records\n{srv}\n\n; SPF Records\n{spf}\n\n; URI Records\n{uri}\n"),e=function(t,e){var r="";return void 0!==t&&(r+="$ORIGIN "+t),e.replace("{$origin}",r)}(t.$origin,e),e=function(t,e){var r="";return void 0!==t&&(r+="$TTL "+t),e.replace("{$ttl}",r)}(t.$ttl,e),e=function(t,e){var r=e;if(void 0!==t)for(var n in t.name=t.name||"@",t.ttl=t.ttl||"",t)r=r.replace("{"+n+"}",t[n]+"\t");return r}(t.soa,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tNS\t"+a.host+"\n"}return e.replace("{ns}",r)}(t.ns,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tA\t"+a.ip+"\n"}return e.replace("{a}",r)}(t.a,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tAAAA\t"+a.ip+"\n"}return e.replace("{aaaa}",r)}(t.aaaa,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tCNAME\t"+a.alias+"\n"}return e.replace("{cname}",r)}(t.cname,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tMX\t"+a.preference+"\t"+a.host+"\n"}return e.replace("{mx}",r)}(t.mx,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tPTR\t"+a.host+"\n"}return e.replace("{ptr}",r)}(t.ptr,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tTXT\t";var s=a.txt;"string"==typeof s?r+='"'+s+'"':s instanceof Array&&(r+=s.map((function(t){return'"'+t+'"'})).join(" ")),r+="\n"}return e.replace("{txt}",r)}(t.txt,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tSRV\t"+a.priority+"\t",r+=a.weight+"\t",r+=a.port+"\t",r+=a.target+"\n"}return e.replace("{srv}",r)}(t.srv,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tSPF\t"+a.data+"\n"}return e.replace("{spf}",r)}(t.spf,e),(e=function(t,e){e=(e=e.replace("{zone}",t.$origin||!!t.soa&&t.soa.name||"")).replace("{datetime}",(new Date).toISOString());var r=Math.round(Date.now()/1e3);return e.replace("{time}",""+r)}(t,e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tURI\t"+a.priority+"\t",r+=a.weight+"\t",r+='"'+a.target+'"\n'}return e.replace("{uri}",r)}(t.uri,e))).replace(/\n{2,}/gim,"\n\n")}function o(t){return function(t){for(var e,r={},i=n(t.split("\n"));!(e=i()).done;){var o=e.value;if(o&&o.trim()){var g=o.toUpperCase();/\s+TXT\s+/.test(g)?(r.txt=r.txt||[],r.txt.push(d(o))):0===g.indexOf("$ORIGIN")?r.$origin=o.split(/\s+/g)[1]:0===g.indexOf("$TTL")?r.$ttl=parseInt(o.split(/\s+/g)[1],10):/\s+SOA\s+/.test(g)?r.soa=a(o):/\s+NS\s+/.test(g)?(r.ns=r.ns||[],r.ns.push(s(o))):/\s+A\s+/.test(g)?(r.a=r.a||[],r.a.push(f(o,r.a))):/\s+AAAA\s+/.test(g)?(r.aaaa=r.aaaa||[],r.aaaa.push(u(o))):/\s+CNAME\s+/.test(g)?(r.cname=r.cname||[],r.cname.push(c(o))):/\s+MX\s+/.test(g)?(r.mx=r.mx||[],r.mx.push(h(o))):/\s+PTR\s+/.test(g)?(r.ptr=r.ptr||[],r.ptr.push(l(o,r.ptr,r.$origin))):/\s+SRV\s+/.test(g)?(r.srv=r.srv||[],r.srv.push(p(o))):/\s+SPF\s+/.test(g)?(r.spf=r.spf||[],r.spf.push(b(o))):/\s+URI\s+/.test(g)&&(r.uri=r.uri||[],r.uri.push(y(o)))}}return r}(t=function(t){for(var e=[],r=/\([\s\S]*?\)/gim,n=r.exec(t);null!==n;){var i=n[0].replace(/\s+/gm," ");e.push({match:n,replacement:i}),n=r.exec(t)}for(var o=t.split(""),a=0,s=e;a<s.length;a++){var f=s[a],u=f.match;o.splice(u.index,u[0].length,f.replacement)}return o.join("").replace(/\(|\)/gim," ")}(t=function(t){return t.replace(/(^|[^\\]);.*/g,(function(t,e){return e||""}))}(t)))}function a(t){var e={},r=t.trim().split(/\s+/g),n=r.length;return e.name=r[0],e.minimum=parseInt(r[n-1],10),e.expire=parseInt(r[n-2],10),e.retry=parseInt(r[n-3],10),e.refresh=parseInt(r[n-4],10),e.serial=parseInt(r[n-5],10),e.rname=r[n-6],e.mname=r[n-7],isNaN(r[1])||(e.ttl=parseInt(r[1],10)),e}function s(t){var e=t.trim().split(/\s+/g),r={name:e[0],host:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function f(t,e){var r=t.trim().split(/\s+/g),n=t.trim().toUpperCase().split(/\s+/g),i={name:r[0],ip:r[r.length-1]};return 0===n.lastIndexOf("A")&&(i.name=e.length?e[e.length-1].name:"@"),isNaN(r[1])||(i.ttl=parseInt(r[1],10)),i}function u(t){var e=t.trim().split(/\s+/g),r={name:e[0],ip:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function c(t){var e=t.trim().split(/\s+/g),r={name:e[0],alias:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function h(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],preference:parseInt(e[r-2],10),host:e[r-1]};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}function d(t){var e=t.trim().match(/[^\s"']+|"[^"]*"|'[^']*'/g);if(!e)throw new Error("Failure to tokenize TXT record");var r,n=e.length,i=e.indexOf("TXT");function o(t){return t.indexOf('"')>-1&&(t=t.split('"')[1]),t}r=n-i-1>1?[].concat(e.slice(i+1).map(o)):o(e[n-1]);var a={name:e[0],txt:r};return isNaN(e[1])||(a.ttl=parseInt(e[1],10)),a}function l(t,e,r){var n=t.trim().split(/\s+/g);0===t.trim().toUpperCase().split(/\s+/g).lastIndexOf("PTR")&&e[e.length-1]&&n.unshift(e[e.length-1].name);var i={name:n[0],fullname:n[0]+"."+r,host:n[n.length-1]};return isNaN(n[1])||(i.ttl=parseInt(n[1],10)),i}function p(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],target:e[r-1],priority:parseInt(e[r-4],10),weight:parseInt(e[r-3],10),port:parseInt(e[r-2],10)};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}function b(t){for(var e=t.trim().split(/\s+/g),r={name:e[0],data:""},n=e.length;n-- >4;)r.data=e[n]+" "+r.data.trim();return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function y(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],target:e[r-1].replace(/"/g,""),priority:parseInt(e[r-3],10),weight:parseInt(e[r-2],10)};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}(function(){var t=function(t){this.jsonZoneFile="object"==typeof t?JSON.parse(JSON.stringify(t)):"string"==typeof t?o(t):void 0}.prototype;t.toJSON=function(){return this.jsonZoneFile},t.toString=function(){return i(this.toJSON())}})(),e.makeZoneFile=i,e.parseZoneFile=o},9314:()=>{},8087:()=>{},9096:()=>{},488:()=>{},1812:()=>{},763:t=>{"use strict";t.exports={i8:"6.5.4"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.r(n),r.d(n,{BLOCKSTACK_GAIA_HUB_LABEL:()=>Qe,GaiaHubConfig:()=>t.GaiaHubConfig,Storage:()=>sr,connectToGaiaHub:()=>ir,deleteFromGaiaHub:()=>er,getBucketUrl:()=>or,getFullReadUrl:()=>rr,getUserAppFileUrl:()=>fr,uploadToGaiaHub:()=>tr});var t={};r.r(t),r.d(t,{Ne:()=>Qe,cc:()=>ir,gZ:()=>er,CC:()=>ar,JV:()=>or,J$:()=>rr,d_:()=>tr});var e=r(7474);const i=["debug","info","warn","error","none"],o={},a={};for(let t=0;t<i.length;t++){const e=i[t];o[e]=t,a[t]=e}class s{static error(t){this.shouldLog("error")&&console.error(this.logMessage("error",t))}static warn(t){this.shouldLog("warn")&&console.warn(this.logMessage("warn",t))}static info(t){this.shouldLog("info")&&console.log(this.logMessage("info",t))}static debug(t){this.shouldLog("debug")&&console.log(this.logMessage("debug",t))}static logMessage(t,e){return`[${t.toUpperCase()}] ${e}`}static shouldLog(t){return o.debug<=o[t]}}var f=r(8834),u=r(8834).Buffer;const c=void 0!==u?u:f.Buffer;function h(t){return Number.isFinite(t)?Math.floor(1024*t*1024):0}function d(){let t=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))}function l(t,{throwIfUnavailable:e,usageDesc:n,returnEmptyObject:i}={}){let o;try{if(o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("Unexpected runtime environment - no supported global scope (`window`, `self`, `global`) available")}(),o){const e=o[t];if(e)return e}}catch(e){s.error(`Error getting object '${t}' from global scope '${o}': ${e}`)}if(e){const e=function(t,e,r){return r?`Use of '${r}' requires \`${e}\` which is unavailable on the '${t}' object within the currently executing environment.`:`\`${e}\` is unavailable on the '${t}' object within the currently executing environment.`}(o,t.toString(),n);throw s.error(e),new Error(e)}if(i)return{}}const p=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function b(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=p[t[r]];return e}"object"==typeof self&&"crypto"in self&&self.crypto;const y=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),g=(t,e)=>t<<32-e|t>>>e;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function m(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got "+typeof t);return(new TextEncoder).encode(t)}(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}function v(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0"))),(()=>{const t="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);try{if(t){const{setImmediate:e}=t("timers")}}catch(t){}})();class w{clone(){return this._cloneInto()}}class _ extends w{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");v(t.outputLen),v(t.blockLen)}(t);const r=m(e);if(this.iHash=t.create(),!(this.iHash instanceof w))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(t),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return(t=t).finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=a,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const S=(t,e,r)=>new _(t,e).update(r).digest();S.create=(t,e)=>new _(t,e);class E extends w{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=y(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");const{view:e,buffer:r,blockLen:n,finished:i}=this;if(i)throw new Error("digest() was already called");const o=(t=m(t)).length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a!==n)r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=y(t);for(;n<=o-i;i+=n)this.process(e,i)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),f=n?4:0,u=n?0:4;t.setUint32(e+f,a,n),t.setUint32(e+u,s,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const a=y(t);this.get().forEach(((t,e)=>a.setUint32(4*e,t,i)))}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return t.length=n,t.pos=a,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}const A=(t,e,r)=>t&e^t&r^e&r,x=new Uint32Array([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]),M=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),k=new Uint32Array(64);class I extends E{constructor(){super(64,32,8,!1),this.A=0|M[0],this.B=0|M[1],this.C=0|M[2],this.D=0|M[3],this.E=0|M[4],this.F=0|M[5],this.G=0|M[6],this.H=0|M[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[t,e,r,n,i,o,a,s]}set(t,e,r,n,i,o,a,s){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(t,e){for(let r=0;r<16;r++,e+=4)k[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=k[t-15],r=k[t-2],n=g(e,7)^g(e,18)^e>>>3,i=g(r,17)^g(r,19)^r>>>10;k[t]=i+k[t-7]+n+k[t-16]|0}let{A:r,B:n,C:i,D:o,E:a,F:s,G:f,H:u}=this;for(let t=0;t<64;t++){const e=u+(g(a,6)^g(a,11)^g(a,25))+((c=a)&s^~c&f)+x[t]+k[t]|0,h=(g(r,2)^g(r,13)^g(r,22))+A(r,n,i)|0;u=f,f=s,s=a,a=o+e|0,o=i,i=n,n=r,r=e+h|0}var c;r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(r,n,i,o,a,s,f,u)}roundClean(){k.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const B=function(t){const e=e=>t().update(m(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}((()=>new I));var O=r(9314);const T=BigInt(0),U=BigInt(1),j=BigInt(2),L=BigInt(3),R=BigInt(8),P=j**BigInt(256),F={a:T,b:BigInt(7),P:P-j**BigInt(32)-BigInt(977),n:P-BigInt("432420386565659656852420866394968145599"),h:U,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function N(t){const{a:e,b:r}=F,n=nt(t*t),i=nt(n*t);return nt(i+e*t+r)}const z=F.a===T;class C{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof D))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new C(t.x,t.y,U)}static toAffineBatch(t){const e=function(t,e=F.P){const r=new Array(t.length),n=ot(t.reduce(((t,n,i)=>n===T?t:(r[i]=t,nt(t*n,e))),U),e);return t.reduceRight(((t,n,i)=>n===T?t:(r[i]=nt(t*r[i],e),nt(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return C.toAffineBatch(t).map(C.fromAffine)}equals(t){if(!(t instanceof C))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:o,z:a}=t,s=nt(n**j),f=nt(a**j),u=nt(e*f),c=nt(i*s),h=nt(nt(r*a)*f),d=nt(nt(o*n)*s);return u===c&&h===d}negate(){return new C(this.x,nt(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=nt(t**j),i=nt(e**j),o=nt(i**j),a=nt(j*(nt((t+i)**j)-n-o)),s=nt(L*n),f=nt(s**j),u=nt(f-j*a),c=nt(s*(a-u)-R*o),h=nt(j*e*r);return new C(u,c,h)}add(t){if(!(t instanceof C))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:o,z:a}=t;if(i===T||o===T)return this;if(e===T||r===T)return t;const s=nt(n**j),f=nt(a**j),u=nt(e*f),c=nt(i*s),h=nt(nt(r*a)*f),d=nt(nt(o*n)*s),l=nt(c-u),p=nt(d-h);if(l===T)return p===T?this.double():C.ZERO;const b=nt(l**j),y=nt(l*b),g=nt(u*b),m=nt(p**j-y-j*g),v=nt(p*(g-m)-h*y),w=nt(n*a*l);return new C(m,v,w)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){let e=rt(t);C.BASE;const r=C.ZERO;if(e===T)return r;if(e===U)return this;if(!z){let t=r,n=this;for(;e>T;)e&U&&(t=t.add(n)),n=n.double(),e>>=U;return t}let{k1neg:n,k1:i,k2neg:o,k2:a}=ft(e),s=r,f=r,u=this;for(;i>T||a>T;)i&U&&(s=s.add(u)),a&U&&(f=f.add(u)),u=u.double(),i>>=U,a>>=U;return n&&(s=s.negate()),o&&(f=f.negate()),f=new C(nt(f.x*F.beta),f.y,f.z),s.add(f)}precomputeWindow(t){const e=z?128/t+1:256/t+1,r=[];let n=this,i=n;for(let o=0;o<e;o++){i=n,r.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(t,e){!e&&this.equals(C.BASE)&&(e=D.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&$.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=C.normalizeZ(n),$.set(e,n)));let i=C.ZERO,o=C.ZERO;const a=1+(z?128/r:256/r),s=2**(r-1),f=BigInt(2**r-1),u=2**r,c=BigInt(r);for(let e=0;e<a;e++){const r=e*s;let a=Number(t&f);if(t>>=c,a>s&&(a-=u,t+=U),0===a){let t=n[r];e%2&&(t=t.negate()),o=o.add(t)}else{let t=n[r+Math.abs(a)-1];a<0&&(t=t.negate()),i=i.add(t)}}return{p:i,f:o}}multiply(t,e){let r,n,i=rt(t);if(z){const{k1neg:t,k1:o,k2neg:a,k2:s}=ft(i);let{p:f,f:u}=this.wNAF(o,e),{p:c,f:h}=this.wNAF(s,e);t&&(f=f.negate()),a&&(c=c.negate()),c=new C(nt(c.x*F.beta),c.y,c.z),r=f.add(c),n=u.add(h)}else{const{p:t,f:o}=this.wNAF(i,e);r=t,n=o}return C.normalizeZ([r,n])[0]}toAffine(t=ot(this.z)){const{x:e,y:r,z:n}=this,i=t,o=nt(i*i),a=nt(o*i),s=nt(e*o),f=nt(r*a);if(nt(n*i)!==U)throw new Error("invZ was invalid");return new D(s,f)}}C.BASE=new C(F.Gx,F.Gy,U),C.ZERO=new C(T,U,T);const $=new WeakMap;class D{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,$.delete(this)}static fromCompressedHex(t){const e=32===t.length,r=tt(e?t:t.subarray(1));if(!dt(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=F,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),f=t*t*t%e,u=f*f*t%e,c=it(u,L)*u%e,h=it(c,L)*u%e,d=it(h,j)*f%e,l=it(d,n)*d%e,p=it(l,i)*l%e,b=it(p,a)*p%e,y=it(b,s)*b%e,g=it(y,a)*p%e,m=it(g,L)*u%e,v=it(m,o)*l%e,w=it(v,r)*f%e;return it(w,j)}(N(r));const i=(n&U)===U;e?i&&(n=nt(-n)):1==(1&t[0])!==i&&(n=nt(-n));const o=new D(r,n);return o.assertValidity(),o}static fromUncompressedHex(t){const e=tt(t.subarray(1,33)),r=tt(t.subarray(33,65)),n=new D(e,r);return n.assertValidity(),n}static fromHex(t){const e=et(t),r=e.length,n=e[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(e);if(65===r&&4===n)return this.fromUncompressedHex(e);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return D.BASE.multiply(pt(t))}static fromSignature(t,e,r){const n=ut(t=et(t)),{r:i,s:o}=bt(e);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===T)throw new Error("Cannot recover signature: msgHash cannot be 0");const a=1&r?"03":"02",s=D.fromHex(a+Z(i)),{n:f}=F,u=ot(i,f),c=nt(-n*u,f),h=nt(o*u,f),d=D.BASE.multiplyAndAddUnsafe(s,c,h);if(!d)throw new Error("Cannot recover signature: point at infinify");return d.assertValidity(),d}toRawBytes(t=!1){return Q(this.toHex(t))}toHex(t=!1){const e=Z(this.x);return t?`${this.y&U?"03":"02"}${e}`:`04${e}${Z(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:r}=this;if(!dt(e)||!dt(r))throw new Error(t);const n=nt(r*r);if(nt(n-N(e))!==T)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new D(this.x,nt(-this.y))}double(){return C.fromAffine(this).double().toAffine()}add(t){return C.fromAffine(this).add(C.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return C.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=C.fromAffine(this).multiply(e),i=C.fromAffine(t).multiplyUnsafe(r),o=n.add(i);return o.equals(C.ZERO)?void 0:o.toAffine()}}function q(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function H(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${W(t)}`);const e=t[1],r=t.subarray(2,e+2);if(!e||r.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:tt(r),left:t.subarray(e+2)}}D.BASE=new D(F.Gx,F.Gy),D.ZERO=new D(T,T);class V{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=J(t),r="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=e?W(t):t;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new V(Y(n.slice(0,64)),Y(n.slice(64,128)))}static fromDER(t){const e=J(t);if("string"!=typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(t){if(t.length<2||48!=t[0])throw new Error(`Invalid signature tag: ${W(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=H(t.subarray(2)),{data:n,left:i}=H(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${W(i)}`);return{r:e,s:n}}(e?t:Q(t));return new V(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!ht(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!ht(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=F.n>>U;return this.s>t}normalizeS(){return this.hasHighS()?new V(this.r,F.n-this.s):this}toDERRawBytes(t=!1){return Q(this.toDERHex(t))}toDERHex(t=!1){const e=q(X(this.s));if(t)return e;const r=q(X(this.r)),n=X(r.length/2),i=X(e.length/2);return`30${X(r.length/2+e.length/2+4)}02${n}${r}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Q(this.toCompactHex())}toCompactHex(){return Z(this.r)+Z(this.s)}}function K(...t){if(!t.every(J))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r}function J(t){return t instanceof Uint8Array}const G=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function W(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=G[t[r]];return e}function Z(t){if(t>P)throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function X(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function Y(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function Q(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[r]=o}return e}function tt(t){return Y(W(t))}function et(t){return t instanceof Uint8Array?Uint8Array.from(t):Q(t)}function rt(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&ht(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function nt(t,e=F.P){const r=t%e;return r>=T?r:e+r}function it(t,e){const{P:r}=F;let n=t;for(;e-- >T;)n*=n,n%=r;return n}function ot(t,e=F.P){if(t===T||e<=T)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=nt(t,e),n=e,i=T,o=U,a=U,s=T;for(;r!==T;){const t=n/r,e=n%r,f=i-a*t,u=o-s*t;n=r,r=e,i=a,o=s,a=f,s=u}if(n!==U)throw new Error("invert: does not exist");return nt(i,e)}const at=(t,e)=>(t+e/j)/e,st=j**BigInt(128);function ft(t){const{n:e}=F,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-U*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=at(o*t,e),s=at(-n*t,e);let f=nt(t-a*r-s*i,e),u=nt(-a*n-s*o,e);const c=f>st,h=u>st;if(c&&(f=e-f),h&&(u=e-u),f>st||u>st)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:c,k1:f,k2neg:h,k2:u}}function ut(t){const{n:e}=F,r=8*t.length-256;let n=tt(t);return r>0&&(n>>=BigInt(r)),n>=e&&(n-=e),n}class ct{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...t){return St.hmacSha256(this.k,...t)}hmacSync(...t){if("function"!=typeof St.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const e=St.hmacSha256Sync(this.k,...t);if(e instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return e}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),0!==t.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),0!==t.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function ht(t){return T<t&&t<F.n}function dt(t){return T<t&&t<F.P}function lt(t,e,r){const n=tt(t);if(!ht(n))return;const{n:i}=F,o=D.BASE.multiply(n),a=nt(o.x,i);if(a===T)return;const s=nt(ot(n,i)*nt(e+r*a,i),i);if(s===T)return;const f=new V(a,s);return{sig:f,recovery:(o.x===f.r?0:2)|Number(o.y&U)}}function pt(t){let e;if("bigint"==typeof t)e=t;else if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"==typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=Y(t)}else{if(!J(t))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=tt(t)}if(!ht(e))throw new Error("Expected private key: 0 < key < n");return e}function bt(t){if(t instanceof V)return t.assertValidity(),t;try{return V.fromDER(t)}catch(e){return V.fromCompact(t)}}function yt(t){return tt(t.length>32?t.slice(0,32):t)}function gt(t){const e=yt(t),r=nt(e,F.n);return mt(r<T?e:r)}function mt(t){if("bigint"!=typeof t)throw new Error("Expected bigint");return Q(Z(t))}function vt(t,e,r={}){const{seed:n,m:i,d:o}=function(t,e,r){if(null==t)throw new Error(`sign: expected valid message hash, not "${t}"`);const n=et(t),i=pt(e),o=[mt(i),gt(n)];if(null!=r){!0===r&&(r=St.randomBytes(32));const t=et(r);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(t)}return{seed:K(...o),m:yt(n),d:i}}(t,e,r.extraEntropy);let a;const s=new ct;for(s.reseedSync(n);!(a=lt(s.generateSync(),i,o));)s.reseedSync();return function(t,e){let{sig:r,recovery:n}=t;const{canonical:i,der:o,recovered:a}=Object.assign({canonical:!0,der:!0},e);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const s=o?r.toDERRawBytes():r.toCompactRawBytes();return a?[s,n]:s}(a,r)}const wt={strict:!0};D.BASE._setWindowSize(8);const _t={node:O,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},St={isValidPrivateKey(t){try{return pt(t),!0}catch(t){return!1}},hashToPrivateKey:t=>{if((t=et(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=nt(tt(t),F.n);if(e===T||e===U)throw new Error("Invalid private key");return function(t){return Q(Z(t))}(e)},randomBytes:(t=32)=>{if(_t.web)return _t.web.getRandomValues(new Uint8Array(t));if(_t.node){const{randomBytes:e}=_t.node;return Uint8Array.from(e(t))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>St.hashToPrivateKey(St.randomBytes(40)),bytesToHex:W,mod:nt,sha256:async t=>{if(_t.web){const e=await _t.web.subtle.digest("SHA-256",t.buffer);return new Uint8Array(e)}if(_t.node){const{createHash:e}=_t.node;return Uint8Array.from(e("sha256").update(t).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(t,...e)=>{if(_t.web){const r=await _t.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=K(...e),i=await _t.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(_t.node){const{createHmac:r}=_t.node,n=r("sha256",t);return e.forEach((t=>n.update(t))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(t=8,e=D.BASE){const r=e===D.BASE?e:new D(e.x,e.y);return r._setWindowSize(t),r.multiply(L),r}};var Et,At,xt,Mt,kt,It,Bt,Ot,Tt,Ut,jt,Lt,Rt,Pt,Ft,Nt,zt,Ct,$t,Dt,qt=r(2870);(At=Et||(Et={}))[At.Testnet=2147483648]="Testnet",At[At.Mainnet=1]="Mainnet",Et.Mainnet,(Ot=xt||(xt={}))[Ot.Address=0]="Address",Ot[Ot.Principal=1]="Principal",Ot[Ot.LengthPrefixedString=2]="LengthPrefixedString",Ot[Ot.MemoString=3]="MemoString",Ot[Ot.AssetInfo=4]="AssetInfo",Ot[Ot.PostCondition=5]="PostCondition",Ot[Ot.PublicKey=6]="PublicKey",Ot[Ot.LengthPrefixedList=7]="LengthPrefixedList",Ot[Ot.Payload=8]="Payload",Ot[Ot.MessageSignature=9]="MessageSignature",Ot[Ot.TransactionAuthField=10]="TransactionAuthField",function(t){t[t.TokenTransfer=0]="TokenTransfer",t[t.SmartContract=1]="SmartContract",t[t.ContractCall=2]="ContractCall",t[t.PoisonMicroblock=3]="PoisonMicroblock",t[t.Coinbase=4]="Coinbase"}(Mt||(Mt={})),function(t){t[t.OnChainOnly=1]="OnChainOnly",t[t.OffChainOnly=2]="OffChainOnly",t[t.Any=3]="Any"}(kt||(kt={})),(Bt=It||(It={}))[Bt.Mainnet=0]="Mainnet",Bt[Bt.Testnet=128]="Testnet",It.Mainnet,function(t){t[t.Allow=1]="Allow",t[t.Deny=2]="Deny"}(Tt||(Tt={})),function(t){t[t.STX=0]="STX",t[t.Fungible=1]="Fungible",t[t.NonFungible=2]="NonFungible"}(Ut||(Ut={})),function(t){t[t.Standard=4]="Standard",t[t.Sponsored=5]="Sponsored"}(jt||(jt={})),function(t){t[t.SerializeP2PKH=0]="SerializeP2PKH",t[t.SerializeP2SH=1]="SerializeP2SH",t[t.SerializeP2WPKH=2]="SerializeP2WPKH",t[t.SerializeP2WSH=3]="SerializeP2WSH"}(Lt||(Lt={})),function(t){t[t.MainnetSingleSig=22]="MainnetSingleSig",t[t.MainnetMultiSig=20]="MainnetMultiSig",t[t.TestnetSingleSig=26]="TestnetSingleSig",t[t.TestnetMultiSig=21]="TestnetMultiSig"}(Rt||(Rt={})),(Dt=Pt||(Pt={}))[Dt.Compressed=0]="Compressed",Dt[Dt.Uncompressed=1]="Uncompressed",function(t){t[t.Equal=1]="Equal",t[t.Greater=2]="Greater",t[t.GreaterEqual=3]="GreaterEqual",t[t.Less=4]="Less",t[t.LessEqual=5]="LessEqual"}(Ft||(Ft={})),function(t){t[t.DoesNotOwn=16]="DoesNotOwn",t[t.Owns=17]="Owns"}(Nt||(Nt={})),function(t){t[t.Origin=1]="Origin",t[t.Standard=2]="Standard",t[t.Contract=3]="Contract"}(zt||(zt={})),function(t){t[t.STX=0]="STX",t[t.Fungible=1]="Fungible",t[t.NonFungible=2]="NonFungible"}(Ct||(Ct={})),function(t){t.Serialization="Serialization",t.Deserialization="Deserialization",t.SignatureValidation="SignatureValidation",t.FeeTooLow="FeeTooLow",t.BadNonce="BadNonce",t.NotEnoughFunds="NotEnoughFunds",t.NoSuchContract="NoSuchContract",t.NoSuchPublicFunction="NoSuchPublicFunction",t.BadFunctionArgument="BadFunctionArgument",t.ContractAlreadyExists="ContractAlreadyExists",t.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",t.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",t.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",t.BadAddressVersionByte="BadAddressVersionByte",t.NoCoinbaseViaMempool="NoCoinbaseViaMempool",t.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",t.ServerFailureDatabase="ServerFailureDatabase",t.ServerFailureOther="ServerFailureOther"}($t||($t={}));var Ht=r(9065);const Vt=new Array(16),Kt=fe([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),Jt=fe([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),Gt=fe([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Wt=fe([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Zt=se([0,1518500249,1859775393,2400959708,2840853838]),Xt=se([1352829926,1548603684,1836072691,2053994217,0]);function Yt(t,e){return t<<e|t>>>32-e}function Qt(t,e,r,n,i,o,a,s){return Yt(t+(e^r^n)+o+a|0,s)+i|0}function te(t,e,r,n,i,o,a,s){return Yt(t+(e&r|~e&n)+o+a|0,s)+i|0}function ee(t,e,r,n,i,o,a,s){return Yt(t+((e|~r)^n)+o+a|0,s)+i|0}function re(t,e,r,n,i,o,a,s){return Yt(t+(e&n|r&~n)+o+a|0,s)+i|0}function ne(t,e,r,n,i,o,a,s){return Yt(t+(e^(r|~n))+o+a|0,s)+i|0}function ie(t,e){return t[e>>>=0]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function oe(t,e,r){return e=+e,t[3+(r>>>=0)]=e>>>24,t[r+2]=e>>>16,t[r+1]=e>>>8,t[r]=255&e,r+4}function ae(t,e,r){return e=+e,t[r>>>=0]=255&e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,r+4}function se(t){return"undefined"!=typeof Uint32Array?new Uint32Array(t):t}function fe(t){return"undefined"!=typeof Uint8Array?new Uint8Array(t):t}function ue(t){return"undefined"!=typeof Uint8Array?new Uint8Array(t):new Array(t)}const ce=class{constructor(){this._block=ue(64),this._blockSize=64,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1,this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}update(t){if(this._finalized)throw new Error("Digest already called");const e=this._block;let r=0;for(;this._blockOffset+t.length-r>=this._blockSize;){for(let n=this._blockOffset;n<this._blockSize;)e[n++]=t[r++];this._update(),this._blockOffset=0}for(;r<t.length;)e[this._blockOffset++]=t[r++];for(let e=0,r=8*t.length;r>0;++e)this._length[e]+=r,r=this._length[e]/4294967296|0,r>0&&(this._length[e]-=4294967296*r);return this}_update(){const t=Vt;for(let e=0;e<16;++e)t[e]=ie(this._block,4*e);let e=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,o=0|this._e,a=0|this._a,s=0|this._b,f=0|this._c,u=0|this._d,c=0|this._e;for(let h=0;h<80;h+=1){let d,l;h<16?(d=Qt(e,r,n,i,o,t[Kt[h]],Zt[0],Gt[h]),l=ne(a,s,f,u,c,t[Jt[h]],Xt[0],Wt[h])):h<32?(d=te(e,r,n,i,o,t[Kt[h]],Zt[1],Gt[h]),l=re(a,s,f,u,c,t[Jt[h]],Xt[1],Wt[h])):h<48?(d=ee(e,r,n,i,o,t[Kt[h]],Zt[2],Gt[h]),l=ee(a,s,f,u,c,t[Jt[h]],Xt[2],Wt[h])):h<64?(d=re(e,r,n,i,o,t[Kt[h]],Zt[3],Gt[h]),l=te(a,s,f,u,c,t[Jt[h]],Xt[3],Wt[h])):(d=ne(e,r,n,i,o,t[Kt[h]],Zt[4],Gt[h]),l=Qt(a,s,f,u,c,t[Jt[h]],Xt[4],Wt[h])),e=o,o=i,i=Yt(n,10),n=r,r=d,a=c,c=u,u=Yt(f,10),f=s,s=l}const h=this._b+n+u|0;this._b=this._c+i+c|0,this._c=this._d+o+a|0,this._d=this._e+e+s|0,this._e=this._a+r+f|0,this._a=h}digest(){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),oe(this._block,this._length[0],56),oe(this._block,this._length[1],60),this._update();const t=ue(20);ae(t,this._a,0),ae(t,this._b,4),ae(t,this._c,8),ae(t,this._d,12),ae(t,this._e,16),this._block.fill(0),this._blockOffset=0;for(let t=0;t<4;++t)this._length[t]=0;return t}};r(9907);function he(t,e=It.Mainnet){t="string"==typeof t?t:t.toString("hex");var r,n,i;return i=(r=function(t,e){switch(t){case Lt.SerializeP2PKH:switch(e){case It.Mainnet:return Rt.MainnetSingleSig;case It.Testnet:return Rt.TestnetSingleSig;default:throw new Error(`Unexpected txVersion ${JSON.stringify(e)} for hashMode ${t}`)}case Lt.SerializeP2SH:case Lt.SerializeP2WPKH:case Lt.SerializeP2WSH:switch(e){case It.Mainnet:return Rt.MainnetMultiSig;case It.Testnet:return Rt.TestnetMultiSig;default:throw new Error(`Unexpected txVersion ${JSON.stringify(e)} for hashMode ${t}`)}default:throw new Error(`Unexpected hashMode ${JSON.stringify(t)}`)}}(Lt.SerializeP2PKH,e),n=(t=>{const e=(new Ht.sha256).update(t).digest();return c.from((new ce).update(e).digest())})(c.from(t,"hex")).toString("hex"),{type:xt.Address,version:r,hash160:n}),(0,qt.H4)(i.version,i.hash160).toString()}function de(t,r=null){let n;n=r?function(t,r){const n=(0,e.decodeToken)(t),i=n.payload;if("string"==typeof i)throw new Error("Unexpected token payload type of string");if(!i.hasOwnProperty("subject")||!i.subject)throw new Error("Token doesn't have a subject");if(!i.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key");if(!i.hasOwnProperty("issuer")||!i.issuer)throw new Error("Token doesn't have an issuer");if(!i.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key");if(!i.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const o=i.issuer.publicKey,a=he(o);if(r===o);else if(r!==a)throw new Error("Token issuer public key does not match the verifying value");const s=new e.TokenVerifier(n.header.alg,o);if(!s)throw new Error("Invalid token verifier");if(!s.verify(t))throw new Error("Token verification failed");return n}(t,r):(0,e.decodeToken)(t);let i={};if(n.hasOwnProperty("payload")){const t=n.payload;if("string"==typeof t)throw new Error("Unexpected token payload type of string");t.hasOwnProperty("claim")&&(i=t.claim)}return i}function le(t,e){let r;return e.proof&&e.proof.url&&(r=e.proof.url),{"@type":"Account",service:t,identifier:e.username,proofType:"http",proofUrl:r}}St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()};var pe=r(2377),be=r(2179);r(3616);const ye={referrerPolicy:"origin"};async function ge(t,e){const r={};return Object.assign(r,e,ye),await fetch(t,r)}const me={type:"object",properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"}}};class ve{constructor(t={}){this._profile=Object.assign({},{"@context":"http://schema.org/"},t)}toJSON(){return Object.assign({},this._profile)}toToken(t){return function(t,r,n,i,o="ES256K",a=new Date,s=function(){return new Date((new Date).setFullYear((new Date).getFullYear()+1))}()){if("ES256K"!==o)throw new Error("Signing algorithm not supported");const f=e.SECP256K1Client.derivePublicKey(r);n||(n={publicKey:f}),i||(i={publicKey:f});const u=new e.TokenSigner(o,r),c={jti:d(),iat:a.toISOString(),exp:s.toISOString(),subject:n,issuer:i,claim:t};return u.sign(c)}(this.toJSON(),t)}static validateSchema(t,e=!1){return me.strict=e,be.validate(me,t)}static fromToken(t,e=null){const r=de(t,e);return new ve(r)}static makeZoneFile(t,e){return function(t,e){if(!e.includes("://"))throw new Error("Invalid token file url");const r=e.split("://")[0],n=e.split("://")[1].split("/"),i={$origin:t,$ttl:3600,uri:[{name:"_http._tcp",priority:10,weight:1,target:`${r}://${n[0]}${`/${n.slice(1).join("/")}`}`}]};return(0,pe.makeZoneFile)(i,"{$origin}\n{$ttl}\n{uri}\n")}(t,e)}}const we={type:"object",strict:!1,properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"},"@id":{type:"string",optional:!0},name:{type:"string",optional:!0},givenName:{type:"string",optional:!0},familyName:{type:"string",optional:!0},description:{type:"string",optional:!0},image:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},name:{type:"string",optional:!0},contentUrl:{type:"string",optional:!0}}}},website:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},url:{type:"string",optional:!0}}}},account:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},service:{type:"string",optional:!0},identifier:{type:"string",optional:!0},proofType:{type:"string",optional:!0},proofUrl:{type:"string",optional:!0},proofMessage:{type:"string",optional:!0},proofSignature:{type:"string",optional:!0}}}},worksFor:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},knows:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},address:{type:"object",optional:!0,properties:{"@type":{type:"string"},streetAddress:{type:"string",optional:!0},addressLocality:{type:"string",optional:!0},postalCode:{type:"string",optional:!0},addressCountry:{type:"string",optional:!0}}},birthDate:{type:"string",optional:!0},taxID:{type:"string",optional:!0}}};class _e extends ve{constructor(t={}){super(t),this._profile=Object.assign({},{"@type":"Person"},this._profile)}static validateSchema(t,e=!1){return we.strict=e,be.validate(me,t)}static fromToken(t,e=null){const r=de(t,e);return new _e(r)}static fromLegacyFormat(t){const e=function(t){const e={"@type":"Person"};if(t){t.name&&t.name.formatted&&(e.name=t.name.formatted),t.bio&&(e.description=t.bio),t.location&&t.location.formatted&&(e.address={"@type":"PostalAddress",addressLocality:t.location.formatted});const r=[];t.avatar&&t.avatar.url&&r.push({"@type":"ImageObject",name:"avatar",contentUrl:t.avatar.url}),t.cover&&t.cover.url&&r.push({"@type":"ImageObject",name:"cover",contentUrl:t.cover.url}),r.length&&(e.image=r),t.website&&(e.website=[{"@type":"WebSite",url:t.website}]);const n=[];t.bitcoin&&t.bitcoin.address&&n.push({"@type":"Account",role:"payment",service:"bitcoin",identifier:t.bitcoin.address}),t.twitter&&t.twitter.username&&n.push(le("twitter",t.twitter)),t.facebook&&t.facebook.username&&n.push(le("facebook",t.facebook)),t.github&&t.github.username&&n.push(le("github",t.github)),t.auth&&t.auth.length>0&&t.auth[0]&&t.auth[0].publicKeychain&&n.push({"@type":"Account",role:"key",service:"bip32",identifier:t.auth[0].publicKeychain}),t.pgp&&t.pgp.url&&n.push({"@type":"Account",role:"key",service:"pgp",identifier:t.pgp.fingerprint,contentUrl:t.pgp.url}),e.account=n}return e}(t);return new _e(e)}toJSON(){return{profile:this.profile(),name:this.name(),givenName:this.givenName(),familyName:this.familyName(),description:this.description(),avatarUrl:this.avatarUrl(),verifiedAccounts:this.verifiedAccounts(),address:this.address(),birthDate:this.birthDate(),connections:this.connections(),organizations:this.organizations()}}profile(){return Object.assign({},this._profile)}name(){return function(t){if(!t)return null;let e=null;return t.name?e=t.name:(t.givenName||t.familyName)&&(e="",t.givenName&&(e=t.givenName),t.familyName&&(e+=` ${t.familyName}`)),e}(this.profile())}givenName(){return function(t){if(!t)return null;let e=null;return t.givenName?e=t.givenName:t.name&&(e=t.name.split(" ").slice(0,-1).join(" ")),e}(this.profile())}familyName(){return function(t){if(!t)return null;let e=null;return t.familyName?e=t.familyName:t.name&&(e=t.name.split(" ").pop()),e}(this.profile())}description(){return function(t){if(!t)return null;let e=null;return t.description&&(e=t.description),e}(this.profile())}avatarUrl(){return function(t){if(!t)return null;let e=null;return t.image&&t.image.map((t=>"avatar"===t.name?(e=t.contentUrl,e):null)),e}(this.profile())}verifiedAccounts(t){return function(t,e){if(!t)return null;const r=[];return t.hasOwnProperty("account")&&e&&t.account.map((t=>{let n=!1,i=null;return e.map((e=>(e.hasOwnProperty("proof_url")&&(e.proofUrl=e.proof_url),!(!e.valid||e.service!==t.service||e.identifier!==t.identifier||!e.proofUrl||(n=!0,i=e.proofUrl,0))))),n?(t.proofUrl=i,r.push(t),t):null})),r}(this.profile(),t)}address(){return function(t){if(!t)return null;let e=null;if(t.hasOwnProperty("address")){const r=[];t.address.hasOwnProperty("streetAddress")&&r.push(t.address.streetAddress),t.address.hasOwnProperty("addressLocality")&&r.push(t.address.addressLocality),t.address.hasOwnProperty("postalCode")&&r.push(t.address.postalCode),t.address.hasOwnProperty("addressCountry")&&r.push(t.address.addressCountry),r.length&&(e=r.join(", "))}return e}(this.profile())}birthDate(){return function(t){if(!t)return null;const e=["January","February","March","April","May","June","July","August","September","October","November","December"];let r=null;if(t.hasOwnProperty("birthDate")){const n=new Date(t.birthDate);r=`${e[n.getMonth()]} ${n.getDate()}, ${n.getFullYear()}`}return r}(this.profile())}connections(){return function(t){if(!t)return null;let e=[];return t.hasOwnProperty("knows")&&(e=t.knows),e}(this.profile())}organizations(){return(t=this.profile())?t.hasOwnProperty("worksFor")?t.worksFor:[]:null;var t}}var Se,Ee;!function(t){t[t.Testnet=2147483648]="Testnet",t[t.Mainnet=1]="Mainnet"}(Se||(Se={})),function(t){t[t.Mainnet=0]="Mainnet",t[t.Testnet=128]="Testnet"}(Ee||(Ee={}));const Ae=["mainnet","testnet"];class xe{constructor(t){this.version=Ee.Mainnet,this.chainId=Se.Mainnet,this.bnsLookupUrl="https://stacks-node-api.mainnet.stacks.co",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.transactionFeeEstimateEndpoint="/v2/fees/transaction",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=()=>this.version===Ee.Mainnet,this.getBroadcastApiUrl=()=>`${this.coreApiUrl}${this.broadcastEndpoint}`,this.getTransferFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transferFeeEstimateEndpoint}`,this.getTransactionFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transactionFeeEstimateEndpoint}`,this.getAccountApiUrl=t=>`${this.coreApiUrl}${this.accountEndpoint}/${t}?proof=0`,this.getAbiApiUrl=(t,e)=>`${this.coreApiUrl}${this.contractAbiEndpoint}/${t}/${e}`,this.getReadOnlyFunctionCallApiUrl=(t,e,r)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}/${t}/${e}/${encodeURIComponent(r)}`,this.getInfoUrl=()=>`${this.coreApiUrl}/v2/info`,this.getBlockTimeInfoUrl=()=>`${this.coreApiUrl}/extended/v1/info/network_block_times`,this.getPoxInfoUrl=()=>`${this.coreApiUrl}/v2/pox`,this.getRewardsUrl=(t,e)=>{let r=`${this.coreApiUrl}/extended/v1/burnchain/rewards/${t}`;return e&&(r=`${r}?limit=${e.limit}&offset=${e.offset}`),r},this.getRewardsTotalUrl=t=>`${this.coreApiUrl}/extended/v1/burnchain/rewards/${t}/total`,this.getRewardHoldersUrl=(t,e)=>{let r=`${this.coreApiUrl}/extended/v1/burnchain/reward_slot_holders/${t}`;return e&&(r=`${r}?limit=${e.limit}&offset=${e.offset}`),r},this.getStackerInfoUrl=(t,e)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}\n ${t}/${e}/get-stacker-info`,this.coreApiUrl=t.url}getNameInfo(t){return ge(`${this.bnsLookupUrl}/v1/names/${t}`).then((t=>{if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error(`Bad response status: ${t.status}`);return t.json()})).then((t=>t.address?Object.assign({},t,{address:t.address}):t))}}xe.fromName=t=>{switch(t){case"mainnet":return new Me;case"testnet":return new ke;default:throw new Error(`Invalid network name provided. Must be one of the following: ${Ae.join(", ")}`)}},xe.fromNameOrNetwork=t=>"string"!=typeof t&&"version"in t?t:xe.fromName(t);class Me extends xe{constructor(t={url:"https://stacks-node-api.mainnet.stacks.co"}){super(t),this.version=Ee.Mainnet,this.chainId=Se.Mainnet}}class ke extends xe{constructor(t={url:"https://stacks-node-api.testnet.stacks.co"}){super(t),this.version=Ee.Testnet,this.chainId=Se.Testnet}}const Ie={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",DOES_NOT_EXIST:"does_not_exist",FAILED_DECRYPTION_ERROR:"failed_decryption_error",INVALID_DID_ERROR:"invalid_did_error",NOT_ENOUGH_FUNDS_ERROR:"not_enough_error",INVALID_AMOUNT_ERROR:"invalid_amount_error",LOGIN_FAILED_ERROR:"login_failed",SIGNATURE_VERIFICATION_ERROR:"signature_verification_failure",CONFLICT_ERROR:"conflict_error",NOT_ENOUGH_PROOF_ERROR:"not_enough_proof_error",BAD_PATH_ERROR:"bad_path_error",VALIDATION_ERROR:"validation_error",PAYLOAD_TOO_LARGE_ERROR:"payload_too_large_error",PRECONDITION_FAILED_ERROR:"precondition_failed_error",UNKNOWN:"unknown"};Object.freeze(Ie);class Be extends Error{constructor(t){super();let e=t.message,r=`Error Code: ${t.code}`,n=this.stack;if(n)r+=`Stack Trace:\n${n}`;else try{throw new Error}catch(t){n=t.stack}e+=`\nIf you believe this exception is caused by a bug in stacks.js,\n please file a bug report: https://github.com/blockstack/stacks.js/issues\n\n${r}`,this.message=e,this.code=t.code,this.parameter=t.parameter?t.parameter:void 0}toString(){return`${super.toString()}\n code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}class Oe extends Be{constructor(t){const e=`Failed to verify signature: ${t}`;super({code:Ie.SIGNATURE_VERIFICATION_ERROR,message:e}),this.message=e,this.name="SignatureVerificationError"}}class Te extends Be{constructor(t){super({code:Ie.INVALID_STATE,message:t}),this.message=t,this.name="InvalidStateError"}}class Ue extends Be{constructor(t,e){super(t),e&&(this.hubError={statusCode:e.status,statusText:e.statusText},"string"==typeof e.body?this.hubError.message=e.body:"object"==typeof e.body&&Object.assign(this.hubError,e.body))}}class je extends Ue{constructor(t,e){super({message:t,code:Ie.DOES_NOT_EXIST},e),this.name="DoesNotExist"}}class Le extends Ue{constructor(t,e){super({message:t,code:Ie.CONFLICT_ERROR},e),this.name="ConflictError"}}class Re extends Ue{constructor(t,e){super({message:t,code:Ie.NOT_ENOUGH_PROOF_ERROR},e),this.name="NotEnoughProofError"}}class Pe extends Ue{constructor(t,e){super({message:t,code:Ie.BAD_PATH_ERROR},e),this.name="BadPathError"}}class Fe extends Ue{constructor(t,e){super({message:t,code:Ie.VALIDATION_ERROR},e),this.name="ValidationError"}}class Ne extends Ue{constructor(t,e,r){super({message:t,code:Ie.PAYLOAD_TOO_LARGE_ERROR},e),this.name="PayloadTooLargeError",this.maxUploadByteSize=r}}class ze extends Ue{constructor(t,e){super({message:t,code:Ie.PRECONDITION_FAILED_ERROR},e),this.name="PreconditionFailedError"}}function Ce(t){const e=c.isBuffer(t)?t:c.from(t,"hex");if(32!=e.length&&33!=e.length)throw new Error(`Improperly formatted private-key. Private-key byte length should be 32 or 33. Length provided: ${e.length}`);if(33==e.length&&1!==e[32])throw new Error("Improperly formatted private-key. 33 bytes indicate compressed key, but the last byte must be == 01");return e}var $e=r(7022),De=r.n($e);class qe{digest(t){const e=new ce;e.update(t);const r=e.digest();return Array.isArray(r)?c.from(r):c.from(r.buffer)}}class He{constructor(t){this.nodeCryptoCreateHash=t}digest(t){try{return this.nodeCryptoCreateHash("rmd160").update(t).digest()}catch(e){try{return this.nodeCryptoCreateHash("ripemd160").update(t).digest()}catch(r){return console.log(e),console.log("Node.js `crypto.createHash` exists but failing to digest for ripemd160, falling back to js implementation"),(new qe).digest(t)}}}}function Ve(t){const e=new Ht.sha256;return e.update(t),e.digest()}const Ke=0;function Je(t){var e,n;return e=Ve(c.isBuffer(t)?t:c.from(t,"hex")),n=function(){const t=function(t){try{if(!Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()))return!1;const e=r(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return!!e&&(!t||t(e))}catch(t){return!1}}((t=>"function"==typeof t.createHash&&t.createHash));return t?new He(t):new qe}().digest(e),function(t){const e=B(B(t));return De().encode(c.concat([t,e],t.length+4))}(c.from([Ke,...n].slice(0,21)))}function Ge(t){const e=Ce(t);return c.from(function(t,e=!1){return D.fromPrivateKey(t).toRawBytes(e)}(e.slice(0,32),!0)).toString("hex")}var We;function Ze(t,e,r){const n=function(t){return t instanceof c?t:(ArrayBuffer,c.from(t))}(t);return function(t,e,r,n=wt){let i;try{i=bt(t),e=et(e)}catch(t){return!1}const{r:o,s:a}=i;if(n.strict&&i.hasHighS())return!1;const s=ut(e);if(s===T)return!1;let f;try{f=function(t){return t instanceof D?(t.assertValidity(),t):D.fromHex(t)}(r)}catch(t){return!1}const{n:u}=F,c=ot(a,u),h=nt(s*c,u),d=nt(o*c,u),l=D.BASE.multiplyAndAddUnsafe(f,h,d);return!!l&&nt(l.x,u)===o}(r,Ve(n),e)}St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()},St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()},function(t){t.InvalidFormat="InvalidFormat",t.IsNotPoint="IsNotPoint"}(We||(We={}));const Xe=class{constructor(t,e){this.wasString="string"==typeof t,this.content=Xe.normalizeContentDataType(t,e),this.contentType=e||this.detectContentType(),this.contentByteLength=this.detectContentLength()}static normalizeContentDataType(t,e){try{if("string"==typeof t){const r=(e||"").toLowerCase().replace("-","");if(r.includes("charset")&&!r.includes("charset=utf8")&&!r.includes("charset=ascii"))throw new Error(`Unable to determine byte length with charset: ${e}`);if("undefined"!=typeof TextEncoder){const e=(new TextEncoder).encode(t);return c.from(e.buffer)}return c.from(t)}if(c.isBuffer(t))return t;if(ArrayBuffer.isView(t))return c.from(t.buffer,t.byteOffset,t.byteLength);if("undefined"!=typeof Blob&&t instanceof Blob)return t;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return c.from(t);if(Array.isArray(t)){if(t.length>0&&(!Number.isInteger(t[0])||t[0]<0||t[0]>255))throw new Error(`Unexpected array values provided as file data: value "${t[0]}" at index 0 is not an octet number. ${this.supportedTypesMsg}`);return c.from(t)}{const e=Object.prototype.toString.call(t);throw new Error(`Unexpected type provided as file data: ${e}. ${this.supportedTypesMsg}`)}}catch(t){throw console.error(t),new Error(`Error processing data: ${t}`)}}detectContentType(){return this.wasString?"text/plain; charset=utf-8":"undefined"!=typeof Blob&&this.content instanceof Blob&&this.content.type?this.content.type:"application/octet-stream"}detectContentLength(){if(ArrayBuffer.isView(this.content)||c.isBuffer(this.content))return this.content.byteLength;if("undefined"!=typeof Blob&&this.content instanceof Blob)return this.content.size;const t=Object.prototype.toString.call(this.content),e=new Error(`Unexpected type "${t}" while detecting content length`);throw console.error(e),e}async loadContent(){try{if(c.isBuffer(this.content))return this.content;if(ArrayBuffer.isView(this.content))return c.from(this.content.buffer,this.content.byteOffset,this.content.byteLength);if("undefined"!=typeof Blob&&this.content instanceof Blob){const t=new FileReader,e=new Promise(((e,r)=>{t.onerror=t=>{r(t)},t.onload=()=>{const r=t.result;e(c.from(r))},t.readAsArrayBuffer(this.content)}));return await e}{const t=Object.prototype.toString.call(this.content);throw new Error(`Unexpected type ${t}`)}}catch(t){console.error(t);const e=new Error(`Error loading content: ${t}`);throw console.error(e),e}}load(){return void 0===this.loadedData&&(this.loadedData=this.loadContent()),this.loadedData}};let Ye=Xe;Ye.supportedTypesMsg="Supported types are: `string` (to be UTF8 encoded), `Buffer`, `Blob`, `File`, `ArrayBuffer`, `UInt8Array` or any other typed array buffer. ";const Qe="blockstack-gaia-hub-config";async function tr(t,e,r,n="application/octet-stream",i=!0,o,a){s.debug(`uploadToGaiaHub: uploading ${t} to ${r.server}`);const f={"Content-Type":n,Authorization:`bearer ${r.token}`};a||(i?f["If-None-Match"]="*":o&&(f["If-Match"]=o));const u=await ge(`${r.server}/store/${r.address}/${t}`,{method:"POST",headers:f,body:e});if(!u.ok)throw await ar(u,"Error when uploading to Gaia hub.",r);const c=await u.text();return JSON.parse(c)}async function er(t,e){s.debug(`deleteFromGaiaHub: deleting ${t} from ${e.server}`);const r=await ge(`${e.server}/delete/${e.address}/${t}`,{method:"DELETE",headers:{Authorization:`bearer ${e.token}`}});if(!r.ok)throw await ar(r,"Error deleting file from Gaia hub.",e)}function rr(t,e){return Promise.resolve(`${e.url_prefix}${e.address}/${t}`)}function nr(t,r,n,i){const o=t.challenge_text,a=t.latest_auth_version&&parseInt(t.latest_auth_version.slice(1),10)>=1,s=Ge(r);if(!a)return function(t,e){let r;try{r=JSON.parse(t)}catch(t){throw new Error("Failed in parsing legacy challenge text from the gaia hub.")}if("gaiahub"===r[0]&&"blockstack_storage_please_sign"===r[3]){const r=(n=Ve(c.from(t)),i=function(t){const e=Ce(t);return 33==e.length?e:c.concat([e,c.from([1])])}(e),c.from(vt(n,Ce(i).slice(0,32),{der:!1}))),o=V.fromCompact(r.toString("hex")).toDERHex(),a=Ge(e);return c.from(JSON.stringify({publickey:a,signature:o})).toString("base64")}throw new Error("Failed to connect to legacy gaia hub. If you operate this hub, please update.");var n,i}(o,r);const f={gaiaChallenge:o,hubUrl:n,iss:s,salt:(16,c.from(St.randomBytes(16))).toString("hex"),associationToken:i};return`v1:${new e.TokenSigner("ES256K",r).sign(f)}`}async function ir(t,e,r){s.debug(`connectToGaiaHub: ${t}/hub_info`);const n=await ge(`${t}/hub_info`),i=await n.json(),o=i.read_url_prefix,a=nr(i,e,t,r),f=Je(Ge(e));return{url_prefix:o,max_file_upload_size_megabytes:i.max_file_upload_size_megabytes,address:f,token:a,server:t}}async function or(t,e){const r=await ge(`${t}/hub_info`),n=await r.text();return`${JSON.parse(n).read_url_prefix}${Je(Ge(e))}/`}async function ar(t,e,r){if(t.ok)throw new Error("Cannot get a BlockstackError from a valid response.");const n=await async function(t){let e,r="";try{r=await t.text();try{e=JSON.parse(r)}catch(t){}}catch(t){s.debug(`Error getting bad http response text: ${t}`)}return{status:t.status,statusText:t.statusText,body:e||r}}(t);if(401===n.status)return new Fe(e,n);if(402===n.status)return new Re(e,n);if(403===n.status)return new Pe(e,n);if(404===n.status)throw new je(e,n);if(409===n.status)return new Le(e,n);if(412===n.status)return new ze(e,n);if(413===n.status){const t=r&&r.max_file_upload_size_megabytes?h(r.max_file_upload_size_megabytes):0;return new Ne(e,n,t)}return new Error(e)}class sr{constructor(t){this.userSession=t.userSession}async getFile(t,e){const r={decrypt:!0,verify:!1,app:l("location",{returnEmptyObject:!0}).origin},n=Object.assign({},r,e);if(n.verify&&!n.decrypt)return this.getFileSignedUnencrypted(t,n);const i=await this.getFileContents(t,n.app,n.username,n.zoneFileLookupURL,!!n.decrypt);if(null===i)return i;if(n.decrypt&&!n.verify){if("string"!=typeof i)throw new Error("Expected to get back a string for the cipherText");if("string"==typeof n.decrypt){const t={privateKey:n.decrypt};return this.userSession.decryptContent(i,t)}return this.userSession.decryptContent(i)}if(n.decrypt&&n.verify){if("string"!=typeof i)throw new Error("Expected to get back a string for the cipherText");let e;return"string"==typeof n.decrypt&&(e=n.decrypt),this.handleSignedEncryptedContents(t,i,n.app,e,n.username,n.zoneFileLookupURL)}if(n.verify||n.decrypt)throw new Error("Should be unreachable.");return i}async getUserAppFileUrl(t,e,r,n){const i=await function(t){if(!t.username)return Promise.reject(new Error("No username provided"));const e={network:new Me},r=Object.assign(e,t),n=xe.fromNameOrNetwork(r.network);let i;return i=r.zoneFileLookupURL?ge(`${r.zoneFileLookupURL.replace(/\/$/,"")}/${r.username}`).then((t=>t.json())):n.getNameInfo(r.username),i.then((t=>{if(t.hasOwnProperty("zonefile")&&t.hasOwnProperty("address"))return e=t.zonefile,r=t.address,new Promise(((t,n)=>{let i=null;try{i=(0,pe.parseZoneFile)(e),i.hasOwnProperty("$origin")||(i=null)}catch(t){n(t)}let o=null;if(i&&Object.keys(i).length>0)o=function(t){if(!t.hasOwnProperty("uri"))return null;if(!Array.isArray(t.uri))return null;if(t.uri.length<1)return null;const e=t.uri.filter((t=>t.hasOwnProperty("target")&&"_http._tcp"===t.name));if(e.length<1)return null;const r=e[0];if(!r.hasOwnProperty("target"))return null;let n=r.target;return n.startsWith("https")||n.startsWith("http")||(n=`https://${n}`),n}(i);else try{return t(_e.fromLegacyFormat(JSON.parse(e)).profile())}catch(t){return n(t)}o?ge(o).then((t=>t.text())).then((t=>JSON.parse(t))).then((e=>{const n=de(e[0].token,r);t(n)})).catch((t=>{s.error(`resolveZoneFileToProfile: error fetching token file ${o}: ${t}`),n(t)})):(s.debug("Token file url not found. Resolving to blank profile."),t({}))}));var e,r;throw new Error("Invalid zonefile lookup response: did not contain `address` or `zonefile` field")}))}({username:e,zoneFileLookupURL:n});let o;return i.hasOwnProperty("apps")&&i.apps.hasOwnProperty(r)&&(o=`${i.apps[r].replace(/\/?(\?|#|$)/,"/$1")}${t}`),o}async getGaiaAddress(t,e,r){const n=ur(this.userSession,{app:t,username:e,zoneFileLookupURL:r});let i;if(e)i=await this.getUserAppFileUrl("/",n.username,n.app,n.zoneFileLookupURL);else{const t=await this.getOrSetLocalGaiaHubConnection();i=await rr("/",t)}const o=i.match(/([13][a-km-zA-HJ-NP-Z0-9]{26,35})/);if(!o)throw new Error("Failed to parse gaia address");return o[o.length-1]}async getFileUrl(t,e){const r=ur(this.userSession,e);let n;if(r.username)n=await this.getUserAppFileUrl(t,r.username,r.app,r.zoneFileLookupURL);else{const e=await this.getOrSetLocalGaiaHubConnection();n=await rr(t,e)}if(n)return n;throw new Error("Missing readURL")}async getFileContents(t,e,r,n,i){const o={app:e,username:r,zoneFileLookupURL:n},a=await this.getFileUrl(t,o),s=await ge(a);if(!s.ok)throw await ar(s,`getFile ${t} failed.`,null);let f=s.headers.get("Content-Type");"string"==typeof f&&(f=f.toLowerCase());const u=s.headers.get("ETag");if(u){const e=this.userSession.store.getSessionData();e.etags[t]=u,this.userSession.store.setSessionData(e)}return i||null===f||f.startsWith("text")||f.startsWith("application/json")?s.text():s.arrayBuffer()}async getFileSignedUnencrypted(t,e){const r=`${t}.sig`;try{const[n,i,o]=await Promise.all([this.getFileContents(t,e.app,e.username,e.zoneFileLookupURL,!1),this.getFileContents(r,e.app,e.username,e.zoneFileLookupURL,!0),this.getGaiaAddress(e.app,e.username,e.zoneFileLookupURL)]);if(!n)return n;if(!o)throw new Oe(`Failed to get gaia address for verification of: ${t}`);if(!i||"string"!=typeof i)throw new Oe(`Failed to obtain signature for file: ${t} -- looked in ${t}.sig`);let a,s;try{const t=JSON.parse(i);a=t.signature,s=t.publicKey}catch(e){throw e instanceof SyntaxError?new Error(`Failed to parse signature content JSON (path: ${t}.sig) The content may be corrupted.`):e}const f=Je(s);if(o!==f)throw new Oe(`Signer pubkey address (${f}) doesn't match gaia address (${o})`);if(Ze(n,s,a))return n;throw new Oe(`Contents do not match ECDSA signature: path: ${t}, signature: ${t}.sig`)}catch(e){throw e instanceof je&&e.message.indexOf(r)>=0?new Oe(`Failed to obtain signature for file: ${t} -- looked in ${t}.sig`):e}}async handleSignedEncryptedContents(t,e,r,n,i,o){const a=Ge(n||this.userSession.loadUserData().appPrivateKey);let s,f;if(s=i?await this.getGaiaAddress(r,i,o):Je(a),!s)throw new Oe(`Failed to get gaia address for verification of: ${t}`);try{f=JSON.parse(e)}catch(t){throw t instanceof SyntaxError?new Error("Failed to parse encrypted, signed content JSON. The content may not be encrypted. If using getFile, try passing { verify: false, decrypt: false }."):t}const u=f.signature,c=f.publicKey,h=f.cipherText,d=Je(c);if(c&&h&&u){if(d!==s)throw new Oe(`Signer pubkey address (${d}) doesn't match gaia address (${s})`);if(Ze(h,c,u)){if("string"==typeof n){const t={privateKey:n};return this.userSession.decryptContent(h,t)}return this.userSession.decryptContent(h)}throw new Oe(`Contents do not match ECDSA signature in file: ${t}`)}throw new Oe(`Failed to get signature verification data from file: ${t}`)}async putFile(t,e,r){var n,i;const o=Object.assign({},{encrypt:!0,sign:!1,cipherTextEncoding:"hex",dangerouslyIgnoreEtag:!1},r),a=await this.getOrSetLocalGaiaHubConnection(),s=h(a.max_file_upload_size_megabytes),f=s>0,u=new Ye(e,o.contentType);let d,l=u.contentType;if(!o.encrypt&&f&&u.contentByteLength>s){const t=`The max file upload size for this hub is ${s} bytes, the given content is ${u.contentByteLength} bytes`,e=new Ne(t,null,s);throw console.error(e),e}if(o.encrypt&&f){const t=function(t){const{payloadShell:e,payloadValuesLength:r}=function(t){const e={iv:"",ephemeralPK:"",mac:"",cipherText:"",wasString:!!t.wasString};return"base64"===t.cipherTextEncoding&&(e.cipherTextEncoding="base64"),{payloadValuesLength:162,payloadShell:JSON.stringify(e)}}(t),n=(i=t.contentLength,16*(Math.floor(i/16)+1));var i;let o;if(t.cipherTextEncoding&&"hex"!==t.cipherTextEncoding){if("base64"!==t.cipherTextEncoding)throw new Error(`Unexpected cipherTextEncoding "${t.cipherTextEncoding}"`);o=function(t){return 4*Math.ceil(t/3)}(n)}else o=2*n;if(t.sign){const{signedPayloadShell:t,signedPayloadValuesLength:n}=function(t){const e={signature:"",publicKey:"",cipherText:t};return{signedPayloadValuesLength:210,signedPayloadShell:JSON.stringify(e)}}(e);return t.length+n+r+o}return e.length+r+o}({contentLength:u.contentByteLength,wasString:u.wasString,sign:!!o.sign,cipherTextEncoding:o.cipherTextEncoding});if(t>s){const e=new Ne(`The max file upload size for this hub is ${s} bytes, the given content is ${t} bytes after encryption`,null,s);throw console.error(e),e}}let p=!0;const y=this.userSession.store.getSessionData();let g;if(o.dangerouslyIgnoreEtag||(null==(n=y.etags)?void 0:n[t])&&(p=!1,d=null==(i=y.etags)?void 0:i[t]),!o.encrypt&&o.sign){const e=await u.load();let r;r="string"==typeof o.sign?o.sign:this.userSession.loadUserData().appPrivateKey;const n=function(t,e){const r=e instanceof c?e:c.from(e),n=Ge(t);return{signature:b(vt(Ve(r),t)),publicKey:n}}(r,e),i=JSON.stringify(n);g=async r=>{const n=(await Promise.all([tr(t,e,r,l,p,d,o.dangerouslyIgnoreEtag),tr(`${t}.sig`,i,r,"application/json")]))[0];return!o.dangerouslyIgnoreEtag&&n.etag&&(y.etags[t]=n.etag,this.userSession.store.setSessionData(y)),n.publicURL}}else{let e;if(o.encrypt||o.sign){let t;t="string"==typeof o.encrypt?o.encrypt:"string"==typeof o.sign?Ge(o.sign):Ge(this.userSession.loadUserData().appPrivateKey);const r=await u.load();e=await this.userSession.encryptContent(r,{publicKey:t,wasString:u.wasString,cipherTextEncoding:o.cipherTextEncoding,sign:o.sign}),l="application/json"}else e=u.content;g=async r=>{const n=await tr(t,e,r,l,p,d,o.dangerouslyIgnoreEtag);return n.etag&&(y.etags[t]=n.etag,this.userSession.store.setSessionData(y)),n.publicURL}}try{return await g(a)}catch(t){if(function(t){if(!t||!t.hubError||!t.hubError.statusCode)return!1;const e=t.hubError.statusCode;return 401===e||(409===e||e>=500&&e<=599)}(t)){console.error(t),console.error("Possible recoverable error during Gaia upload, retrying...");const e=await this.setLocalGaiaHubConnection();return await g(e)}throw t}}async deleteFile(t,e){const r=await this.getOrSetLocalGaiaHubConnection();if(Object.assign({},e).wasSigned)try{await er(t,r),await er(`${t}.sig`,r);const e=this.userSession.store.getSessionData();delete e.etags[t],this.userSession.store.setSessionData(e)}catch(e){const n=await this.setLocalGaiaHubConnection();await er(t,n),await er(`${t}.sig`,r);const i=this.userSession.store.getSessionData();delete i.etags[t],this.userSession.store.setSessionData(i)}else try{await er(t,r);const e=this.userSession.store.getSessionData();delete e.etags[t],this.userSession.store.setSessionData(e)}catch(e){const r=await this.setLocalGaiaHubConnection();await er(t,r);const n=this.userSession.store.getSessionData();delete n.etags[t],this.userSession.store.setSessionData(n)}}getAppBucketUrl(t,e){return or(t,e)}async listFilesLoop(t,e,r,n,i){if(r>65536)throw new Error("Too many entries to list");let o;t=t||await this.getOrSetLocalGaiaHubConnection();try{const r=JSON.stringify({page:e}),n={method:"POST",headers:{"Content-Type":"application/json","Content-Length":`${r.length}`,Authorization:`bearer ${t.token}`},body:r};if(o=await ge(`${t.server}/list-files/${t.address}`,n),!o.ok)throw await ar(o,"ListFiles failed.",t)}catch(t){if(0===r){const t=await this.setLocalGaiaHubConnection();return this.listFilesLoop(t,e,r+1,0,i)}throw t}const a=await o.text(),s=JSON.parse(a),f=s.entries,u=s.page;if(null==f)throw new Error("Bad listFiles response: no entries");let c=0;for(let t=0;t<f.length;t++)if(null!==f[t]&&(c++,!i(f[t])))return n+t;return u&&f.length>0?this.listFilesLoop(t,u,r+1,n+c,i):n+c}listFiles(t){return this.listFilesLoop(null,null,0,0,t)}async getOrSetLocalGaiaHubConnection(){const t=this.userSession.store.getSessionData().userData;if(!t)throw new Te("Missing userData");const e=t.gaiaHubConfig;return e?Promise.resolve(e):this.setLocalGaiaHubConnection()}async setLocalGaiaHubConnection(){const t=this.userSession.loadUserData();if(!t)throw new Te("Missing userData");t.hubUrl||(t.hubUrl="https://hub.blockstack.org");const e=await ir(t.hubUrl,t.appPrivateKey,t.gaiaAssociationToken);t.gaiaHubConfig=e;const r=this.userSession.store.getSessionData();return r.userData.gaiaHubConfig=e,this.userSession.store.setSessionData(r),e}}function fr(t){return new sr({}).getUserAppFileUrl(t.path,t.username,t.appOrigin,t.zoneFileLookupURL)}function ur(t,e){var r;const n=Object.assign({},e);if(n.username){if(!n.app){if(!t.appConfig)throw new Te("Missing AppConfig");n.app=t.appConfig.appDomain}if(!n.zoneFileLookupURL){if(!t.appConfig)throw new Te("Missing AppConfig");if(!t.store)throw new Te("Missing store UserSession");const e=(null==(r=t.store.getSessionData().userData)?void 0:r.coreNode)||t.appConfig.coreNode;e&&(n.zoneFileLookupURL=`${e}/v1/names`)}}return n}})(),n})()));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.StacksStorage=e():t.StacksStorage=e()}(this,(()=>(()=>{var t={625:function(t,e,r){t=r.nmd(t);var n=r(4406);!function(e){"use strict";function i(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i<r;i++)n[i]=t[e+i];return n}var o=function(t){var e=i(arguments,1);return function(){var r=i(arguments);return t.apply(null,e.concat(r))}},a=function(t){return function(){var e=i(arguments),r=e.pop();t.call(this,e,r)}};function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var f="function"==typeof setImmediate&&setImmediate,u="object"==typeof n&&"function"==typeof n.nextTick;function c(t){setTimeout(t,0)}function h(t){return function(e){var r=i(arguments,1);t((function(){e.apply(null,r)}))}}var d=h(f?setImmediate:u?n.nextTick:c);function l(t){return a((function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}s(n)&&"function"==typeof n.then?n.then((function(t){p(r,null,t)}),(function(t){p(r,t.message?t:new Error(t))})):r(null,n)}))}function p(t,e,r){try{t(e,r)}catch(t){d(b,t)}}function b(t){throw t}var y="function"==typeof Symbol;function g(t){return y&&"AsyncFunction"===t[Symbol.toStringTag]}function m(t){return g(t)?l(t):t}function v(t){return function(e){var r=i(arguments,1),n=a((function(r,n){var i=this;return t(e,(function(t,e){m(t).apply(i,r.concat(e))}),n)}));return r.length?n.apply(this,r):n}}var w="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,_="object"==typeof self&&self&&self.Object===Object&&self,S=w||_||Function("return this")(),E=S.Symbol,A=Object.prototype,x=A.hasOwnProperty,M=A.toString,k=E?E.toStringTag:void 0;var I=Object.prototype.toString;var B=E?E.toStringTag:void 0;function O(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=x.call(t,k),r=t[k];try{t[k]=void 0;var n=!0}catch(t){}var i=M.call(t);return n&&(e?t[k]=r:delete t[k]),i}(t):function(t){return I.call(t)}(t)}function T(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function U(t){return null!=t&&T(t.length)&&!function(t){if(!s(t))return!1;var e=O(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)}var j={};function L(){}function R(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var P="function"==typeof Symbol&&Symbol.iterator;function F(t){return null!=t&&"object"==typeof t}function N(t){return F(t)&&"[object Arguments]"==O(t)}var z=Object.prototype,C=z.hasOwnProperty,$=z.propertyIsEnumerable,D=N(function(){return arguments}())?N:function(t){return F(t)&&C.call(t,"callee")&&!$.call(t,"callee")},q=Array.isArray;var H="object"==typeof e&&e&&!e.nodeType&&e,V=H&&t&&!t.nodeType&&t,K=V&&V.exports===H?S.Buffer:void 0,J=(K?K.isBuffer:void 0)||function(){return!1},G=/^(?:0|[1-9]\d*)$/;function W(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&G.test(t))&&t>-1&&t%1==0&&t<e}var Z={};Z["[object Float32Array]"]=Z["[object Float64Array]"]=Z["[object Int8Array]"]=Z["[object Int16Array]"]=Z["[object Int32Array]"]=Z["[object Uint8Array]"]=Z["[object Uint8ClampedArray]"]=Z["[object Uint16Array]"]=Z["[object Uint32Array]"]=!0,Z["[object Arguments]"]=Z["[object Array]"]=Z["[object ArrayBuffer]"]=Z["[object Boolean]"]=Z["[object DataView]"]=Z["[object Date]"]=Z["[object Error]"]=Z["[object Function]"]=Z["[object Map]"]=Z["[object Number]"]=Z["[object Object]"]=Z["[object RegExp]"]=Z["[object Set]"]=Z["[object String]"]=Z["[object WeakMap]"]=!1;var X,Y="object"==typeof e&&e&&!e.nodeType&&e,Q=Y&&t&&!t.nodeType&&t,tt=Q&&Q.exports===Y&&w.process,et=function(){try{return Q&&Q.require&&Q.require("util").types||tt&&tt.binding&&tt.binding("util")}catch(t){}}(),rt=et&&et.isTypedArray,nt=rt?(X=rt,function(t){return X(t)}):function(t){return F(t)&&T(t.length)&&!!Z[O(t)]},it=Object.prototype.hasOwnProperty;function ot(t,e){var r=q(t),n=!r&&D(t),i=!r&&!n&&J(t),o=!r&&!n&&!i&&nt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],f=s.length;for(var u in t)!e&&!it.call(t,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||W(u,f))||s.push(u);return s}var at=Object.prototype;var st=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),ft=Object.prototype.hasOwnProperty;function ut(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||at))return st(t);var e,r,n=[];for(var i in Object(t))ft.call(t,i)&&"constructor"!=i&&n.push(i);return n}function ct(t){return U(t)?ot(t):ut(t)}function ht(t){if(U(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e,r,n,i,o=function(t){return P&&t[P]&&t[P]()}(t);return o?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(o):(r=ct(e=t),n=-1,i=r.length,function t(){var o=r[++n];return"__proto__"===o?t():n<i?{value:e[o],key:o}:null})}function dt(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function lt(t){return function(e,r,n){if(n=R(n||L),t<=0||!e)return n(null);var i=ht(e),o=!1,a=0,s=!1;function f(t,e){if(a-=1,t)o=!0,n(t);else{if(e===j||o&&a<=0)return o=!0,n(null);s||u()}}function u(){for(s=!0;a<t&&!o;){var e=i();if(null===e)return o=!0,void(a<=0&&n(null));a+=1,r(e.value,e.key,dt(f))}s=!1}u()}}function pt(t,e,r,n){lt(e)(t,m(r),n)}function bt(t,e){return function(r,n,i){return t(r,e,n,i)}}function yt(t,e,r){r=R(r||L);var n=0,i=0,o=t.length;function a(t,e){t?r(t):++i!==o&&e!==j||r(null)}for(0===o&&r(null);n<o;n++)e(t[n],n,dt(a))}var gt=bt(pt,1/0),mt=function(t,e,r){(U(t)?yt:gt)(t,m(e),r)};function vt(t){return function(e,r,n){return t(mt,e,m(r),n)}}function wt(t,e,r,n){n=n||L,e=e||[];var i=[],o=0,a=m(r);t(e,(function(t,e,r){var n=o++;a(t,(function(t,e){i[n]=e,r(t)}))}),(function(t){n(t,i)}))}var _t=vt(wt),St=v(_t);function Et(t){return function(e,r,n,i){return t(lt(r),e,m(n),i)}}var At=Et(wt),xt=bt(At,1),Mt=v(xt);function kt(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var It,Bt=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),a=o.length;a--;){var s=o[It?a:++n];if(!1===e(i[s],s,i))break}return t};function Ot(t,e){return t&&Bt(t,e,ct)}function Tt(t){return t!=t}function Ut(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}(t,Tt,r)}var jt=function(t,e,r){"function"==typeof e&&(r=e,e=null),r=R(r||L);var n=ct(t).length;if(!n)return r(null);e||(e=n);var o={},a=0,s=!1,f=Object.create(null),u=[],c=[],h={};function d(t,e){u.push((function(){!function(t,e){if(!s){var n=dt((function(e,n){if(a--,arguments.length>2&&(n=i(arguments,1)),e){var u={};Ot(o,(function(t,e){u[e]=t})),u[t]=n,s=!0,f=Object.create(null),r(e,u)}else o[t]=n,p(t)}));a++;var u=m(e[e.length-1]);e.length>1?u(o,n):u(n)}}(t,e)}))}function l(){if(0===u.length&&0===a)return r(null,o);for(;u.length&&a<e;)u.shift()()}function p(t){kt(f[t]||[],(function(t){t()})),l()}function b(e){var r=[];return Ot(t,(function(t,n){q(t)&&Ut(t,e,0)>=0&&r.push(n)})),r}Ot(t,(function(e,r){if(!q(e))return d(r,[e]),void c.push(r);var n=e.slice(0,e.length-1),i=n.length;if(0===i)return d(r,e),void c.push(r);h[r]=i,kt(n,(function(o){if(!t[o])throw new Error("async.auto task `"+r+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var a,s,u;s=function(){0==--i&&d(r,e)},(u=f[a=o])||(u=f[a]=[]),u.push(s)}))})),function(){for(var t=0;c.length;)t++,kt(b(c.pop()),(function(t){0==--h[t]&&c.push(t)}));if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),l()};function Lt(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Rt=E?E.prototype:void 0,Pt=Rt?Rt.toString:void 0;function Ft(t){if("string"==typeof t)return t;if(q(t))return Lt(t,Ft)+"";if(function(t){return"symbol"==typeof t||F(t)&&"[object Symbol]"==O(t)}(t))return Pt?Pt.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Nt(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}(t,e,r)}var zt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Ct="[\\ud800-\\udfff]",$t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Dt="\\ud83c[\\udffb-\\udfff]",qt="[^\\ud800-\\udfff]",Ht="(?:\\ud83c[\\udde6-\\uddff]){2}",Vt="[\\ud800-\\udbff][\\udc00-\\udfff]",Kt="(?:"+$t+"|"+Dt+")?",Jt="[\\ufe0e\\ufe0f]?",Gt=Jt+Kt+("(?:\\u200d(?:"+[qt,Ht,Vt].join("|")+")"+Jt+Kt+")*"),Wt="(?:"+[qt+$t+"?",$t,Ht,Vt,Ct].join("|")+")",Zt=RegExp(Dt+"(?="+Dt+")|"+Wt+Gt,"g");function Xt(t){return function(t){return zt.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.split("")}(t)}var Yt=/^\s+|\s+$/g;function Qt(t,e,r){if((t=null==(n=t)?"":Ft(n))&&(r||void 0===e))return t.replace(Yt,"");var n;if(!t||!(e=Ft(e)))return t;var i=Xt(t),o=Xt(e);return Nt(i,function(t,e){for(var r=-1,n=t.length;++r<n&&Ut(e,t[r],0)>-1;);return r}(i,o),function(t,e){for(var r=t.length;r--&&Ut(e,t[r],0)>-1;);return r}(i,o)+1).join("")}var te=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,ee=/,/,re=/(=.+)?(\s*)$/,ne=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;function ie(t,e){var r={};Ot(t,(function(t,e){var n,i=g(t),o=!i&&1===t.length||i&&0===t.length;if(q(t))n=t.slice(0,-1),t=t[t.length-1],r[e]=n.concat(n.length>0?a:t);else if(o)r[e]=t;else{if(n=function(t){return(t=(t=(t=t.toString().replace(ne,"")).match(te)[2].replace(" ",""))?t.split(ee):[]).map((function(t){return Qt(t.replace(re,""))}))}(t),0===t.length&&!i&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");i||n.pop(),r[e]=n.concat(a)}function a(e,r){var i=Lt(n,(function(t){return e[t]}));i.push(r),m(t).apply(null,i)}})),jt(r,e)}function oe(){this.head=this.tail=null,this.length=0}function ae(t,e){t.length=1,t.head=t.tail=e}function se(t,e,r){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var n=m(t),i=0,o=[],a=!1;function s(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(c.started=!0,q(t)||(t=[t]),0===t.length&&c.idle())return d((function(){c.drain()}));for(var n=0,i=t.length;n<i;n++){var o={data:t[n],callback:r||L};e?c._tasks.unshift(o):c._tasks.push(o)}a||(a=!0,d((function(){a=!1,c.process()})))}function f(t){return function(e){i-=1;for(var r=0,n=t.length;r<n;r++){var a=t[r],s=Ut(o,a,0);0===s?o.shift():s>0&&o.splice(s,1),a.callback.apply(a,arguments),null!=e&&c.error(e,a.data)}i<=c.concurrency-c.buffer&&c.unsaturated(),c.idle()&&c.drain(),c.process()}}var u=!1,c={_tasks:new oe,concurrency:e,payload:r,saturated:L,unsaturated:L,buffer:e/4,empty:L,drain:L,error:L,started:!1,paused:!1,push:function(t,e){s(t,!1,e)},kill:function(){c.drain=L,c._tasks.empty()},unshift:function(t,e){s(t,!0,e)},remove:function(t){c._tasks.remove(t)},process:function(){if(!u){for(u=!0;!c.paused&&i<c.concurrency&&c._tasks.length;){var t=[],e=[],r=c._tasks.length;c.payload&&(r=Math.min(r,c.payload));for(var a=0;a<r;a++){var s=c._tasks.shift();t.push(s),o.push(s),e.push(s.data)}i+=1,0===c._tasks.length&&c.empty(),i===c.concurrency&&c.saturated();var h=dt(f(t));n(e,h)}u=!1}},length:function(){return c._tasks.length},running:function(){return i},workersList:function(){return o},idle:function(){return c._tasks.length+i===0},pause:function(){c.paused=!0},resume:function(){!1!==c.paused&&(c.paused=!1,d(c.process))}};return c}function fe(t,e){return se(t,1,e)}oe.prototype.removeLink=function(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t},oe.prototype.empty=function(){for(;this.head;)this.shift();return this},oe.prototype.insertAfter=function(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1},oe.prototype.insertBefore=function(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1},oe.prototype.unshift=function(t){this.head?this.insertBefore(this.head,t):ae(this,t)},oe.prototype.push=function(t){this.tail?this.insertAfter(this.tail,t):ae(this,t)},oe.prototype.shift=function(){return this.head&&this.removeLink(this.head)},oe.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},oe.prototype.toArray=function(){for(var t=Array(this.length),e=this.head,r=0;r<this.length;r++)t[r]=e.data,e=e.next;return t},oe.prototype.remove=function(t){for(var e=this.head;e;){var r=e.next;t(e)&&this.removeLink(e),e=r}return this};var ue=bt(pt,1);function ce(t,e,r,n){n=R(n||L);var i=m(r);ue(t,(function(t,r,n){i(e,t,(function(t,r){e=r,n(t)}))}),(function(t){n(t,e)}))}function he(){var t=Lt(arguments,m);return function(){var e=i(arguments),r=this,n=e[e.length-1];"function"==typeof n?e.pop():n=L,ce(t,e,(function(t,e,n){e.apply(r,t.concat((function(t){var e=i(arguments,1);n(t,e)})))}),(function(t,e){n.apply(r,[t].concat(e))}))}}var de=function(){return he.apply(null,i(arguments).reverse())},le=Array.prototype.concat,pe=function(t,e,r,n){n=n||L;var o=m(r);At(t,e,(function(t,e){o(t,(function(t){return t?e(t):e(null,i(arguments,1))}))}),(function(t,e){for(var r=[],i=0;i<e.length;i++)e[i]&&(r=le.apply(r,e[i]));return n(t,r)}))},be=bt(pe,1/0),ye=bt(pe,1),ge=function(){var t=i(arguments),e=[null].concat(t);return function(){return arguments[arguments.length-1].apply(this,e)}};function me(t){return t}function ve(t,e){return function(r,n,i,o){o=o||L;var a,s=!1;r(n,(function(r,n,o){i(r,(function(n,i){n?o(n):t(i)&&!a?(s=!0,a=e(!0,r),o(null,j)):o()}))}),(function(t){t?o(t):o(null,s?a:e(!1))}))}}function we(t,e){return e}var _e=vt(ve(me,we)),Se=Et(ve(me,we)),Ee=bt(Se,1);function Ae(t){return function(e){var r=i(arguments,1);r.push((function(e){var r=i(arguments,1);"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&kt(r,(function(e){console[t](e)})))})),m(e).apply(null,r)}}var xe=Ae("dir");function Me(t,e,r){r=dt(r||L);var n=m(t),o=m(e);function a(t){if(t)return r(t);var e=i(arguments,1);e.push(s),o.apply(this,e)}function s(t,e){return t?r(t):e?void n(a):r(null)}s(null,!0)}function ke(t,e,r){r=dt(r||L);var n=m(t),o=function(t){if(t)return r(t);var a=i(arguments,1);if(e.apply(this,a))return n(o);r.apply(null,[null].concat(a))};n(o)}function Ie(t,e,r){ke(t,(function(){return!e.apply(this,arguments)}),r)}function Be(t,e,r){r=dt(r||L);var n=m(e),i=m(t);function o(t){if(t)return r(t);i(a)}function a(t,e){return t?r(t):e?void n(o):r(null)}i(a)}function Oe(t){return function(e,r,n){return t(e,n)}}function Te(t,e,r){mt(t,Oe(m(e)),r)}function Ue(t,e,r,n){lt(e)(t,Oe(m(r)),n)}var je=bt(Ue,1);function Le(t){return g(t)?t:a((function(e,r){var n=!0;e.push((function(){var t=arguments;n?d((function(){r.apply(null,t)})):r.apply(null,t)})),t.apply(this,e),n=!1}))}function Re(t){return!t}var Pe=vt(ve(Re,Re)),Fe=Et(ve(Re,Re)),Ne=bt(Fe,1);function ze(t){return function(e){return null==e?void 0:e[t]}}function Ce(t,e,r,n){var i=new Array(e.length);t(e,(function(t,e,n){r(t,(function(t,r){i[e]=!!r,n(t)}))}),(function(t){if(t)return n(t);for(var r=[],o=0;o<e.length;o++)i[o]&&r.push(e[o]);n(null,r)}))}function $e(t,e,r,n){var i=[];t(e,(function(t,e,n){r(t,(function(r,o){r?n(r):(o&&i.push({index:e,value:t}),n())}))}),(function(t){t?n(t):n(null,Lt(i.sort((function(t,e){return t.index-e.index})),ze("value")))}))}function De(t,e,r,n){(U(e)?Ce:$e)(t,e,m(r),n||L)}var qe=vt(De),He=Et(De),Ve=bt(He,1);function Ke(t,e){var r=dt(e||L),n=m(Le(t));!function t(e){if(e)return r(e);n(t)}()}var Je=function(t,e,r,n){n=n||L;var i=m(r);At(t,e,(function(t,e){i(t,(function(r,n){return r?e(r):e(null,{key:n,val:t})}))}),(function(t,e){for(var r={},i=Object.prototype.hasOwnProperty,o=0;o<e.length;o++)if(e[o]){var a=e[o].key,s=e[o].val;i.call(r,a)?r[a].push(s):r[a]=[s]}return n(t,r)}))},Ge=bt(Je,1/0),We=bt(Je,1),Ze=Ae("log");function Xe(t,e,r,n){n=R(n||L);var i={},o=m(r);pt(t,e,(function(t,e,r){o(t,e,(function(t,n){if(t)return r(t);i[e]=n,r()}))}),(function(t){n(t,i)}))}var Ye=bt(Xe,1/0),Qe=bt(Xe,1);function tr(t,e){return e in t}function er(t,e){var r=Object.create(null),n=Object.create(null);e=e||me;var o=m(t),s=a((function(t,a){var s=e.apply(null,t);tr(r,s)?d((function(){a.apply(null,r[s])})):tr(n,s)?n[s].push(a):(n[s]=[a],o.apply(null,t.concat((function(){var t=i(arguments);r[s]=t;var e=n[s];delete n[s];for(var o=0,a=e.length;o<a;o++)e[o].apply(null,t)}))))}));return s.memo=r,s.unmemoized=t,s}var rr=h(u?n.nextTick:f?setImmediate:c);function nr(t,e,r){r=r||L;var n=U(e)?[]:{};t(e,(function(t,e,r){m(t)((function(t,o){arguments.length>2&&(o=i(arguments,1)),n[e]=o,r(t)}))}),(function(t){r(t,n)}))}function ir(t,e){nr(mt,t,e)}function or(t,e,r){nr(lt(e),t,r)}var ar=function(t,e){var r=m(t);return se((function(t,e){r(t[0],e)}),e,1)},sr=function(t,e){var r=ar(t,e);return r.push=function(t,e,n){if(null==n&&(n=L),"function"!=typeof n)throw new Error("task callback must be a function");if(r.started=!0,q(t)||(t=[t]),0===t.length)return d((function(){r.drain()}));e=e||0;for(var i=r._tasks.head;i&&e>=i.priority;)i=i.next;for(var o=0,a=t.length;o<a;o++){var s={data:t[o],priority:e,callback:n};i?r._tasks.insertBefore(i,s):r._tasks.push(s)}d(r.process)},delete r.unshift,r};function fr(t,e){if(e=R(e||L),!q(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var r=0,n=t.length;r<n;r++)m(t[r])(e)}function ur(t,e,r,n){ce(i(t).reverse(),e,r,n)}function cr(t){var e=m(t);return a((function(t,r){return t.push((function(t,e){var n;t?r(null,{error:t}):(n=arguments.length<=2?e:i(arguments,1),r(null,{value:n}))})),e.apply(this,t)}))}function hr(t){var e;return q(t)?e=Lt(t,cr):(e={},Ot(t,(function(t,r){e[r]=cr.call(this,t)}))),e}function dr(t,e,r,n){De(t,e,(function(t,e){r(t,(function(t,r){e(t,!r)}))}),n)}var lr=vt(dr),pr=Et(dr),br=bt(pr,1);function yr(t){return function(){return t}}function gr(t,e,r){var n=5,i=0,o={times:n,intervalFunc:yr(i)};function a(t,e){if("object"==typeof e)t.times=+e.times||n,t.intervalFunc="function"==typeof e.interval?e.interval:yr(+e.interval||i),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||n}}if(arguments.length<3&&"function"==typeof t?(r=e||L,e=t):(a(o,t),r=r||L),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var s=m(e),f=1;function u(){s((function(t){t&&f++<o.times&&("function"!=typeof o.errorFilter||o.errorFilter(t))?setTimeout(u,o.intervalFunc(f)):r.apply(null,arguments)}))}u()}var mr=function(t,e){e||(e=t,t=null);var r=m(e);return a((function(e,n){function i(t){r.apply(null,e.concat(t))}t?gr(t,i,n):gr(i,n)}))};function vr(t,e){nr(ue,t,e)}var wr=vt(ve(Boolean,me)),_r=Et(ve(Boolean,me)),Sr=bt(_r,1);function Er(t,e,r){var n=m(e);function i(t,e){var r=t.criteria,n=e.criteria;return r<n?-1:r>n?1:0}_t(t,(function(t,e){n(t,(function(r,n){if(r)return e(r);e(null,{value:t,criteria:n})}))}),(function(t,e){if(t)return r(t);r(null,Lt(e.sort(i),ze("value")))}))}function Ar(t,e,r){var n=m(t);return a((function(i,o){var a,s=!1;i.push((function(){s||(o.apply(null,arguments),clearTimeout(a))})),a=setTimeout((function(){var e=t.name||"anonymous",n=new Error('Callback function "'+e+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),s=!0,o(n)}),e),n.apply(null,i)}))}var xr=Math.ceil,Mr=Math.max;function kr(t,e,r,n){var i=m(r);At(function(t,e,r,n){for(var i=-1,o=Mr(xr((e-t)/(r||1)),0),a=Array(o);o--;)a[n?o:++i]=t,t+=r;return a}(0,t,1),e,i,n)}var Ir=bt(kr,1/0),Br=bt(kr,1);function Or(t,e,r,n){arguments.length<=3&&(n=r,r=e,e=q(t)?[]:{}),n=R(n||L);var i=m(r);mt(t,(function(t,r,n){i(e,t,r,n)}),(function(t){n(t,e)}))}function Tr(t,e){var r,n=null;e=e||L,je(t,(function(t,e){m(t)((function(t,o){r=arguments.length>2?i(arguments,1):o,n=t,e(!t)}))}),(function(){e(n,r)}))}function Ur(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function jr(t,e,r){r=dt(r||L);var n=m(e);if(!t())return r(null);var o=function(e){if(e)return r(e);if(t())return n(o);var a=i(arguments,1);r.apply(null,[null].concat(a))};n(o)}function Lr(t,e,r){jr((function(){return!t.apply(this,arguments)}),e,r)}var Rr=function(t,e){if(e=R(e||L),!q(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function n(e){var n=m(t[r++]);e.push(dt(o)),n.apply(null,e)}function o(o){if(o||r===t.length)return e.apply(null,arguments);n(i(arguments,1))}n([])},Pr={apply:o,applyEach:St,applyEachSeries:Mt,asyncify:l,auto:jt,autoInject:ie,cargo:fe,compose:de,concat:be,concatLimit:pe,concatSeries:ye,constant:ge,detect:_e,detectLimit:Se,detectSeries:Ee,dir:xe,doDuring:Me,doUntil:Ie,doWhilst:ke,during:Be,each:Te,eachLimit:Ue,eachOf:mt,eachOfLimit:pt,eachOfSeries:ue,eachSeries:je,ensureAsync:Le,every:Pe,everyLimit:Fe,everySeries:Ne,filter:qe,filterLimit:He,filterSeries:Ve,forever:Ke,groupBy:Ge,groupByLimit:Je,groupBySeries:We,log:Ze,map:_t,mapLimit:At,mapSeries:xt,mapValues:Ye,mapValuesLimit:Xe,mapValuesSeries:Qe,memoize:er,nextTick:rr,parallel:ir,parallelLimit:or,priorityQueue:sr,queue:ar,race:fr,reduce:ce,reduceRight:ur,reflect:cr,reflectAll:hr,reject:lr,rejectLimit:pr,rejectSeries:br,retry:gr,retryable:mr,seq:he,series:vr,setImmediate:d,some:wr,someLimit:_r,someSeries:Sr,sortBy:Er,timeout:Ar,times:Ir,timesLimit:kr,timesSeries:Br,transform:Or,tryEach:Tr,unmemoize:Ur,until:Lr,waterfall:Rr,whilst:jr,all:Pe,allLimit:Fe,allSeries:Ne,any:wr,anyLimit:_r,anySeries:Sr,find:_e,findLimit:Se,findSeries:Ee,forEach:Te,forEachSeries:je,forEachLimit:Ue,forEachOf:mt,forEachOfSeries:ue,forEachOfLimit:pt,inject:ce,foldl:ce,foldr:ur,select:qe,selectLimit:He,selectSeries:Ve,wrapSync:l};e.default=Pr,e.apply=o,e.applyEach=St,e.applyEachSeries=Mt,e.asyncify=l,e.auto=jt,e.autoInject=ie,e.cargo=fe,e.compose=de,e.concat=be,e.concatLimit=pe,e.concatSeries=ye,e.constant=ge,e.detect=_e,e.detectLimit=Se,e.detectSeries=Ee,e.dir=xe,e.doDuring=Me,e.doUntil=Ie,e.doWhilst=ke,e.during=Be,e.each=Te,e.eachLimit=Ue,e.eachOf=mt,e.eachOfLimit=pt,e.eachOfSeries=ue,e.eachSeries=je,e.ensureAsync=Le,e.every=Pe,e.everyLimit=Fe,e.everySeries=Ne,e.filter=qe,e.filterLimit=He,e.filterSeries=Ve,e.forever=Ke,e.groupBy=Ge,e.groupByLimit=Je,e.groupBySeries=We,e.log=Ze,e.map=_t,e.mapLimit=At,e.mapSeries=xt,e.mapValues=Ye,e.mapValuesLimit=Xe,e.mapValuesSeries=Qe,e.memoize=er,e.nextTick=rr,e.parallel=ir,e.parallelLimit=or,e.priorityQueue=sr,e.queue=ar,e.race=fr,e.reduce=ce,e.reduceRight=ur,e.reflect=cr,e.reflectAll=hr,e.reject=lr,e.rejectLimit=pr,e.rejectSeries=br,e.retry=gr,e.retryable=mr,e.seq=he,e.series=vr,e.setImmediate=d,e.some=wr,e.someLimit=_r,e.someSeries=Sr,e.sortBy=Er,e.timeout=Ar,e.times=Ir,e.timesLimit=kr,e.timesSeries=Br,e.transform=Or,e.tryEach=Tr,e.unmemoize=Ur,e.until=Lr,e.waterfall=Rr,e.whilst=jr,e.all=Pe,e.allLimit=Fe,e.allSeries=Ne,e.any=wr,e.anyLimit=_r,e.anySeries=Sr,e.find=_e,e.findLimit=Se,e.findSeries=Ee,e.forEach=Te,e.forEachSeries=je,e.forEachLimit=Ue,e.forEachOf=mt,e.forEachOfSeries=ue,e.forEachOfLimit=pt,e.inject=ce,e.foldl=ce,e.foldr=ur,e.select=qe,e.selectLimit=He,e.selectSeries=Ve,e.wrapSync=l,Object.defineProperty(e,"__esModule",{value:!0})}(e)},8166:t=>{"use strict";t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),o=i.charCodeAt(0);if(255!==e[o])throw new TypeError(i+" is ambiguous");e[o]=n}var a=t.length,s=t.charAt(0),f=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return new Uint8Array;for(var r=0,n=0,i=0;t[r]===s;)n++,r++;for(var o=(t.length-r)*f+1>>>0,u=new Uint8Array(o);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var h=0,d=o-1;(0!==c||h<i)&&-1!==d;d--,h++)c+=a*u[d]>>>0,u[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");i=h,r++}for(var l=o-i;l!==o&&0===u[l];)l++;for(var p=new Uint8Array(n+(o-l)),b=n;l!==o;)p[b++]=u[l++];return p}return{encode:function(e){if(e instanceof Uint8Array||(ArrayBuffer.isView(e)?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Array.isArray(e)&&(e=Uint8Array.from(e))),!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===e.length)return"";for(var r=0,n=0,i=0,o=e.length;i!==o&&0===e[i];)i++,r++;for(var f=(o-i)*u+1>>>0,c=new Uint8Array(f);i!==o;){for(var h=e[i],d=0,l=f-1;(0!==h||d<n)&&-1!==l;l--,d++)h+=256*c[l]>>>0,c[l]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");n=d,i++}for(var p=f-n;p!==f&&0===c[p];)p++;for(var b=s.repeat(r);p<f;++p)b+=t.charAt(c[p]);return b},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},5766:(t,e)=>{"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=f(t),a=o[0],s=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,f=n-i;s<f;s+=a)o.push(u(t,s,s+a>f?f:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2573:(t,e,r)=>{"use strict";var n=r(8834).Buffer,i=r(1329);function o(t,e){return void 0===e&&(e="utf8"),n.isBuffer(t)?s(t.toString("base64")):s(n.from(t,e).toString("base64"))}function a(t){return t=t.toString(),i.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function s(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var f=o;f.encode=o,f.decode=function(t,e){return void 0===e&&(e="utf8"),n.from(a(t),"base64").toString(e)},f.toBase64=a,f.fromBase64=s,f.toBuffer=function(t){return n.from(a(t),"base64")},e.default=f},1329:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=e%4;if(!r)return t;var i=e,o=4-r,a=e+o,s=n.alloc(a);for(s.write(t);o--;)s.write("=",i++);return s.toString()}},9487:(t,e,r)=>{t.exports=r(2573).default,t.exports.default=t.exports},2745:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},7022:(t,e,r)=>{const n=r(8166);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8834:(t,e,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;const a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|b(t,e);let n=s(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);const i=function(t){if(f.isBuffer(t)){const e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Z(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){const e=t.length<0?0:0|p(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===f)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){let r=!0;for(let n=0;n<f;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(e.substr(2*a,2),16);if(Z(n))return a;t[r+a]=n}return a}function _(t,e,r,n){return G(K(e,t.length-r),t,r,n)}function S(t,e,r,n){return G(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return G(J(e),t,r,n)}function A(t,e,r,n){return G(function(t,e){let r,n,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,f;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(f=(31&e)<<6|63&r,f>127&&(o=f));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(f=(15&e)<<12|(63&r)<<6|63&n,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(f=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if(W(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=f.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))i+e.length>n.length?(f.isBuffer(e)||(e=f.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!f.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<s;++t)if(u[t]!==c[t]){o=u[t],a=c[t];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function T(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function R(t,e,r,n,i){D(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readBigUInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),f.prototype.readBigUInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readBigInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),f.prototype.readBigInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||H(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigUInt64LE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeBigUInt64BE=Y((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeBigInt64LE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeBigInt64BE=Y((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),f.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=f.isBuffer(t)?t:f.from(t,n),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%a]}return this};const z={};function C(t,e,r){z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function D(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new z.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||H(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!=typeof t)throw new z.ERR_INVALID_ARG_TYPE(e,"number",t)}function H(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new z.ERR_BUFFER_OUT_OF_BOUNDS;throw new z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}C("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),C("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),C("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},8098:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32ToB58=e.b58ToC32=e.c32addressDecode=e.c32address=e.versions=void 0;var n=r(392),i=r(2716);e.versions={mainnet:{p2pkh:22,p2sh:20},testnet:{p2pkh:26,p2sh:21}};var o={};o[0]=e.versions.mainnet.p2pkh,o[5]=e.versions.mainnet.p2sh,o[111]=e.versions.testnet.p2pkh,o[196]=e.versions.testnet.p2sh;var a={};function s(t,e){if(!e.match(/^[0-9a-fA-F]{40}$/))throw new Error("Invalid argument: not a hash160 hex string");return"S"+n.c32checkEncode(t,e)}function f(t){if(t.length<=5)throw new Error("Invalid c32 address: invalid length");if("S"!=t[0])throw new Error('Invalid c32 address: must start with "S"');return n.c32checkDecode(t.slice(1))}a[e.versions.mainnet.p2pkh]=0,a[e.versions.mainnet.p2sh]=5,a[e.versions.testnet.p2pkh]=111,a[e.versions.testnet.p2sh]=196,e.c32address=s,e.c32addressDecode=f,e.b58ToC32=function(t,e){void 0===e&&(e=-1);var r,n=i.decode(t),a=n.data.toString("hex"),f=parseInt(n.prefix.toString("hex"),16);return e<0?(r=f,void 0!==o[f]&&(r=o[f])):r=e,s(r,a)},e.c32ToB58=function(t,e){void 0===e&&(e=-1);var r,n=f(t),o=n[0],s=n[1];e<0?(r=o,void 0!==a[o]&&(r=a[o])):r=e;var u=r.toString(16);return 1===u.length&&(u="0"+u),i.encode(s,u)}},2716:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0;var n=r(8131),i=r(9926),o=r(9805),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";e.encode=function(t,e,r){if(void 0===e&&(e="00"),void 0===r&&(r="hex"),"string"==typeof t&&(t=new n.Buffer(t,r)),!(t instanceof n.Buffer))throw new TypeError('"data" argument must be an Array of Buffers');e instanceof n.Buffer||(e=new n.Buffer(e,r));var s=n.Buffer.concat([e,t]);return s=i.hashSha256(s),s=i.hashSha256(s),s=n.Buffer.concat([e,t,s.slice(0,4)]),o(a).encode(s)},e.decode=function(t,e){var r=new n.Buffer(o(a).decode(t)),s=r.slice(0,1),f=r.slice(1,-4),u=n.Buffer.concat([s,f]);return u=i.hashSha256(u),u=i.hashSha256(u),r.slice(-4).forEach((function(t,e){if(t!==u[e])throw new Error("Invalid checksum")})),e&&(s=s.toString(e),f=f.toString(e)),{prefix:s,data:f}}},392:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32checkDecode=e.c32checkEncode=void 0;var n=r(8131),i=r(4103),o=r(9926);function a(t){return o.hashSha256(o.hashSha256(n.Buffer.from(t,"hex"))).slice(0,4).toString("hex")}e.c32checkEncode=function(t,e){if(t<0||t>=32)throw new Error("Invalid version (must be between 0 and 31)");if(!e.match(/^[0-9a-fA-F]*$/))throw new Error("Invalid data (not a hex string)");(e=e.toLowerCase()).length%2!=0&&(e="0"+e);var r=t.toString(16);1===r.length&&(r="0"+r);var n=a(""+r+e),o=i.c32encode(""+e+n);return""+i.c32[t]+o},e.c32checkDecode=function(t){t=i.c32normalize(t);var e=i.c32decode(t.slice(1)),r=t[0],n=i.c32.indexOf(r),o=e.slice(-8),s=n.toString(16);if(1===s.length&&(s="0"+s),a(""+s+e.substring(0,e.length-8))!==o)throw new Error("Invalid c32check string: checksum mismatch");return[n,e.substring(0,e.length-8)]}},4103:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.c32decode=e.c32normalize=e.c32encode=e.c32=void 0;var n=r(8131);e.c32="0123456789ABCDEFGHJKMNPQRSTVWXYZ";var i="0123456789abcdef";function o(t){return t.toUpperCase().replace(/O/g,"0").replace(/L|I/g,"1")}e.c32encode=function(t,r){if(!t.match(/^[0-9a-fA-F]*$/))throw new Error("Not a hex-encoded string");t.length%2!=0&&(t="0"+t);for(var o=[],a=0,s=(t=t.toLowerCase()).length-1;s>=0;s--)if(a<4){var f=i.indexOf(t[s])>>a,u=0;0!==s&&(u=i.indexOf(t[s-1]));var c=1+a,h=u%(1<<c)<<5-c,d=e.c32[f+h];a=c,o.unshift(d)}else a=0;var l=0;for(s=0;s<o.length&&"0"===o[s];s++)l++;o=o.slice(l);var p=n.Buffer.from(t,"hex").toString().match(/^\u0000*/),b=p?p[0].length:0;for(s=0;s<b;s++)o.unshift(e.c32[0]);if(r){var y=r-o.length;for(s=0;s<y;s++)o.unshift(e.c32[0])}return o.join("")},e.c32normalize=o,e.c32decode=function(t,r){if(!(t=o(t)).match("^["+e.c32+"]*$"))throw new Error("Not a c32-encoded string");for(var n=t.match("^"+e.c32[0]+"*"),a=n?n[0].length:0,s=[],f=0,u=0,c=t.length-1;c>=0;c--){4===u&&(s.unshift(i[f]),u=0,f=0);var h=(e.c32.indexOf(t[c])<<u)+f,d=i[h%16];if((f=h>>4)>1<<(u+=1))throw new Error("Panic error in decoding.");s.unshift(d)}s.unshift(i[f]),s.length%2==1&&s.unshift("0");var l=0;for(c=0;c<s.length&&"0"===s[c];c++)l++;var p=(s=s.slice(l-l%2)).join("");for(c=0;c<a;c++)p="00"+p;if(r){var b=2*r-p.length;for(c=0;c<b;c+=2)p="00"+p}return p}},2870:(t,e,r)=>{"use strict";e.H4=void 0;r(4103),r(392);var n=r(8098);Object.defineProperty(e,"H4",{enumerable:!0,get:function(){return n.c32address}})},9805:(t,e,r)=>{"use strict";var n=r(7834).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(255!==e[a])throw new TypeError(o+" is ambiguous");e[a]=i}var s=t.length,f=t.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===f;)i++,r++;for(var a=(t.length-r)*u+1>>>0,c=new Uint8Array(a);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var d=0,l=a-1;(0!==h||d<o)&&-1!==l;l--,d++)h+=s*c[l]>>>0,c[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");o=d,r++}for(var p=a-o;p!==a&&0===c[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var y=i;p!==a;)b[y++]=c[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var u=(a-o)*c+1>>>0,h=new Uint8Array(u);o!==a;){for(var d=e[o],l=0,p=u-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*h[p]>>>0,h[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=u-i;b!==u&&0===h[b];)b++;for(var y=f.repeat(r);b<u;++b)y+=t.charAt(h[b]);return y},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},8131:(t,e,r)=>{"use strict";var n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){for(var e=t.length<0?0:0|p(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,d=0;d<f;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(D(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return C(N(e,t.length-r),t,r,n)}function S(t,e,r,n){return C(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return C(z(e),t,r,n)}function A(t,e,r,n){return C(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if($(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q[t[o]];return i}function T(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:f.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+/0-9A-Za-z-_]/g;function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},3616:function(){!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function b(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var t,e,r,n=l(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=p(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[u(t)]},d.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},d.prototype.set=function(t,e){this.map[u(t)]=c(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},d.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},d.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,i=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function _(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var S=[301,302,303,307,308];_.redirect=function(t,e){if(-1===S.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function E(t,r){return new Promise((function(n,o){var a=new v(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new _(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,t.fetch||(t.fetch=E,t.Headers=d,t.Request=v,t.Response=_),e.Headers=d,e.Request=v,e.Response=_,e.fetch=E,Object.defineProperty(e,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this)},9926:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hashSha256=e.sha256=e.sha256nodeCrypto=e.sha256js=void 0;var n=r(3878),i=function(){function t(){this._blockSize=64,this._finalSize=56,this._len=0,this._w=new Array(64),this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this._block=n.Buffer.alloc(this._blockSize)}return t.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.Buffer.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var f=a%i,u=Math.min(o-s,i-f),c=0;c<u;c++)r[f+c]=t[s+c];s+=u,(a+=u)%i==0&&this._update(r)}return this._len+=o,this},t.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,o=(r-i)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var a=n.Buffer.alloc(32);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a.writeInt32BE(this._h,28),t?a.toString(t):a},t.prototype.ch=function(t,e,r){return r^t&(e^r)},t.prototype.maj=function(t,e,r){return t&e|r&(t|e)},t.prototype.sigma0=function(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)},t.prototype.sigma1=function(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)},t.prototype.gamma0=function(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3},t.prototype.gamma1=function(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10},t.prototype._update=function(e){for(var r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,s=0|this._e,f=0|this._f,u=0|this._g,c=0|this._h,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<64;++h)r[h]=this.gamma1(r[h-2])+r[h-7]+this.gamma0(r[h-15])+r[h-16]|0;for(var d=0;d<64;++d){var l=c+this.sigma1(s)+this.ch(s,f,u)+t.K[d]+r[d]|0,p=this.sigma0(n)+this.maj(n,i,o)|0;c=u,u=f,f=s,s=a+l|0,a=o,o=i,i=n,n=l+p|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=f+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},t.K=[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],t}();e.sha256js=i;var o=function(){function t(){t.useCryptoModuleCache&&void 0!==t.nodeCryptoCreateHash||(t.nodeCryptoCreateHash=r(9096).createHash),this.hash=t.nodeCryptoCreateHash("sha256")}return t.prototype.update=function(t,e){return this.hash.update(t,e),this},t.prototype.digest=function(t){return t?this.hash.digest(t):this.hash.digest()},t.useCryptoModuleCache=!0,t}();e.sha256nodeCrypto=o;var a=void 0,s=function(){function t(){!function(){if(o.useCryptoModuleCache&&void 0!==a)return a;var t=!1;try{var e=r(9096);t=e&&"function"==typeof e.createHash}catch(t){}return a=t,t}()?this.instance=new i:this.instance=new o}return t.prototype.update=function(t,e){return this.instance.update(t,e),this},t.prototype.digest=function(t){return t?this.instance.digest(t):this.instance.digest()},t}();function f(t){return(new s).update(t).digest()}e.sha256=s,e.hashSha256=f,e.default=f},3878:(t,e,r)=>{"use strict";var n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50;var a=2147483647;function s(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,f.prototype),e}function f(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){var e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return f.from(n,e,r);var i=function(t){if(f.isBuffer(t)){var e=0|p(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?s(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return f.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),s(t<0?0:0|p(t))}function d(t){for(var e=t.length<0?0:0|p(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,f.prototype),n}function p(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function b(t,e){if(f.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:N(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+f>s&&(r=s-f),o=r;o>=0;o--){for(var h=!0,d=0;d<f;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(D(s))return a;t[r+a]=s}return a}function _(t,e,r,n){return C(N(e,t.length-r),t,r,n)}function S(t,e,r,n){return C(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return C(z(e),t,r,n)}function A(t,e,r,n){return C(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,f,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=a,f.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),f.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}}),f.poolSize=8192,f.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array),f.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},f.allocUnsafe=function(t){return h(t)},f.allocUnsafeSlow=function(t){return h(t)},f.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==f.prototype},f.compare=function(t,e){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),$(e,Uint8Array)&&(e=f.from(e,e.offset,e.byteLength)),!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if($(o,Uint8Array))i+o.length>n.length?f.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},f.byteLength=b,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},f.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?M(this,0,t):y.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(f.prototype[o]=f.prototype.inspect),f.prototype.compare=function(t,e,r,n,i){if($(t,Uint8Array)&&(t=f.from(t,t.offset,t.byteLength)),!f.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q[t[o]];return i}function T(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||L(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,f.prototype),n},f.prototype.readUintLE=f.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUintBE=f.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUint8=f.prototype.readUInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),this[t]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(t,e){return t>>>=0,e||U(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||U(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return t>>>=0,e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){t>>>=0,e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return t>>>=0,e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return t>>>=0,e||U(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return t>>>=0,e||U(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUintLE=f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUint8=f.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},f.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(!f.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=f.isBuffer(t)?t:f.from(t,n),s=a.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+/0-9A-Za-z-_]/g;function N(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function C(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},6120:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(2221);function o(t){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function a(t,e,r){for(var n=0;e+n<r&&0===t[e+n];)++n;return t[e+n]>=128&&--n,n}t.exports={derToJose:function(t,e){t=o(t);var r=i(e),a=r+1,s=t.length,f=0;if(48!==t[f++])throw new Error('Could not find expected "seq"');var u=t[f++];if(129===u&&(u=t[f++]),s-f<u)throw new Error('"seq" specified length of "'+u+'", only "'+(s-f)+'" remaining');if(2!==t[f++])throw new Error('Could not find expected "int" for "r"');var c=t[f++];if(s-f-2<c)throw new Error('"r" specified length of "'+c+'", only "'+(s-f-2)+'" available');if(a<c)throw new Error('"r" specified length of "'+c+'", max of "'+a+'" is acceptable');var h=f;if(f+=c,2!==t[f++])throw new Error('Could not find expected "int" for "s"');var d=t[f++];if(s-f!==d)throw new Error('"s" specified length of "'+d+'", expected "'+(s-f)+'"');if(a<d)throw new Error('"s" specified length of "'+d+'", max of "'+a+'" is acceptable');var l=f;if((f+=d)!==s)throw new Error('Expected to consume entire buffer, but "'+(s-f)+'" bytes remain');var p=r-c,b=r-d,y=n.allocUnsafe(p+c+b+d);for(f=0;f<p;++f)y[f]=0;t.copy(y,f,h+Math.max(-p,0),h+c);for(var g=f=r;f<g+b;++f)y[f]=0;return t.copy(y,f,l+Math.max(-b,0),l+d),(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(t,e){t=o(t);var r=i(e),s=t.length;if(s!==2*r)throw new TypeError('"'+e+'" signatures must be "'+2*r+'" bytes, saw "'+s+'"');var f=a(t,0,r),u=a(t,r,t.length),c=r-f,h=r-u,d=2+c+1+1+h,l=d<128,p=n.allocUnsafe((l?2:3)+d),b=0;return p[b++]=48,l?p[b++]=d:(p[b++]=129,p[b++]=255&d),p[b++]=2,p[b++]=c,f<0?(p[b++]=0,b+=t.copy(p,b,0,r)):b+=t.copy(p,b,f,r),p[b++]=2,p[b++]=h,u<0?(p[b++]=0,t.copy(p,b,r)):t.copy(p,b,r+u),p}}},2221:t=>{"use strict";function e(t){return(t/8|0)+(t%8==0?0:1)}var r={ES256:e(256),ES384:e(384),ES512:e(521)};t.exports=function(t){var e=r[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}},7554:(t,e,r)=>{"use strict";var n=e;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(8610),n.curves=r(1479),n.ec=r(8596),n.eddsa=r(9208)},8919:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.getNAF,a=i.getJSF,s=i.assert;function f(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,f,u=[];for(a=0;a<n.length;a+=r.step){f=0;for(var c=a+r.step-1;c>=a;c--)f=(f<<1)+n[c];u.push(f)}for(var h=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a<u.length;a++)(f=u[a])===l?d=d.mixedAdd(r.points[a]):f===-l&&(d=d.mixedAdd(r.points[a].neg()));h=h.add(d)}return h.toP()},f.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(e,r,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var c=0;u>=0&&0===a[u];u--)c++;if(u>=0&&c++,f=f.dblp(c),u<0)break;var h=a[u];s(0!==h),f="affine"===t.type?h>0?f.mixedAdd(i[h-1>>1]):f.mixedAdd(i[-h-1>>1].neg()):h>0?f.add(i[h-1>>1]):f.add(i[-h-1>>1].neg())}return"affine"===t.type?f.toP():f},f.prototype._wnafMulAdd=function(t,e,r,n,i){var s,f,u,c=this._wnafT1,h=this._wnafT2,d=this._wnafT3,l=0;for(s=0;s<n;s++){var p=(u=e[s])._getNAFPoints(t);c[s]=p.wnd,h[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,y=s;if(1===c[b]&&1===c[y]){var g=[e[b],null,null,e[y]];0===e[b].y.cmp(e[y].y)?(g[1]=e[b].add(e[y]),g[2]=e[b].toJ().mixedAdd(e[y].neg())):0===e[b].y.cmp(e[y].y.redNeg())?(g[1]=e[b].toJ().mixedAdd(e[y]),g[2]=e[b].add(e[y].neg())):(g[1]=e[b].toJ().mixedAdd(e[y]),g[2]=e[b].toJ().mixedAdd(e[y].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[b],r[y]);for(l=Math.max(v[0].length,l),d[b]=new Array(l),d[y]=new Array(l),f=0;f<l;f++){var w=0|v[0][f],_=0|v[1][f];d[b][f]=m[3*(w+1)+(_+1)],d[y][f]=0,h[b]=g}}else d[b]=o(r[b],c[b],this._bitLength),d[y]=o(r[y],c[y],this._bitLength),l=Math.max(d[b].length,l),l=Math.max(d[y].length,l)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(s=l;s>=0;s--){for(var A=0;s>=0;){var x=!0;for(f=0;f<n;f++)E[f]=0|d[f][s],0!==E[f]&&(x=!1);if(!x)break;A++,s--}if(s>=0&&A++,S=S.dblp(A),s<0)break;for(f=0;f<n;f++){var M=E[f];0!==M&&(M>0?u=h[f][M-1>>1]:M<0&&(u=h[f][-M-1>>1].neg()),S="affine"===u.type?S.mixedAdd(u):S.add(u))}}for(s=0;s<n;s++)h[s]=null;return i?S:S.toP()},f.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},f.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?s(t[t.length-1]%2==0):7===t[0]&&s(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},u.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},u.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},7105:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),a=r(8919),s=n.assert;function f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(f,a),t.exports=f,f.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var f=s.fromRed().isOdd();return(e&&!f||!e&&f)&&(s=s.redNeg()),this.point(t,s)},f.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,a.BasePoint),f.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},f.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),f=i.redMul(a),u=o.redMul(s),c=i.redMul(s),h=a.redMul(o);return this.curve.point(f,u,h,c)},u.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(f);this.zOne?(t=a.redSub(s).redSub(f).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(f)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),t=a.redSub(s).redISub(f).redMul(o),e=u.redMul(n.redSub(f)),r=u.redMul(o))}else n=s.redAdd(f),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(f)),r=n.redMul(o);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),f=r.redAdd(e),u=o.redMul(a),c=s.redMul(f),h=o.redMul(f),d=a.redMul(s);return this.curve.point(u,c,d,h)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),f=i.redSub(s),u=i.redAdd(s),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(f).redMul(c);return this.curve.twisted?(e=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=f.redMul(u)):(e=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(f).redMul(u)),this.curve.point(h,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},8610:(t,e,r)=>{"use strict";var n=e;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(t,e,r)=>{"use strict";var n=r(2140),i=r(1285),o=r(8919),a=r(8288);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(f,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new f(this,t,e)},s.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),f=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,f)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),a=r(8919),s=n.assert;function f(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(f,a),t.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,f,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),g=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);u=l.sub(v.mul(d)),c=y.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&u.cmp(h)<0)e=f.neg(),r=p,n=u.neg(),o=c;else if(n&&2==++m)break;f=u,l=d,d=u,y=p,p=c,g=b,b=w}a=u.neg(),s=c;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a,b:s}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),f=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:f.add(u).neg()}},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var a=this._endoSplit(e[o]),s=t[o],f=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),f=f.neg(!0)),n[2*o]=s,n[2*o+1]=f,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return u},o(u,a.BasePoint),f.prototype.point=function(t,e,r){return new u(this,t,e,r)},f.prototype.pointFromJSON=function(t,e){return u.fromJSON(this,t,e)},u.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,a.BasePoint),f.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),f=o.redSub(a);if(0===s.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),h=n.redMul(u),d=f.redSqr().redIAdd(c).redISub(h).redISub(h),l=f.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),u=f.redMul(a),c=r.redMul(f),h=s.redSqr().redIAdd(u).redISub(c).redISub(c),d=s.redMul(c.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,f=s.redSqr().redSqr(),u=a.redAdd(a);for(e=0;e<t;e++){var c=o.redSqr(),h=u.redSqr(),d=h.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),p=o.redMul(h),b=l.redSqr().redISub(p.redAdd(p)),y=p.redISub(b),g=l.redMul(y);g=g.redIAdd(g).redISub(d);var m=u.redMul(s);e+1<t&&(f=f.redMul(d)),o=b,s=m,u=g}return this.curve.jpoint(o,u.redMul(i),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),f=s.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=f,e=s.redMul(a.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(c).redISub(d);l=l.redIAdd(l);var p=c.redAdd(c).redIAdd(c),b=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=s.redSqr().redISub(a).redISub(a);t=f;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=s.redMul(a.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),l=this.x.redSub(c).redMul(this.x.redAdd(c));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var y=h.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=l.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),f=e.redAdd(e),u=(f=f.redIAdd(f)).redMul(a),c=s.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=s.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,l,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var u=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(f),c=e.redMul(u);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(s).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(f.redISub(u)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(h,d,l)},c.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(t,e,r)=>{"use strict";var n,i=e,o=r(4485),a=r(8610),s=r(8288).assert;function f(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new f(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(7983)}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},8596:(t,e,r)=>{"use strict";var n=r(2140),i=r(8873),o=r(8288),a=r(1479),s=r(2745),f=o.assert,u=r(2307),c=r(1798);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(f(Object.prototype.hasOwnProperty.call(a,t),"Unknown curve "+t),t=a[t]),t instanceof a.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new u(this,t)},h.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||s(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),f=t.toArray("be",a),u=new i({hash:this.hash,entropy:s,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(u.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var g=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new c({r:y,s:g,recoveryParam:m})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new c(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,f=a.invm(this.n),u=f.mul(t).umod(this.n),h=f.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,i){f((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var o=this.n,a=new n(t),s=e.r,u=e.s,h=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var l=e.r.invm(o),p=o.sub(a).mul(l).umod(o),b=u.mul(l).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},2307:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function f(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o<n;o++,a++)i<<=8,i|=t[a],i>>>=0;return!(i<=127)&&(e.place=a,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=f(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=f(t,r);if(!1===a)return!1;var u=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var c=f(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;var h=t.slice(r.place,c+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(u),this.s=new n(h),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),a=[48];return c(a,o.length),a=a.concat(o),i.encode(a,t)}},9208:(t,e,r)=>{"use strict";var n=r(4485),i=r(1479),o=r(8288),a=o.assert,s=o.parseBytes,f=r(851),u=r(6117);function c(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=c,c.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),f=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},c.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},851:(t,e,r)=>{"use strict";var n=r(8288),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=s},6117:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function f(t,e){this.eddsa=t,"object"!=typeof e&&(e=s(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a(f,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(f,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(f,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(f,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),f.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},f.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=f},7983:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},8288:(t,e,r)=>{"use strict";var n=e,i=r(2140),o=r(9561),a=r(3022);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),a=0;a<n.length;a++){var s,f=o.andln(i-1);o.isOdd()?(s=f>(i>>1)-1?(i>>1)-f:f,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,f=t.andln(3)+i&3,u=e.andln(3)+o&3;3===f&&(f=-1),3===u&&(u=-1),a=0==(1&f)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==u?f:-f,r[0].push(a),s=0==(1&u)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==f?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},2140:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(488).Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function f(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a<o;a++){var s=t.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=f(t,e,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,c=r;c<s;c+=n)f=u(t,c,c+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==a){var h=1;for(f=u(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var u=1;u<n;u++){for(var c=f>>>26,h=67108863&f,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],f=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?c[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=h[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:c[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===e,u=new t(o),c=this.clone();if(f){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s<o;s++)u[s]=0}else{for(s=0;s<o-i;s++)u[s]=0;for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[o-s-1]=a}return u},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a<n.length;a++)o=(e=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&e;for(;0!==o&&a<r.length;a++)o=(e=(0|r.words[a])+o)>>26,this.words[a]=67108863&e;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,a=t.words,s=e.words,f=r.words,u=0,c=0|a[0],h=8191&c,d=c>>>13,l=0|a[1],p=8191&l,b=l>>>13,y=0|a[2],g=8191&y,m=y>>>13,v=0|a[3],w=8191&v,_=v>>>13,S=0|a[4],E=8191&S,A=S>>>13,x=0|a[5],M=8191&x,k=x>>>13,I=0|a[6],B=8191&I,O=I>>>13,T=0|a[7],U=8191&T,j=T>>>13,L=0|a[8],R=8191&L,P=L>>>13,F=0|a[9],N=8191&F,z=F>>>13,C=0|s[0],$=8191&C,D=C>>>13,q=0|s[1],H=8191&q,V=q>>>13,K=0|s[2],J=8191&K,G=K>>>13,W=0|s[3],Z=8191&W,X=W>>>13,Y=0|s[4],Q=8191&Y,tt=Y>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ft=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,dt=ct>>>13,lt=0|s[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(u+(n=Math.imul(h,$))|0)+((8191&(i=(i=Math.imul(h,D))+Math.imul(d,$)|0))<<13)|0;u=((o=Math.imul(d,D))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,$),i=(i=Math.imul(p,D))+Math.imul(b,$)|0,o=Math.imul(b,D);var gt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,V)|0)+Math.imul(d,H)|0))<<13)|0;u=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,$),i=(i=Math.imul(g,D))+Math.imul(m,$)|0,o=Math.imul(m,D),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,V)|0;var mt=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,$),i=(i=Math.imul(w,D))+Math.imul(_,$)|0,o=Math.imul(_,D),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,G)|0;var vt=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,Z)|0))<<13)|0;u=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,$),i=(i=Math.imul(E,D))+Math.imul(A,$)|0,o=Math.imul(A,D),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,$),i=(i=Math.imul(M,D))+Math.imul(k,$)|0,o=Math.imul(k,D),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,D))+Math.imul(O,$)|0,o=Math.imul(O,D),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(u+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,D))+Math.imul(j,$)|0,o=Math.imul(j,D),n=n+Math.imul(B,H)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var Et=(u+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,ft)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,D))+Math.imul(P,$)|0,o=Math.imul(P,D),n=n+Math.imul(U,H)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,V)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ut)|0;var At=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,D))+Math.imul(z,$)|0,o=Math.imul(z,D),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,V)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(U,J)|0,i=(i=i+Math.imul(U,G)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,G)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var xt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,V))+Math.imul(z,H)|0,o=Math.imul(z,V),n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(U,Z)|0,i=(i=i+Math.imul(U,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var Mt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,G))+Math.imul(z,J)|0,o=Math.imul(z,G),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,ut)|0)+Math.imul(A,ft)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var kt=(u+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,Z),i=(i=Math.imul(N,X))+Math.imul(z,Z)|0,o=Math.imul(z,X),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ut)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(E,ht)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var It=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(N,Q),i=(i=Math.imul(N,tt))+Math.imul(z,Q)|0,o=Math.imul(z,tt),n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ut)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ut)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,dt)|0;var Bt=(u+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(A,pt)|0))<<13)|0;u=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(z,rt)|0,o=Math.imul(z,nt),n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(U,ft)|0,i=(i=i+Math.imul(U,ut)|0)+Math.imul(j,ft)|0,o=o+Math.imul(j,ut)|0,n=n+Math.imul(B,ht)|0,i=(i=i+Math.imul(B,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Ot=(u+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(N,ot),i=(i=Math.imul(N,at))+Math.imul(z,ot)|0,o=Math.imul(z,at),n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ut)|0,n=n+Math.imul(U,ht)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,dt)|0;var Tt=(u+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ut))+Math.imul(z,ft)|0,o=Math.imul(z,ut),n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(P,ht)|0,o=o+Math.imul(P,dt)|0;var Ut=(u+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(j,pt)|0))<<13)|0;u=((o=o+Math.imul(j,bt)|0)+(i>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,n=Math.imul(N,ht),i=(i=Math.imul(N,dt))+Math.imul(z,ht)|0,o=Math.imul(z,dt);var jt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(P,pt)|0))<<13)|0;u=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863;var Lt=(u+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,bt))+Math.imul(z,pt)|0))<<13)|0;return u=((o=Math.imul(z,bt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,f[0]=yt,f[1]=gt,f[2]=mt,f[3]=vt,f[4]=wt,f[5]=_t,f[6]=St,f[7]=Et,f[8]=At,f[9]=xt,f[10]=Mt,f[11]=kt,f[12]=It,f[13]=Bt,f[14]=Ot,f[15]=Tt,f[16]=Ut,f[17]=jt,f[18]=Lt,0!==u&&(f[19]=u,r.length++),r};function b(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(p=l),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?l(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,f=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=f;u++){var c=o-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;s=67108863&(d=d+s|0),i+=(a=(a=a+(h/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):b(this,t,e),r},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a<o;a++)n[a]=e[t[a]],i[a]=r[t[a]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,f=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var h=f,d=u,l=0;l<a;l++){var p=r[c+l],b=n[c+l],y=r[c+l+a],g=n[c+l+a],m=h*y-d*g;g=h*g+d*y,y=m,r[c+l]=p+y,n[c+l]=b+g,r[c+l+a]=p-y,n[c+l+a]=b-g,l!==s&&(m=f*h-u*d,d=f*d+u*h,h=m)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,e,r,i){for(var o=0,a=0;a<e;a++)o+=0|t[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),f=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,a,n),this.convert13b(e.words,e.length,u,n),this.transform(a,o,s,f,n,i),this.transform(u,o,c,h,n,i);for(var l=0;l<n;l++){var p=s[l]*c[l]-f[l]*h[l];f[l]=s[l]*h[l]+f[l]*c[l],s[l]=p}return this.conjugate(s,f,n),this.transform(s,f,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e<this.length;e++){var s=this.words[e]&o,f=(0|this.words[e])-s<<r;this.words[e]=f|a,a=s>>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<<o,f=r;if(i-=a,i=Math.max(0,i),f){for(var u=0;u<a;u++)f.words[u]=this.words[u];f.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;u>=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,a=t.length+r;this._expand(a);var s=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+s;var f=(0|t.words[i])*e;s=((o-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==e){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,f);0===c.negative&&(n=c,s&&(s.words[f]=1));for(var h=f-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),f=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(f)):(r.isub(e),s.isub(i),f.isub(a))}return{a:s,b:f,gcd:r.iushln(u)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(v,m),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var a=0|t.words[i];t.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,m),i(_,m),i(S,m),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return g[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y<p);var g=this.pow(h,new o(1).iushln(p-y-1));d=d.redMul(g),h=g.redSqr(),l=l.redMul(h),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],a=0,s=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var u=e.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,E),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},4485:(t,e,r)=>{var n=e;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},4495:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1396:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,a=n.sum32,s=n.sum32_3,f=n.sum32_4,u=i.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,u),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],c=this.h[4],m=r,v=n,w=i,_=u,S=c,E=0;E<80;E++){var A=a(o(f(r,h(E,n,i,u),t[p[E]+e],d(E)),y[E]),c);r=c,c=u,u=o(i,10),i=n,n=A,A=a(o(f(m,h(79-E,v,w,_),t[b[E]+e],l(E)),g[E]),S),m=S,S=_,_=o(w,10),w=v,v=A}A=s(this.h[1],i,_),this.h[1]=s(this.h[2],u,S),this.h[2]=s(this.h[3],c,m),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=A},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5530:(t,e,r)=>{"use strict";e.sha1=r(5079),e.sha224=r(3823),e.sha256=r(8032),e.sha384=r(5328),e.sha512=r(168)},5079:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),a=n.rotl32,s=n.sum32,f=n.sum32_5,u=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=f(a(i,5),u(p,o,c,d),l,r[n],h[p]);l=d,d=c,c=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(t,e,r)=>{"use strict";var n=r(212),i=r(8032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8032:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),a=r(9561),s=n.sum32,f=n.sum32_4,u=n.sum32_5,c=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,g=[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];function m(){if(!(this instanceof m))return new m;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(m,y),t.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=f(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],g=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var S=u(_,l(m),c(m,v,w),this.k[n],r[n]),E=s(d(i),h(i,o,y));_=w,w=v,v=m,m=s(g,S),g=y,y=o,o=i,i=s(S,E)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],y),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],m),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},m.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(t,e,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),a=n.rotr64_hi,s=n.rotr64_lo,f=n.shr64_hi,u=n.shr64_lo,c=n.sum64,h=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,y=n.sum64_5_lo,g=i.BlockHash,m=[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];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var a=e&n^~e&o;return a<0&&(a+=4294967296),a}function S(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var a=e&n^e&o^n&o;return a<0&&(a+=4294967296),a}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,1)^a(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(y=r[n-4],g=r[n-3],m=void 0,(m=a(y,g,19)^a(g,y,29)^f(y,g,6))<0&&(m+=4294967296),m),o=B(r[n-4],r[n-3]),s=r[n-14],u=r[n-13],c=k(r[n-30],r[n-29]),h=I(r[n-30],r[n-29]),d=r[n-32],b=r[n-31];r[n]=l(i,o,s,u,c,h,d,b),r[n+1]=p(i,o,s,u,c,h,d,b)}var y,g,m},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,s=this.W,f=this.h[0],u=this.h[1],l=this.h[2],p=this.h[3],g=this.h[4],m=this.h[5],v=this.h[6],k=this.h[7],I=this.h[8],B=this.h[9],O=this.h[10],T=this.h[11],U=this.h[12],j=this.h[13],L=this.h[14],R=this.h[15];o(this.k.length===s.length);for(var P=0;P<s.length;P+=2){var F=L,N=R,z=(i=void 0,(i=a(r=I,n=B,14)^a(r,n,18)^a(n,r,9))<0&&(i+=4294967296),i),C=M(I,B),$=w(I,0,O,0,U),D=_(0,B,0,T,0,j),q=this.k[P],H=this.k[P+1],V=s[P],K=s[P+1],J=b(F,N,z,C,$,D,q,H,V,K),G=y(F,N,z,C,$,D,q,H,V,K);F=A(f,u),N=x(f,u),z=S(f,0,l,0,g),C=E(0,u,0,p,0,m);var W=h(F,N,z,C),Z=d(F,N,z,C);L=U,R=j,U=O,j=T,O=I,T=B,I=h(v,k,J,G),B=d(k,k,J,G),v=g,k=m,g=l,m=p,l=f,p=u,f=h(J,G,W,Z),u=d(J,G,W,Z)}c(this.h,0,f,u),c(this.h,2,l,p),c(this.h,4,g,m),c(this.h,6,v,k),c(this.h,8,I,B),c(this.h,10,O,T),c(this.h,12,U,j),c(this.h,14,L,R)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(t,e,r)=>{"use strict";var n=r(212).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?a(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},212:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=a(i)),r+=f(i.toString(16))}return r},e.zero2=s,e.zero8=f,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var a=new Array(o/4),s=0,f=e;s<a.length;s++,f+=4){var u;u="big"===i?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],a[s]=u>>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var f=0,u=e;return f+=(u=u+n>>>0)<e?1:0,f+=(u=u+o>>>0)<o?1:0,t+r+i+a+(f+=(u=u+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,f,u){var c=0,h=e;return c+=(h=h+n>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+s>>>0)<s?1:0,t+r+i+a+f+(c+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,f,u){return e+n+o+s+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8873:(t,e,r)=>{"use strict";var n=r(4485),i=r(3022),o=r(9561);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,t);return this._update(r),this._reseed++,i.encode(a,e)}},2333:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=u}return(l?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+h>=1?d/f:d*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*f-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+l]=255&a,l+=p,a/=256,u-=8);t[r+l-p]|=128*b}},1285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},9996:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7650);e.SECP256K1Client=n.SECP256K1Client;const i={ES256K:n.SECP256K1Client};e.cryptoClients=i},7650:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0});const i=r(7554),o=r(6120),a=r(8643);class s{constructor(){}static loadPrivateKey(t){return 66===t.length&&(t=t.slice(0,64)),s.ec.keyFromPrivate(t)}static loadPublicKey(t){return s.ec.keyFromPublic(t,"hex")}static derivePublicKey(t,e=!0){if("string"!=typeof t)throw Error("private key must be a string");if(!/^[0-9A-F]+$/i.test(t))throw Error("private key must be a hex string");if(66==t.length)t=t.slice(0,64);else if(!(t.length<=64))throw Error("private key must be 66 characters or less");return s.ec.keyFromPrivate(t).getPublic(e,"hex")}static signHash(t,e,r="jose"){if(!t||!e)throw new a.MissingParametersError("a signing input hash and private key are all required");const i=s.loadPrivateKey(e).sign(t),f=n.from(i.toDER());if("der"===r)return f.toString("hex");if("jose"===r)return o.derToJose(f,"ES256");throw Error("Invalid signature format")}static loadSignature(t){return o.joseToDer(t,"ES256")}static verifyHash(t,e,r){if(!(t&&e&&r))throw new a.MissingParametersError("a signing input hash, der signature, and public key are all required");return s.loadPublicKey(r).verify(t,e)}}e.SECP256K1Client=s,s.ec=new i.ec("secp256k1"),s.algorithmName="ES256K"},874:function(t,e,r){"use strict";var n=r(8834).Buffer,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=r(9065);function a(t){return(new o.sha256).update(t).digest()}e.hashSha256=a,e.hashSha256Async=function(t){return i(this,void 0,void 0,(function*(){try{if("undefined"!=typeof crypto&&void 0!==crypto.subtle){const e="string"==typeof t?n.from(t):t,r=yield crypto.subtle.digest("SHA-256",e);return n.from(r)}{const e=r(1812);if(!e.createHash)throw new Error("`crypto` module does not contain `createHash`");return Promise.resolve(e.createHash("sha256").update(t).digest())}}catch(e){return console.log(e),console.log('Crypto lib not found. Neither the global `crypto.subtle` Web Crypto API, nor the or the Node.js `require("crypto").createHash` module is available. Falling back to JS implementation.'),Promise.resolve(a(t))}}))}},8917:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(9487);e.decodeToken=function(t){if("string"==typeof t){const e=t.split(".");return{header:JSON.parse(n.default.decode(e[0])),payload:JSON.parse(n.default.decode(e[1])),signature:e[2]}}if("object"==typeof t){if("string"!=typeof t.payload)throw new Error("Expected token payload to be a base64 or json string");let e=t.payload;"{"!==t.payload[0]&&(e=n.default.decode(e));const r=[];return t.header.map((t=>{const e=JSON.parse(n.default.decode(t));r.push(e)})),{header:r,payload:JSON.parse(e),signature:t.signature}}}},8643:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class r extends Error{constructor(t){super(),this.name="MissingParametersError",this.message=t||""}}e.MissingParametersError=r;class n extends Error{constructor(t){super(),this.name="InvalidTokenError",this.message=t||""}}e.InvalidTokenError=n},7474:(t,e,r)=>{"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5650)),n(r(7458)),n(r(8917)),n(r(8643)),n(r(9996))},5650:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=r(9487),o=r(9996),a=r(8643),s=r(874);function f(t,e){const r=[],n=i.default.encode(JSON.stringify(e));r.push(n);const o=i.default.encode(JSON.stringify(t));return r.push(o),r.join(".")}e.createUnsecuredToken=function(t){return f(t,{typ:"JWT",alg:"none"})+"."},e.TokenSigner=class{constructor(t,e){if(!t||!e)throw new a.MissingParametersError("a signing algorithm and private key are required");if("string"!=typeof t)throw new Error("signing algorithm parameter must be a string");if(t=t.toUpperCase(),!o.cryptoClients.hasOwnProperty(t))throw new Error("invalid signing algorithm");this.tokenType="JWT",this.cryptoClient=o.cryptoClients[t],this.rawPrivateKey=e}header(t={}){const e={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},e,t)}sign(t,e=!1,r={}){const n=this.header(r),i=f(t,n),o=s.hashSha256(i);return this.createWithSignedHash(t,e,n,i,o)}signAsync(t,e=!1,r={}){return n(this,void 0,void 0,(function*(){const n=this.header(r),i=f(t,n),o=yield s.hashSha256Async(i);return this.createWithSignedHash(t,e,n,i,o)}))}createWithSignedHash(t,e,r,n,o){const a=this.cryptoClient.signHash(o,this.rawPrivateKey);return e?{header:[i.default.encode(JSON.stringify(r))],payload:JSON.stringify(t),signature:[a]}:[n,a].join(".")}}},7458:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(9487),i=r(9996),o=r(8643),a=r(874);e.TokenVerifier=class{constructor(t,e){if(!t||!e)throw new o.MissingParametersError("a signing algorithm and public key are required");if("string"!=typeof t)throw"signing algorithm parameter must be a string";if(t=t.toUpperCase(),!i.cryptoClients.hasOwnProperty(t))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=i.cryptoClients[t],this.rawPublicKey=e}verify(t){return"string"==typeof t?this.verifyCompact(t,!1):"object"==typeof t?this.verifyExpanded(t,!1):void 0}verifyAsync(t){return"string"==typeof t?this.verifyCompact(t,!0):"object"==typeof t?this.verifyExpanded(t,!0):Promise.resolve(!1)}verifyCompact(t,e){const r=t.split("."),n=r[0]+"."+r[1],i=t=>{const e=this.cryptoClient.loadSignature(r[2]);return this.cryptoClient.verifyHash(t,e,this.rawPublicKey)};if(e)return a.hashSha256Async(n).then((t=>i(t)));{const t=a.hashSha256(n);return i(t)}}verifyExpanded(t,e){const r=[t.header.join("."),n.default.encode(t.payload)].join(".");let i=!0;const o=e=>(t.signature.map((t=>{const r=this.cryptoClient.loadSignature(t);this.cryptoClient.verifyHash(e,r,this.rawPublicKey)||(i=!1)})),i);if(e)return a.hashSha256Async(r).then((t=>o(t)));{const t=a.hashSha256(r);return o(t)}}}},9907:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Boolean]",s="[object Date]",f="[object Function]",u="[object GeneratorFunction]",c="[object Map]",h="[object Number]",d="[object Object]",l="[object Promise]",p="[object RegExp]",b="[object Set]",y="[object String]",g="[object Symbol]",m="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",x="[object Int32Array]",M="[object Uint8Array]",k="[object Uint8ClampedArray]",I="[object Uint16Array]",B="[object Uint32Array]",O=/\w*$/,T=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,j={};j[o]=j["[object Array]"]=j[v]=j[w]=j[a]=j[s]=j[_]=j[S]=j[E]=j[A]=j[x]=j[c]=j[h]=j[d]=j[p]=j[b]=j[y]=j[g]=j[M]=j[k]=j[I]=j[B]=!0,j["[object Error]"]=j[f]=j[m]=!1;var L="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,R="object"==typeof self&&self&&self.Object===Object&&self,P=L||R||Function("return this")(),F=e&&!e.nodeType&&e,N=F&&t&&!t.nodeType&&t,z=N&&N.exports===F;function C(t,e){return t.set(e[0],e[1]),t}function $(t,e){return t.add(e),t}function D(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function H(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t,e){return function(r){return t(e(r))}}function K(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var J,G=Array.prototype,W=Function.prototype,Z=Object.prototype,X=P["__core-js_shared__"],Y=(J=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",Q=W.toString,tt=Z.hasOwnProperty,et=Z.toString,rt=RegExp("^"+Q.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nt=z?P.Buffer:void 0,it=P.Symbol,ot=P.Uint8Array,at=V(Object.getPrototypeOf,Object),st=Object.create,ft=Z.propertyIsEnumerable,ut=G.splice,ct=Object.getOwnPropertySymbols,ht=nt?nt.isBuffer:void 0,dt=V(Object.keys,Object),lt=Pt(P,"DataView"),pt=Pt(P,"Map"),bt=Pt(P,"Promise"),yt=Pt(P,"Set"),gt=Pt(P,"WeakMap"),mt=Pt(Object,"create"),vt=$t(lt),wt=$t(pt),_t=$t(bt),St=$t(yt),Et=$t(gt),At=it?it.prototype:void 0,xt=At?At.valueOf:void 0;function Mt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function It(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){this.__data__=new kt(t)}function Ot(t,e,r){var n=t[e];tt.call(t,e)&&Dt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Tt(t,e){for(var r=t.length;r--;)if(Dt(t[r][0],e))return r;return-1}function Ut(t,e,r,n,i,l,m){var T;if(n&&(T=l?n(t,i,l,m):n(t)),void 0!==T)return T;if(!Jt(t))return t;var U=qt(t);if(U){if(T=function(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!e)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,T)}else{var L=Nt(t),R=L==f||L==u;if(Vt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(L==d||L==o||R&&!l){if(q(t))return l?t:{};if(T=function(t){return"function"!=typeof t.constructor||Ct(t)?{}:Jt(e=at(t))?st(e):{};var e}(R?{}:t),!e)return function(t,e){return Lt(t,Ft(t),e)}(t,function(t,e){return t&&Lt(e,Gt(e),t)}(T,t))}else{if(!j[L])return l?t:{};T=function(t,e,r,n){var i,o=t.constructor;switch(e){case v:return jt(t);case a:case s:return new o(+t);case w:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case _:case S:case E:case A:case x:case M:case k:case I:case B:return function(t,e){var r=e?jt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case c:return function(t,e,r){return D(e?r(H(t),!0):H(t),C,new t.constructor)}(t,n,r);case h:case y:return new o(t);case p:return function(t){var e=new t.constructor(t.source,O.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return function(t,e,r){return D(e?r(K(t),!0):K(t),$,new t.constructor)}(t,n,r);case g:return i=t,xt?Object(xt.call(i)):{}}}(t,L,Ut,e)}}m||(m=new Bt);var P=m.get(t);if(P)return P;if(m.set(t,T),!U)var F=r?function(t){return function(t,e,r){var n=e(t);return qt(t)?n:function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}(n,r(t))}(t,Gt,Ft)}(t):Gt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r););}(F||t,(function(i,o){F&&(i=t[o=i]),Ot(T,o,Ut(i,e,r,n,o,t,m))})),T}function jt(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}function Lt(t,e,r,n){r||(r={});for(var i=-1,o=e.length;++i<o;){var a=e[i],s=n?n(r[a],t[a],a,r,t):void 0;Ot(r,a,void 0===s?t[a]:s)}return r}function Rt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Pt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Jt(t)||(e=t,Y&&Y in e))&&(Kt(t)||q(t)?rt:T).test($t(t));var e}(r)?r:void 0}Mt.prototype.clear=function(){this.__data__=mt?mt(null):{}},Mt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Mt.prototype.get=function(t){var e=this.__data__;if(mt){var r=e[t];return r===n?void 0:r}return tt.call(e,t)?e[t]:void 0},Mt.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:tt.call(e,t)},Mt.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?n:e,this},kt.prototype.clear=function(){this.__data__=[]},kt.prototype.delete=function(t){var e=this.__data__,r=Tt(e,t);return!(r<0||(r==e.length-1?e.pop():ut.call(e,r,1),0))},kt.prototype.get=function(t){var e=this.__data__,r=Tt(e,t);return r<0?void 0:e[r][1]},kt.prototype.has=function(t){return Tt(this.__data__,t)>-1},kt.prototype.set=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},It.prototype.clear=function(){this.__data__={hash:new Mt,map:new(pt||kt),string:new Mt}},It.prototype.delete=function(t){return Rt(this,t).delete(t)},It.prototype.get=function(t){return Rt(this,t).get(t)},It.prototype.has=function(t){return Rt(this,t).has(t)},It.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},Bt.prototype.clear=function(){this.__data__=new kt},Bt.prototype.delete=function(t){return this.__data__.delete(t)},Bt.prototype.get=function(t){return this.__data__.get(t)},Bt.prototype.has=function(t){return this.__data__.has(t)},Bt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof kt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new It(n)}return r.set(t,e),this};var Ft=ct?V(ct,Object):function(){return[]},Nt=function(t){return et.call(t)};function zt(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||U.test(t))&&t>-1&&t%1==0&&t<e}function Ct(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Z)}function $t(t){if(null!=t){try{return Q.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Dt(t,e){return t===e||t!=t&&e!=e}(lt&&Nt(new lt(new ArrayBuffer(1)))!=w||pt&&Nt(new pt)!=c||bt&&Nt(bt.resolve())!=l||yt&&Nt(new yt)!=b||gt&&Nt(new gt)!=m)&&(Nt=function(t){var e=et.call(t),r=e==d?t.constructor:void 0,n=r?$t(r):void 0;if(n)switch(n){case vt:return w;case wt:return c;case _t:return l;case St:return b;case Et:return m}return e});var qt=Array.isArray;function Ht(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!Kt(t)}var Vt=ht||function(){return!1};function Kt(t){var e=Jt(t)?et.call(t):"";return e==f||e==u}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Gt(t){return Ht(t)?function(t,e){var r=qt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Ht(t)}(t)&&tt.call(t,"callee")&&(!ft.call(t,"callee")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var a in t)!e&&!tt.call(t,a)||i&&("length"==a||zt(a,n))||r.push(a);return r}(t):function(t){if(!Ct(t))return dt(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Ut(t,!0,!0)}},9561:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},3022:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},4406:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,f=[],u=!1,c=-1;function h(){u&&s&&(u=!1,s.length?f=s.concat(f):c=-1,f.length&&d())}function d(){if(!u){var t=a(h);u=!0;for(var e=f.length;e;){for(s=f,f=[];++c<e;)s&&s[c].run();c=-1,e=f.length}s=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function l(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new l(t,e)),1!==f.length||u||a(d)},l.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},7834:(t,e,r)=>{var n=r(8834),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},2179:(t,e,r)=>{t.exports=r(8224)},8224:(t,e,r)=>{!function(){var e={};if(e.async=r(625),"object"!=typeof e.async)throw new Error("Module async is required (https://github.com/caolan/async)");var n=e.async;function i(t,e){if(!e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function o(){var t={},e=Array.prototype.slice.call(arguments),r=null,n=null;return e.forEach((function(e){if(e&&e.constructor===Object)for(r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]]})),t}function a(){this.custom={},this.extend=function(t){return i(this.custom,t)},this.reset=function(){this.custom={}},this.remove=function(t){f.array(t)||(t=[t]),t.forEach((function(t){delete this.custom[t]}),this)}}function s(t,e){var r=["@"];if(this._schema=t,this._custom={},null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._custom["$"+n]=e[n]);this._getDepth=function(){return r.length},this._dumpStack=function(){return r.map((function(t){return t.replace(/^\[/g,"")})).join(".").replace(/\.\u001b\u001c\u001d\u001e/g,"[")},this._deeperObject=function(t){return r.push(/^[a-z$_][a-z0-9$_]*$/i.test(t)?t:'["'+t+'"]'),this},this._deeperArray=function(t){return r.push("["+t+"]"),this},this._back=function(){return r.pop(),this}}var f={function:function(t){return"function"==typeof t},string:function(t){return"string"==typeof t},number:function(t){return"number"==typeof t&&!isNaN(t)},integer:function(t){return"number"==typeof t&&t%1==0},NaN:function(t){return"number"==typeof t&&isNaN(t)},boolean:function(t){return"boolean"==typeof t},null:function(t){return null===t},date:function(t){return null!=t&&t instanceof Date},object:function(t){return"object"==typeof t&&t.constructor!==Array&&null!=t},array:function(t){return null!=t&&t.constructor===Array},any:function(){return!0}};function u(t,e){return"function"==typeof t?e instanceof t:f[t=t in f?t:"any"](e)}function c(t,e){for(var r=[],n=t.indexOf(e);-1!==n;)r.push(n),n=t.indexOf(e,n+1);return r}var h={void:/^$/,url:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)?(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,"date-time":/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z?|(-|\+)\d{2}:\d{2})$/,date:/^\d{4}-\d{2}-\d{2}$/,coolDateTime:/^\d{4}(-|\/)\d{2}(-|\/)\d{2}(T| )\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/,time:/^\d{2}\:\d{2}\:\d{2}$/,color:/^#([0-9a-f])+$/i,email:new RegExp("(?:[^\\W_](?:[\\w\\.\\+]+)@(?:localhost|(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:northwesternmutual|travelersinsurance|vermögensberatung|vermögensberater|americanexpress|kerryproperties|sandvikcoromant|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|construction|lplfinancial|scholarships|versicherung|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|university|vlaanderen|volkswagen|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|موريتانيا|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|السعودية|yokohama|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|католик|الجزائر|العليان|اتصالات|پاکستان|البحرين|كاثوليك|இந்தியா|yamaxun|youtube|zuerich|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|москва|онлайн|ファッション|भारतम्|ارامكو|امارات|الاردن|المغرب|ابوظبي|مليسيا|இலங்கை|فلسطين|yachts|yandex|zappos|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|ישראל|বাংলা|భారత్|भारोत|संगठन|ایران|بازار|بھارت|سودان|همراه|سورية|ഭാരതം|嘉里大酒店|yahoo|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|duck|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|ಭಾರತ|ଭାରତ|大众汽车|ভাৰত|ভারত|موقع|香格里拉|сайт|アマゾン|дети|ポイント|ලංකා|電訊盈科|クラウド|ભારત|भारत|عمان|بارت|ڀارت|عراق|شبكة|بيتك|组织机构|تونس|グーグル|ਭਾਰਤ|yoga|zara|zero|zone|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|कॉम|セール|คอม|我爱你|қаз|срб|бел|קום|淡马锡|орг|नेट|ストア|мкд|كوم|中文网|ком|укр|亚马逊|诺基亚|飞利浦|мон|عرب|ไทย|рус|ລາວ|みんな|天主教|مصر|قطر|հայ|新加坡|xxx|xyz|you|yun|zip|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|佛山|慈善|集团|在线|한국|点看|八卦|公益|公司|网站|移动|联通|бг|时尚|微博|삼성|商标|商店|商城|ею|新闻|家電|中信|中国|中國|娱乐|谷歌|购物|通販|网店|餐厅|网络|香港|食品|台湾|台灣|手机|澳門|닷컴|政府|გე|机构|健康|招聘|рф|大拿|ευ|ελ|世界|書籍|网址|닷넷|コム|游戏|企业|信息|嘉里|广东|政务|ye|yt|za|zm|zw))))"),numeric:/^[0-9]+$/,integer:/^\-?[0-9]+$/,decimal:/^\-?[0-9]*\.?[0-9]+$/,alpha:/^[a-z]+$/i,alphaNumeric:/^[a-z0-9]+$/i,alphaDash:/^[a-z0-9_-]+$/i,javascript:/^[a-z_\$][a-z0-9_\$]*$/i,upperString:/^[A-Z ]*$/,lowerString:/^[a-z ]*$/,v4uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/i},d={optional:function(t,e){!0!==("boolean"==typeof t.optional?t.optional:"true"===t.optional)&&void 0===e&&this.report("is missing and not optional",null,"optional")},type:function(t,e){if(void 0!==e&&("string"==typeof t.type||t.type instanceof Array||"function"==typeof t.type)){var r=f.array(t.type)?t.type:[t.type];r.some((function(t){return u(t,e)}))||(r=r.map((function(t){return"function"==typeof t?"an instance of "+t.name:t})),this.report("must be "+r.join(" or ")+", but is "+function(t){for(var e in f)if(u(e,t))return"any"===e||"object"===e&&t.constructor!==Object?"an instance of "+t.constructor.name:e}(e),null,"type"))}},uniqueness:function(t,e){if("string"==typeof t.uniqueness&&(t.uniqueness="true"===t.uniqueness),"boolean"==typeof t.uniqueness&&!1!==t.uniqueness&&(f.array(e)||"string"==typeof e))for(var r=[],n=0;n<e.length;n++)if(!(r.indexOf(e[n])>=0)){var i=c(e,e[n]);i.length>1&&(r.push(e[n]),this.report("has value ["+e[n]+"] more than once at indexes ["+i.join(", ")+"]",null,"uniqueness"))}},pattern:function(t,e){var r=t.pattern;if("string"==typeof e){var n=!1;f.array(r)||(r=[r]),r.forEach((function(t){"string"==typeof t&&t in h&&(t=h[t]),t instanceof RegExp&&t.test(e)&&(n=!0)})),n||this.report("must match ["+r.join(" or ")+'], but is equal to "'+e+'"',null,"pattern")}},validDate:function(t,e){"true"===String(t.validDate)&&e instanceof Date&&isNaN(e.getTime())&&this.report("must be a valid date",null,"validDate")},minLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.minLength);isNaN(r)||e.length<r&&this.report("must be longer than "+r+" elements, but it has "+e.length,null,"minLength")}},maxLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.maxLength);isNaN(r)||e.length>r&&this.report("must be shorter than "+r+" elements, but it has "+e.length,null,"maxLength")}},exactLength:function(t,e){if("string"==typeof e||f.array(e)){var r=Number(t.exactLength);isNaN(r)||e.length!==r&&this.report("must have exactly "+r+" elements, but it have "+e.length,null,"exactLength")}},lt:function(t,e){var r=Number(t.lt);"number"!=typeof e||isNaN(r)||e>=r&&this.report("must be less than "+r+', but is equal to "'+e+'"',null,"lt")},lte:function(t,e){var r=Number(t.lte);"number"!=typeof e||isNaN(r)||e>r&&this.report("must be less than or equal to "+r+', but is equal to "'+e+'"',null,"lte")},gt:function(t,e){var r=Number(t.gt);"number"!=typeof e||isNaN(r)||e<=r&&this.report("must be greater than "+r+', but is equal to "'+e+'"',null,"gt")},gte:function(t,e){var r=Number(t.gte);"number"!=typeof e||isNaN(r)||e<r&&this.report("must be greater than or equal to "+r+', but is equal to "'+e+'"',null,"gte")},eq:function(t,e){if("number"==typeof e||"string"==typeof e||"boolean"==typeof e){var r=t.eq;if("number"==typeof r||"string"==typeof r||"boolean"==typeof r||f.array(r))if(f.array(r)){for(var n=0;n<r.length;n++)if(e===r[n])return;this.report("must be equal to ["+r.map((function(t){return'"'+t+'"'})).join(" or ")+'], but is equal to "'+e+'"',null,"eq")}else e!==r&&this.report('must be equal to "'+r+'", but is equal to "'+e+'"',null,"eq")}},ne:function(t,e){if("number"==typeof e||"string"==typeof e){var r=t.ne;if("number"==typeof r||"string"==typeof r||f.array(r))if(f.array(r)){for(var n=0;n<r.length;n++)if(e===r[n])return void this.report('must not be equal to "'+r[n]+'"',null,"ne")}else e===r&&this.report('must not be equal to "'+r+'"',null,"ne")}},someKeys:function(t,e){var r=t.someKeys;f.object(e)&&(r.some((function(t){return t in e}))||this.report("must have at least key "+r.map((function(t){return'"'+t+'"'})).join(" or "),null,"someKeys"))},strict:function(t,e){if("string"==typeof t.strict&&(t.strict="true"===t.strict),!0===t.strict&&f.object(e)&&f.object(t.properties)&&void 0===t.properties["*"]){var r=Object.keys(e).filter((function(e){return void 0===t.properties[e]}));if(r.length>0){var n="should not contains "+(r.length>1?"properties":"property")+" ["+r.map((function(t){return'"'+t+'"'})).join(", ")+"]";this.report(n,null,"strict")}}},exec:function(t,e,r){var n=this;if("function"==typeof r)return this.asyncExec(t,e,r);(f.array(t.exec)?t.exec:[t.exec]).forEach((function(r){"function"==typeof r&&r.call(n,t,e)}))},properties:function(t,e,r){if("function"==typeof r)return this.asyncProperties(t,e,r);if(t.properties instanceof Object&&e instanceof Object){var n,i=t.properties;if(null!=i["*"])for(n in e)n in i||(this._deeperObject(n),this._validate(i["*"],e[n]),this._back());for(n in i)"*"!==n&&(this._deeperObject(n),this._validate(i[n],e[n]),this._back())}},items:function(t,e,r){if("function"==typeof r)return this.asyncItems(t,e,r);if(t.items instanceof Object&&e instanceof Object){var n,i,o=t.items;if(f.array(o)&&f.array(e))for(n=0,i=o.length;n<i;n++)this._deeperArray(n),this._validate(o[n],e[n]),this._back();else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(this._deeperArray(a),this._validate(o,e[a]),this._back())}}},l={asyncExec:function(t,e,r){var i=this;n.eachSeries(f.array(t.exec)?t.exec:[t.exec],(function(r,o){if("function"==typeof r){if(r.length>2)return r.call(i,t,e,o);r.call(i,t,e)}n.nextTick(o)}),r)},asyncProperties:function(t,e,r){if(!(t.properties instanceof Object&&f.object(e)))return r();var i=this,o=t.properties;n.series([function(t){if(null==o["*"])return t();n.eachSeries(Object.keys(e),(function(t,r){if(t in o)return n.nextTick(r);i._deeperObject(t),i._asyncValidate(o["*"],e[t],(function(t){i._back(),r(t)}))}),t)},function(t){n.eachSeries(Object.keys(o),(function(t,r){if("*"===t)return n.nextTick(r);i._deeperObject(t),i._asyncValidate(o[t],e[t],(function(t){i._back(),r(t)}))}),t)}],r)},asyncItems:function(t,e,r){if(!(t.items instanceof Object&&e instanceof Object))return r();var i=this,o=t.items;f.array(o)&&f.array(e)?n.timesSeries(o.length,(function(t,r){i._deeperArray(t),i._asyncValidate(o[t],e[t],(function(t,e){i._back(),r(t,e)})),i._back()}),r):n.eachSeries(Object.keys(e),(function(t,r){i._deeperArray(t),i._asyncValidate(o,e[t],(function(t,e){i._back(),r(t,e)}))}),r)}};function p(t,e){s.prototype.constructor.call(this,t,o(p.custom,e));var r=[];this._basicFields=Object.keys(d),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(t,e,n){var i={code:e||this.userCode||null,reason:n||"unknown",message:this.userError||t||"is invalid",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};return r.push(i),this},this.result=function(){return{error:r,valid:0===r.length,format:function(){return!0===this.valid?"Candidate is valid":this.error.map((function(t){return"Property "+t.property+": "+t.message})).join("\n")}}}}i(p.prototype,d),i(p.prototype,l),i(p,new a),p.prototype.validate=function(t,e){if(this.origin=t,"function"==typeof e){var r=this;return n.nextTick((function(){r._asyncValidate(r._schema,t,(function(t){r.origin=null,e(t,r.result())}))}))}return this._validate(this._schema,t).result()},p.prototype._validate=function(t,e,r){return this.userCode=t.code||null,this.userError=t.error||null,this.userAlias=t.alias||null,this._basicFields.forEach((function(r){!(r in t)&&"optional"!==r||"function"!=typeof this[r]||this[r](t,e)}),this),this._customFields.forEach((function(r){r in t&&"function"==typeof this._custom[r]&&this._custom[r].call(this,t,e)}),this),this},p.prototype._asyncValidate=function(t,e,r){var i=this;this.userCode=t.code||null,this.userError=t.error||null,this.userAlias=t.alias||null,n.series([function(r){n.eachSeries(Object.keys(d),(function(r,o){n.nextTick((function(){if((r in t||"optional"===r)&&"function"==typeof i[r]){if(i[r].length>2)return i[r](t,e,o);i[r](t,e)}o()}))}),r)},function(r){n.eachSeries(Object.keys(i._custom),(function(r,o){n.nextTick((function(){if(r in t&&"function"==typeof i._custom[r]){if(i._custom[r].length>2)return i._custom[r].call(i,t,e,o);i._custom[r].call(i,t,e)}o()}))}),r)}],r)};var b={number:function(t,e){var r;if("number"==typeof t)return t;if(""===t)return void 0!==e.def?e.def:null;if("string"==typeof t){if("number"==typeof(r=parseFloat(t.replace(/,/g,".").replace(/ /g,""))))return r}else if(t instanceof Date)return+t;return null},integer:function(t,e){var r;if("number"==typeof t&&t%1==0)return t;if(""===t)return void 0!==e.def?e.def:null;if("string"==typeof t){if("number"==typeof(r=parseInt(t.replace(/ /g,""),10)))return r}else{if("number"==typeof t)return parseInt(t,10);if("boolean"==typeof t)return t?1:0;if(t instanceof Date)return+t}return null},string:function(t,e){return"boolean"==typeof t||"number"==typeof t||t instanceof Date?t.toString():f.array(t)?e.items||e.properties?t:t.join(String(e.joinWith||",")):t instanceof Object?e.items||e.properties?t:JSON.stringify(t):"string"==typeof t&&t.length?t:null},date:function(t,e){if(t instanceof Date)return t;var r=new Date(t);return isNaN(r.getTime())?null:r},boolean:function(t,e){return void 0===t?null:("string"!=typeof t||"false"!==t.toLowerCase())&&!!t},object:function(t,e){if("string"!=typeof t||f.object(t))return t;try{return JSON.parse(t)}catch(t){return null}},array:function(t,e){if(f.array(t))return t;if(void 0===t)return null;if("string"==typeof t){if("["===t.substring(0,1)&&"]"===t.slice(-1))try{return JSON.parse(t)}catch(t){return null}return t.split(String(e.splitWith||","))}return f.array(t)?null:[t]}},y={upper:function(t){return t.toUpperCase()},lower:function(t){return t.toLowerCase()},title:function(t){return t.replace(/\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))},capitalize:function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()},ucfirst:function(t){return t.charAt(0).toUpperCase()+t.substr(1)},trim:function(t){return t.trim()}},g={strict:function(t,e){return"string"==typeof t.strict&&(t.strict="true"===t.strict),!0!==t.strict?e:f.object(t.properties)&&f.object(e)?(Object.keys(e).forEach((function(r){r in t.properties||delete e[r]})),e):e},optional:function(t,e){return!0===("boolean"==typeof t.optional?t.optional:"false"!==t.optional)||void 0!==e?e:(this.report(),t.def===Date?new Date:t.def)},type:function(t,e){if("string"!=typeof t.type||"function"!=typeof b[t.type])return e;var r,n="boolean"!=typeof t.optional||t.optional;return"function"==typeof b[t.type]?(null===(r=b[t.type](e,t))&&!n||!r&&isNaN(r)||null===r&&"string"===t.type)&&(r=t.def):n||(r=t.def),(null!=r||void 0!==t.def&&t.def===r)&&r!==e?(this.report(),r):e},rules:function(t,e){var r=t.rules;if("string"!=typeof e||"string"!=typeof r&&!f.array(r))return e;var n=!1;return(f.array(r)?r:[r]).forEach((function(t){"function"==typeof y[t]&&(e=y[t](e),n=!0)})),n&&this.report(),e},min:function(t,e){var r=Number(e);if(isNaN(r))return e;var n=Number(t.min);return isNaN(n)?e:r<n?(this.report(),n):e},max:function(t,e){var r=Number(e);if(isNaN(r))return e;var n=Number(t.max);return isNaN(n)?e:r>n?(this.report(),n):e},minLength:function(t,e){var r=Number(t.minLength);if("string"!=typeof e||isNaN(r)||r<0)return e;var n="",i=r-e.length;if(i>0){for(var o=0;o<i;o++)n+="-";return this.report(),e+n}return e},maxLength:function(t,e){var r=Number(t.maxLength);return"string"!=typeof e||isNaN(r)||r<0?e:e.length>r?(this.report(),e.slice(0,r)):e},properties:function(t,e,r){if("function"==typeof r)return this.asyncProperties(t,e,r);if(!e||"object"!=typeof e)return e;var n,i,o=t.properties;if(void 0!==o["*"])for(i in e)i in o||(this._deeperObject(i),void 0!==(n=this._sanitize(t.properties["*"],e[i]))&&(e[i]=n),this._back());for(i in t.properties)"*"!==i&&(this._deeperObject(i),void 0!==(n=this._sanitize(t.properties[i],e[i]))&&(e[i]=n),this._back());return e},items:function(t,e,r){if("function"==typeof r)return this.asyncItems(t,e,r);if(!(t.items instanceof Object&&e instanceof Object))return e;var n;if(f.array(t.items)&&f.array(e)){var i=t.items.length<e.length?t.items.length:e.length;for(n=0;n<i;n++)this._deeperArray(n),e[n]=this._sanitize(t.items[n],e[n]),this._back()}else for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._deeperArray(n),e[n]=this._sanitize(t.items,e[n]),this._back());return e},exec:function(t,e,r){return"function"==typeof r?this.asyncExec(t,e,r):((f.array(t.exec)?t.exec:[t.exec]).forEach((function(r){"function"==typeof r&&(e=r.call(this,t,e))}),this),e)}},m={asyncExec:function(t,e,r){var i=this,o=f.array(t.exec)?t.exec:[t.exec];n.eachSeries(o,(function(r,n){if("function"==typeof r){if(r.length>2)return r.call(i,t,e,(function(t,r){if(t)return n(t);e=r,n()}));e=r.call(i,t,e)}n()}),(function(t){r(t,e)}))},asyncProperties:function(t,e,r){if(!e||"object"!=typeof e)return r(null,e);var i=this,o=t.properties;n.series([function(t){if(null==o["*"])return t();var r=o["*"];n.eachSeries(Object.keys(e),(function(t,n){if(t in o)return n();i._deeperObject(t),i._asyncSanitize(r,e[t],(function(r,o){void 0!==o&&(e[t]=o),i._back(),n()}))}),t)},function(t){n.eachSeries(Object.keys(o),(function(t,r){if("*"===t)return r();i._deeperObject(t),i._asyncSanitize(o[t],e[t],(function(n,o){if(n)return r(n);void 0!==o&&(e[t]=o),i._back(),r()}))}),t)}],(function(t){return r(t,e)}))},asyncItems:function(t,e,r){if(!(t.items instanceof Object&&e instanceof Object))return r(null,e);var i=this,o=t.items;if(f.array(o)&&f.array(e)){var a=o.length<e.length?o.length:e.length;n.timesSeries(a,(function(t,r){i._deeperArray(t),i._asyncSanitize(o[t],e[t],(function(n,o){if(n)return r(n);e[t]=o,i._back(),r()}))}),(function(t){r(t,e)}))}else n.eachSeries(Object.keys(e),(function(t,r){i._deeperArray(t),i._asyncSanitize(o,e[t],(function(n,o){if(n)return r();e[t]=o,i._back(),r()}))}),(function(t){r(t,e)}));return e}};function v(t,e){s.prototype.constructor.call(this,t,o(v.custom,e));var r=[];this._basicFields=Object.keys(g),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(t){var e={message:t||"was sanitized",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};r.some((function(t){return t.property===e.property}))||r.push(e)},this.result=function(t){return{data:t,reporting:r,format:function(){return this.reporting.map((function(t){return"Property "+t.property+" "+t.message})).join("\n")}}}}i(v.prototype,g),i(v.prototype,m),i(v,new a),v.prototype.sanitize=function(t,e){if(this.origin=t,"function"==typeof e){var r=this;return this._asyncSanitize(this._schema,t,(function(t,n){r.origin=null,e(t,r.result(n))}))}var n=this._sanitize(this._schema,t);return this.origin=null,this.result(n)},v.prototype._sanitize=function(t,e){return this.userAlias=t.alias||null,this._basicFields.forEach((function(r){!(r in t)&&"optional"!==r||"function"!=typeof this[r]||(e=this[r](t,e))}),this),this._customFields.forEach((function(r){r in t&&"function"==typeof this._custom[r]&&(e=this._custom[r].call(this,t,e))}),this),e},v.prototype._asyncSanitize=function(t,e,r){var i=this;this.userAlias=t.alias||null,n.waterfall([function(r){n.reduce(i._basicFields,e,(function(e,r,o){n.nextTick((function(){if((r in t||"optional"===r)&&"function"==typeof i[r]){if(i[r].length>2)return i[r](t,e,o);e=i[r](t,e)}o(null,e)}))}),r)},function(e,r){n.reduce(i._customFields,e,(function(e,r,o){n.nextTick((function(){if(r in t&&"function"==typeof i._custom[r]){if(i._custom[r].length>2)return i._custom[r].call(i,t,e,o);e=i._custom[r].call(i,t,e)}o(null,e)}))}),r)}],r)};var w=2147483647,_={int:function(t,e){return t+(0|Math.random()*(e-t+1))},float:function(t,e){return Math.random()*(e-t)+t},bool:function(){return Math.random()>.5},char:function(t,e){return String.fromCharCode(this.int(t,e))},fromList:function(t){return t[this.int(0,t.length-1)]}},S={"date-time":function(){return(new Date).toISOString()},date:function(){return(new Date).toISOString().replace(/T.*$/,"")},time:function(){return(new Date).toLocaleTimeString({},{hour12:!1})},color:function(t,e){var r="#";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("0123456789abcdefABCDEF");return r},numeric:function(){return""+_.int(0,w)},integer:function(){return!0===_.bool()?"-"+this.numeric():this.numeric()},decimal:function(){return this.integer()+"."+this.numeric()},alpha:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");return r},alphaNumeric:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");return r},alphaDash:function(t,e){var r="";t<1&&(t=1);for(var n=0,i=_.int(t,e);n<i;n++)r+=_.fromList("_-abcdefghijklmnopqrstuvwxyz_-ABCDEFGHIJKLMNOPQRSTUVWXYZ_-0123456789_-");return r},javascript:function(t,e){for(var r=_.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$"),n=0,i=_.int(t,e-1);n<i;n++)r+=_.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789_$");return r}};function E(t){var e=-2147483648,r=w;return null!=t.gte?e=t.gte:null!=t.gt&&(e=t.gt+1),null!=t.lte?r=t.lte:null!=t.lt&&(r=t.lt-1),{min:e,max:r}}var A={string:function(t){if(null!=t.eq)return t.eq;var e="",r=null!=t.minLength?t.minLength:0,n=null!=t.maxLength?t.maxLength:32;if("string"==typeof t.pattern&&"function"==typeof S[t.pattern])return S[t.pattern](r,n);for(var i=null!=t.exactLength?t.exactLength:_.int(r,n),o=0;o<i;o++)e+=_.char(32,126);return e},number:function(t){if(null!=t.eq)return t.eq;var e=E(t),r=_.float(e.min,e.max);if(null!=t.ne)for(var n=f.array(t.ne)?t.ne:[t.ne];-1!==n.indexOf(r);)r=_.float(e.min,e.max);return r},integer:function(t){if(null!=t.eq)return t.eq;var e=E(t),r=_.int(e.min,e.max);if(null!=t.ne)for(var n=f.array(t.ne)?t.ne:[t.ne];-1!==n.indexOf(r);)r=_.int(e.min,e.max);return r},boolean:function(t){return null!=t.eq?t.eq:_.bool()},null:function(t){return null},date:function(t){return null!=t.eq?t.eq:new Date},object:function(t){var e={},r=t.properties||{};for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){if(!0===r[n].optional&&!0===_.bool())continue;if("*"!==n)e[n]=this.generate(r[n]);else for(var i="__random_key_",o=i+0,a=_.int(1,9),s=1;s<=a;s++)o in r||(e[o]=this.generate(r[n])),o=i+s}return e},array:function(t){var e,r,n,i,o=t.items||{},a=null!=t.minLength?t.minLength:0,s=null!=t.maxLength?t.maxLength:16;if(f.array(o))for(n=o.length,null!=t.exactLength?n=t.exactLength:n<a?n=a:n>s&&(n=s),r=new Array(n),e=null,i=0;i<n;i++)e=o[i].type||"any",f.array(e)&&(e=e[_.int(0,e.length-1)]),r[i]=this[e](o[i]);else for(n=null!=t.exactLength?t.exactLength:_.int(a,s),r=new Array(n),e=o.type||"any",f.array(e)&&(e=e[_.int(0,e.length-1)]),i=0;i<n;i++)r[i]=this[e](o);return r},any:function(t){var e=Object.keys(A);return this[e[_.int(0,e.length-2)]](t)}};function x(){}i(x.prototype,A);var M=null;x.instance=function(){return M instanceof x||(M=new x),M},x.prototype.generate=function(t){var e=t.type||"any";return f.array(e)&&(e=e[_.int(0,e.length-1)]),this[e](t)};var k={};t.exports?t.exports=k:window.SchemaInspector=k,k.newSanitization=function(t,e){return new v(t,e)},k.newValidation=function(t,e){return new p(t,e)},k.Validation=p,k.Sanitization=v,k.sanitize=function(t,e,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new v(t,r).sanitize(e,n)},k.validate=function(t,e,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new p(t,r).validate(e,n)},k.generate=function(t,e){if("number"==typeof e){for(var r=new Array(e),n=0;n<e;n++)r[n]=x.instance().generate(t);return r}return x.instance().generate(t)}}()},3327:(t,e,r)=>{var n=r(7834).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var f=a%i,u=Math.min(o-s,i-f),c=0;c<u;c++)r[f+c]=t[s+c];s+=u,(a+=u)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9065:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(8820),n.sha1=r(7885),n.sha224=r(8321),n.sha256=r(4424),n.sha384=r(213),n.sha512=r(5596)},8820:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=n)<<5|e>>>27)+c(l,i,o,s)+f+r[d]+a[l];f=s,s=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=f},7885:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(f,i),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=u(n)+h(p,i,o,s)+f+r[l]+a[p]|0;f=s,s=o,o=c(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=f},8321:(t,e,r)=>{var n=r(1285),i=r(4424),o=r(3327),a=r(7834).Buffer,s=new Array(64);function f(){this.init(),this._w=s,o.call(this,64,56)}n(f,i),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=f},4424:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[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],s=new Array(64);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(f,i),f.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var m=0;m<64;++m){var v=y+d(f)+u(f,p,b)+a[m]+r[m]|0,w=h(n)+c(n,i,o)|0;y=b,b=p,p=f,f=s+v|0,s=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},f.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=f},213:(t,e,r)=>{var n=r(1285),i=r(5596),o=r(3327),a=r(7834).Buffer,s=new Array(160);function f(){this.init(),this._w=s,o.call(this,128,112)}n(f,i),f.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},f.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=f},5596:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,a=[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],s=new Array(160);function f(){this.init(),this._w=s,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0<e>>>0?1:0}n(f,i),f.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},f.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,f=0|this._fh,m=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,A=0|this._el,x=0|this._fl,M=0|this._gl,k=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var B=e[I-30],O=e[I-30+1],T=l(B,O),U=p(O,B),j=b(B=e[I-4],O=e[I-4+1]),L=y(O,B),R=e[I-14],P=e[I-14+1],F=e[I-32],N=e[I-32+1],z=U+P|0,C=T+R+g(z,U)|0;C=(C=C+j+g(z=z+L|0,L)|0)+F+g(z=z+N|0,N)|0,e[I]=C,e[I+1]=z}for(var $=0;$<160;$+=2){C=e[$],z=e[$+1];var D=c(r,n,i),q=c(w,_,S),H=h(r,w),V=h(w,r),K=d(s,A),J=d(A,s),G=a[$],W=a[$+1],Z=u(s,f,m),X=u(A,x,M),Y=k+J|0,Q=v+K+g(Y,k)|0;Q=(Q=(Q=Q+Z+g(Y=Y+X|0,X)|0)+G+g(Y=Y+W|0,W)|0)+C+g(Y=Y+z|0,z)|0;var tt=V+q|0,et=H+D+g(tt,V)|0;v=m,k=M,m=f,M=x,f=s,x=A,s=o+Q+g(A=E+Y|0,E)|0,o=i,E=S,i=n,S=_,n=r,_=w,r=Q+et+g(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+A|0,this._fl=this._fl+x|0,this._gl=this._gl+M|0,this._hl=this._hl+k|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,A)|0,this._fh=this._fh+f+g(this._fl,x)|0,this._gh=this._gh+m+g(this._gl,M)|0,this._hh=this._hh+v+g(this._hl,k)|0},f.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=f},2377:(t,e,r)=>{"use strict";t.exports=r(8613)},8613:(t,e)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,void 0):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function i(t,e){return void 0===e&&(e="{$origin}\n{$ttl}\n\n; SOA Record\n{name} {ttl} IN SOA {mname}{rname}(\n{serial} ;serial\n{refresh} ;refresh\n{retry} ;retry\n{expire} ;expire\n{minimum} ;minimum ttl\n)\n\n; NS Records\n{ns}\n\n; MX Records\n{mx}\n\n; A Records\n{a}\n\n; AAAA Records\n{aaaa}\n\n; CNAME Records\n{cname}\n\n; PTR Records\n{ptr}\n\n; TXT Records\n{txt}\n\n; SRV Records\n{srv}\n\n; SPF Records\n{spf}\n\n; URI Records\n{uri}\n"),e=function(t,e){var r="";return void 0!==t&&(r+="$ORIGIN "+t),e.replace("{$origin}",r)}(t.$origin,e),e=function(t,e){var r="";return void 0!==t&&(r+="$TTL "+t),e.replace("{$ttl}",r)}(t.$ttl,e),e=function(t,e){var r=e;if(void 0!==t)for(var n in t.name=t.name||"@",t.ttl=t.ttl||"",t)r=r.replace("{"+n+"}",t[n]+"\t");return r}(t.soa,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tNS\t"+a.host+"\n"}return e.replace("{ns}",r)}(t.ns,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tA\t"+a.ip+"\n"}return e.replace("{a}",r)}(t.a,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tAAAA\t"+a.ip+"\n"}return e.replace("{aaaa}",r)}(t.aaaa,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tCNAME\t"+a.alias+"\n"}return e.replace("{cname}",r)}(t.cname,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tMX\t"+a.preference+"\t"+a.host+"\n"}return e.replace("{mx}",r)}(t.mx,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tPTR\t"+a.host+"\n"}return e.replace("{ptr}",r)}(t.ptr,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tTXT\t";var s=a.txt;"string"==typeof s?r+='"'+s+'"':s instanceof Array&&(r+=s.map((function(t){return'"'+t+'"'})).join(" ")),r+="\n"}return e.replace("{txt}",r)}(t.txt,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tSRV\t"+a.priority+"\t",r+=a.weight+"\t",r+=a.port+"\t",r+=a.target+"\n"}return e.replace("{srv}",r)}(t.srv,e),e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tSPF\t"+a.data+"\n"}return e.replace("{spf}",r)}(t.spf,e),(e=function(t,e){e=(e=e.replace("{zone}",t.$origin||!!t.soa&&t.soa.name||"")).replace("{datetime}",(new Date).toISOString());var r=Math.round(Date.now()/1e3);return e.replace("{time}",""+r)}(t,e=function(t,e){var r="";if(t)for(var i,o=n(t);!(i=o()).done;){var a=i.value;r+=(a.name||"@")+"\t",a.ttl&&(r+=a.ttl+"\t"),r+="IN\tURI\t"+a.priority+"\t",r+=a.weight+"\t",r+='"'+a.target+'"\n'}return e.replace("{uri}",r)}(t.uri,e))).replace(/\n{2,}/gim,"\n\n")}function o(t){return function(t){for(var e,r={},i=n(t.split("\n"));!(e=i()).done;){var o=e.value;if(o&&o.trim()){var g=o.toUpperCase();/\s+TXT\s+/.test(g)?(r.txt=r.txt||[],r.txt.push(d(o))):0===g.indexOf("$ORIGIN")?r.$origin=o.split(/\s+/g)[1]:0===g.indexOf("$TTL")?r.$ttl=parseInt(o.split(/\s+/g)[1],10):/\s+SOA\s+/.test(g)?r.soa=a(o):/\s+NS\s+/.test(g)?(r.ns=r.ns||[],r.ns.push(s(o))):/\s+A\s+/.test(g)?(r.a=r.a||[],r.a.push(f(o,r.a))):/\s+AAAA\s+/.test(g)?(r.aaaa=r.aaaa||[],r.aaaa.push(u(o))):/\s+CNAME\s+/.test(g)?(r.cname=r.cname||[],r.cname.push(c(o))):/\s+MX\s+/.test(g)?(r.mx=r.mx||[],r.mx.push(h(o))):/\s+PTR\s+/.test(g)?(r.ptr=r.ptr||[],r.ptr.push(l(o,r.ptr,r.$origin))):/\s+SRV\s+/.test(g)?(r.srv=r.srv||[],r.srv.push(p(o))):/\s+SPF\s+/.test(g)?(r.spf=r.spf||[],r.spf.push(b(o))):/\s+URI\s+/.test(g)&&(r.uri=r.uri||[],r.uri.push(y(o)))}}return r}(t=function(t){for(var e=[],r=/\([\s\S]*?\)/gim,n=r.exec(t);null!==n;){var i=n[0].replace(/\s+/gm," ");e.push({match:n,replacement:i}),n=r.exec(t)}for(var o=t.split(""),a=0,s=e;a<s.length;a++){var f=s[a],u=f.match;o.splice(u.index,u[0].length,f.replacement)}return o.join("").replace(/\(|\)/gim," ")}(t=function(t){return t.replace(/(^|[^\\]);.*/g,(function(t,e){return e||""}))}(t)))}function a(t){var e={},r=t.trim().split(/\s+/g),n=r.length;return e.name=r[0],e.minimum=parseInt(r[n-1],10),e.expire=parseInt(r[n-2],10),e.retry=parseInt(r[n-3],10),e.refresh=parseInt(r[n-4],10),e.serial=parseInt(r[n-5],10),e.rname=r[n-6],e.mname=r[n-7],isNaN(r[1])||(e.ttl=parseInt(r[1],10)),e}function s(t){var e=t.trim().split(/\s+/g),r={name:e[0],host:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function f(t,e){var r=t.trim().split(/\s+/g),n=t.trim().toUpperCase().split(/\s+/g),i={name:r[0],ip:r[r.length-1]};return 0===n.lastIndexOf("A")&&(i.name=e.length?e[e.length-1].name:"@"),isNaN(r[1])||(i.ttl=parseInt(r[1],10)),i}function u(t){var e=t.trim().split(/\s+/g),r={name:e[0],ip:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function c(t){var e=t.trim().split(/\s+/g),r={name:e[0],alias:e[e.length-1]};return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function h(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],preference:parseInt(e[r-2],10),host:e[r-1]};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}function d(t){var e=t.trim().match(/[^\s"']+|"[^"]*"|'[^']*'/g);if(!e)throw new Error("Failure to tokenize TXT record");var r,n=e.length,i=e.indexOf("TXT");function o(t){return t.indexOf('"')>-1&&(t=t.split('"')[1]),t}r=n-i-1>1?[].concat(e.slice(i+1).map(o)):o(e[n-1]);var a={name:e[0],txt:r};return isNaN(e[1])||(a.ttl=parseInt(e[1],10)),a}function l(t,e,r){var n=t.trim().split(/\s+/g);0===t.trim().toUpperCase().split(/\s+/g).lastIndexOf("PTR")&&e[e.length-1]&&n.unshift(e[e.length-1].name);var i={name:n[0],fullname:n[0]+"."+r,host:n[n.length-1]};return isNaN(n[1])||(i.ttl=parseInt(n[1],10)),i}function p(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],target:e[r-1],priority:parseInt(e[r-4],10),weight:parseInt(e[r-3],10),port:parseInt(e[r-2],10)};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}function b(t){for(var e=t.trim().split(/\s+/g),r={name:e[0],data:""},n=e.length;n-- >4;)r.data=e[n]+" "+r.data.trim();return isNaN(e[1])||(r.ttl=parseInt(e[1],10)),r}function y(t){var e=t.trim().split(/\s+/g),r=e.length,n={name:e[0],target:e[r-1].replace(/"/g,""),priority:parseInt(e[r-3],10),weight:parseInt(e[r-2],10)};return isNaN(e[1])||(n.ttl=parseInt(e[1],10)),n}(function(){var t=function(t){this.jsonZoneFile="object"==typeof t?JSON.parse(JSON.stringify(t)):"string"==typeof t?o(t):void 0}.prototype;t.toJSON=function(){return this.jsonZoneFile},t.toString=function(){return i(this.toJSON())}})(),e.makeZoneFile=i,e.parseZoneFile=o},9314:()=>{},8087:()=>{},9096:()=>{},488:()=>{},1812:()=>{},763:t=>{"use strict";t.exports={i8:"6.5.4"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};return(()=>{"use strict";r.r(n),r.d(n,{BLOCKSTACK_GAIA_HUB_LABEL:()=>tr,GaiaHubConfig:()=>t.GaiaHubConfig,Storage:()=>fr,connectToGaiaHub:()=>or,deleteFromGaiaHub:()=>rr,getBucketUrl:()=>ar,getFullReadUrl:()=>nr,getUserAppFileUrl:()=>ur,uploadToGaiaHub:()=>er});var t={};r.r(t),r.d(t,{Ne:()=>tr,cc:()=>or,gZ:()=>rr,CC:()=>sr,JV:()=>ar,J$:()=>nr,d_:()=>er});var e=r(7474);const i=["debug","info","warn","error","none"],o={},a={};for(let t=0;t<i.length;t++){const e=i[t];o[e]=t,a[t]=e}class s{static error(t){this.shouldLog("error")&&console.error(this.logMessage("error",t))}static warn(t){this.shouldLog("warn")&&console.warn(this.logMessage("warn",t))}static info(t){this.shouldLog("info")&&console.log(this.logMessage("info",t))}static debug(t){this.shouldLog("debug")&&console.log(this.logMessage("debug",t))}static logMessage(t,e){return`[${t.toUpperCase()}] ${e}`}static shouldLog(t){return o.debug<=o[t]}}var f=r(8834),u=r(8834).Buffer;const c=void 0!==u?u:f.Buffer;function h(t){return Number.isFinite(t)?Math.floor(1024*t*1024):0}function d(){let t=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:3&r|8).toString(16)}))}function l(t,{throwIfUnavailable:e,usageDesc:n,returnEmptyObject:i}={}){let o;try{if(o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("Unexpected runtime environment - no supported global scope (`window`, `self`, `global`) available")}(),o){const e=o[t];if(e)return e}}catch(e){s.error(`Error getting object '${t}' from global scope '${o}': ${e}`)}if(e){const e=function(t,e,r){return r?`Use of '${r}' requires \`${e}\` which is unavailable on the '${t}' object within the currently executing environment.`:`\`${e}\` is unavailable on the '${t}' object within the currently executing environment.`}(o,t.toString(),n);throw s.error(e),new Error(e)}if(i)return{}}const p=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function b(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=p[t[r]];return e}"object"==typeof self&&"crypto"in self&&self.crypto;const y=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),g=(t,e)=>t<<32-e|t>>>e;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function m(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got "+typeof t);return(new TextEncoder).encode(t)}(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}function v(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0"))),(()=>{const t="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);try{if(t){const{setImmediate:e}=t("timers")}}catch(t){}})();class w{clone(){return this._cloneInto()}}class _ extends w{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");v(t.outputLen),v(t.blockLen)}(t);const r=m(e);if(this.iHash=t.create(),!(this.iHash instanceof w))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(t),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return(t=t).finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=a,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const S=(t,e,r)=>new _(t,e).update(r).digest();S.create=(t,e)=>new _(t,e);class E extends w{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=y(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");const{view:e,buffer:r,blockLen:n,finished:i}=this;if(i)throw new Error("digest() was already called");const o=(t=m(t)).length;for(let i=0;i<o;){const a=Math.min(n-this.pos,o-i);if(a!==n)r.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=y(t);for(;n<=o-i;i+=n)this.process(e,i)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),f=n?4:0,u=n?0:4;t.setUint32(e+f,a,n),t.setUint32(e+u,s,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const a=y(t);this.get().forEach(((t,e)=>a.setUint32(4*e,t,i)))}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return t.length=n,t.pos=a,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}const A=(t,e,r)=>t&e^t&r^e&r,x=new Uint32Array([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]),M=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),k=new Uint32Array(64);class I extends E{constructor(){super(64,32,8,!1),this.A=0|M[0],this.B=0|M[1],this.C=0|M[2],this.D=0|M[3],this.E=0|M[4],this.F=0|M[5],this.G=0|M[6],this.H=0|M[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[t,e,r,n,i,o,a,s]}set(t,e,r,n,i,o,a,s){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(t,e){for(let r=0;r<16;r++,e+=4)k[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=k[t-15],r=k[t-2],n=g(e,7)^g(e,18)^e>>>3,i=g(r,17)^g(r,19)^r>>>10;k[t]=i+k[t-7]+n+k[t-16]|0}let{A:r,B:n,C:i,D:o,E:a,F:s,G:f,H:u}=this;for(let t=0;t<64;t++){const e=u+(g(a,6)^g(a,11)^g(a,25))+((c=a)&s^~c&f)+x[t]+k[t]|0,h=(g(r,2)^g(r,13)^g(r,22))+A(r,n,i)|0;u=f,f=s,s=a,a=o+e|0,o=i,i=n,n=r,r=e+h|0}var c;r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,s=s+this.F|0,f=f+this.G|0,u=u+this.H|0,this.set(r,n,i,o,a,s,f,u)}roundClean(){k.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const B=function(t){const e=e=>t().update(m(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}((()=>new I));var O=r(9314);const T=BigInt(0),U=BigInt(1),j=BigInt(2),L=BigInt(3),R=BigInt(8),P=j**BigInt(256),F={a:T,b:BigInt(7),P:P-j**BigInt(32)-BigInt(977),n:P-BigInt("432420386565659656852420866394968145599"),h:U,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function N(t){const{a:e,b:r}=F,n=nt(t*t),i=nt(n*t);return nt(i+e*t+r)}const z=F.a===T;class C{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof D))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new C(t.x,t.y,U)}static toAffineBatch(t){const e=function(t,e=F.P){const r=new Array(t.length),n=ot(t.reduce(((t,n,i)=>n===T?t:(r[i]=t,nt(t*n,e))),U),e);return t.reduceRight(((t,n,i)=>n===T?t:(r[i]=nt(t*r[i],e),nt(t*n,e))),n),r}(t.map((t=>t.z)));return t.map(((t,r)=>t.toAffine(e[r])))}static normalizeZ(t){return C.toAffineBatch(t).map(C.fromAffine)}equals(t){if(!(t instanceof C))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:o,z:a}=t,s=nt(n**j),f=nt(a**j),u=nt(e*f),c=nt(i*s),h=nt(nt(r*a)*f),d=nt(nt(o*n)*s);return u===c&&h===d}negate(){return new C(this.x,nt(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=nt(t**j),i=nt(e**j),o=nt(i**j),a=nt(j*(nt((t+i)**j)-n-o)),s=nt(L*n),f=nt(s**j),u=nt(f-j*a),c=nt(s*(a-u)-R*o),h=nt(j*e*r);return new C(u,c,h)}add(t){if(!(t instanceof C))throw new TypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:i,y:o,z:a}=t;if(i===T||o===T)return this;if(e===T||r===T)return t;const s=nt(n**j),f=nt(a**j),u=nt(e*f),c=nt(i*s),h=nt(nt(r*a)*f),d=nt(nt(o*n)*s),l=nt(c-u),p=nt(d-h);if(l===T)return p===T?this.double():C.ZERO;const b=nt(l**j),y=nt(l*b),g=nt(u*b),m=nt(p**j-y-j*g),v=nt(p*(g-m)-h*y),w=nt(n*a*l);return new C(m,v,w)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){let e=rt(t);C.BASE;const r=C.ZERO;if(e===T)return r;if(e===U)return this;if(!z){let t=r,n=this;for(;e>T;)e&U&&(t=t.add(n)),n=n.double(),e>>=U;return t}let{k1neg:n,k1:i,k2neg:o,k2:a}=ft(e),s=r,f=r,u=this;for(;i>T||a>T;)i&U&&(s=s.add(u)),a&U&&(f=f.add(u)),u=u.double(),i>>=U,a>>=U;return n&&(s=s.negate()),o&&(f=f.negate()),f=new C(nt(f.x*F.beta),f.y,f.z),s.add(f)}precomputeWindow(t){const e=z?128/t+1:256/t+1,r=[];let n=this,i=n;for(let o=0;o<e;o++){i=n,r.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(t,e){!e&&this.equals(C.BASE)&&(e=D.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&$.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=C.normalizeZ(n),$.set(e,n)));let i=C.ZERO,o=C.ZERO;const a=1+(z?128/r:256/r),s=2**(r-1),f=BigInt(2**r-1),u=2**r,c=BigInt(r);for(let e=0;e<a;e++){const r=e*s;let a=Number(t&f);if(t>>=c,a>s&&(a-=u,t+=U),0===a){let t=n[r];e%2&&(t=t.negate()),o=o.add(t)}else{let t=n[r+Math.abs(a)-1];a<0&&(t=t.negate()),i=i.add(t)}}return{p:i,f:o}}multiply(t,e){let r,n,i=rt(t);if(z){const{k1neg:t,k1:o,k2neg:a,k2:s}=ft(i);let{p:f,f:u}=this.wNAF(o,e),{p:c,f:h}=this.wNAF(s,e);t&&(f=f.negate()),a&&(c=c.negate()),c=new C(nt(c.x*F.beta),c.y,c.z),r=f.add(c),n=u.add(h)}else{const{p:t,f:o}=this.wNAF(i,e);r=t,n=o}return C.normalizeZ([r,n])[0]}toAffine(t=ot(this.z)){const{x:e,y:r,z:n}=this,i=t,o=nt(i*i),a=nt(o*i),s=nt(e*o),f=nt(r*a);if(nt(n*i)!==U)throw new Error("invZ was invalid");return new D(s,f)}}C.BASE=new C(F.Gx,F.Gy,U),C.ZERO=new C(T,U,T);const $=new WeakMap;class D{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,$.delete(this)}static fromCompressedHex(t){const e=32===t.length,r=tt(e?t:t.subarray(1));if(!dt(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=F,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),f=t*t*t%e,u=f*f*t%e,c=it(u,L)*u%e,h=it(c,L)*u%e,d=it(h,j)*f%e,l=it(d,n)*d%e,p=it(l,i)*l%e,b=it(p,a)*p%e,y=it(b,s)*b%e,g=it(y,a)*p%e,m=it(g,L)*u%e,v=it(m,o)*l%e,w=it(v,r)*f%e;return it(w,j)}(N(r));const i=(n&U)===U;e?i&&(n=nt(-n)):1==(1&t[0])!==i&&(n=nt(-n));const o=new D(r,n);return o.assertValidity(),o}static fromUncompressedHex(t){const e=tt(t.subarray(1,33)),r=tt(t.subarray(33,65)),n=new D(e,r);return n.assertValidity(),n}static fromHex(t){const e=et(t),r=e.length,n=e[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(e);if(65===r&&4===n)return this.fromUncompressedHex(e);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return D.BASE.multiply(pt(t))}static fromSignature(t,e,r){const n=ut(t=et(t)),{r:i,s:o}=bt(e);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===T)throw new Error("Cannot recover signature: msgHash cannot be 0");const a=1&r?"03":"02",s=D.fromHex(a+Z(i)),{n:f}=F,u=ot(i,f),c=nt(-n*u,f),h=nt(o*u,f),d=D.BASE.multiplyAndAddUnsafe(s,c,h);if(!d)throw new Error("Cannot recover signature: point at infinify");return d.assertValidity(),d}toRawBytes(t=!1){return Q(this.toHex(t))}toHex(t=!1){const e=Z(this.x);return t?`${this.y&U?"03":"02"}${e}`:`04${e}${Z(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:r}=this;if(!dt(e)||!dt(r))throw new Error(t);const n=nt(r*r);if(nt(n-N(e))!==T)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new D(this.x,nt(-this.y))}double(){return C.fromAffine(this).double().toAffine()}add(t){return C.fromAffine(this).add(C.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return C.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=C.fromAffine(this).multiply(e),i=C.fromAffine(t).multiplyUnsafe(r),o=n.add(i);return o.equals(C.ZERO)?void 0:o.toAffine()}}function q(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function H(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${W(t)}`);const e=t[1],r=t.subarray(2,e+2);if(!e||r.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:tt(r),left:t.subarray(e+2)}}D.BASE=new D(F.Gx,F.Gy),D.ZERO=new D(T,T);class V{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=J(t),r="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=e?W(t):t;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new V(Y(n.slice(0,64)),Y(n.slice(64,128)))}static fromDER(t){const e=J(t);if("string"!=typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(t){if(t.length<2||48!=t[0])throw new Error(`Invalid signature tag: ${W(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=H(t.subarray(2)),{data:n,left:i}=H(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${W(i)}`);return{r:e,s:n}}(e?t:Q(t));return new V(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!ht(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!ht(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=F.n>>U;return this.s>t}normalizeS(){return this.hasHighS()?new V(this.r,F.n-this.s):this}toDERRawBytes(t=!1){return Q(this.toDERHex(t))}toDERHex(t=!1){const e=q(X(this.s));if(t)return e;const r=q(X(this.r)),n=X(r.length/2),i=X(e.length/2);return`30${X(r.length/2+e.length/2+4)}02${n}${r}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Q(this.toCompactHex())}toCompactHex(){return Z(this.r)+Z(this.s)}}function K(...t){if(!t.every(J))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r}function J(t){return t instanceof Uint8Array}const G=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function W(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=G[t[r]];return e}function Z(t){if(t>P)throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function X(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function Y(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function Q(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[r]=o}return e}function tt(t){return Y(W(t))}function et(t){return t instanceof Uint8Array?Uint8Array.from(t):Q(t)}function rt(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&ht(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function nt(t,e=F.P){const r=t%e;return r>=T?r:e+r}function it(t,e){const{P:r}=F;let n=t;for(;e-- >T;)n*=n,n%=r;return n}function ot(t,e=F.P){if(t===T||e<=T)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=nt(t,e),n=e,i=T,o=U,a=U,s=T;for(;r!==T;){const t=n/r,e=n%r,f=i-a*t,u=o-s*t;n=r,r=e,i=a,o=s,a=f,s=u}if(n!==U)throw new Error("invert: does not exist");return nt(i,e)}const at=(t,e)=>(t+e/j)/e,st=j**BigInt(128);function ft(t){const{n:e}=F,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-U*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=at(o*t,e),s=at(-n*t,e);let f=nt(t-a*r-s*i,e),u=nt(-a*n-s*o,e);const c=f>st,h=u>st;if(c&&(f=e-f),h&&(u=e-u),f>st||u>st)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:c,k1:f,k2neg:h,k2:u}}function ut(t){const{n:e}=F,r=8*t.length-256;let n=tt(t);return r>0&&(n>>=BigInt(r)),n>=e&&(n-=e),n}class ct{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...t){return St.hmacSha256(this.k,...t)}hmacSync(...t){if("function"!=typeof St.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const e=St.hmacSha256Sync(this.k,...t);if(e instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return e}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),0!==t.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),0!==t.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function ht(t){return T<t&&t<F.n}function dt(t){return T<t&&t<F.P}function lt(t,e,r){const n=tt(t);if(!ht(n))return;const{n:i}=F,o=D.BASE.multiply(n),a=nt(o.x,i);if(a===T)return;const s=nt(ot(n,i)*nt(e+r*a,i),i);if(s===T)return;const f=new V(a,s);return{sig:f,recovery:(o.x===f.r?0:2)|Number(o.y&U)}}function pt(t){let e;if("bigint"==typeof t)e=t;else if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"==typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=Y(t)}else{if(!J(t))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=tt(t)}if(!ht(e))throw new Error("Expected private key: 0 < key < n");return e}function bt(t){if(t instanceof V)return t.assertValidity(),t;try{return V.fromDER(t)}catch(e){return V.fromCompact(t)}}function yt(t){return tt(t.length>32?t.slice(0,32):t)}function gt(t){const e=yt(t),r=nt(e,F.n);return mt(r<T?e:r)}function mt(t){if("bigint"!=typeof t)throw new Error("Expected bigint");return Q(Z(t))}function vt(t,e,r={}){const{seed:n,m:i,d:o}=function(t,e,r){if(null==t)throw new Error(`sign: expected valid message hash, not "${t}"`);const n=et(t),i=pt(e),o=[mt(i),gt(n)];if(null!=r){!0===r&&(r=St.randomBytes(32));const t=et(r);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(t)}return{seed:K(...o),m:yt(n),d:i}}(t,e,r.extraEntropy);let a;const s=new ct;for(s.reseedSync(n);!(a=lt(s.generateSync(),i,o));)s.reseedSync();return function(t,e){let{sig:r,recovery:n}=t;const{canonical:i,der:o,recovered:a}=Object.assign({canonical:!0,der:!0},e);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const s=o?r.toDERRawBytes():r.toCompactRawBytes();return a?[s,n]:s}(a,r)}const wt={strict:!0};D.BASE._setWindowSize(8);const _t={node:O,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},St={isValidPrivateKey(t){try{return pt(t),!0}catch(t){return!1}},hashToPrivateKey:t=>{if((t=et(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const e=nt(tt(t),F.n);if(e===T||e===U)throw new Error("Invalid private key");return function(t){return Q(Z(t))}(e)},randomBytes:(t=32)=>{if(_t.web)return _t.web.getRandomValues(new Uint8Array(t));if(_t.node){const{randomBytes:e}=_t.node;return Uint8Array.from(e(t))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>St.hashToPrivateKey(St.randomBytes(40)),bytesToHex:W,mod:nt,sha256:async t=>{if(_t.web){const e=await _t.web.subtle.digest("SHA-256",t.buffer);return new Uint8Array(e)}if(_t.node){const{createHash:e}=_t.node;return Uint8Array.from(e("sha256").update(t).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(t,...e)=>{if(_t.web){const r=await _t.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=K(...e),i=await _t.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(_t.node){const{createHmac:r}=_t.node,n=r("sha256",t);return e.forEach((t=>n.update(t))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(t=8,e=D.BASE){const r=e===D.BASE?e:new D(e.x,e.y);return r._setWindowSize(t),r.multiply(L),r}};var Et,At,xt,Mt,kt,It,Bt,Ot,Tt,Ut,jt,Lt,Rt,Pt,Ft,Nt,zt,Ct,$t,Dt,qt=r(2870);(At=Et||(Et={}))[At.Testnet=2147483648]="Testnet",At[At.Mainnet=1]="Mainnet",Et.Mainnet,(Ot=xt||(xt={}))[Ot.Address=0]="Address",Ot[Ot.Principal=1]="Principal",Ot[Ot.LengthPrefixedString=2]="LengthPrefixedString",Ot[Ot.MemoString=3]="MemoString",Ot[Ot.AssetInfo=4]="AssetInfo",Ot[Ot.PostCondition=5]="PostCondition",Ot[Ot.PublicKey=6]="PublicKey",Ot[Ot.LengthPrefixedList=7]="LengthPrefixedList",Ot[Ot.Payload=8]="Payload",Ot[Ot.MessageSignature=9]="MessageSignature",Ot[Ot.TransactionAuthField=10]="TransactionAuthField",function(t){t[t.TokenTransfer=0]="TokenTransfer",t[t.SmartContract=1]="SmartContract",t[t.ContractCall=2]="ContractCall",t[t.PoisonMicroblock=3]="PoisonMicroblock",t[t.Coinbase=4]="Coinbase"}(Mt||(Mt={})),function(t){t[t.OnChainOnly=1]="OnChainOnly",t[t.OffChainOnly=2]="OffChainOnly",t[t.Any=3]="Any"}(kt||(kt={})),(Bt=It||(It={}))[Bt.Mainnet=0]="Mainnet",Bt[Bt.Testnet=128]="Testnet",It.Mainnet,function(t){t[t.Allow=1]="Allow",t[t.Deny=2]="Deny"}(Tt||(Tt={})),function(t){t[t.STX=0]="STX",t[t.Fungible=1]="Fungible",t[t.NonFungible=2]="NonFungible"}(Ut||(Ut={})),function(t){t[t.Standard=4]="Standard",t[t.Sponsored=5]="Sponsored"}(jt||(jt={})),function(t){t[t.SerializeP2PKH=0]="SerializeP2PKH",t[t.SerializeP2SH=1]="SerializeP2SH",t[t.SerializeP2WPKH=2]="SerializeP2WPKH",t[t.SerializeP2WSH=3]="SerializeP2WSH"}(Lt||(Lt={})),function(t){t[t.MainnetSingleSig=22]="MainnetSingleSig",t[t.MainnetMultiSig=20]="MainnetMultiSig",t[t.TestnetSingleSig=26]="TestnetSingleSig",t[t.TestnetMultiSig=21]="TestnetMultiSig"}(Rt||(Rt={})),(Dt=Pt||(Pt={}))[Dt.Compressed=0]="Compressed",Dt[Dt.Uncompressed=1]="Uncompressed",function(t){t[t.Equal=1]="Equal",t[t.Greater=2]="Greater",t[t.GreaterEqual=3]="GreaterEqual",t[t.Less=4]="Less",t[t.LessEqual=5]="LessEqual"}(Ft||(Ft={})),function(t){t[t.DoesNotOwn=16]="DoesNotOwn",t[t.Owns=17]="Owns"}(Nt||(Nt={})),function(t){t[t.Origin=1]="Origin",t[t.Standard=2]="Standard",t[t.Contract=3]="Contract"}(zt||(zt={})),function(t){t[t.STX=0]="STX",t[t.Fungible=1]="Fungible",t[t.NonFungible=2]="NonFungible"}(Ct||(Ct={})),function(t){t.Serialization="Serialization",t.Deserialization="Deserialization",t.SignatureValidation="SignatureValidation",t.FeeTooLow="FeeTooLow",t.BadNonce="BadNonce",t.NotEnoughFunds="NotEnoughFunds",t.NoSuchContract="NoSuchContract",t.NoSuchPublicFunction="NoSuchPublicFunction",t.BadFunctionArgument="BadFunctionArgument",t.ContractAlreadyExists="ContractAlreadyExists",t.PoisonMicroblocksDoNotConflict="PoisonMicroblocksDoNotConflict",t.PoisonMicroblockHasUnknownPubKeyHash="PoisonMicroblockHasUnknownPubKeyHash",t.PoisonMicroblockIsInvalid="PoisonMicroblockIsInvalid",t.BadAddressVersionByte="BadAddressVersionByte",t.NoCoinbaseViaMempool="NoCoinbaseViaMempool",t.ServerFailureNoSuchChainTip="ServerFailureNoSuchChainTip",t.ServerFailureDatabase="ServerFailureDatabase",t.ServerFailureOther="ServerFailureOther"}($t||($t={})),r(9907);const Ht=new Array(16),Vt=se([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),Kt=se([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),Jt=se([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Gt=se([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Wt=ae([0,1518500249,1859775393,2400959708,2840853838]),Zt=ae([1352829926,1548603684,1836072691,2053994217,0]);function Xt(t,e){return t<<e|t>>>32-e}function Yt(t,e,r,n,i,o,a,s){return Xt(t+(e^r^n)+o+a|0,s)+i|0}function Qt(t,e,r,n,i,o,a,s){return Xt(t+(e&r|~e&n)+o+a|0,s)+i|0}function te(t,e,r,n,i,o,a,s){return Xt(t+((e|~r)^n)+o+a|0,s)+i|0}function ee(t,e,r,n,i,o,a,s){return Xt(t+(e&n|r&~n)+o+a|0,s)+i|0}function re(t,e,r,n,i,o,a,s){return Xt(t+(e^(r|~n))+o+a|0,s)+i|0}function ne(t,e){return t[e>>>=0]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function ie(t,e,r){return e=+e,t[3+(r>>>=0)]=e>>>24,t[r+2]=e>>>16,t[r+1]=e>>>8,t[r]=255&e,r+4}function oe(t,e,r){return e=+e,t[r>>>=0]=255&e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,r+4}function ae(t){return"undefined"!=typeof Uint32Array?new Uint32Array(t):t}function se(t){return"undefined"!=typeof Uint8Array?new Uint8Array(t):t}function fe(t){return"undefined"!=typeof Uint8Array?new Uint8Array(t):new Array(t)}const ue=class{constructor(){this._block=fe(64),this._blockSize=64,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1,this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}update(t){if(this._finalized)throw new Error("Digest already called");const e=this._block;let r=0;for(;this._blockOffset+t.length-r>=this._blockSize;){for(let n=this._blockOffset;n<this._blockSize;)e[n++]=t[r++];this._update(),this._blockOffset=0}for(;r<t.length;)e[this._blockOffset++]=t[r++];for(let e=0,r=8*t.length;r>0;++e)this._length[e]+=r,r=this._length[e]/4294967296|0,r>0&&(this._length[e]-=4294967296*r);return this}_update(){const t=Ht;for(let e=0;e<16;++e)t[e]=ne(this._block,4*e);let e=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,o=0|this._e,a=0|this._a,s=0|this._b,f=0|this._c,u=0|this._d,c=0|this._e;for(let h=0;h<80;h+=1){let d,l;h<16?(d=Yt(e,r,n,i,o,t[Vt[h]],Wt[0],Jt[h]),l=re(a,s,f,u,c,t[Kt[h]],Zt[0],Gt[h])):h<32?(d=Qt(e,r,n,i,o,t[Vt[h]],Wt[1],Jt[h]),l=ee(a,s,f,u,c,t[Kt[h]],Zt[1],Gt[h])):h<48?(d=te(e,r,n,i,o,t[Vt[h]],Wt[2],Jt[h]),l=te(a,s,f,u,c,t[Kt[h]],Zt[2],Gt[h])):h<64?(d=ee(e,r,n,i,o,t[Vt[h]],Wt[3],Jt[h]),l=Qt(a,s,f,u,c,t[Kt[h]],Zt[3],Gt[h])):(d=re(e,r,n,i,o,t[Vt[h]],Wt[4],Jt[h]),l=Yt(a,s,f,u,c,t[Kt[h]],Zt[4],Gt[h])),e=o,o=i,i=Xt(n,10),n=r,r=d,a=c,c=u,u=Xt(f,10),f=s,s=l}const h=this._b+n+u|0;this._b=this._c+i+c|0,this._c=this._d+o+a|0,this._d=this._e+e+s|0,this._e=this._a+r+f|0,this._a=h}digest(){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),ie(this._block,this._length[0],56),ie(this._block,this._length[1],60),this._update();const t=fe(20);oe(t,this._a,0),oe(t,this._b,4),oe(t,this._c,8),oe(t,this._d,12),oe(t,this._e,16),this._block.fill(0),this._blockOffset=0;for(let t=0;t<4;++t)this._length[t]=0;return t}};var ce=r(9065);function he(t,e=It.Mainnet){t="string"==typeof t?t:t.toString("hex");var r,n,i;return i=(r=function(t,e){switch(t){case Lt.SerializeP2PKH:switch(e){case It.Mainnet:return Rt.MainnetSingleSig;case It.Testnet:return Rt.TestnetSingleSig;default:throw new Error(`Unexpected txVersion ${JSON.stringify(e)} for hashMode ${t}`)}case Lt.SerializeP2SH:case Lt.SerializeP2WPKH:case Lt.SerializeP2WSH:switch(e){case It.Mainnet:return Rt.MainnetMultiSig;case It.Testnet:return Rt.TestnetMultiSig;default:throw new Error(`Unexpected txVersion ${JSON.stringify(e)} for hashMode ${t}`)}default:throw new Error(`Unexpected hashMode ${JSON.stringify(t)}`)}}(Lt.SerializeP2PKH,e),n=(t=>{const e=(new ce.sha256).update(t).digest();return c.from((new ue).update(e).digest())})(c.from(t,"hex")).toString("hex"),{type:xt.Address,version:r,hash160:n}),(0,qt.H4)(i.version,i.hash160).toString()}function de(t,r=null){let n;n=r?function(t,r){const n=(0,e.decodeToken)(t),i=n.payload;if("string"==typeof i)throw new Error("Unexpected token payload type of string");if(!i.hasOwnProperty("subject")||!i.subject)throw new Error("Token doesn't have a subject");if(!i.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key");if(!i.hasOwnProperty("issuer")||!i.issuer)throw new Error("Token doesn't have an issuer");if(!i.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key");if(!i.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const o=i.issuer.publicKey,a=he(o);if(r===o);else if(r!==a)throw new Error("Token issuer public key does not match the verifying value");const s=new e.TokenVerifier(n.header.alg,o);if(!s)throw new Error("Invalid token verifier");if(!s.verify(t))throw new Error("Token verification failed");return n}(t,r):(0,e.decodeToken)(t);let i={};if(n.hasOwnProperty("payload")){const t=n.payload;if("string"==typeof t)throw new Error("Unexpected token payload type of string");t.hasOwnProperty("claim")&&(i=t.claim)}return i}function le(t,e){let r;return e.proof&&e.proof.url&&(r=e.proof.url),{"@type":"Account",service:t,identifier:e.username,proofType:"http",proofUrl:r}}St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()};var pe=r(2377),be=r(2179);r(3616);const ye={referrerPolicy:"origin"};async function ge(t,e){const r={};return Object.assign(r,e,ye),await fetch(t,r)}function me(...t){const{fetchLib:e,middlewares:r}=function(t){let e=ge,r=[];return t.length>0&&"function"==typeof t[0]&&(e=t.shift()),t.length>0&&(r=t),{fetchLib:e,middlewares:r}}(t);return async(t,n)=>{var i;let o={url:t,init:null!=n?n:{}};for(const t of r)if("function"==typeof t.pre){const r=await Promise.resolve(t.pre(Object.assign({fetch:e},o)));o=null!=r?r:o}let a=await e(o.url,o.init);for(const t of r)if("function"==typeof t.post){const r=await Promise.resolve(t.post({fetch:e,url:o.url,init:o.init,response:null!==(i=null==a?void 0:a.clone())&&void 0!==i?i:a}));a=null!=r?r:a}return a}}const ve={type:"object",properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"}}};class we{constructor(t={}){this._profile=Object.assign({},{"@context":"http://schema.org/"},t)}toJSON(){return Object.assign({},this._profile)}toToken(t){return function(t,r,n,i,o="ES256K",a=new Date,s=function(){return new Date((new Date).setFullYear((new Date).getFullYear()+1))}()){if("ES256K"!==o)throw new Error("Signing algorithm not supported");const f=e.SECP256K1Client.derivePublicKey(r);n||(n={publicKey:f}),i||(i={publicKey:f});const u=new e.TokenSigner(o,r),c={jti:d(),iat:a.toISOString(),exp:s.toISOString(),subject:n,issuer:i,claim:t};return u.sign(c)}(this.toJSON(),t)}static validateSchema(t,e=!1){return ve.strict=e,be.validate(ve,t)}static fromToken(t,e=null){const r=de(t,e);return new we(r)}static makeZoneFile(t,e){return function(t,e){if(!e.includes("://"))throw new Error("Invalid token file url");const r=e.split("://")[0],n=e.split("://")[1].split("/"),i={$origin:t,$ttl:3600,uri:[{name:"_http._tcp",priority:10,weight:1,target:`${r}://${n[0]}${`/${n.slice(1).join("/")}`}`}]};return(0,pe.makeZoneFile)(i,"{$origin}\n{$ttl}\n{uri}\n")}(t,e)}}const _e={type:"object",strict:!1,properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"},"@id":{type:"string",optional:!0},name:{type:"string",optional:!0},givenName:{type:"string",optional:!0},familyName:{type:"string",optional:!0},description:{type:"string",optional:!0},image:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},name:{type:"string",optional:!0},contentUrl:{type:"string",optional:!0}}}},website:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},url:{type:"string",optional:!0}}}},account:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},service:{type:"string",optional:!0},identifier:{type:"string",optional:!0},proofType:{type:"string",optional:!0},proofUrl:{type:"string",optional:!0},proofMessage:{type:"string",optional:!0},proofSignature:{type:"string",optional:!0}}}},worksFor:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},knows:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},address:{type:"object",optional:!0,properties:{"@type":{type:"string"},streetAddress:{type:"string",optional:!0},addressLocality:{type:"string",optional:!0},postalCode:{type:"string",optional:!0},addressCountry:{type:"string",optional:!0}}},birthDate:{type:"string",optional:!0},taxID:{type:"string",optional:!0}}};class Se extends we{constructor(t={}){super(t),this._profile=Object.assign({},{"@type":"Person"},this._profile)}static validateSchema(t,e=!1){return _e.strict=e,be.validate(ve,t)}static fromToken(t,e=null){const r=de(t,e);return new Se(r)}static fromLegacyFormat(t){const e=function(t){const e={"@type":"Person"};if(t){t.name&&t.name.formatted&&(e.name=t.name.formatted),t.bio&&(e.description=t.bio),t.location&&t.location.formatted&&(e.address={"@type":"PostalAddress",addressLocality:t.location.formatted});const r=[];t.avatar&&t.avatar.url&&r.push({"@type":"ImageObject",name:"avatar",contentUrl:t.avatar.url}),t.cover&&t.cover.url&&r.push({"@type":"ImageObject",name:"cover",contentUrl:t.cover.url}),r.length&&(e.image=r),t.website&&(e.website=[{"@type":"WebSite",url:t.website}]);const n=[];t.bitcoin&&t.bitcoin.address&&n.push({"@type":"Account",role:"payment",service:"bitcoin",identifier:t.bitcoin.address}),t.twitter&&t.twitter.username&&n.push(le("twitter",t.twitter)),t.facebook&&t.facebook.username&&n.push(le("facebook",t.facebook)),t.github&&t.github.username&&n.push(le("github",t.github)),t.auth&&t.auth.length>0&&t.auth[0]&&t.auth[0].publicKeychain&&n.push({"@type":"Account",role:"key",service:"bip32",identifier:t.auth[0].publicKeychain}),t.pgp&&t.pgp.url&&n.push({"@type":"Account",role:"key",service:"pgp",identifier:t.pgp.fingerprint,contentUrl:t.pgp.url}),e.account=n}return e}(t);return new Se(e)}toJSON(){return{profile:this.profile(),name:this.name(),givenName:this.givenName(),familyName:this.familyName(),description:this.description(),avatarUrl:this.avatarUrl(),verifiedAccounts:this.verifiedAccounts(),address:this.address(),birthDate:this.birthDate(),connections:this.connections(),organizations:this.organizations()}}profile(){return Object.assign({},this._profile)}name(){return function(t){if(!t)return null;let e=null;return t.name?e=t.name:(t.givenName||t.familyName)&&(e="",t.givenName&&(e=t.givenName),t.familyName&&(e+=` ${t.familyName}`)),e}(this.profile())}givenName(){return function(t){if(!t)return null;let e=null;return t.givenName?e=t.givenName:t.name&&(e=t.name.split(" ").slice(0,-1).join(" ")),e}(this.profile())}familyName(){return function(t){if(!t)return null;let e=null;return t.familyName?e=t.familyName:t.name&&(e=t.name.split(" ").pop()),e}(this.profile())}description(){return function(t){if(!t)return null;let e=null;return t.description&&(e=t.description),e}(this.profile())}avatarUrl(){return function(t){if(!t)return null;let e=null;return t.image&&t.image.map((t=>"avatar"===t.name?(e=t.contentUrl,e):null)),e}(this.profile())}verifiedAccounts(t){return function(t,e){if(!t)return null;const r=[];return t.hasOwnProperty("account")&&e&&t.account.map((t=>{let n=!1,i=null;return e.map((e=>(e.hasOwnProperty("proof_url")&&(e.proofUrl=e.proof_url),!(!e.valid||e.service!==t.service||e.identifier!==t.identifier||!e.proofUrl||(n=!0,i=e.proofUrl,0))))),n?(t.proofUrl=i,r.push(t),t):null})),r}(this.profile(),t)}address(){return function(t){if(!t)return null;let e=null;if(t.hasOwnProperty("address")){const r=[];t.address.hasOwnProperty("streetAddress")&&r.push(t.address.streetAddress),t.address.hasOwnProperty("addressLocality")&&r.push(t.address.addressLocality),t.address.hasOwnProperty("postalCode")&&r.push(t.address.postalCode),t.address.hasOwnProperty("addressCountry")&&r.push(t.address.addressCountry),r.length&&(e=r.join(", "))}return e}(this.profile())}birthDate(){return function(t){if(!t)return null;const e=["January","February","March","April","May","June","July","August","September","October","November","December"];let r=null;if(t.hasOwnProperty("birthDate")){const n=new Date(t.birthDate);r=`${e[n.getMonth()]} ${n.getDate()}, ${n.getFullYear()}`}return r}(this.profile())}connections(){return function(t){if(!t)return null;let e=[];return t.hasOwnProperty("knows")&&(e=t.knows),e}(this.profile())}organizations(){return(t=this.profile())?t.hasOwnProperty("worksFor")?t.worksFor:[]:null;var t}}var Ee,Ae;!function(t){t[t.Testnet=2147483648]="Testnet",t[t.Mainnet=1]="Mainnet"}(Ee||(Ee={})),function(t){t[t.Mainnet=0]="Mainnet",t[t.Testnet=128]="Testnet"}(Ae||(Ae={}));const xe=["mainnet","testnet"];class Me{constructor(t){var e;this.version=Ae.Mainnet,this.chainId=Ee.Mainnet,this.bnsLookupUrl="https://stacks-node-api.mainnet.stacks.co",this.broadcastEndpoint="/v2/transactions",this.transferFeeEstimateEndpoint="/v2/fees/transfer",this.transactionFeeEstimateEndpoint="/v2/fees/transaction",this.accountEndpoint="/v2/accounts",this.contractAbiEndpoint="/v2/contracts/interface",this.readOnlyFunctionCallEndpoint="/v2/contracts/call-read",this.isMainnet=()=>this.version===Ae.Mainnet,this.getBroadcastApiUrl=()=>`${this.coreApiUrl}${this.broadcastEndpoint}`,this.getTransferFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transferFeeEstimateEndpoint}`,this.getTransactionFeeEstimateApiUrl=()=>`${this.coreApiUrl}${this.transactionFeeEstimateEndpoint}`,this.getAccountApiUrl=t=>`${this.coreApiUrl}${this.accountEndpoint}/${t}?proof=0`,this.getAbiApiUrl=(t,e)=>`${this.coreApiUrl}${this.contractAbiEndpoint}/${t}/${e}`,this.getReadOnlyFunctionCallApiUrl=(t,e,r)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}/${t}/${e}/${encodeURIComponent(r)}`,this.getInfoUrl=()=>`${this.coreApiUrl}/v2/info`,this.getBlockTimeInfoUrl=()=>`${this.coreApiUrl}/extended/v1/info/network_block_times`,this.getPoxInfoUrl=()=>`${this.coreApiUrl}/v2/pox`,this.getRewardsUrl=(t,e)=>{let r=`${this.coreApiUrl}/extended/v1/burnchain/rewards/${t}`;return e&&(r=`${r}?limit=${e.limit}&offset=${e.offset}`),r},this.getRewardsTotalUrl=t=>`${this.coreApiUrl}/extended/v1/burnchain/rewards/${t}/total`,this.getRewardHoldersUrl=(t,e)=>{let r=`${this.coreApiUrl}/extended/v1/burnchain/reward_slot_holders/${t}`;return e&&(r=`${r}?limit=${e.limit}&offset=${e.offset}`),r},this.getStackerInfoUrl=(t,e)=>`${this.coreApiUrl}${this.readOnlyFunctionCallEndpoint}\n ${t}/${e}/get-stacker-info`,this.coreApiUrl=t.url,this.fetchFn=null!==(e=t.fetchFn)&&void 0!==e?e:me()}getNameInfo(t){const e=`${this.bnsLookupUrl}/v1/names/${t}`;return this.fetchFn(e).then((t=>{if(404===t.status)throw new Error("Name not found");if(200!==t.status)throw new Error(`Bad response status: ${t.status}`);return t.json()})).then((t=>t.address?Object.assign({},t,{address:t.address}):t))}}Me.fromName=t=>{switch(t){case"mainnet":return new ke;case"testnet":return new Ie;default:throw new Error(`Invalid network name provided. Must be one of the following: ${xe.join(", ")}`)}},Me.fromNameOrNetwork=t=>"string"!=typeof t&&"version"in t?t:Me.fromName(t);class ke extends Me{constructor(t){var e;super({url:null!==(e=null==t?void 0:t.url)&&void 0!==e?e:"https://stacks-node-api.mainnet.stacks.co",fetchFn:null==t?void 0:t.fetchFn}),this.version=Ae.Mainnet,this.chainId=Ee.Mainnet}}class Ie extends Me{constructor(t){var e;super({url:null!==(e=null==t?void 0:t.url)&&void 0!==e?e:"https://stacks-node-api.testnet.stacks.co",fetchFn:null==t?void 0:t.fetchFn}),this.version=Ae.Testnet,this.chainId=Ee.Testnet}}const Be={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",DOES_NOT_EXIST:"does_not_exist",FAILED_DECRYPTION_ERROR:"failed_decryption_error",INVALID_DID_ERROR:"invalid_did_error",NOT_ENOUGH_FUNDS_ERROR:"not_enough_error",INVALID_AMOUNT_ERROR:"invalid_amount_error",LOGIN_FAILED_ERROR:"login_failed",SIGNATURE_VERIFICATION_ERROR:"signature_verification_failure",CONFLICT_ERROR:"conflict_error",NOT_ENOUGH_PROOF_ERROR:"not_enough_proof_error",BAD_PATH_ERROR:"bad_path_error",VALIDATION_ERROR:"validation_error",PAYLOAD_TOO_LARGE_ERROR:"payload_too_large_error",PRECONDITION_FAILED_ERROR:"precondition_failed_error",UNKNOWN:"unknown"};Object.freeze(Be);class Oe extends Error{constructor(t){super();let e=t.message,r=`Error Code: ${t.code}`,n=this.stack;if(n)r+=`Stack Trace:\n${n}`;else try{throw new Error}catch(t){n=t.stack}e+=`\nIf you believe this exception is caused by a bug in stacks.js,\n please file a bug report: https://github.com/blockstack/stacks.js/issues\n\n${r}`,this.message=e,this.code=t.code,this.parameter=t.parameter?t.parameter:void 0}toString(){return`${super.toString()}\n code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}class Te extends Oe{constructor(t){const e=`Failed to verify signature: ${t}`;super({code:Be.SIGNATURE_VERIFICATION_ERROR,message:e}),this.message=e,this.name="SignatureVerificationError"}}class Ue extends Oe{constructor(t){super({code:Be.INVALID_STATE,message:t}),this.message=t,this.name="InvalidStateError"}}class je extends Oe{constructor(t,e){super(t),e&&(this.hubError={statusCode:e.status,statusText:e.statusText},"string"==typeof e.body?this.hubError.message=e.body:"object"==typeof e.body&&Object.assign(this.hubError,e.body))}}class Le extends je{constructor(t,e){super({message:t,code:Be.DOES_NOT_EXIST},e),this.name="DoesNotExist"}}class Re extends je{constructor(t,e){super({message:t,code:Be.CONFLICT_ERROR},e),this.name="ConflictError"}}class Pe extends je{constructor(t,e){super({message:t,code:Be.NOT_ENOUGH_PROOF_ERROR},e),this.name="NotEnoughProofError"}}class Fe extends je{constructor(t,e){super({message:t,code:Be.BAD_PATH_ERROR},e),this.name="BadPathError"}}class Ne extends je{constructor(t,e){super({message:t,code:Be.VALIDATION_ERROR},e),this.name="ValidationError"}}class ze extends je{constructor(t,e,r){super({message:t,code:Be.PAYLOAD_TOO_LARGE_ERROR},e),this.name="PayloadTooLargeError",this.maxUploadByteSize=r}}class Ce extends je{constructor(t,e){super({message:t,code:Be.PRECONDITION_FAILED_ERROR},e),this.name="PreconditionFailedError"}}function $e(t){const e=c.isBuffer(t)?t:c.from(t,"hex");if(32!=e.length&&33!=e.length)throw new Error(`Improperly formatted private-key. Private-key byte length should be 32 or 33. Length provided: ${e.length}`);if(33==e.length&&1!==e[32])throw new Error("Improperly formatted private-key. 33 bytes indicate compressed key, but the last byte must be == 01");return e}var De=r(7022),qe=r.n(De);class He{digest(t){const e=new ue;e.update(t);const r=e.digest();return Array.isArray(r)?c.from(r):c.from(r.buffer)}}class Ve{constructor(t){this.nodeCryptoCreateHash=t}digest(t){try{return this.nodeCryptoCreateHash("rmd160").update(t).digest()}catch(e){try{return this.nodeCryptoCreateHash("ripemd160").update(t).digest()}catch(r){return console.log(e),console.log("Node.js `crypto.createHash` exists but failing to digest for ripemd160, falling back to js implementation"),(new He).digest(t)}}}}function Ke(t){const e=new ce.sha256;return e.update(t),e.digest()}const Je=0;function Ge(t){var e,n;return e=Ke(c.isBuffer(t)?t:c.from(t,"hex")),n=function(){const t=function(t){try{if(!Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()))return!1;const e=r(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return!!e&&(!t||t(e))}catch(t){return!1}}((t=>"function"==typeof t.createHash&&t.createHash));return t?new Ve(t):new He}().digest(e),function(t){const e=B(B(t));return qe().encode(c.concat([t,e],t.length+4))}(c.from([Je,...n].slice(0,21)))}function We(t){const e=$e(t);return c.from(function(t,e=!1){return D.fromPrivateKey(t).toRawBytes(e)}(e.slice(0,32),!0)).toString("hex")}var Ze;function Xe(t,e,r){const n=function(t){return t instanceof c?t:(ArrayBuffer,c.from(t))}(t);return function(t,e,r,n=wt){let i;try{i=bt(t),e=et(e)}catch(t){return!1}const{r:o,s:a}=i;if(n.strict&&i.hasHighS())return!1;const s=ut(e);if(s===T)return!1;let f;try{f=function(t){return t instanceof D?(t.assertValidity(),t):D.fromHex(t)}(r)}catch(t){return!1}const{n:u}=F,c=ot(a,u),h=nt(s*c,u),d=nt(o*c,u),l=D.BASE.multiplyAndAddUnsafe(f,h,d);return!!l&&nt(l.x,u)===o}(r,Ke(n),e)}St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()},St.hmacSha256Sync=(t,...e)=>{const r=S.create(B,t);return e.forEach((t=>r.update(t))),r.digest()},function(t){t.InvalidFormat="InvalidFormat",t.IsNotPoint="IsNotPoint"}(Ze||(Ze={}));const Ye=class{constructor(t,e){this.wasString="string"==typeof t,this.content=Ye.normalizeContentDataType(t,e),this.contentType=e||this.detectContentType(),this.contentByteLength=this.detectContentLength()}static normalizeContentDataType(t,e){try{if("string"==typeof t){const r=(e||"").toLowerCase().replace("-","");if(r.includes("charset")&&!r.includes("charset=utf8")&&!r.includes("charset=ascii"))throw new Error(`Unable to determine byte length with charset: ${e}`);if("undefined"!=typeof TextEncoder){const e=(new TextEncoder).encode(t);return c.from(e.buffer)}return c.from(t)}if(c.isBuffer(t))return t;if(ArrayBuffer.isView(t))return c.from(t.buffer,t.byteOffset,t.byteLength);if("undefined"!=typeof Blob&&t instanceof Blob)return t;if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return c.from(t);if(Array.isArray(t)){if(t.length>0&&(!Number.isInteger(t[0])||t[0]<0||t[0]>255))throw new Error(`Unexpected array values provided as file data: value "${t[0]}" at index 0 is not an octet number. ${this.supportedTypesMsg}`);return c.from(t)}{const e=Object.prototype.toString.call(t);throw new Error(`Unexpected type provided as file data: ${e}. ${this.supportedTypesMsg}`)}}catch(t){throw console.error(t),new Error(`Error processing data: ${t}`)}}detectContentType(){return this.wasString?"text/plain; charset=utf-8":"undefined"!=typeof Blob&&this.content instanceof Blob&&this.content.type?this.content.type:"application/octet-stream"}detectContentLength(){if(ArrayBuffer.isView(this.content)||c.isBuffer(this.content))return this.content.byteLength;if("undefined"!=typeof Blob&&this.content instanceof Blob)return this.content.size;const t=Object.prototype.toString.call(this.content),e=new Error(`Unexpected type "${t}" while detecting content length`);throw console.error(e),e}async loadContent(){try{if(c.isBuffer(this.content))return this.content;if(ArrayBuffer.isView(this.content))return c.from(this.content.buffer,this.content.byteOffset,this.content.byteLength);if("undefined"!=typeof Blob&&this.content instanceof Blob){const t=new FileReader,e=new Promise(((e,r)=>{t.onerror=t=>{r(t)},t.onload=()=>{const r=t.result;e(c.from(r))},t.readAsArrayBuffer(this.content)}));return await e}{const t=Object.prototype.toString.call(this.content);throw new Error(`Unexpected type ${t}`)}}catch(t){console.error(t);const e=new Error(`Error loading content: ${t}`);throw console.error(e),e}}load(){return void 0===this.loadedData&&(this.loadedData=this.loadContent()),this.loadedData}};let Qe=Ye;Qe.supportedTypesMsg="Supported types are: `string` (to be UTF8 encoded), `Buffer`, `Blob`, `File`, `ArrayBuffer`, `UInt8Array` or any other typed array buffer. ";const tr="blockstack-gaia-hub-config";async function er(t,e,r,n="application/octet-stream",i=!0,o,a,f=me()){s.debug(`uploadToGaiaHub: uploading ${t} to ${r.server}`);const u={"Content-Type":n,Authorization:`bearer ${r.token}`};a||(i?u["If-None-Match"]="*":o&&(u["If-Match"]=o));const c=await f(`${r.server}/store/${r.address}/${t}`,{method:"POST",headers:u,body:e});if(!c.ok)throw await sr(c,"Error when uploading to Gaia hub.",r);const h=await c.text();return JSON.parse(h)}async function rr(t,e,r=me()){s.debug(`deleteFromGaiaHub: deleting ${t} from ${e.server}`);const n=await r(`${e.server}/delete/${e.address}/${t}`,{method:"DELETE",headers:{Authorization:`bearer ${e.token}`}});if(!n.ok)throw await sr(n,"Error deleting file from Gaia hub.",e)}function nr(t,e){return Promise.resolve(`${e.url_prefix}${e.address}/${t}`)}function ir(t,r,n,i){const o=t.challenge_text,a=t.latest_auth_version&&parseInt(t.latest_auth_version.slice(1),10)>=1,s=We(r);if(!a)return function(t,e){let r;try{r=JSON.parse(t)}catch(t){throw new Error("Failed in parsing legacy challenge text from the gaia hub.")}if("gaiahub"===r[0]&&"blockstack_storage_please_sign"===r[3]){const r=(n=Ke(c.from(t)),i=function(t){const e=$e(t);return 33==e.length?e:c.concat([e,c.from([1])])}(e),c.from(vt(n,$e(i).slice(0,32),{der:!1}))),o=V.fromCompact(r.toString("hex")).toDERHex(),a=We(e);return c.from(JSON.stringify({publickey:a,signature:o})).toString("base64")}throw new Error("Failed to connect to legacy gaia hub. If you operate this hub, please update.");var n,i}(o,r);const f={gaiaChallenge:o,hubUrl:n,iss:s,salt:(16,c.from(St.randomBytes(16))).toString("hex"),associationToken:i};return`v1:${new e.TokenSigner("ES256K",r).sign(f)}`}async function or(t,e,r,n=me()){s.debug(`connectToGaiaHub: ${t}/hub_info`);const i=await n(`${t}/hub_info`),o=await i.json(),a=o.read_url_prefix,f=ir(o,e,t,r),u=Ge(We(e));return{url_prefix:a,max_file_upload_size_megabytes:o.max_file_upload_size_megabytes,address:u,token:f,server:t}}async function ar(t,e,r=me()){const n=await r(`${t}/hub_info`),i=await n.text();return`${JSON.parse(i).read_url_prefix}${Ge(We(e))}/`}async function sr(t,e,r){if(t.ok)throw new Error("Cannot get a BlockstackError from a valid response.");const n=await async function(t){let e,r="";try{r=await t.text();try{e=JSON.parse(r)}catch(t){}}catch(t){s.debug(`Error getting bad http response text: ${t}`)}return{status:t.status,statusText:t.statusText,body:e||r}}(t);if(401===n.status)return new Ne(e,n);if(402===n.status)return new Pe(e,n);if(403===n.status)return new Fe(e,n);if(404===n.status)throw new Le(e,n);if(409===n.status)return new Re(e,n);if(412===n.status)return new Ce(e,n);if(413===n.status){const t=r&&r.max_file_upload_size_megabytes?h(r.max_file_upload_size_megabytes):0;return new ze(e,n,t)}return new Error(e)}class fr{constructor(t){this.userSession=t.userSession}async getFile(t,e){const r={decrypt:!0,verify:!1,app:l("location",{returnEmptyObject:!0}).origin},n=Object.assign({},r,e);if(n.verify&&!n.decrypt)return this.getFileSignedUnencrypted(t,n);const i=await this.getFileContents(t,n.app,n.username,n.zoneFileLookupURL,!!n.decrypt);if(null===i)return i;if(n.decrypt&&!n.verify){if("string"!=typeof i)throw new Error("Expected to get back a string for the cipherText");if("string"==typeof n.decrypt){const t={privateKey:n.decrypt};return this.userSession.decryptContent(i,t)}return this.userSession.decryptContent(i)}if(n.decrypt&&n.verify){if("string"!=typeof i)throw new Error("Expected to get back a string for the cipherText");let e;return"string"==typeof n.decrypt&&(e=n.decrypt),this.handleSignedEncryptedContents(t,i,n.app,e,n.username,n.zoneFileLookupURL)}if(n.verify||n.decrypt)throw new Error("Should be unreachable.");return i}async getUserAppFileUrl(t,e,r,n){const i=await function(t){if(!t.username)return Promise.reject(new Error("No username provided"));const e={network:new ke},r=Object.assign(e,t),n=Me.fromNameOrNetwork(r.network);let i;if(r.zoneFileLookupURL){const t=`${r.zoneFileLookupURL.replace(/\/$/,"")}/${r.username}`;i=n.fetchFn(t).then((t=>t.json()))}else i=n.getNameInfo(r.username);return i.then((t=>{if(t.hasOwnProperty("zonefile")&&t.hasOwnProperty("address"))return function(t,e,r=me()){return new Promise(((n,i)=>{let o=null;try{o=(0,pe.parseZoneFile)(t),o.hasOwnProperty("$origin")||(o=null)}catch(t){i(t)}let a=null;if(o&&Object.keys(o).length>0)a=function(t){if(!t.hasOwnProperty("uri"))return null;if(!Array.isArray(t.uri))return null;if(t.uri.length<1)return null;const e=t.uri.filter((t=>t.hasOwnProperty("target")&&"_http._tcp"===t.name));if(e.length<1)return null;const r=e[0];if(!r.hasOwnProperty("target"))return null;let n=r.target;return n.startsWith("https")||n.startsWith("http")||(n=`https://${n}`),n}(o);else try{return n(Se.fromLegacyFormat(JSON.parse(t)).profile())}catch(t){return i(t)}a?r(a).then((t=>t.text())).then((t=>JSON.parse(t))).then((t=>{const r=de(t[0].token,e);n(r)})).catch((t=>{s.error(`resolveZoneFileToProfile: error fetching token file ${a}: ${t}`),i(t)})):(s.debug("Token file url not found. Resolving to blank profile."),n({}))}))}(t.zonefile,t.address,n.fetchFn);throw new Error("Invalid zonefile lookup response: did not contain `address` or `zonefile` field")}))}({username:e,zoneFileLookupURL:n});let o;return i.hasOwnProperty("apps")&&i.apps.hasOwnProperty(r)&&(o=`${i.apps[r].replace(/\/?(\?|#|$)/,"/$1")}${t}`),o}async getGaiaAddress(t,e,r){const n=cr(this.userSession,{app:t,username:e,zoneFileLookupURL:r});let i;if(e)i=await this.getUserAppFileUrl("/",n.username,n.app,n.zoneFileLookupURL);else{const t=await this.getOrSetLocalGaiaHubConnection();i=await nr("/",t)}const o=i.match(/([13][a-km-zA-HJ-NP-Z0-9]{26,35})/);if(!o)throw new Error("Failed to parse gaia address");return o[o.length-1]}async getFileUrl(t,e){const r=cr(this.userSession,e);let n;if(r.username)n=await this.getUserAppFileUrl(t,r.username,r.app,r.zoneFileLookupURL);else{const e=await this.getOrSetLocalGaiaHubConnection();n=await nr(t,e)}if(n)return n;throw new Error("Missing readURL")}async getFileContents(t,e,r,n,i,o=me()){const a={app:e,username:r,zoneFileLookupURL:n},s=await this.getFileUrl(t,a),f=await o(s);if(!f.ok)throw await sr(f,`getFile ${t} failed.`,null);let u=f.headers.get("Content-Type");"string"==typeof u&&(u=u.toLowerCase());const c=f.headers.get("ETag");if(c){const e=this.userSession.store.getSessionData();e.etags[t]=c,this.userSession.store.setSessionData(e)}return i||null===u||u.startsWith("text")||u.startsWith("application/json")?f.text():f.arrayBuffer()}async getFileSignedUnencrypted(t,e){const r=`${t}.sig`;try{const[n,i,o]=await Promise.all([this.getFileContents(t,e.app,e.username,e.zoneFileLookupURL,!1),this.getFileContents(r,e.app,e.username,e.zoneFileLookupURL,!0),this.getGaiaAddress(e.app,e.username,e.zoneFileLookupURL)]);if(!n)return n;if(!o)throw new Te(`Failed to get gaia address for verification of: ${t}`);if(!i||"string"!=typeof i)throw new Te(`Failed to obtain signature for file: ${t} -- looked in ${t}.sig`);let a,s;try{const t=JSON.parse(i);a=t.signature,s=t.publicKey}catch(e){throw e instanceof SyntaxError?new Error(`Failed to parse signature content JSON (path: ${t}.sig) The content may be corrupted.`):e}const f=Ge(s);if(o!==f)throw new Te(`Signer pubkey address (${f}) doesn't match gaia address (${o})`);if(Xe(n,s,a))return n;throw new Te(`Contents do not match ECDSA signature: path: ${t}, signature: ${t}.sig`)}catch(e){throw e instanceof Le&&e.message.indexOf(r)>=0?new Te(`Failed to obtain signature for file: ${t} -- looked in ${t}.sig`):e}}async handleSignedEncryptedContents(t,e,r,n,i,o){const a=We(n||this.userSession.loadUserData().appPrivateKey);let s,f;if(s=i?await this.getGaiaAddress(r,i,o):Ge(a),!s)throw new Te(`Failed to get gaia address for verification of: ${t}`);try{f=JSON.parse(e)}catch(t){throw t instanceof SyntaxError?new Error("Failed to parse encrypted, signed content JSON. The content may not be encrypted. If using getFile, try passing { verify: false, decrypt: false }."):t}const u=f.signature,c=f.publicKey,h=f.cipherText,d=Ge(c);if(c&&h&&u){if(d!==s)throw new Te(`Signer pubkey address (${d}) doesn't match gaia address (${s})`);if(Xe(h,c,u)){if("string"==typeof n){const t={privateKey:n};return this.userSession.decryptContent(h,t)}return this.userSession.decryptContent(h)}throw new Te(`Contents do not match ECDSA signature in file: ${t}`)}throw new Te(`Failed to get signature verification data from file: ${t}`)}async putFile(t,e,r){var n,i;const o=Object.assign({},{encrypt:!0,sign:!1,cipherTextEncoding:"hex",dangerouslyIgnoreEtag:!1},r),a=await this.getOrSetLocalGaiaHubConnection(),s=h(a.max_file_upload_size_megabytes),f=s>0,u=new Qe(e,o.contentType);let d,l=u.contentType;if(!o.encrypt&&f&&u.contentByteLength>s){const t=`The max file upload size for this hub is ${s} bytes, the given content is ${u.contentByteLength} bytes`,e=new ze(t,null,s);throw console.error(e),e}if(o.encrypt&&f){const t=function(t){const{payloadShell:e,payloadValuesLength:r}=function(t){const e={iv:"",ephemeralPK:"",mac:"",cipherText:"",wasString:!!t.wasString};return"base64"===t.cipherTextEncoding&&(e.cipherTextEncoding="base64"),{payloadValuesLength:162,payloadShell:JSON.stringify(e)}}(t),n=(i=t.contentLength,16*(Math.floor(i/16)+1));var i;let o;if(t.cipherTextEncoding&&"hex"!==t.cipherTextEncoding){if("base64"!==t.cipherTextEncoding)throw new Error(`Unexpected cipherTextEncoding "${t.cipherTextEncoding}"`);o=function(t){return 4*Math.ceil(t/3)}(n)}else o=2*n;if(t.sign){const{signedPayloadShell:t,signedPayloadValuesLength:n}=function(t){const e={signature:"",publicKey:"",cipherText:t};return{signedPayloadValuesLength:210,signedPayloadShell:JSON.stringify(e)}}(e);return t.length+n+r+o}return e.length+r+o}({contentLength:u.contentByteLength,wasString:u.wasString,sign:!!o.sign,cipherTextEncoding:o.cipherTextEncoding});if(t>s){const e=new ze(`The max file upload size for this hub is ${s} bytes, the given content is ${t} bytes after encryption`,null,s);throw console.error(e),e}}let p=!0;const y=this.userSession.store.getSessionData();let g;if(o.dangerouslyIgnoreEtag||(null==(n=y.etags)?void 0:n[t])&&(p=!1,d=null==(i=y.etags)?void 0:i[t]),!o.encrypt&&o.sign){const e=await u.load();let r;r="string"==typeof o.sign?o.sign:this.userSession.loadUserData().appPrivateKey;const n=function(t,e){const r=e instanceof c?e:c.from(e),n=We(t);return{signature:b(vt(Ke(r),t)),publicKey:n}}(r,e),i=JSON.stringify(n);g=async r=>{const n=(await Promise.all([er(t,e,r,l,p,d,o.dangerouslyIgnoreEtag),er(`${t}.sig`,i,r,"application/json")]))[0];return!o.dangerouslyIgnoreEtag&&n.etag&&(y.etags[t]=n.etag,this.userSession.store.setSessionData(y)),n.publicURL}}else{let e;if(o.encrypt||o.sign){let t;t="string"==typeof o.encrypt?o.encrypt:"string"==typeof o.sign?We(o.sign):We(this.userSession.loadUserData().appPrivateKey);const r=await u.load();e=await this.userSession.encryptContent(r,{publicKey:t,wasString:u.wasString,cipherTextEncoding:o.cipherTextEncoding,sign:o.sign}),l="application/json"}else e=u.content;g=async r=>{const n=await er(t,e,r,l,p,d,o.dangerouslyIgnoreEtag);return n.etag&&(y.etags[t]=n.etag,this.userSession.store.setSessionData(y)),n.publicURL}}try{return await g(a)}catch(t){if(function(t){if(!t||!t.hubError||!t.hubError.statusCode)return!1;const e=t.hubError.statusCode;return 401===e||(409===e||e>=500&&e<=599)}(t)){console.error(t),console.error("Possible recoverable error during Gaia upload, retrying...");const e=await this.setLocalGaiaHubConnection();return await g(e)}throw t}}async deleteFile(t,e){const r=await this.getOrSetLocalGaiaHubConnection();if(Object.assign({},e).wasSigned)try{await rr(t,r),await rr(`${t}.sig`,r);const e=this.userSession.store.getSessionData();delete e.etags[t],this.userSession.store.setSessionData(e)}catch(e){const n=await this.setLocalGaiaHubConnection();await rr(t,n),await rr(`${t}.sig`,r);const i=this.userSession.store.getSessionData();delete i.etags[t],this.userSession.store.setSessionData(i)}else try{await rr(t,r);const e=this.userSession.store.getSessionData();delete e.etags[t],this.userSession.store.setSessionData(e)}catch(e){const r=await this.setLocalGaiaHubConnection();await rr(t,r);const n=this.userSession.store.getSessionData();delete n.etags[t],this.userSession.store.setSessionData(n)}}getAppBucketUrl(t,e){return ar(t,e)}async listFilesLoop(t,e,r,n,i,o=me()){if(r>65536)throw new Error("Too many entries to list");let a;t=t||await this.getOrSetLocalGaiaHubConnection();try{const r=JSON.stringify({page:e}),n={method:"POST",headers:{"Content-Type":"application/json","Content-Length":`${r.length}`,Authorization:`bearer ${t.token}`},body:r};if(a=await o(`${t.server}/list-files/${t.address}`,n),!a.ok)throw await sr(a,"ListFiles failed.",t)}catch(t){if(0===r){const t=await this.setLocalGaiaHubConnection();return this.listFilesLoop(t,e,r+1,0,i)}throw t}const s=await a.text(),f=JSON.parse(s),u=f.entries,c=f.page;if(null==u)throw new Error("Bad listFiles response: no entries");let h=0;for(let t=0;t<u.length;t++)if(null!==u[t]&&(h++,!i(u[t])))return n+t;return c&&u.length>0?this.listFilesLoop(t,c,r+1,n+h,i):n+h}listFiles(t){return this.listFilesLoop(null,null,0,0,t)}async getOrSetLocalGaiaHubConnection(){const t=this.userSession.store.getSessionData().userData;if(!t)throw new Ue("Missing userData");const e=t.gaiaHubConfig;return e?Promise.resolve(e):this.setLocalGaiaHubConnection()}async setLocalGaiaHubConnection(){const t=this.userSession.loadUserData();if(!t)throw new Ue("Missing userData");t.hubUrl||(t.hubUrl="https://hub.blockstack.org");const e=await or(t.hubUrl,t.appPrivateKey,t.gaiaAssociationToken);t.gaiaHubConfig=e;const r=this.userSession.store.getSessionData();return r.userData.gaiaHubConfig=e,this.userSession.store.setSessionData(r),e}}function ur(t){return new fr({}).getUserAppFileUrl(t.path,t.username,t.appOrigin,t.zoneFileLookupURL)}function cr(t,e){var r;const n=Object.assign({},e);if(n.username){if(!n.app){if(!t.appConfig)throw new Ue("Missing AppConfig");n.app=t.appConfig.appDomain}if(!n.zoneFileLookupURL){if(!t.appConfig)throw new Ue("Missing AppConfig");if(!t.store)throw new Ue("Missing store UserSession");const e=(null==(r=t.store.getSessionData().userData)?void 0:r.coreNode)||t.appConfig.coreNode;e&&(n.zoneFileLookupURL=`${e}/v1/names`)}}return n}})(),n})()));
3
3
  //# sourceMappingURL=index.js.map