12 |
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).msgpackr={})}(this,(function(t){"use strict";var e,r,n;try{e=new TextDecoder}catch(t){}var i,s,o,u,a,l=0,c={},f=0,h=0,g=[],p={useRecords:!1,mapsAsObjects:!0};class d{}const y=new d;y.name="MessagePack 0xC1";var w,b=!1,m=2;try{new w("")}catch(t){m=1/0}class S{constructor(t){t&&(!1===t.useRecords&&void 0===t.mapsAsObjects&&(t.mapsAsObjects=!0),t.sequential&&!1!==t.trusted&&(t.trusted=!0,t.structures||0==t.useRecords||(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,e){if(r)return Z((()=>(G(),this?this.unpack(t,e):S.prototype.unpack.call(p,t,e))));t.buffer||t.constructor!==ArrayBuffer||(t="undefined"!=typeof Buffer?Buffer.from(t):new Uint8Array(t)),"object"==typeof e?(n=e.end||t.length,l=e.start||0):(l=0,n=e>-1?e:t.length),h=0,s=null,o=null,r=t;try{a=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(e){if(r=null,t instanceof Uint8Array)throw e;throw new Error("Source must be a Uint8Array or Buffer but was a "+(t&&"object"==typeof t?t.constructor.name:typeof t))}if(this instanceof S){if(c=this,this.structures)return i=this.structures,I(e);(!i||i.length>0)&&(i=[])}else c=p,(!i||i.length>0)&&(i=[]);return I(e)}unpackMultiple(t,e){let r,n=0;try{b=!0;let i=t.length,s=this?this.unpack(t,i):X.unpack(t,i);if(!e){for(r=[s];l<i;)n=l,r.push(I());return r}if(!1===e(s,n,l))return;for(;l<i;)if(n=l,!1===e(I(),n,l))return}catch(t){throw t.lastPosition=n,t.values=r,t}finally{b=!1,G()}}_mergeStructures(t,e){t=t||[],Object.isFrozen(t)&&(t=t.map((t=>t.slice(0))));for(let e=0,r=t.length;e<r;e++){let r=t[e];r&&(r.isShared=!0,e>=32&&(r.highByte=e-32>>5))}t.sharedLength=t.length;for(let r in e||[])if(r>=0){let n=t[r],i=e[r];i&&(n&&((t.restoreStructures||(t.restoreStructures=[]))[r]=n),t[r]=i)}return this.structures=t}decode(t,e){return this.unpack(t,e)}}function I(t){try{if(!c.trusted&&!b){let t=i.sharedLength||0;t<i.length&&(i.length=t)}let t;if(c.randomAccessStructure&&r[l]<64&&r[l],t=A(),o&&(l=o.postBundlePosition,o=null),b&&(i.restoreStructures=null),l==n)i&&i.restoreStructures&&U(),i=null,r=null,u&&(u=null);else{if(l>n)throw new Error("Unexpected end of MessagePack data");if(!b){let e;try{e=JSON.stringify(t,((t,e)=>"bigint"==typeof e?`${e}n`:e)).slice(0,100)}catch(t){e="(JSON view not available "+t+")"}throw new Error("Data read, but end of buffer not reached "+e)}}return t}catch(t){throw i&&i.restoreStructures&&U(),G(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||l>n)&&(t.incomplete=!0),t}}function U(){for(let t in i.restoreStructures)i[t]=i.restoreStructures[t];i.restoreStructures=null}function A(){let t=r[l++];if(t<160){if(t<128){if(t<64)return t;{let e=i[63&t]||c.getStructures&&v()[63&t];return e?(e.read||(e.read=B(e,63&t)),e.read()):t}}if(t<144){if(t-=128,c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=C();"__proto__"===t&&(t="__proto_"),e[t]=A()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(A(),A());return e}}{t-=144;let e=new Array(t);for(let r=0;r<t;r++)e[r]=A();return c.freezeData?Object.freeze(e):e}}if(t<192){let e=t-160;if(h>=l)return s.slice(l-f,(l+=e)-f);if(0==h&&n<140){let t=e<16?L(e):V(e);if(null!=t)return t}return O(e)}{let e;switch(t){case 192:return null;case 193:return o?(e=A(),e>0?o[1].slice(o.position1,o.position1+=e):o[0].slice(o.position0,o.position0-=e)):y;case 194:return!1;case 195:return!0;case 196:if(e=r[l++],void 0===e)throw new Error("Unexpected end of buffer");return F(e);case 197:return e=a.getUint16(l),l+=2,F(e);case 198:return e=a.getUint32(l),l+=4,F(e);case 199:return P(r[l++]);case 200:return e=a.getUint16(l),l+=2,P(e);case 201:return e=a.getUint32(l),l+=4,P(e);case 202:if(e=a.getFloat32(l),c.useFloat32>2){let t=H[(127&r[l])<<1|r[l+1]>>7];return l+=4,(t*e+(e>0?.5:-.5)>>0)/t}return l+=4,e;case 203:return e=a.getFloat64(l),l+=8,e;case 204:return r[l++];case 205:return e=a.getUint16(l),l+=2,e;case 206:return e=a.getUint32(l),l+=4,e;case 207:return"number"===c.int64AsType?(e=4294967296*a.getUint32(l),e+=a.getUint32(l+4)):"string"===c.int64AsType?e=a.getBigUint64(l).toString():"auto"===c.int64AsType?(e=a.getBigUint64(l),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=a.getBigUint64(l),l+=8,e;case 208:return a.getInt8(l++);case 209:return e=a.getInt16(l),l+=2,e;case 210:return e=a.getInt32(l),l+=4,e;case 211:return"number"===c.int64AsType?(e=4294967296*a.getInt32(l),e+=a.getUint32(l+4)):"string"===c.int64AsType?e=a.getBigInt64(l).toString():"auto"===c.int64AsType?(e=a.getBigInt64(l),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=a.getBigInt64(l),l+=8,e;case 212:if(e=r[l++],114==e)return J(63&r[l++]);{let t=g[e];if(t)return t.read?(l++,t.read(A())):t.noBuffer?(l++,t()):t(r.subarray(l,++l));throw new Error("Unknown extension "+e)}case 213:return e=r[l],114==e?(l++,J(63&r[l++],r[l++])):P(2);case 214:return P(4);case 215:return P(8);case 216:return P(16);case 217:return e=r[l++],h>=l?s.slice(l-f,(l+=e)-f):_(e);case 218:return e=a.getUint16(l),h>=(l+=2)?s.slice(l-f,(l+=e)-f):x(e);case 219:return e=a.getUint32(l),h>=(l+=4)?s.slice(l-f,(l+=e)-f):T(e);case 220:return e=a.getUint16(l),l+=2,M(e);case 221:return e=a.getUint32(l),l+=4,M(e);case 222:return e=a.getUint16(l),l+=2,D(e);case 223:return e=a.getUint32(l),l+=4,D(e);default:if(t>=224)return t-256;if(void 0===t){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+t)}}}const E=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function B(t,e){function r(){if(r.count++>m){let r=t.read=new w("r","return function(){return "+(c.freezeData?"Object.freeze":"")+"({"+t.map((t=>"__proto__"===t?"__proto_:r()":E.test(t)?t+":r()":"["+JSON.stringify(t)+"]:r()")).join(",")+"})}")(A);return 0===t.highByte&&(t.read=k(e,t.read)),r()}let n={};for(let e=0,r=t.length;e<r;e++){let r=t[e];"__proto__"===r&&(r="__proto_"),n[r]=A()}return c.freezeData?Object.freeze(n):n}return r.count=0,0===t.highByte?k(e,r):r}const k=(t,e)=>function(){let n=r[l++];if(0===n)return e();let s=t<32?-(t+(n<<5)):t+(n<<5),o=i[s]||v()[s];if(!o)throw new Error("Record id is not defined for "+s);return o.read||(o.read=B(o,t)),o.read()};function v(){let t=Z((()=>(r=null,c.getStructures())));return i=c._mergeStructures(t,i)}var O=j,_=j,x=j,T=j;function j(t){let n;if(t<16&&(n=L(t)))return n;if(t>64&&e)return e.decode(r.subarray(l,l+=t));const i=l+t,s=[];for(n="";l<i;){const t=r[l++];if(0==(128&t))s.push(t);else if(192==(224&t)){const e=63&r[l++];s.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&r[l++],n=63&r[l++];s.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&r[l++])<<12|(63&r[l++])<<6|63&r[l++];e>65535&&(e-=65536,s.push(e>>>10&1023|55296),e=56320|1023&e),s.push(e)}else s.push(t);s.length>=4096&&(n+=R.apply(String,s),s.length=0)}return s.length>0&&(n+=R.apply(String,s)),n}function M(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=A();return c.freezeData?Object.freeze(e):e}function D(t){if(c.mapsAsObjects){let e={};for(let r=0;r<t;r++){let t=C();"__proto__"===t&&(t="__proto_"),e[t]=A()}return e}{let e=new Map;for(let r=0;r<t;r++)e.set(A(),A());return e}}var R=String.fromCharCode;function V(t){let e=l,n=new Array(t);for(let i=0;i<t;i++){const t=r[l++];if((128&t)>0)return void(l=e);n[i]=t}return R.apply(String,n)}function L(t){if(t<4){if(t<2){if(0===t)return"";{let t=r[l++];return(128&t)>1?void(l-=1):R(t)}}{let e=r[l++],n=r[l++];if((128&e)>0||(128&n)>0)return void(l-=2);if(t<3)return R(e,n);let i=r[l++];return(128&i)>0?void(l-=3):R(e,n,i)}}{let e=r[l++],n=r[l++],i=r[l++],s=r[l++];if((128&e)>0||(128&n)>0||(128&i)>0||(128&s)>0)return void(l-=4);if(t<6){if(4===t)return R(e,n,i,s);{let t=r[l++];return(128&t)>0?void(l-=5):R(e,n,i,s,t)}}if(t<8){let o=r[l++],u=r[l++];if((128&o)>0||(128&u)>0)return void(l-=6);if(t<7)return R(e,n,i,s,o,u);let a=r[l++];return(128&a)>0?void(l-=7):R(e,n,i,s,o,u,a)}{let o=r[l++],u=r[l++],a=r[l++],c=r[l++];if((128&o)>0||(128&u)>0||(128&a)>0||(128&c)>0)return void(l-=8);if(t<10){if(8===t)return R(e,n,i,s,o,u,a,c);{let t=r[l++];return(128&t)>0?void(l-=9):R(e,n,i,s,o,u,a,c,t)}}if(t<12){let f=r[l++],h=r[l++];if((128&f)>0||(128&h)>0)return void(l-=10);if(t<11)return R(e,n,i,s,o,u,a,c,f,h);let g=r[l++];return(128&g)>0?void(l-=11):R(e,n,i,s,o,u,a,c,f,h,g)}{let f=r[l++],h=r[l++],g=r[l++],p=r[l++];if((128&f)>0||(128&h)>0||(128&g)>0||(128&p)>0)return void(l-=12);if(t<14){if(12===t)return R(e,n,i,s,o,u,a,c,f,h,g,p);{let t=r[l++];return(128&t)>0?void(l-=13):R(e,n,i,s,o,u,a,c,f,h,g,p,t)}}{let d=r[l++],y=r[l++];if((128&d)>0||(128&y)>0)return void(l-=14);if(t<15)return R(e,n,i,s,o,u,a,c,f,h,g,p,d,y);let w=r[l++];return(128&w)>0?void(l-=15):R(e,n,i,s,o,u,a,c,f,h,g,p,d,y,w)}}}}}function N(){let t,e=r[l++];if(e<192)t=e-160;else switch(e){case 217:t=r[l++];break;case 218:t=a.getUint16(l),l+=2;break;case 219:t=a.getUint32(l),l+=4;break;default:throw new Error("Expected string")}return j(t)}function F(t){return c.copyBuffers?Uint8Array.prototype.slice.call(r,l,l+=t):r.subarray(l,l+=t)}function P(t){let e=r[l++];if(g[e]){let n;return g[e](r.subarray(l,n=l+=t),(t=>{l=t;try{return A()}finally{l=n}}))}throw new Error("Unknown extension type "+e)}var z=new Array(4096);function C(){let t=r[l++];if(!(t>=160&&t<192))return l--,W(A());if(t-=160,h>=l)return s.slice(l-f,(l+=t)-f);if(!(0==h&&n<180))return O(t);let e,i=4095&(t<<5^(t>1?a.getUint16(l):t>0?r[l]:0)),o=z[i],u=l,c=l+t-3,g=0;if(o&&o.bytes==t){for(;u<c;){if(e=a.getUint32(u),e!=o[g++]){u=1879048192;break}u+=4}for(c+=3;u<c;)if(e=r[u++],e!=o[g++]){u=1879048192;break}if(u===c)return l=u,o.string;c-=3,u=l}for(o=[],z[i]=o,o.bytes=t;u<c;)e=a.getUint32(u),o.push(e),u+=4;for(c+=3;u<c;)e=r[u++],o.push(e);let p=t<16?L(t):V(t);return o.string=null!=p?p:O(t)}function W(t){if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t||"bigint"==typeof t)return t.toString();if(null==t)return t+"";throw new Error("Invalid property type for record",typeof t)}const J=(t,e)=>{let r=A().map(W),n=t;void 0!==e&&(t=t<32?-((e<<5)+t):(e<<5)+t,r.highByte=e);let s=i[t];return s&&(s.isShared||b)&&((i.restoreStructures||(i.restoreStructures=[]))[t]=s),i[t]=r,r.read=B(r,n),r.read()};g[0]=()=>{},g[0].noBuffer=!0,g[66]=t=>{let e=t.length,r=BigInt(128&t[0]?t[0]-256:t[0]);for(let n=1;n<e;n++)r<<=BigInt(8),r+=BigInt(t[n]);return r};let $={Error:Error,TypeError:TypeError,ReferenceError:ReferenceError};g[101]=()=>{let t=A();return($[t[0]]||Error)(t[1],{cause:t[2]})},g[105]=t=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let e=a.getUint32(l-4);u||(u=new Map);let n,i=r[l];n=i>=144&&i<160||220==i||221==i?[]:{};let s={target:n};u.set(e,s);let o=A();return s.used?Object.assign(n,o):(s.target=o,o)},g[112]=t=>{if(!1===c.structuredClone)throw new Error("Structured clone extension is disabled");let e=a.getUint32(l-4),r=u.get(e);return r.used=!0,r.target},g[115]=()=>new Set(A());const Y=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map((t=>t+"Array"));let q="object"==typeof globalThis?globalThis:window;g[116]=t=>{let e=t[0],r=Y[e];if(!r){if(16===e){let e=new ArrayBuffer(t.length-1);return new Uint8Array(e).set(t.subarray(1)),e}throw new Error("Could not find typed array for code "+e)}return new q[r](Uint8Array.prototype.slice.call(t,1).buffer)},g[120]=()=>{let t=A();return new RegExp(t[0],t[1])};const K=[];function Z(t){let e=n,g=l,p=f,d=h,y=s,w=u,m=o,S=new Uint8Array(r.slice(0,n)),I=i,U=i.slice(0,i.length),A=c,E=b,B=t();return n=e,l=g,f=p,h=d,s=y,u=w,o=m,r=S,b=E,(i=I).splice(0,i.length,...U),c=A,a=new DataView(r.buffer,r.byteOffset,r.byteLength),B}function G(){r=null,u=null,i=null}g[98]=t=>{let e=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=l;return l+=e-t.length,o=K,(o=[N(),N()]).position0=0,o.position1=0,o.postBundlePosition=l,l=r,A()},g[255]=t=>4==t.length?new Date(1e3*(16777216*t[0]+(t[1]<<16)+(t[2]<<8)+t[3])):8==t.length?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+1e3*(4294967296*(3&t[3])+16777216*t[4]+(t[5]<<16)+(t[6]<<8)+t[7])):12==t.length?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+1e3*((128&t[4]?-281474976710656:0)+1099511627776*t[6]+4294967296*t[7]+16777216*t[8]+(t[9]<<16)+(t[10]<<8)+t[11])):new Date("invalid");const H=new Array(147);for(let t=0;t<256;t++)H[t]=+("1e"+Math.floor(45.15-.30103*t));const Q=S;var X=new S({useRecords:!1});const tt=X.unpack,et=X.unpackMultiple,rt=X.unpack,nt={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let it,st,ot,ut=new Float32Array(1),at=new Uint8Array(ut.buffer,0,4);try{it=new TextEncoder}catch(t){}const lt="undefined"!=typeof Buffer,ct=lt?function(t){return Buffer.allocUnsafeSlow(t)}:Uint8Array,ft=lt?Buffer:Uint8Array,ht=lt?4294967296:2144337920;let gt,pt,dt,yt,wt=0,bt=null;const mt=/[\u0080-\uFFFF]/,St=Symbol("record-id");class It extends S{constructor(t){let e,r,n,i;super(t),this.offset=0;let s=ft.prototype.utf8Write?function(t,e){return gt.utf8Write(t,e,gt.byteLength-e)}:!(!it||!it.encodeInto)&&function(t,e){return it.encodeInto(t,gt.subarray(e)).written},o=this;t||(t={});let u=t&&t.sequential,a=t.structures||t.saveStructures,l=t.maxSharedStructures;if(null==l&&(l=a?32:0),l>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&null==t.moreTypes&&(this.moreTypes=!0);let c=t.maxOwnStructures;null==c&&(c=a?32:64),this.structures||0==t.useRecords||(this.structures=[]);let f=l>32||c+l>64,h=l+64,g=l+c+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],d=0,y=0;this.pack=this.encode=function(t,s){if(gt||(gt=new ct(8192),dt=gt.dataView||(gt.dataView=new DataView(gt.buffer,0,8192)),wt=0),yt=gt.length-10,yt-wt<2048?(gt=new ct(gt.length),dt=gt.dataView||(gt.dataView=new DataView(gt.buffer,0,gt.length)),yt=gt.length-10,wt=0):wt=wt+7&2147483640,e=wt,s&Vt&&(wt+=255&s),i=o.structuredClone?new Map:null,o.bundleStrings&&"string"!=typeof t?(bt=[],bt.size=1/0):bt=null,n=o.structures,n){n.uninitialized&&(n=o._mergeStructures(o.getStructures()));let t=n.sharedLength||0;if(t>l)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+n.sharedLength);if(!n.transitions){n.transitions=Object.create(null);for(let e=0;e<t;e++){let t=n[e];if(!t)continue;let r,i=n.transitions;for(let e=0,n=t.length;e<n;e++){let n=t[e];r=i[n],r||(r=i[n]=Object.create(null)),i=r}i[St]=e+64}this.lastNamedStructuresLength=t}u||(n.nextId=t+64)}let a;r&&(r=!1);try{o.randomAccessStructure&&t&&t.constructor&&t.constructor===Object?v(t):m(t);let u=bt;if(bt&&Bt(e,m,0),i&&i.idsToInsert){let t=i.idsToInsert.sort(((t,e)=>t.offset>e.offset?1:-1)),r=t.length,n=-1;for(;u&&r>0;){let i=t[--r].offset+e;i<u.stringsPosition+e&&-1===n&&(n=0),i>u.position+e?n>=0&&(n+=6):(n>=0&&(dt.setUint32(u.position+e,dt.getUint32(u.position+e)+n),n=-1),u=u.previous,r++)}n>=0&&u&&dt.setUint32(u.position+e,dt.getUint32(u.position+e)+n),wt+=6*t.length,wt>yt&&E(wt),o.offset=wt;let s=function(t,e){let r,n=6*e.length,i=t.length-n;for(;r=e.pop();){let e=r.offset,s=r.id;t.copyWithin(e+n,e,i),n-=6;let o=e+n;t[o++]=214,t[o++]=105,t[o++]=s>>24,t[o++]=s>>16&255,t[o++]=s>>8&255,t[o++]=255&s,i=e}return t}(gt.subarray(e,wt),t);return i=null,s}return o.offset=wt,s&Dt?(gt.start=e,gt.end=wt,gt):gt.subarray(e,wt)}catch(t){throw a=t,t}finally{if(n&&(w(),r&&o.saveStructures)){let r=n.sharedLength||0,i=gt.subarray(e,wt),u=function(t,e){return t.isCompatible=t=>{let r=!t||(e.lastNamedStructuresLength||0)===t.length;return r||e._mergeStructures(t),r},t}(n,o);if(!a)return!1===o.saveStructures(u,u.isCompatible)?o.pack(t,s):(o.lastNamedStructuresLength=r,gt.length>1073741824&&(gt=null),i)}gt.length>1073741824&&(gt=null),s&Rt&&(wt=e)}};const w=()=>{y<10&&y++;let t=n.sharedLength||0;if(n.length>t&&!u&&(n.length=t),d>1e4)n.transitions=null,y=0,d=0,p.length>0&&(p=[]);else if(p.length>0&&!u){for(let t=0,e=p.length;t<e;t++)p[t][St]=0;p=[]}},b=t=>{var e=t.length;e<16?gt[wt++]=144|e:e<65536?(gt[wt++]=220,gt[wt++]=e>>8,gt[wt++]=255&e):(gt[wt++]=221,dt.setUint32(wt,e),wt+=4);for(let r=0;r<e;r++)m(t[r])},m=t=>{wt>yt&&(gt=E(wt));var r,n=typeof t;if("string"===n){let n,i=t.length;if(bt&&i>=4&&i<4096){if((bt.size+=i)>21760){let t,r,n=(bt[0]?3*bt[0].length+bt[1].length:0)+10;wt+n>yt&&(gt=E(wt+n)),bt.position?(r=bt,gt[wt]=200,wt+=3,gt[wt++]=98,t=wt-e,wt+=4,Bt(e,m,0),dt.setUint16(t+e-3,wt-e-t)):(gt[wt++]=214,gt[wt++]=98,t=wt-e,wt+=4),bt=["",""],bt.previous=r,bt.size=0,bt.position=t}let r=mt.test(t);return bt[r?0:1]+=t,gt[wt++]=193,void m(r?-i:i)}n=i<32?1:i<256?2:i<65536?3:5;let o=3*i;if(wt+o>yt&&(gt=E(wt+o)),i<64||!s){let e,s,o,u=wt+n;for(e=0;e<i;e++)s=t.charCodeAt(e),s<128?gt[u++]=s:s<2048?(gt[u++]=s>>6|192,gt[u++]=63&s|128):55296==(64512&s)&&56320==(64512&(o=t.charCodeAt(e+1)))?(s=65536+((1023&s)<<10)+(1023&o),e++,gt[u++]=s>>18|240,gt[u++]=s>>12&63|128,gt[u++]=s>>6&63|128,gt[u++]=63&s|128):(gt[u++]=s>>12|224,gt[u++]=s>>6&63|128,gt[u++]=63&s|128);r=u-wt-n}else r=s(t,wt+n);r<32?gt[wt++]=160|r:r<256?(n<2&>.copyWithin(wt+2,wt+1,wt+1+r),gt[wt++]=217,gt[wt++]=r):r<65536?(n<3&>.copyWithin(wt+3,wt+2,wt+2+r),gt[wt++]=218,gt[wt++]=r>>8,gt[wt++]=255&r):(n<5&>.copyWithin(wt+5,wt+3,wt+3+r),gt[wt++]=219,dt.setUint32(wt,r),wt+=4),wt+=r}else if("number"===n)if(t>>>0===t)t<32||t<128&&!1===this.useRecords||t<64&&!this.randomAccessStructure?gt[wt++]=t:t<256?(gt[wt++]=204,gt[wt++]=t):t<65536?(gt[wt++]=205,gt[wt++]=t>>8,gt[wt++]=255&t):(gt[wt++]=206,dt.setUint32(wt,t),wt+=4);else if(t>>0===t)t>=-32?gt[wt++]=256+t:t>=-128?(gt[wt++]=208,gt[wt++]=t+256):t>=-32768?(gt[wt++]=209,dt.setInt16(wt,t),wt+=2):(gt[wt++]=210,dt.setInt32(wt,t),wt+=4);else{let e;if((e=this.useFloat32)>0&&t<4294967296&&t>=-2147483648){let r;if(gt[wt++]=202,dt.setFloat32(wt,t),e<4||(r=t*H[(127>[wt])<<1|gt[wt+1]>>7])>>0===r)return void(wt+=4);wt--}gt[wt++]=203,dt.setFloat64(wt,t),wt+=8}else if("object"===n||"function"===n)if(t){if(i){let r=i.get(t);if(r){if(!r.id){let t=i.idsToInsert||(i.idsToInsert=[]);r.id=t.push(r)}return gt[wt++]=214,gt[wt++]=112,dt.setUint32(wt,r.id),void(wt+=4)}i.set(t,{offset:wt-e})}let s=t.constructor;if(s===Object)A(t);else if(s===Array)b(t);else if(s===Map)if(this.mapAsEmptyObject)gt[wt++]=128;else{(r=t.size)<16?gt[wt++]=128|r:r<65536?(gt[wt++]=222,gt[wt++]=r>>8,gt[wt++]=255&r):(gt[wt++]=223,dt.setUint32(wt,r),wt+=4);for(let[e,r]of t)m(e),m(r)}else{for(let e=0,r=st.length;e<r;e++){if(t instanceof ot[e]){let r=st[e];if(r.write){r.type&&(gt[wt++]=212,gt[wt++]=r.type,gt[wt++]=0);let e=r.write.call(this,t);return void(e===t?Array.isArray(t)?b(t):A(t):m(e))}let n,i=gt,s=dt,o=wt;gt=null;try{n=r.pack.call(this,t,(t=>(gt=i,i=null,wt+=t,wt>yt&&E(wt),{target:gt,targetView:dt,position:wt-t})),m)}finally{i&&(gt=i,dt=s,wt=o,yt=gt.length-10)}return void(n&&(n.length+wt>yt&&E(n.length+wt),wt=Et(n,gt,wt,r.type)))}}if(Array.isArray(t))b(t);else{if(t.toJSON){const e=t.toJSON();if(e!==t)return m(e)}if("function"===n)return m(this.writeFunction&&this.writeFunction(t));A(t)}}}else gt[wt++]=192;else if("boolean"===n)gt[wt++]=t?195:194;else if("bigint"===n){if(t<BigInt(1)<<BigInt(63)&&t>=-(BigInt(1)<<BigInt(63)))gt[wt++]=211,dt.setBigInt64(wt,t);else if(t<BigInt(1)<<BigInt(64)&&t>0)gt[wt++]=207,dt.setBigUint64(wt,t);else{if(!this.largeBigIntToFloat){if(this.largeBigIntToString)return m(t.toString());if(this.useBigIntExtension&&t<BigInt(2)**BigInt(1023)&&t>-(BigInt(2)**BigInt(1023))){gt[wt++]=199,wt++,gt[wt++]=66;let e,r=[];do{let n=t&BigInt(255);e=(n&BigInt(128))===(t<BigInt(0)?BigInt(128):BigInt(0)),r.push(n),t>>=BigInt(8)}while(t!==BigInt(0)&&t!==BigInt(-1)||!e);gt[wt-2]=r.length;for(let t=r.length;t>0;)gt[wt++]=Number(r[--t]);return}throw new RangeError(t+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}gt[wt++]=203,dt.setFloat64(wt,Number(t))}wt+=8}else{if("undefined"!==n)throw new Error("Unknown type: "+n);this.encodeUndefinedAsNil?gt[wt++]=192:(gt[wt++]=212,gt[wt++]=0,gt[wt++]=0)}},S=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?t=>{let e;if(this.skipValues){e=[];for(let r in t)"function"==typeof t.hasOwnProperty&&!t.hasOwnProperty(r)||this.skipValues.includes(t[r])||e.push(r)}else e=Object.keys(t);let r,n=e.length;if(n<16?gt[wt++]=128|n:n<65536?(gt[wt++]=222,gt[wt++]=n>>8,gt[wt++]=255&n):(gt[wt++]=223,dt.setUint32(wt,n),wt+=4),this.coercibleKeyAsNumber)for(let i=0;i<n;i++){r=e[i];let n=Number(r);m(isNaN(n)?r:n),m(t[r])}else for(let i=0;i<n;i++)m(r=e[i]),m(t[r])}:t=>{gt[wt++]=222;let r=wt-e;wt+=2;let n=0;for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&(m(e),m(t[e]),n++);if(n>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');gt[r+++e]=n>>8,gt[r+e]=255&n},I=!1===this.useRecords?S:t.progressiveRecords&&!f?t=>{let r,i,s=n.transitions||(n.transitions=Object.create(null)),o=wt++-e;for(let u in t)if("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(u)){if(r=s[u],r)s=r;else{let a=Object.keys(t),l=s;s=n.transitions;let c=0;for(let t=0,e=a.length;t<e;t++){let e=a[t];r=s[e],r||(r=s[e]=Object.create(null),c++),s=r}o+e+1==wt?(wt--,B(s,a,c)):k(s,a,o,c),i=!0,s=l[u]}m(t[u])}if(!i){let r=s[St];r?gt[o+e]=r:k(s,Object.keys(t),o,0)}}:t=>{let e,r=n.transitions||(n.transitions=Object.create(null)),i=0;for(let n in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(n))&&(e=r[n],e||(e=r[n]=Object.create(null),i++),r=e);let s=r[St];s?s>=96&&f?(gt[wt++]=96+(31&(s-=96)),gt[wt++]=s>>5):gt[wt++]=s:B(r,r.__keys__||Object.keys(t),i);for(let e in t)("function"!=typeof t.hasOwnProperty||t.hasOwnProperty(e))&&m(t[e])},U="function"==typeof this.useRecords&&this.useRecords,A=U?t=>{U(t)?I(t):S(t)}:I,E=t=>{let r;if(t>16777216){if(t-e>ht)throw new Error("Packed buffer would be larger than maximum buffer size");r=Math.min(ht,4096*Math.round(Math.max((t-e)*(t>67108864?1.25:2),4194304)/4096))}else r=1+(Math.max(t-e<<2,gt.length-1)>>12)<<12;let n=new ct(r);return dt=n.dataView||(n.dataView=new DataView(n.buffer,0,r)),t=Math.min(t,gt.length),gt.copy?gt.copy(n,0,e,t):n.set(gt.slice(e,t)),wt-=e,e=0,yt=n.length-10,gt=n},B=(t,e,i)=>{let s=n.nextId;s||(s=64),s<h&&this.shouldShareStructure&&!this.shouldShareStructure(e)?(s=n.nextOwnId,s<g||(s=h),n.nextOwnId=s+1):(s>=g&&(s=h),n.nextId=s+1);let o=e.highByte=s>=96&&f?s-96>>5:-1;t[St]=s,t.__keys__=e,n[s-64]=e,s<h?(e.isShared=!0,n.sharedLength=s-63,r=!0,o>=0?(gt[wt++]=96+(31&s),gt[wt++]=o):gt[wt++]=s):(o>=0?(gt[wt++]=213,gt[wt++]=114,gt[wt++]=96+(31&s),gt[wt++]=o):(gt[wt++]=212,gt[wt++]=114,gt[wt++]=s),i&&(d+=y*i),p.length>=c&&(p.shift()[St]=0),p.push(t),m(e))},k=(t,r,n,i)=>{let s=gt,o=wt,u=yt,a=e;gt=pt,wt=0,e=0,gt||(pt=gt=new ct(8192)),yt=gt.length-10,B(t,r,i),pt=gt;let l=wt;if(gt=s,wt=o,yt=u,e=a,l>1){let t=wt+l-1;t>yt&&E(t);let r=n+e;gt.copyWithin(r+l,r+1,wt),gt.set(pt.slice(0,l),r),wt=t}else gt[n+e]=pt[0]},v=t=>{let i=undefined(t,gt,e,wt,n,E,((t,e,n)=>{if(n)return r=!0;wt=e;let i=gt;return m(t),w(),i!==gt?{position:wt,targetView:dt,target:gt}:wt}),this);if(0===i)return A(t);wt=i}}useBuffer(t){gt=t,gt.dataView||(gt.dataView=new DataView(gt.buffer,gt.byteOffset,gt.byteLength)),wt=0}set position(t){wt=t}get position(){return wt}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function Ut(t,e,r,n){let i=t.byteLength;if(i+1<256){var{target:s,position:o}=r(4+i);s[o++]=199,s[o++]=i+1}else if(i+1<65536){var{target:s,position:o}=r(5+i);s[o++]=200,s[o++]=i+1>>8,s[o++]=i+1&255}else{var{target:s,position:o,targetView:u}=r(7+i);s[o++]=201,u.setUint32(o,i+1),o+=4}s[o++]=116,s[o++]=e,t.buffer||(t=new Uint8Array(t)),s.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o)}function At(t,e){let r=t.byteLength;var n,i;if(r<256){var{target:n,position:i}=e(r+2);n[i++]=196,n[i++]=r}else if(r<65536){var{target:n,position:i}=e(r+3);n[i++]=197,n[i++]=r>>8,n[i++]=255&r}else{var{target:n,position:i,targetView:s}=e(r+5);n[i++]=198,s.setUint32(i,r),i+=4}n.set(t,i)}function Et(t,e,r,n){let i=t.length;switch(i){case 1:e[r++]=212;break;case 2:e[r++]=213;break;case 4:e[r++]=214;break;case 8:e[r++]=215;break;case 16:e[r++]=216;break;default:i<256?(e[r++]=199,e[r++]=i):i<65536?(e[r++]=200,e[r++]=i>>8,e[r++]=255&i):(e[r++]=201,e[r++]=i>>24,e[r++]=i>>16&255,e[r++]=i>>8&255,e[r++]=255&i)}return e[r++]=n,e.set(t,r),r+=i}function Bt(t,e,r){if(bt.length>0){dt.setUint32(bt.position+t,wt+r-bt.position-t),bt.stringsPosition=wt-t;let n=bt;bt=null,e(n[0]),e(n[1])}}ot=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,d],st=[{pack(t,e,r){let n=t.getTime()/1e3;if((this.useTimestamp32||0===t.getMilliseconds())&&n>=0&&n<4294967296){let{target:t,targetView:r,position:i}=e(6);t[i++]=214,t[i++]=255,r.setUint32(i,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:s}=e(10);r[s++]=215,r[s++]=255,i.setUint32(s,4e6*t.getMilliseconds()+(n/1e3/4294967296>>0)),i.setUint32(s+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),r(this.onInvalidDate());let{target:t,targetView:n,position:i}=e(3);t[i++]=212,t[i++]=255,t[i++]=255}else{let{target:r,targetView:i,position:s}=e(15);r[s++]=199,r[s++]=12,r[s++]=255,i.setUint32(s,1e6*t.getMilliseconds()),i.setBigInt64(s+4,BigInt(Math.floor(n)))}}},{pack(t,e,r){if(this.setAsEmptyObject)return e(0),r({});let n=Array.from(t),{target:i,position:s}=e(this.moreTypes?3:0);this.moreTypes&&(i[s++]=212,i[s++]=115,i[s++]=0),r(n)}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=101,n[i++]=0),r([t.name,t.message,t.cause])}},{pack(t,e,r){let{target:n,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(n[i++]=212,n[i++]=120,n[i++]=0),r([t.source,t.flags])}},{pack(t,e){this.moreTypes?Ut(t,16,e):At(lt?Buffer.from(t):new Uint8Array(t),e)}},{pack(t,e){let r=t.constructor;r!==ft&&this.moreTypes?Ut(t,Y.indexOf(r.name),e):At(t,e)}},{pack(t,e){let{target:r,position:n}=e(1);r[n]=193}}];let kt=new It({useRecords:!1});const vt=kt.pack,Ot=kt.pack,_t=It,{NEVER:xt,ALWAYS:Tt,DECIMAL_ROUND:jt,DECIMAL_FIT:Mt}=nt,Dt=512,Rt=1024,Vt=2048;const Lt=function(t,e={}){if(!t||"object"!=typeof t)throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const r=new S(e);let n;const i=t=>{let e;n&&(t=Buffer.concat([n,t]),n=void 0);try{e=r.unpackMultiple(t)}catch(r){if(!r.incomplete)throw r;n=t.slice(r.lastPosition),e=r.values}return e};return"function"==typeof t[Symbol.iterator]?function*(){for(const e of t)yield*i(e)}():"function"==typeof t[Symbol.asyncIterator]?async function*(){for await(const e of t)yield*i(e)}():void 0},Nt=function(t,e={}){if(t&&"object"==typeof t){if("function"==typeof t[Symbol.iterator])return function*(t,e){const r=new It(e);for(const e of t)yield r.pack(e)}(t,e);if("function"==typeof t.then||"function"==typeof t[Symbol.asyncIterator])return async function*(t,e){const r=new It(e);for await(const e of t)yield r.pack(e)}(t,e);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable")};t.ALWAYS=Tt,t.C1=y,t.DECIMAL_FIT=Mt,t.DECIMAL_ROUND=jt,t.Decoder=Q,t.Encoder=_t,t.FLOAT32_OPTIONS=nt,t.NEVER=xt,t.Packr=It,t.RESERVE_START_SPACE=Vt,t.RESET_BUFFER_MODE=Rt,t.REUSE_BUFFER_MODE=Dt,t.Unpackr=S,t.addExtension=function(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");ot.unshift(t.Class),st.unshift(t)}!function(t){t.unpack?g[t.type]=t.unpack:g[t.type]=t}(t)},t.clearSource=G,t.decode=rt,t.decodeIter=Lt,t.encode=Ot,t.encodeIter=Nt,t.isNativeAccelerationEnabled=!1,t.mapsAsObjects=!0,t.pack=vt,t.roundFloat32=function(t){ut[0]=t;let e=H[(127&at[3])<<1|at[2]>>7];return(e*t+(t>0?.5:-.5)>>0)/e},t.unpack=tt,t.unpackMultiple=et,t.useRecords=!1}));
- //# sourceMappingURL=index-no-eval.min.js.map
|