map.meshcore.dev/lib/msgpackr.js

8 lines
51 KiB
JavaScript
Raw Normal View History

/**
* Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
* Original file: /npm/msgpackr@1.11.8/index.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)e[n]=t[n],r[t.charCodeAt(n)]=n;r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63}function s(t,r,n){for(var i,o,s=[],u=r;u<n;u+=3)i=(t[u]<<16)+(t[u+1]<<8)+t[u+2],s.push(e[(o=i)>>18&63]+e[o>>12&63]+e[o>>6&63]+e[63&o]);return s.join("")}function u(t){var r;i||o();for(var n=t.length,u=n%3,a="",f=[],l=16383,h=0,c=n-u;h<c;h+=l)f.push(s(t,h,h+l>c?c:h+l));return 1===u?(r=t[n-1],a+=e[r>>2],a+=e[r<<4&63],a+="=="):2===u&&(r=(t[n-2]<<8)+t[n-1],a+=e[r>>10],a+=e[r>>4&63],a+=e[r<<2&63],a+="="),f.push(a),f.join("")}function a(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,f=a>>1,l=-7,h=r?i-1:0,c=r?-1:1,g=t[e+h];for(h+=c,o=g&(1<<-l)-1,g>>=-l,l+=u;l>0;o=256*o+t[e+h],h+=c,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===o)o=1-f;else{if(o===a)return s?NaN:1/0*(g?-1:1);s+=Math.pow(2,n),o-=f}return(g?-1:1)*s*Math.pow(2,o-n)}function f(t,e,r,n,i,o){var s,u,a,f=8*o-i-1,l=(1<<f)-1,h=l>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,p=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?c/a:c*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=l?(u=0,s=l):s+h>=1?(u=(e*a-1)*Math.pow(2,i),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+g]=255&u,g+=p,u/=256,i-=8);for(s=s<<i|u,f+=i;f>0;t[r+g]=255&s,g+=p,s/=256,f-=8);t[r+g-p]|=128*y}var l={}.toString,h=Array.isArray||function(t){return"[object Array]"==l.call(t)};function c(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,e){if(c()<e)throw new RangeError("Invalid typed array length");return p.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=p.prototype:(null===t&&(t=new p(e)),t.length=e),t}function p(t,e,r){if(!(p.TYPED_ARRAY_SUPPORT||this instanceof p))return new p(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return w(this,t)}return y(this,t,e,r)}function y(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);p.TYPED_ARRAY_SUPPORT?(t=e).__proto__=p.prototype:t=b(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!p.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|A(e,r);t=g(t,n);var i=t.write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(v(e)){var r=0|m(e.length);return 0===(t=g(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?g(t,0):b(t,e);if("Buffer"===e.type&&h(e.data))return b(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function w(t,e){if(d(e),t=g(t,e<0?0:0|m(e)),!p.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function b(t,e){var r=e.length<0?0:0|m(e.length);t=g(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function m(t){if(t>=c())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c().toString(16)+" bytes");return 0|t}function v(t){return!(null==t||!t._isBuffer)}function A(t,e){if(v(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t insta
//# sourceMappingURL=/sm/abb326e39ebbcdafe0d57b3cddbc235858530eba6320ddf2f7cf50015c28a63f.map