use-mmdb-vanilla 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +221 -256
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -6
package/dist/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ft={},q={},Q={};Q.byteLength=Xt;Q.toByteArray=Zt;Q.fromByteArray=vt;var k=[],P=[],qt=typeof Uint8Array<"u"?Uint8Array:Array,it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var V=0,Ht=it.length;V<Ht;++V)k[V]=it[V],P[it.charCodeAt(V)]=V;P[45]=62;P[95]=63;function At(u){var o=u.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=u.indexOf("=");s===-1&&(s=o);var f=s===o?0:4-s%4;return[s,f]}function Xt(u){var o=At(u),s=o[0],f=o[1];return(s+f)*3/4-f}function Jt(u,o,s){return(o+s)*3/4-s}function Zt(u){var o,s=At(u),f=s[0],l=s[1],d=new qt(Jt(u,f,l)),p=0,c=l>0?f-4:f,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ft={},q={},Q={};Q.byteLength=Xt;Q.toByteArray=Zt;Q.fromByteArray=vt;var k=[],P=[],qt=typeof Uint8Array<"u"?Uint8Array:Array,it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var V=0,Ht=it.length;V<Ht;++V)k[V]=it[V],P[it.charCodeAt(V)]=V;P[45]=62;P[95]=63;function At(u){var o=u.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=u.indexOf("=");s===-1&&(s=o);var f=s===o?0:4-s%4;return[s,f]}function Xt(u){var o=At(u),s=o[0],f=o[1];return(s+f)*3/4-f}function Jt(u,o,s){return(o+s)*3/4-s}function Zt(u){var o,s=At(u),f=s[0],l=s[1],d=new qt(Jt(u,f,l)),p=0,c=l>0?f-4:f,B;for(B=0;B<c;B+=4)o=P[u.charCodeAt(B)]<<18|P[u.charCodeAt(B+1)]<<12|P[u.charCodeAt(B+2)]<<6|P[u.charCodeAt(B+3)],d[p++]=o>>16&255,d[p++]=o>>8&255,d[p++]=o&255;return l===2&&(o=P[u.charCodeAt(B)]<<2|P[u.charCodeAt(B+1)]>>4,d[p++]=o&255),l===1&&(o=P[u.charCodeAt(B)]<<10|P[u.charCodeAt(B+1)]<<4|P[u.charCodeAt(B+2)]>>2,d[p++]=o>>8&255,d[p++]=o&255),d}function Kt(u){return k[u>>18&63]+k[u>>12&63]+k[u>>6&63]+k[u&63]}function Qt(u,o,s){for(var f,l=[],d=o;d<s;d+=3)f=(u[d]<<16&16711680)+(u[d+1]<<8&65280)+(u[d+2]&255),l.push(Kt(f));return l.join("")}function vt(u){for(var o,s=u.length,f=s%3,l=[],d=16383,p=0,c=s-f;p<c;p+=d)l.push(Qt(u,p,p+d>c?c:p+d));return f===1?(o=u[s-1],l.push(k[o>>2]+k[o<<4&63]+"==")):f===2&&(o=(u[s-2]<<8)+u[s-1],l.push(k[o>>10]+k[o>>4&63]+k[o<<2&63]+"=")),l.join("")}var ct={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ct.read=function(u,o,s,f,l){var d,p,c=l*8-f-1,B=(1<<c)-1,m=B>>1,E=-7,g=s?l-1:0,y=s?-1:1,w=u[o+g];for(g+=y,d=w&(1<<-E)-1,w>>=-E,E+=c;E>0;d=d*256+u[o+g],g+=y,E-=8);for(p=d&(1<<-E)-1,d>>=-E,E+=f;E>0;p=p*256+u[o+g],g+=y,E-=8);if(d===0)d=1-m;else{if(d===B)return p?NaN:(w?-1:1)*(1/0);p=p+Math.pow(2,f),d=d-m}return(w?-1:1)*p*Math.pow(2,d-f)};ct.write=function(u,o,s,f,l,d){var p,c,B,m=d*8-l-1,E=(1<<m)-1,g=E>>1,y=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=f?0:d-1,_=f?1:-1,S=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(c=isNaN(o)?1:0,p=E):(p=Math.floor(Math.log(o)/Math.LN2),o*(B=Math.pow(2,-p))<1&&(p--,B*=2),p+g>=1?o+=y/B:o+=y*Math.pow(2,1-g),o*B>=2&&(p++,B/=2),p+g>=E?(c=0,p=E):p+g>=1?(c=(o*B-1)*Math.pow(2,l),p=p+g):(c=o*Math.pow(2,g-1)*Math.pow(2,l),p=0));l>=8;u[s+w]=c&255,w+=_,c/=256,l-=8);for(p=p<<l|c,m+=l;m>0;u[s+w]=p&255,w+=_,p/=256,m-=8);u[s+w-_]|=S*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(u){const o=Q,s=ct,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u.Buffer=c,u.SlowBuffer=W,u.INSPECT_MAX_BYTES=50;const l=2147483647;u.kMaxLength=l,c.TYPED_ARRAY_SUPPORT=d(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function d(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function p(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return x(e,t,r)}c.poolSize=8192;function x(e,t,r){if(typeof e=="string")return w(e,t);if(ArrayBuffer.isView(e))return _(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return S(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return c.from(n,t,r);const i=X(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,t,r){return x(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function m(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function E(e,t,r){return m(e),e<=0?p(e):t!==void 0?typeof r=="string"?p(e).fill(t,r):p(e).fill(t):p(e)}c.alloc=function(e,t,r){return E(e,t,r)};function g(e){return m(e),p(e<0?0:T(e)|0)}c.allocUnsafe=function(e){return g(e)},c.allocUnsafeSlow=function(e){return g(e)};function w(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=O(e,t)|0;let n=p(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function y(e){const t=e.length<0?0:T(e.length)|0,r=p(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function _(e){if(N(e,Uint8Array)){const t=new Uint8Array(e);return S(t.buffer,t.byteOffset,t.byteLength)}return y(e)}function S(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function X(e){if(c.isBuffer(e)){const t=T(e.length)|0,r=p(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||nt(e.length)?p(0):y(e);if(e.type==="Buffer"&&Array.isArray(e.data))return y(e.data)}function T(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function W(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype},c.compare=function(t,r){if(N(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),N(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,h=Math.min(n,i);a<h;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0},c.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}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;const i=c.allocUnsafe(r);let a=0;for(n=0;n<t.length;++n){let h=t[n];if(N(h,Uint8Array))a+h.length>i.length?(c.isBuffer(h)||(h=c.from(h)),h.copy(i,a)):Uint8Array.prototype.set.call(i,h,a);else if(c.isBuffer(h))h.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=h.length}return i};function O(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mt(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}c.byteLength=O;function bt(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ot(this,t,r);case"utf8":case"utf-8":return lt(this,t,r);case"ascii":return Nt(this,t,r);case"latin1":case"binary":return kt(this,t,r);case"base64":return Lt(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $t(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function D(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}c.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 r=0;r<t;r+=2)D(this,r,r+1);return this},c.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 r=0;r<t;r+=4)D(this,r,r+3),D(this,r+1,r+2);return this},c.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 r=0;r<t;r+=8)D(this,r,r+7),D(this,r+1,r+6),D(this,r+2,r+5),D(this,r+3,r+4);return this},c.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?lt(this,0,t):bt.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0},c.prototype.inspect=function(){let t="";const r=u.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},f&&(c.prototype[f]=c.prototype.inspect),c.prototype.compare=function(t,r,n,i,a){if(N(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let h=a-i,B=n-r;const A=Math.min(h,B),F=this.slice(i,a),U=t.slice(r,n);for(let I=0;I<A;++I)if(F[I]!==U[I]){h=F[I],B=U[I];break}return h<B?-1:B<h?1:0};function ht(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=c.from(t,n)),c.isBuffer(t))return t.length===0?-1:ft(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ft(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ft(e,t,r,n,i){let a=1,h=e.length,B=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,h/=2,B/=2,r/=2}function A(U,I){return a===1?U[I]:U.readUInt16BE(I*a)}let F;if(i){let U=-1;for(F=r;F<h;F++)if(A(e,F)===A(t,U===-1?0:F-U)){if(U===-1&&(U=F),F-U+1===B)return U*a}else U!==-1&&(F-=F-U),U=-1}else for(r+B>h&&(r=h-B),F=r;F>=0;F--){let U=!0;for(let I=0;I<B;I++)if(A(e,F+I)!==A(t,I)){U=!1;break}if(U)return F}return-1}c.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1},c.prototype.indexOf=function(t,r,n){return ht(this,t,r,n,!0)},c.prototype.lastIndexOf=function(t,r,n){return ht(this,t,r,n,!1)};function Rt(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;const a=t.length;n>a/2&&(n=a/2);let h;for(h=0;h<n;++h){const B=parseInt(t.substr(h*2,2),16);if(nt(B))return h;e[r+h]=B}return h}function St(e,t,r,n){return J(et(t,e.length-r),e,r,n)}function Mt(e,t,r,n){return J(zt(t),e,r,n)}function Ct(e,t,r,n){return J(mt(t),e,r,n)}function Pt(e,t,r,n){return J(Vt(t,e.length-r),e,r,n)}c.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let h=!1;for(;;)switch(i){case"hex":return Rt(this,t,r,n);case"utf8":case"utf-8":return St(this,t,r,n);case"ascii":case"latin1":case"binary":return Mt(this,t,r,n);case"base64":return Ct(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,t,r,n);default:if(h)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Lt(e,t,r){return t===0&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function lt(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const a=e[i];let h=null,B=a>239?4:a>223?3:a>191?2:1;if(i+B<=r){let A,F,U,I;switch(B){case 1:a<128&&(h=a);break;case 2:A=e[i+1],(A&192)===128&&(I=(a&31)<<6|A&63,I>127&&(h=I));break;case 3:A=e[i+1],F=e[i+2],(A&192)===128&&(F&192)===128&&(I=(a&15)<<12|(A&63)<<6|F&63,I>2047&&(I<55296||I>57343)&&(h=I));break;case 4:A=e[i+1],F=e[i+2],U=e[i+3],(A&192)===128&&(F&192)===128&&(U&192)===128&&(I=(a&15)<<18|(A&63)<<12|(F&63)<<6|U&63,I>65535&&I<1114112&&(h=I))}}h===null?(h=65533,B=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),i+=B}return Tt(n)}const dt=4096;function Tt(e){const t=e.length;if(t<=dt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=dt));return r}function Nt(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function kt(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Ot(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=Wt[e[a]];return i}function $t(e,t,r){const n=e.slice(t,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}c.prototype.slice=function(t,r){const n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);const i=this.subarray(t,r);return Object.setPrototypeOf(i,c.prototype),i};function b(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))}),c.prototype.readBigUInt64BE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)}),c.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=r,a=1,h=this[t+--i];for(;i>0&&(a*=256);)h+=this[t+--i]*a;return a*=128,h>=a&&(h-=Math.pow(2,8*r)),h},c.prototype.readInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},c.prototype.readInt16LE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},c.prototype.readInt16BE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},c.prototype.readInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),c.prototype.readBigInt64BE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),c.prototype.readFloatLE=function(t,r){return t=t>>>0,r||b(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t=t>>>0,r||b(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||b(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||b(t,8,this.length),s.read(this,t,!1,52,8)};function C(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const B=Math.pow(2,8*n)-1;C(this,t,r,n,B,0)}let a=1,h=0;for(this[r]=t&255;++h<n&&(a*=256);)this[r+h]=t/a&255;return r+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const B=Math.pow(2,8*n)-1;C(this,t,r,n,B,0)}let a=n-1,h=1;for(this[r+a]=t&255;--a>=0&&(h*=256);)this[r+a]=t/h&255;return r+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,255,0),this[r]=t&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function pt(e,t,r,n,i){Et(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,r}function wt(e,t,r,n,i){Et(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=h,h=h>>8,e[r+2]=h,h=h>>8,e[r+1]=h,h=h>>8,e[r]=h,r+8}c.prototype.writeBigUInt64LE=$(function(t,r=0){return pt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(t,r=0){return wt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=0,h=1,B=0;for(this[r]=t&255;++a<n&&(h*=256);)t<0&&B===0&&this[r+a-1]!==0&&(B=1),this[r+a]=(t/h>>0)-B&255;return r+n},c.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=n-1,h=1,B=0;for(this[r+a]=t&255;--a>=0&&(h*=256);)t<0&&B===0&&this[r+a+1]!==0&&(B=1),this[r+a]=(t/h>>0)-B&255;return r+n},c.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1},c.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4},c.prototype.writeBigInt64LE=$(function(t,r=0){return pt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(t,r=0){return wt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function yt(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function gt(e,t,r,n,i){return t=+t,r=r>>>0,i||yt(e,t,r,4),s.write(e,t,r,n,23,4),r+4}c.prototype.writeFloatLE=function(t,r,n){return gt(this,t,r,!0,n)},c.prototype.writeFloatBE=function(t,r,n){return gt(this,t,r,!1,n)};function Bt(e,t,r,n,i){return t=+t,r=r>>>0,i||yt(e,t,r,8),s.write(e,t,r,n,52,8),r+8}c.prototype.writeDoubleLE=function(t,r,n){return Bt(this,t,r,!0,n)},c.prototype.writeDoubleBE=function(t,r,n){return Bt(this,t,r,!1,n)},c.prototype.copy=function(t,r,n,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);const a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a},c.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){const h=t.charCodeAt(0);(i==="utf8"&&h<128||i==="latin1")&&(t=h)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{const h=c.isBuffer(t)?t:c.from(t,i),B=h.length;if(B===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=h[a%B]}return this};const G={};function rt(e,t,r){G[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),rt("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=xt(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=xt(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function xt(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Dt(e,t,r){z(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Y(t,e.length-(r+1))}function Et(e,t,r,n,i,a){if(e>r||e<t){const h=typeof t=="bigint"?"n":"";let B;throw a>3?t===0||t===BigInt(0)?B=`>= 0${h} and < 2${h} ** ${(a+1)*8}${h}`:B=`>= -(2${h} ** ${(a+1)*8-1}${h}) and < 2 ** ${(a+1)*8-1}${h}`:B=`>= ${t}${h} and <= ${r}${h}`,new G.ERR_OUT_OF_RANGE("value",B,e)}Dt(n,i,a)}function z(e,t){if(typeof e!="number")throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){throw Math.floor(e)!==e?(z(e,r),new G.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}const jt=/[^+/0-9A-Za-z-_]/g;function Gt(e){if(e=e.split("=")[0],e=e.trim().replace(jt,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function et(e,t){t=t||1/0;let r;const n=e.length;let i=null;const a=[];for(let h=0;h<n;++h){if(r=e.charCodeAt(h),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function zt(e){const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Vt(e,t){let r,n,i;const a=[];for(let h=0;h<e.length&&!((t-=2)<0);++h)r=e.charCodeAt(h),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function mt(e){return o.toByteArray(Gt(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function nt(e){return e!==e}const Wt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function $(e){return typeof BigInt>"u"?Yt:e}function Yt(){throw new Error("BigInt not supported")}})(q);var v={},H={};Object.defineProperty(H,"__esModule",{value:!0});const tr=(u,o)=>u<<8|o,rr=(u,o,s)=>u<<16|o<<8|s,er=(u,o,s,f)=>u<<24|o<<16|s<<8|f,nr=`Maxmind v2 module has changed API.
|
|
6
|
+
*/(function(u){const o=Q,s=ct,f=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u.Buffer=c,u.SlowBuffer=W,u.INSPECT_MAX_BYTES=50;const l=2147483647;u.kMaxLength=l,c.TYPED_ARRAY_SUPPORT=d(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function d(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function p(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(e)}return B(e,t,r)}c.poolSize=8192;function B(e,t,r){if(typeof e=="string")return y(e,t);if(ArrayBuffer.isView(e))return _(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return S(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return c.from(n,t,r);const i=X(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,t,r){return B(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function m(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function E(e,t,r){return m(e),e<=0?p(e):t!==void 0?typeof r=="string"?p(e).fill(t,r):p(e).fill(t):p(e)}c.alloc=function(e,t,r){return E(e,t,r)};function g(e){return m(e),p(e<0?0:T(e)|0)}c.allocUnsafe=function(e){return g(e)},c.allocUnsafeSlow=function(e){return g(e)};function y(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=O(e,t)|0;let n=p(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function w(e){const t=e.length<0?0:T(e.length)|0,r=p(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function _(e){if(N(e,Uint8Array)){const t=new Uint8Array(e);return S(t.buffer,t.byteOffset,t.byteLength)}return w(e)}function S(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function X(e){if(c.isBuffer(e)){const t=T(e.length)|0,r=p(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||nt(e.length)?p(0):w(e);if(e.type==="Buffer"&&Array.isArray(e.data))return w(e.data)}function T(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function W(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype},c.compare=function(t,r){if(N(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),N(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let a=0,h=Math.min(n,i);a<h;++a)if(t[a]!==r[a]){n=t[a],i=r[a];break}return n<i?-1:i<n?1:0},c.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}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;const i=c.allocUnsafe(r);let a=0;for(n=0;n<t.length;++n){let h=t[n];if(N(h,Uint8Array))a+h.length>i.length?(c.isBuffer(h)||(h=c.from(h)),h.copy(i,a)):Uint8Array.prototype.set.call(i,h,a);else if(c.isBuffer(h))h.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=h.length}return i};function O(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mt(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}c.byteLength=O;function bt(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ot(this,t,r);case"utf8":case"utf-8":return lt(this,t,r);case"ascii":return Nt(this,t,r);case"latin1":case"binary":return kt(this,t,r);case"base64":return Lt(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $t(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function D(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}c.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 r=0;r<t;r+=2)D(this,r,r+1);return this},c.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 r=0;r<t;r+=4)D(this,r,r+3),D(this,r+1,r+2);return this},c.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 r=0;r<t;r+=8)D(this,r,r+7),D(this,r+1,r+6),D(this,r+2,r+5),D(this,r+3,r+4);return this},c.prototype.toString=function(){const t=this.length;return t===0?"":arguments.length===0?lt(this,0,t):bt.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0},c.prototype.inspect=function(){let t="";const r=u.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},f&&(c.prototype[f]=c.prototype.inspect),c.prototype.compare=function(t,r,n,i,a){if(N(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;let h=a-i,x=n-r;const A=Math.min(h,x),F=this.slice(i,a),U=t.slice(r,n);for(let I=0;I<A;++I)if(F[I]!==U[I]){h=F[I],x=U[I];break}return h<x?-1:x<h?1:0};function ht(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nt(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=c.from(t,n)),c.isBuffer(t))return t.length===0?-1:ft(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ft(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ft(e,t,r,n,i){let a=1,h=e.length,x=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,h/=2,x/=2,r/=2}function A(U,I){return a===1?U[I]:U.readUInt16BE(I*a)}let F;if(i){let U=-1;for(F=r;F<h;F++)if(A(e,F)===A(t,U===-1?0:F-U)){if(U===-1&&(U=F),F-U+1===x)return U*a}else U!==-1&&(F-=F-U),U=-1}else for(r+x>h&&(r=h-x),F=r;F>=0;F--){let U=!0;for(let I=0;I<x;I++)if(A(e,F+I)!==A(t,I)){U=!1;break}if(U)return F}return-1}c.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1},c.prototype.indexOf=function(t,r,n){return ht(this,t,r,n,!0)},c.prototype.lastIndexOf=function(t,r,n){return ht(this,t,r,n,!1)};function Rt(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;const a=t.length;n>a/2&&(n=a/2);let h;for(h=0;h<n;++h){const x=parseInt(t.substr(h*2,2),16);if(nt(x))return h;e[r+h]=x}return h}function St(e,t,r,n){return J(et(t,e.length-r),e,r,n)}function Mt(e,t,r,n){return J(zt(t),e,r,n)}function Ct(e,t,r,n){return J(mt(t),e,r,n)}function Pt(e,t,r,n){return J(Vt(t,e.length-r),e,r,n)}c.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const a=this.length-r;if((n===void 0||n>a)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let h=!1;for(;;)switch(i){case"hex":return Rt(this,t,r,n);case"utf8":case"utf-8":return St(this,t,r,n);case"ascii":case"latin1":case"binary":return Mt(this,t,r,n);case"base64":return Ct(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,t,r,n);default:if(h)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Lt(e,t,r){return t===0&&r===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,r))}function lt(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const a=e[i];let h=null,x=a>239?4:a>223?3:a>191?2:1;if(i+x<=r){let A,F,U,I;switch(x){case 1:a<128&&(h=a);break;case 2:A=e[i+1],(A&192)===128&&(I=(a&31)<<6|A&63,I>127&&(h=I));break;case 3:A=e[i+1],F=e[i+2],(A&192)===128&&(F&192)===128&&(I=(a&15)<<12|(A&63)<<6|F&63,I>2047&&(I<55296||I>57343)&&(h=I));break;case 4:A=e[i+1],F=e[i+2],U=e[i+3],(A&192)===128&&(F&192)===128&&(U&192)===128&&(I=(a&15)<<18|(A&63)<<12|(F&63)<<6|U&63,I>65535&&I<1114112&&(h=I))}}h===null?(h=65533,x=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),i+=x}return Tt(n)}const dt=4096;function Tt(e){const t=e.length;if(t<=dt)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=dt));return r}function Nt(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function kt(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Ot(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=Wt[e[a]];return i}function $t(e,t,r){const n=e.slice(t,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}c.prototype.slice=function(t,r){const n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);const i=this.subarray(t,r);return Object.setPrototypeOf(i,c.prototype),i};function b(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return i},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t+--r],a=1;for(;r>0&&(a*=256);)i+=this[t+--r]*a;return i},c.prototype.readUint8=c.prototype.readUInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||b(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(a)<<BigInt(32))}),c.prototype.readBigUInt64BE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(a)}),c.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=this[t],a=1,h=0;for(;++h<r&&(a*=256);)i+=this[t+h]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||b(t,r,this.length);let i=r,a=1,h=this[t+--i];for(;i>0&&(a*=256);)h+=this[t+--i]*a;return a*=128,h>=a&&(h-=Math.pow(2,8*r)),h},c.prototype.readInt8=function(t,r){return t=t>>>0,r||b(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},c.prototype.readInt16LE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},c.prototype.readInt16BE=function(t,r){t=t>>>0,r||b(t,2,this.length);const n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},c.prototype.readInt32LE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t=t>>>0,r||b(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),c.prototype.readBigInt64BE=$(function(t){t=t>>>0,z(t,"offset");const r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Y(t,this.length-8);const i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)}),c.prototype.readFloatLE=function(t,r){return t=t>>>0,r||b(t,4,this.length),s.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t=t>>>0,r||b(t,4,this.length),s.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||b(t,8,this.length),s.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||b(t,8,this.length),s.read(this,t,!1,52,8)};function C(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const x=Math.pow(2,8*n)-1;C(this,t,r,n,x,0)}let a=1,h=0;for(this[r]=t&255;++h<n&&(a*=256);)this[r+h]=t/a&255;return r+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){const x=Math.pow(2,8*n)-1;C(this,t,r,n,x,0)}let a=n-1,h=1;for(this[r+a]=t&255;--a>=0&&(h*=256);)this[r+a]=t/h&255;return r+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,255,0),this[r]=t&255,r+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function pt(e,t,r,n,i){Et(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a,a=a>>8,e[r++]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,h=h>>8,e[r++]=h,r}function yt(e,t,r,n,i){Et(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a=a>>8,e[r+6]=a,a=a>>8,e[r+5]=a,a=a>>8,e[r+4]=a;let h=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=h,h=h>>8,e[r+2]=h,h=h>>8,e[r+1]=h,h=h>>8,e[r]=h,r+8}c.prototype.writeBigUInt64LE=$(function(t,r=0){return pt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=$(function(t,r=0){return yt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=0,h=1,x=0;for(this[r]=t&255;++a<n&&(h*=256);)t<0&&x===0&&this[r+a-1]!==0&&(x=1),this[r+a]=(t/h>>0)-x&255;return r+n},c.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){const A=Math.pow(2,8*n-1);C(this,t,r,n,A-1,-A)}let a=n-1,h=1,x=0;for(this[r+a]=t&255;--a>=0&&(h*=256);)t<0&&x===0&&this[r+a+1]!==0&&(x=1),this[r+a]=(t/h>>0)-x&255;return r+n},c.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1},c.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2},c.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||C(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4},c.prototype.writeBigInt64LE=$(function(t,r=0){return pt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=$(function(t,r=0){return yt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function wt(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function gt(e,t,r,n,i){return t=+t,r=r>>>0,i||wt(e,t,r,4),s.write(e,t,r,n,23,4),r+4}c.prototype.writeFloatLE=function(t,r,n){return gt(this,t,r,!0,n)},c.prototype.writeFloatBE=function(t,r,n){return gt(this,t,r,!1,n)};function xt(e,t,r,n,i){return t=+t,r=r>>>0,i||wt(e,t,r,8),s.write(e,t,r,n,52,8),r+8}c.prototype.writeDoubleLE=function(t,r,n){return xt(this,t,r,!0,n)},c.prototype.writeDoubleBE=function(t,r,n){return xt(this,t,r,!1,n)},c.prototype.copy=function(t,r,n,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);const a=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),a},c.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){const h=t.charCodeAt(0);(i==="utf8"&&h<128||i==="latin1")&&(t=h)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let a;if(typeof t=="number")for(a=r;a<n;++a)this[a]=t;else{const h=c.isBuffer(t)?t:c.from(t,i),x=h.length;if(x===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=h[a%x]}return this};const G={};function rt(e,t,r){G[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),rt("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Bt(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Bt(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Bt(e){let t="",r=e.length;const n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Dt(e,t,r){z(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Y(t,e.length-(r+1))}function Et(e,t,r,n,i,a){if(e>r||e<t){const h=typeof t=="bigint"?"n":"";let x;throw t===0||t===BigInt(0)?x=`>= 0${h} and < 2${h} ** ${(a+1)*8}${h}`:x=`>= -(2${h} ** ${(a+1)*8-1}${h}) and < 2 ** ${(a+1)*8-1}${h}`,new G.ERR_OUT_OF_RANGE("value",x,e)}Dt(n,i,a)}function z(e,t){if(typeof e!="number")throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){throw Math.floor(e)!==e?(z(e,r),new G.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}const jt=/[^+/0-9A-Za-z-_]/g;function Gt(e){if(e=e.split("=")[0],e=e.trim().replace(jt,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function et(e,t){t=t||1/0;let r;const n=e.length;let i=null;const a=[];for(let h=0;h<n;++h){if(r=e.charCodeAt(h),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(h+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function zt(e){const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function Vt(e,t){let r,n,i;const a=[];for(let h=0;h<e.length&&!((t-=2)<0);++h)r=e.charCodeAt(h),n=r>>8,i=r%256,a.push(i),a.push(n);return a}function mt(e){return o.toByteArray(Gt(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function nt(e){return e!==e}const Wt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function $(e){return typeof BigInt>"u"?Yt:e}function Yt(){throw new Error("BigInt not supported")}})(q);var v={},H={};Object.defineProperty(H,"__esModule",{value:!0});const tr=(u,o)=>u<<8|o,rr=(u,o,s)=>u<<16|o<<8|s,er=(u,o,s,f)=>u<<24|o<<16|s<<8|f,nr=`Maxmind v2 module has changed API.
|
|
7
7
|
Upgrade instructions can be found here: https://github.com/runk/node-maxmind/wiki/Migration-guide
|
|
8
|
-
If you want to use legacy library then explicitly install maxmind@1`;H.default={concat2:tr,concat3:rr,concat4:er,legacyErrorMessage:nr};var ir=L&&L.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(v,"__esModule",{value:!0});const j=ir(H),or=q;var M;(function(u){u[u.Extended=0]="Extended",u[u.Pointer=1]="Pointer",u[u.Utf8String=2]="Utf8String",u[u.Double=3]="Double",u[u.Bytes=4]="Bytes",u[u.Uint16=5]="Uint16",u[u.Uint32=6]="Uint32",u[u.Map=7]="Map",u[u.Int32=8]="Int32",u[u.Uint64=9]="Uint64",u[u.Uint128=10]="Uint128",u[u.Array=11]="Array",u[u.Container=12]="Container",u[u.EndMarker=13]="EndMarker",u[u.Boolean=14]="Boolean",u[u.Float=15]="Float"})(M||(M={}));const ur=[0,2048,526336,0],cr={get:()=>{},set:()=>{}},R=(u,o)=>({value:u,offset:o});class ar{constructor(o,s=0,f=cr){this.telemetry={},this.db=o,this.baseOffset=s,this.cache=f}decode(o){let s;const f=this.db[o++];let l=f>>5;if(l===M.Pointer)return s=this.decodePointer(f,o),R(this.decodeFast(s.value).value,s.offset);if(l===M.Extended){if(s=this.db[o]+7,s<8)throw new Error("Invalid Extended Type at offset "+o+" val "+s);l=s,o++}const d=this.sizeFromCtrlByte(f,o);return this.decodeByType(l,d.offset,d.value)}decodeFast(o){const s=this.cache.get(o);if(s)return s;const f=this.decode(o);return this.cache.set(o,f),f}decodeByType(o,s,f){const l=s+f;switch(o){case M.Utf8String:return R(this.decodeString(s,f),l);case M.Map:return this.decodeMap(f,s);case M.Uint32:return R(this.decodeUint(s,f),l);case M.Double:return R(this.decodeDouble(s),l);case M.Array:return this.decodeArray(f,s);case M.Boolean:return R(this.decodeBoolean(f),s);case M.Float:return R(this.decodeFloat(s),l);case M.Bytes:return R(this.decodeBytes(s,f),l);case M.Uint16:return R(this.decodeUint(s,f),l);case M.Int32:return R(this.decodeInt32(s,f),l);case M.Uint64:return R(this.decodeUint(s,f),l);case M.Uint128:return R(this.decodeUint(s,f),l)}throw new Error("Unknown type "+o+" at offset "+s)}sizeFromCtrlByte(o,s){const f=o&31;return f<29?R(f,s):f===29?R(29+this.db[s],s+1):f===30?R(285+this.db.readUInt16BE(s),s+2):R(65821+j.default.concat3(this.db[s],this.db[s+1],this.db[s+2]),s+3)}decodeBytes(o,s){return this.db.slice(o,o+s)}decodePointer(o,s){const f=o>>3&3,l=this.baseOffset+ur[f];let d=0;return f===0?d=j.default.concat2(o&7,this.db[s]):f===1?d=j.default.concat3(o&7,this.db[s],this.db[s+1]):f===2?d=j.default.concat4(o&7,this.db[s],this.db[s+1],this.db[s+2]):d=this.db.readUInt32BE(s),s+=f+1,R(l+d,s)}decodeArray(o,s){let f;const l=[];for(let d=0;d<o;d++)f=this.decode(s),s=f.offset,l.push(f.value);return R(l,s)}decodeBoolean(o){return o!==0}decodeDouble(o){return this.db.readDoubleBE(o)}decodeFloat(o){return this.db.readFloatBE(o)}decodeMap(o,s){let f,l;const d={};for(let p=0;p<o;p++)f=this.decode(s),l=f.value,f=this.decode(f.offset),s=f.offset,d[l]=f.value;return R(d,s)}decodeInt32(o,s){return s===0?0:this.db.readInt32BE(o)}decodeUint(o,s){switch(s){case 0:return 0;case 1:return this.db[o];case 2:return j.default.concat2(this.db[o+0],this.db[o+1]);case 3:return j.default.concat3(this.db[o+0],this.db[o+1],this.db[o+2]);case 4:return j.default.concat4(this.db[o+0],this.db[o+1],this.db[o+2],this.db[o+3]);case 8:return this.decodeBigUint(o,s);case 16:return this.decodeBigUint(o,s)}return 0}decodeString(o,s){return this.db.slice(o,o+s).toString()}decodeBigUint(o,s){const f=or.Buffer.alloc(s);this.db.copy(f,0,o,o+s);let l=BigInt(0);const d=s/4;for(let p=0;p<d;p++)l=l*BigInt(4294967296)+BigInt(f.readUInt32BE(p<<2));return l.toString()}}v.default=ar;var at={};Object.defineProperty(at,"__esModule",{value:!0});const sr=u=>{const o=u.split(".",4),s=parseInt(o[0]),f=parseInt(o[1]),l=parseInt(o[2]),d=parseInt(o[3]);return[s,f,l,d]},Z=u=>{const o=parseInt(u,10).toString(16);return o.length===2?o:"0"+o},hr=u=>{const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let s,f,l;const d=u.indexOf(".")>-1?u.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/,(
|
|
8
|
+
If you want to use legacy library then explicitly install maxmind@1`;H.default={concat2:tr,concat3:rr,concat4:er,legacyErrorMessage:nr};var ir=L&&L.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(v,"__esModule",{value:!0});const j=ir(H),or=q;var M;(function(u){u[u.Extended=0]="Extended",u[u.Pointer=1]="Pointer",u[u.Utf8String=2]="Utf8String",u[u.Double=3]="Double",u[u.Bytes=4]="Bytes",u[u.Uint16=5]="Uint16",u[u.Uint32=6]="Uint32",u[u.Map=7]="Map",u[u.Int32=8]="Int32",u[u.Uint64=9]="Uint64",u[u.Uint128=10]="Uint128",u[u.Array=11]="Array",u[u.Container=12]="Container",u[u.EndMarker=13]="EndMarker",u[u.Boolean=14]="Boolean",u[u.Float=15]="Float"})(M||(M={}));const ur=[0,2048,526336,0],cr={get:()=>{},set:()=>{}},R=(u,o)=>({value:u,offset:o});class ar{constructor(o,s=0,f=cr){this.telemetry={},this.db=o,this.baseOffset=s,this.cache=f}decode(o){let s;const f=this.db[o++];let l=f>>5;if(l===M.Pointer)return s=this.decodePointer(f,o),R(this.decodeFast(s.value).value,s.offset);if(l===M.Extended){if(s=this.db[o]+7,s<8)throw new Error("Invalid Extended Type at offset "+o+" val "+s);l=s,o++}const d=this.sizeFromCtrlByte(f,o);return this.decodeByType(l,d.offset,d.value)}decodeFast(o){const s=this.cache.get(o);if(s)return s;const f=this.decode(o);return this.cache.set(o,f),f}decodeByType(o,s,f){const l=s+f;switch(o){case M.Utf8String:return R(this.decodeString(s,f),l);case M.Map:return this.decodeMap(f,s);case M.Uint32:return R(this.decodeUint(s,f),l);case M.Double:return R(this.decodeDouble(s),l);case M.Array:return this.decodeArray(f,s);case M.Boolean:return R(this.decodeBoolean(f),s);case M.Float:return R(this.decodeFloat(s),l);case M.Bytes:return R(this.decodeBytes(s,f),l);case M.Uint16:return R(this.decodeUint(s,f),l);case M.Int32:return R(this.decodeInt32(s,f),l);case M.Uint64:return R(this.decodeUint(s,f),l);case M.Uint128:return R(this.decodeUint(s,f),l)}throw new Error("Unknown type "+o+" at offset "+s)}sizeFromCtrlByte(o,s){const f=o&31;return f<29?R(f,s):f===29?R(29+this.db[s],s+1):f===30?R(285+this.db.readUInt16BE(s),s+2):R(65821+j.default.concat3(this.db[s],this.db[s+1],this.db[s+2]),s+3)}decodeBytes(o,s){return this.db.slice(o,o+s)}decodePointer(o,s){const f=o>>3&3,l=this.baseOffset+ur[f];let d=0;return f===0?d=j.default.concat2(o&7,this.db[s]):f===1?d=j.default.concat3(o&7,this.db[s],this.db[s+1]):f===2?d=j.default.concat4(o&7,this.db[s],this.db[s+1],this.db[s+2]):d=this.db.readUInt32BE(s),s+=f+1,R(l+d,s)}decodeArray(o,s){let f;const l=[];for(let d=0;d<o;d++)f=this.decode(s),s=f.offset,l.push(f.value);return R(l,s)}decodeBoolean(o){return o!==0}decodeDouble(o){return this.db.readDoubleBE(o)}decodeFloat(o){return this.db.readFloatBE(o)}decodeMap(o,s){let f,l;const d={};for(let p=0;p<o;p++)f=this.decode(s),l=f.value,f=this.decode(f.offset),s=f.offset,d[l]=f.value;return R(d,s)}decodeInt32(o,s){return s===0?0:this.db.readInt32BE(o)}decodeUint(o,s){switch(s){case 0:return 0;case 1:return this.db[o];case 2:return j.default.concat2(this.db[o+0],this.db[o+1]);case 3:return j.default.concat3(this.db[o+0],this.db[o+1],this.db[o+2]);case 4:return j.default.concat4(this.db[o+0],this.db[o+1],this.db[o+2],this.db[o+3]);case 8:return this.decodeBigUint(o,s);case 16:return this.decodeBigUint(o,s)}return 0}decodeString(o,s){return this.db.slice(o,o+s).toString()}decodeBigUint(o,s){const f=or.Buffer.alloc(s);this.db.copy(f,0,o,o+s);let l=BigInt(0);const d=s/4;for(let p=0;p<d;p++)l=l*BigInt(4294967296)+BigInt(f.readUInt32BE(p<<2));return l.toString()}}v.default=ar;var at={};Object.defineProperty(at,"__esModule",{value:!0});const sr=u=>{const o=u.split(".",4),s=parseInt(o[0]),f=parseInt(o[1]),l=parseInt(o[2]),d=parseInt(o[3]);return[s,f,l,d]},Z=u=>{const o=parseInt(u,10).toString(16);return o.length===2?o:"0"+o},hr=u=>{const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let s,f,l;const d=u.indexOf(".")>-1?u.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/,(B,m,E,g,y)=>Z(m)+Z(E)+":"+Z(g)+Z(y)):u,[p,c]=d.split("::",2);if(p)for(f=p.split(":"),s=0;s<f.length;s++)l=parseInt(f[s],16),o[s*2]=l>>8,o[s*2+1]=l&255;if(c){f=c.split(":");const B=16-f.length*2;for(s=0;s<f.length;s++)l=parseInt(f[s],16),o[B+s*2]=l>>8,o[B+(s*2+1)]=l&255}return o},fr=u=>u.indexOf(":")===-1?sr(u):hr(u),lr=(u,o)=>{const s=o>>3,f=7^o&7;return u[s]>>>f&1},dr=u=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(u),pr=u=>/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test(u),yr=u=>dr(u)||pr(u);at.default={bitAt:lr,parse:fr,validate:yr};var Ut={};(function(u){var o=L&&L.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(u,"__esModule",{value:!0}),u.isLegacyFormat=u.parseMetadata=void 0;const s=o(v),f=o(H),d=q.Buffer.from("ABCDEF4D61784D696E642E636F6D","hex"),p=m=>{const E=c(m),y=new s.default(m,E).decode(E).value;if(!y)throw new Error((0,u.isLegacyFormat)(m)?f.default.legacyErrorMessage:"Cannot parse binary database");return[24,28,32].indexOf(y.record_size)>-1,{binaryFormatMajorVersion:y.binary_format_major_version,binaryFormatMinorVersion:y.binary_format_minor_version,buildEpoch:new Date(y.build_epoch*1e3),databaseType:y.database_type,description:y.description,ipVersion:y.ip_version,languages:y.languages,nodeByteSize:y.record_size/4,nodeCount:y.node_count,recordSize:y.record_size,searchTreeSize:y.node_count*y.record_size/4,treeDepth:Math.pow(2,y.ip_version+1)}};u.parseMetadata=p;const c=m=>{let E=0,g=m.length-1;const y=d.length-1;for(;E<=y&&g-- >0;)E+=m[g]===d[y-E]?1:-E;return g+E},B=m=>{for(let g=0;g<20;g++){const y=m.slice(m.length-3-g,m.length-g);if(y[0]===255&&y[1]===255&&y[2]===255)return!0}return!1};u.isLegacyFormat=B})(Ut);var st={},wr=L&&L.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(st,"__esModule",{value:!0});const tt=wr(H),gr=u=>o=>tt.default.concat3(u[o+3],u[o+4],u[o+5]),xr=u=>o=>tt.default.concat3(u[o],u[o+1],u[o+2]),Br=u=>o=>tt.default.concat4(u[o+3]>>4,u[o],u[o+1],u[o+2]),Er=u=>o=>tt.default.concat4(u[o+3]&15,u[o+4],u[o+5],u[o+6]),mr=u=>o=>u.readUInt32BE(o),Ir=u=>o=>u.readUInt32BE(o+4);st.default=(u,o)=>{switch(o){case 24:return{left:xr(u),right:gr(u)};case 28:return{left:Br(u),right:Er(u)};case 32:return{left:mr(u),right:Ir(u)}}throw new Error("Unsupported record size")};var ot={},It;function Fr(){return It||(It=1,Object.defineProperty(ot,"__esModule",{value:!0})),ot}(function(u){var o=L&&L.__createBinding||(Object.create?function(g,y,w,_){_===void 0&&(_=w);var S=Object.getOwnPropertyDescriptor(y,w);(!S||("get"in S?!y.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return y[w]}}),Object.defineProperty(g,_,S)}:function(g,y,w,_){_===void 0&&(_=w),g[_]=y[w]}),s=L&&L.__exportStar||function(g,y){for(var w in g)w!=="default"&&!Object.prototype.hasOwnProperty.call(y,w)&&o(y,g,w)},f=L&&L.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(u,"__esModule",{value:!0}),u.Reader=void 0;const l=q,d=f(v),p=f(at),c=Ut,B=f(st),m=16;class E{constructor(y,w={}){this.opts=w,this.load(y)}load(y){if(!l.Buffer.isBuffer(y))throw new Error(`mmdb-lib expects an instance of Buffer, got: ${typeof y}`);this.db=y,this.metadata=(0,c.parseMetadata)(this.db),this.decoder=new d.default(this.db,this.metadata.searchTreeSize+m,this.opts.cache),this.walker=(0,B.default)(this.db,this.metadata.recordSize),this.ipv4StartNodeNumber=this.ipv4Start()}get(y){const[w]=this.getWithPrefixLength(y);return w}getWithPrefixLength(y){const[w,_]=this.findAddressInTree(y);return[w?this.resolveDataPointer(w):null,_]}findAddressInTree(y){const w=p.default.parse(y),_=this.metadata.nodeCount,S=w.length*8;let X,T=0,W,O=0;for(w.length===4&&(T=this.ipv4StartNodeNumber);O<S&&T<_;O++)X=p.default.bitAt(w,O),W=T*this.metadata.nodeByteSize,T=X?this.walker.right(W):this.walker.left(W);return T>_?[T,O]:[null,O]}resolveDataPointer(y){const w=y-this.metadata.nodeCount+this.metadata.searchTreeSize;return this.decoder.decodeFast(w).value}ipv4Start(){if(this.metadata.ipVersion===4)return 0;const y=this.metadata.nodeCount;let w=0,_=0;for(;_<96&&w<y;_++){const S=w*this.metadata.nodeByteSize;w=this.walker.left(S)}return w}}u.Reader=E,s(Fr(),u)})(Ft);async function Ar(u){try{const o=await fetch(u);if(!o.ok)throw new Error("Network response was not ok");const s=await o.arrayBuffer(),f=new Uint8Array(s);return q.Buffer.from(f)}catch(o){console.error("Fetching file failed:",o)}}const Ur="https://raw.githubusercontent.com/Max-Sum/17mon-mmdb/release/Country.mmdb";let K=null;const _r=async u=>{if(K)return K;const o=await Ar(Ur);if(o)return K=new Ft.Reader(o),K},ut=new Map,_t=async u=>{var d;if(ut.has(u))return ut.get(u);const o=await _r(),s=o==null?void 0:o.get(u),f=(d=s==null?void 0:s.country)==null?void 0:d.names,l=(f==null?void 0:f["zh-CN"])??(f==null?void 0:f.en)??"n/a";return l&&ut.set(u,l),l};window.getGeoFromIp=_t;exports.getGeoFromIp=_t;
|
|
9
9
|
//# sourceMappingURL=index.cjs.js.map
|