@imtbl/metrics 2.12.4-alpha.7 → 2.12.4-alpha.8
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/browser/index.js +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memorise } from 'lru-memorise';
|
|
2
2
|
import { getGlobalisedValue } from 'global-const';
|
|
3
3
|
|
|
4
|
-
var Ut=Object.defineProperty;var St=(s,c)=>{for(var p in c)Ut(s,p,{get:c[p],enumerable:!0});};function Br(s){throw new Error("Node.js process "+s+" is not supported by JSPM core outside of Node.js")}var G=[],tr=!1,H,cr=-1;function kt(){!tr||!H||(tr=!1,H.length?G=H.concat(G):cr=-1,G.length&&Vr());}function Vr(){if(!tr){var s=setTimeout(kt,0);tr=!0;for(var c=G.length;c;){for(H=G,G=[];++cr<c;)H&&H[cr].run();cr=-1,c=G.length;}H=null,tr=!1,clearTimeout(s);}}function _t(s){var c=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)c[p-1]=arguments[p];G.push(new Gr(s,c)),G.length===1&&!tr&&setTimeout(Vr,0);}function Gr(s,c){this.fun=s,this.array=c;}Gr.prototype.run=function(){this.fun.apply(null,this.array);};var Pt="browser",Rt="x64",bt="browser",Nt={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},vt=["/usr/bin/node"],Mt=[],Ct="v16.8.0",Lt={},Dt=function(s,c){console.warn((c?c+": ":"")+s);},$t=function(s){Br("binding");},Ft=function(s){return 0},Ot=function(){return "/"},Vt=function(s){},Gt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function M(){}var Yt=M,Kt=[];function jt(s){Br("_linkedBinding");}var Ht={},Wt=!1,qt={};function Xt(s){Br("dlopen");}function Jt(){return []}function zt(){return []}var Qt=M,Zt=M,Tr=function(){return {}},re=Tr,te=Tr,ee=M,ne=M,ie=M,oe={};function se(s,c){if(!s)throw new Error(c||"assertion error")}var ue={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ae=M,ce=M;function pe(){return !1}var le=M,fe=M,he=M,de=M,me=M,we=void 0,ge=void 0,ye=void 0,Ee=M,Ie=2,Be=1,Te="/bin/usr/node",Ae=9229,xe="node",Ue=[],Se=M,K={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};K.now===void 0&&(yr=Date.now(),K.timing&&K.timing.navigationStart&&(yr=K.timing.navigationStart),K.now=()=>Date.now()-yr);var yr;function ke(){return K.now()/1e3}var Er=1e9;function Ir(s){var c=Math.floor((Date.now()-K.now())*.001),p=K.now()*.001,l=Math.floor(p)+c,h=Math.floor(p%1*1e9);return s&&(l=l-s[0],h=h-s[1],h<0&&(l--,h+=Er)),[l,h]}Ir.bigint=function(s){var c=Ir(s);return typeof BigInt>"u"?c[0]*Er+c[1]:BigInt(c[0]*Er)+BigInt(c[1])};var _e=10,Pe={},Re=0;function j(){return T}var be=j,Ne=j,ve=j,Me=j,Ce=j,Le=M,De=j,$e=j;function Fe(s){return []}var T={version:Ct,versions:Lt,arch:Rt,platform:bt,release:Gt,_rawDebug:Yt,moduleLoadList:Kt,binding:$t,_linkedBinding:jt,_events:Pe,_eventsCount:Re,_maxListeners:_e,on:j,addListener:be,once:Ne,off:ve,removeListener:Me,removeAllListeners:Ce,emit:Le,prependListener:De,prependOnceListener:$e,listeners:Fe,domain:Ht,_exiting:Wt,config:qt,dlopen:Xt,uptime:ke,_getActiveRequests:Jt,_getActiveHandles:zt,reallyExit:Qt,_kill:Zt,cpuUsage:Tr,resourceUsage:re,memoryUsage:te,kill:ee,exit:ne,openStdin:ie,allowedNodeEnvironmentFlags:oe,assert:se,features:ue,_fatalExceptions:ae,setUncaughtExceptionCaptureCallback:ce,hasUncaughtExceptionCaptureCallback:pe,emitWarning:Dt,nextTick:_t,_tickCallback:le,_debugProcess:fe,_debugEnd:he,_startProfilerIdleNotifier:de,_stopProfilerIdleNotifier:me,stdout:we,stdin:ye,stderr:ge,abort:Ee,umask:Ft,chdir:Vt,cwd:Ot,env:Nt,title:Pt,argv:vt,execArgv:Mt,pid:Ie,ppid:Be,execPath:Te,debugPort:Ae,hrtime:Ir,argv0:xe,_preload_modules:Ue,setSourceMapsEnabled:Se};var nr={},Yr=!1;function Oe(){if(Yr)return nr;Yr=!0,nr.byteLength=E,nr.toByteArray=C,nr.fromByteArray=_;for(var s=[],c=[],p=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,w=l.length;h<w;++h)s[h]=l[h],c[l.charCodeAt(h)]=h;c[45]=62,c[95]=63;function o(f){var d=f.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=d);var A=g===d?0:4-g%4;return [g,A]}function E(f){var d=o(f),g=d[0],A=d[1];return (g+A)*3/4-A}function b(f,d,g){return (d+g)*3/4-g}function C(f){var d,g=o(f),A=g[0],v=g[1],P=new p(b(f,A,v)),D=0,F=v>0?A-4:A,L;for(L=0;L<F;L+=4)d=c[f.charCodeAt(L)]<<18|c[f.charCodeAt(L+1)]<<12|c[f.charCodeAt(L+2)]<<6|c[f.charCodeAt(L+3)],P[D++]=d>>16&255,P[D++]=d>>8&255,P[D++]=d&255;return v===2&&(d=c[f.charCodeAt(L)]<<2|c[f.charCodeAt(L+1)]>>4,P[D++]=d&255),v===1&&(d=c[f.charCodeAt(L)]<<10|c[f.charCodeAt(L+1)]<<4|c[f.charCodeAt(L+2)]>>2,P[D++]=d>>8&255,P[D++]=d&255),P}function B(f){return s[f>>18&63]+s[f>>12&63]+s[f>>6&63]+s[f&63]}function k(f,d,g){for(var A,v=[],P=d;P<g;P+=3)A=(f[P]<<16&16711680)+(f[P+1]<<8&65280)+(f[P+2]&255),v.push(B(A));return v.join("")}function _(f){for(var d,g=f.length,A=g%3,v=[],P=16383,D=0,F=g-A;D<F;D+=P)v.push(k(f,D,D+P>F?F:D+P));return A===1?(d=f[g-1],v.push(s[d>>2]+s[d<<4&63]+"==")):A===2&&(d=(f[g-2]<<8)+f[g-1],v.push(s[d>>10]+s[d>>4&63]+s[d<<2&63]+"=")),v.join("")}return nr}var pr={},Kr=!1;function Ve(){if(Kr)return pr;Kr=!0;return pr.read=function(s,c,p,l,h){var w,o,E=h*8-l-1,b=(1<<E)-1,C=b>>1,B=-7,k=p?h-1:0,_=p?-1:1,f=s[c+k];for(k+=_,w=f&(1<<-B)-1,f>>=-B,B+=E;B>0;w=w*256+s[c+k],k+=_,B-=8);for(o=w&(1<<-B)-1,w>>=-B,B+=l;B>0;o=o*256+s[c+k],k+=_,B-=8);if(w===0)w=1-C;else {if(w===b)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,l),w=w-C;}return (f?-1:1)*o*Math.pow(2,w-l)},pr.write=function(s,c,p,l,h,w){var o,E,b,C=w*8-h-1,B=(1<<C)-1,k=B>>1,_=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=l?0:w-1,d=l?1:-1,g=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(E=isNaN(c)?1:0,o=B):(o=Math.floor(Math.log(c)/Math.LN2),c*(b=Math.pow(2,-o))<1&&(o--,b*=2),o+k>=1?c+=_/b:c+=_*Math.pow(2,1-k),c*b>=2&&(o++,b/=2),o+k>=B?(E=0,o=B):o+k>=1?(E=(c*b-1)*Math.pow(2,h),o=o+k):(E=c*Math.pow(2,k-1)*Math.pow(2,h),o=0));h>=8;s[p+f]=E&255,f+=d,E/=256,h-=8);for(o=o<<h|E,C+=h;C>0;s[p+f]=o&255,f+=d,o/=256,C-=8);s[p+f-d]|=g*128;},pr}var W={},jr=!1;function Ge(){if(jr)return W;jr=!0;let s=Oe(),c=Ve(),p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;W.Buffer=o,W.SlowBuffer=v,W.INSPECT_MAX_BYTES=50;let l=2147483647;W.kMaxLength=l,o.TYPED_ARRAY_SUPPORT=h(),!o.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 h(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return !1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function w(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,o.prototype),r}function o(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return E(e,r,t)}o.poolSize=8192;function E(e,r,t){if(typeof e=="string")return k(e,r);if(ArrayBuffer.isView(e))return f(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(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return d(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return o.from(n,r,t);let i=g(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return o.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}o.from=function(e,r,t){return E(e,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function b(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 C(e,r,t){return b(e),e<=0?w(e):r!==void 0?typeof t=="string"?w(e).fill(r,t):w(e).fill(r):w(e)}o.alloc=function(e,r,t){return C(e,r,t)};function B(e){return b(e),w(e<0?0:A(e)|0)}o.allocUnsafe=function(e){return B(e)},o.allocUnsafeSlow=function(e){return B(e)};function k(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=P(e,r)|0,n=w(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function _(e){let r=e.length<0?0:A(e.length)|0,t=w(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function f(e){if(O(e,Uint8Array)){let r=new Uint8Array(e);return d(r.buffer,r.byteOffset,r.byteLength)}return _(e)}function d(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,o.prototype),n}function g(e){if(o.isBuffer(e)){let r=A(e.length)|0,t=w(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||gr(e.length)?w(0):_(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _(e.data)}function A(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function v(e){return +e!=e&&(e=0),o.alloc(+e)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let u=0,a=Math.min(n,i);u<a;++u)if(r[u]!==t[u]){n=r[u],i=t[u];break}return n<i?-1:i<n?1:0},o.isEncoding=function(r){switch(String(r).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}},o.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;let i=o.allocUnsafe(t),u=0;for(n=0;n<r.length;++n){let a=r[n];if(O(a,Uint8Array))u+a.length>i.length?(o.isBuffer(a)||(a=o.from(a)),a.copy(i,u)):Uint8Array.prototype.set.call(i,a,u);else if(o.isBuffer(a))a.copy(i,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=a.length;}return i};function P(e,r){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(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);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Or(e).length;default:if(i)return n?-1:wr(e).length;r=(""+r).toLowerCase(),i=!0;}}o.byteLength=P;function D(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return "";for(e||(e="utf8");;)switch(e){case"hex":return wt(this,r,t);case"utf8":case"utf-8":return br(this,r,t);case"ascii":return dt(this,r,t);case"latin1":case"binary":return mt(this,r,t);case"base64":return ft(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}o.prototype._isBuffer=!0;function F(e,r,t){let n=e[r];e[r]=e[t],e[t]=n;}o.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)F(this,t,t+1);return this},o.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)F(this,t,t+3),F(this,t+1,t+2);return this},o.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)F(this,t,t+7),F(this,t+1,t+6),F(this,t+2,t+5),F(this,t+3,t+4);return this},o.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?br(this,0,r):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(r){if(!o.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0},o.prototype.inspect=function(){let r="",t=W.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"},p&&(o.prototype[p]=o.prototype.inspect),o.prototype.compare=function(r,t,n,i,u){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),u===void 0&&(u=this.length),t<0||n>r.length||i<0||u>this.length)throw new RangeError("out of range index");if(i>=u&&t>=n)return 0;if(i>=u)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,u>>>=0,this===r)return 0;let a=u-i,m=n-t,x=Math.min(a,m),I=this.slice(i,u),U=r.slice(t,n);for(let y=0;y<x;++y)if(I[y]!==U[y]){a=I[y],m=U[y];break}return a<m?-1:m<a?1:0};function L(e,r,t,n,i){if(e.length===0)return -1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,gr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return -1;t=e.length-1;}else if(t<0)if(i)t=0;else return -1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:Rr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Rr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Rr(e,r,t,n,i){let u=1,a=e.length,m=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return -1;u=2,a/=2,m/=2,t/=2;}function x(U,y){return u===1?U[y]:U.readUInt16BE(y*u)}let I;if(i){let U=-1;for(I=t;I<a;I++)if(x(e,I)===x(r,U===-1?0:I-U)){if(U===-1&&(U=I),I-U+1===m)return U*u}else U!==-1&&(I-=I-U),U=-1;}else for(t+m>a&&(t=a-m),I=t;I>=0;I--){let U=!0;for(let y=0;y<m;y++)if(x(e,I+y)!==x(r,y)){U=!1;break}if(U)return I}return -1}o.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},o.prototype.indexOf=function(r,t,n){return L(this,r,t,n,!0)},o.prototype.lastIndexOf=function(r,t,n){return L(this,r,t,n,!1)};function ut(e,r,t,n){t=Number(t)||0;let i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let u=r.length;n>u/2&&(n=u/2);let a;for(a=0;a<n;++a){let m=parseInt(r.substr(a*2,2),16);if(gr(m))return a;e[t+a]=m;}return a}function at(e,r,t,n){return ar(wr(r,e.length-t),e,t,n)}function ct(e,r,t,n){return ar(Bt(r),e,t,n)}function pt(e,r,t,n){return ar(Or(r),e,t,n)}function lt(e,r,t,n){return ar(Tt(r,e.length-t),e,t,n)}o.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>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");let u=this.length-t;if((n===void 0||n>u)&&(n=u),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return ut(this,r,t,n);case"utf8":case"utf-8":return at(this,r,t,n);case"ascii":case"latin1":case"binary":return ct(this,r,t,n);case"base64":return pt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0;}},o.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,r,t){return r===0&&t===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(r,t))}function br(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i<t;){let u=e[i],a=null,m=u>239?4:u>223?3:u>191?2:1;if(i+m<=t){let x,I,U,y;switch(m){case 1:u<128&&(a=u);break;case 2:x=e[i+1],(x&192)===128&&(y=(u&31)<<6|x&63,y>127&&(a=y));break;case 3:x=e[i+1],I=e[i+2],(x&192)===128&&(I&192)===128&&(y=(u&15)<<12|(x&63)<<6|I&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:x=e[i+1],I=e[i+2],U=e[i+3],(x&192)===128&&(I&192)===128&&(U&192)===128&&(y=(u&15)<<18|(x&63)<<12|(I&63)<<6|U&63,y>65535&&y<1114112&&(a=y));}}a===null?(a=65533,m=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=m;}return ht(n)}let Nr=4096;function ht(e){let r=e.length;if(r<=Nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=Nr));return t}function dt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function mt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function wt(e,r,t){let n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let u=r;u<t;++u)i+=At[e[u]];return i}function gt(e,r,t){let n=e.slice(r,t),i="";for(let u=0;u<n.length-1;u+=2)i+=String.fromCharCode(n[u]+n[u+1]*256);return i}o.prototype.slice=function(r,t){let n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);let i=this.subarray(r,t);return Object.setPrototypeOf(i,o.prototype),i};function N(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],u=1,a=0;for(;++a<t&&(u*=256);)i+=this[r+a]*u;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r+--t],u=1;for(;t>0&&(u*=256);)i+=this[r+--t]*u;return i},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,u=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(u)<<BigInt(32))}),o.prototype.readBigUInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],u=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return (BigInt(i)<<BigInt(32))+BigInt(u)}),o.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],u=1,a=0;for(;++a<t&&(u*=256);)i+=this[r+a]*u;return u*=128,i>=u&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=t,u=1,a=this[r+--i];for(;i>0&&(u*=256);)a+=this[r+--i]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return (BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),o.prototype.readBigInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return (BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)}),o.prototype.readFloatLE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!1,52,8)};function $(e,r,t,n,i,u){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<u)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let m=Math.pow(2,8*n)-1;$(this,r,t,n,m,0);}let u=1,a=0;for(this[t]=r&255;++a<n&&(u*=256);)this[t+a]=r/u&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let m=Math.pow(2,8*n)-1;$(this,r,t,n,m,0);}let u=n-1,a=1;for(this[t+u]=r&255;--u>=0&&(a*=256);)this[t+u]=r/a&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function vr(e,r,t,n,i){Fr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,t}function Mr(e,r,t,n,i){Fr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t+7]=u,u=u>>8,e[t+6]=u,u=u>>8,e[t+5]=u,u=u>>8,e[t+4]=u;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=a,a=a>>8,e[t+2]=a,a=a>>8,e[t+1]=a,a=a>>8,e[t]=a,t+8}o.prototype.writeBigUInt64LE=Y(function(r,t=0){return vr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Y(function(r,t=0){return Mr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let u=0,a=1,m=0;for(this[t]=r&255;++u<n&&(a*=256);)r<0&&m===0&&this[t+u-1]!==0&&(m=1),this[t+u]=(r/a>>0)-m&255;return t+n},o.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let u=n-1,a=1,m=0;for(this[t+u]=r&255;--u>=0&&(a*=256);)r<0&&m===0&&this[t+u+1]!==0&&(m=1),this[t+u]=(r/a>>0)-m&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=Y(function(r,t=0){return vr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Y(function(r,t=0){return Mr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(e,r,t,n,i,u){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Lr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,4),c.write(e,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return Lr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return Lr(this,r,t,!1,n)};function Dr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,8),c.write(e,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return Dr(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return Dr(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,i){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<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),r.length-t<i-n&&(i=r.length-t+n);let u=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),u},o.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=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"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a);}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let u;if(typeof r=="number")for(u=t;u<n;++u)this[u]=r;else {let a=o.isBuffer(r)?r:o.from(r,i),m=a.length;if(m===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=a[u%m];}return this};let Z={};function mr(e,r,t){Z[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.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}`}};}mr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),mr("ERR_INVALID_ARG_TYPE",function(e,r){return `The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),mr("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=$r(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=$r(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function $r(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return `${e.slice(0,t)}${r}`}function yt(e,r,t){rr(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&er(r,e.length-(t+1));}function Fr(e,r,t,n,i,u){if(e>t||e<r){let a=typeof r=="bigint"?"n":"",m;throw r===0||r===BigInt(0)?m=`>= 0${a} and < 2${a} ** ${(u+1)*8}${a}`:m=`>= -(2${a} ** ${(u+1)*8-1}${a}) and < 2 ** ${(u+1)*8-1}${a}`,new Z.ERR_OUT_OF_RANGE("value",m,e)}yt(n,i,u);}function rr(e,r){if(typeof e!="number")throw new Z.ERR_INVALID_ARG_TYPE(r,"number",e)}function er(e,r,t){throw Math.floor(e)!==e?(rr(e,t),new Z.ERR_OUT_OF_RANGE("offset","an integer",e)):r<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${r}`,e)}let Et=/[^+/0-9A-Za-z-_]/g;function It(e){if(e=e.split("=")[0],e=e.trim().replace(Et,""),e.length<2)return "";for(;e.length%4!==0;)e=e+"=";return e}function wr(e,r){r=r||1/0;let t,n=e.length,i=null,u=[];for(let a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&u.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&u.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536;}else i&&(r-=3)>-1&&u.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;u.push(t);}else if(t<2048){if((r-=2)<0)break;u.push(t>>6|192,t&63|128);}else if(t<65536){if((r-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128);}else if(t<1114112){if((r-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128);}else throw new Error("Invalid code point")}return u}function Bt(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Tt(e,r){let t,n,i,u=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,u.push(i),u.push(n);return u}function Or(e){return s.toByteArray(It(e))}function ar(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function O(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function gr(e){return e!==e}let At=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i];}return r}();function Y(e){return typeof BigInt>"u"?xt:e}function xt(){throw new Error("BigInt not supported")}return W}var q=Ge();q.Buffer;q.SlowBuffer;q.INSPECT_MAX_BYTES;q.kMaxLength;var S=q.Buffer;q.INSPECT_MAX_BYTES;q.kMaxLength;var Ur={};St(Ur,{deleteItem:()=>He,getItem:()=>fr,setItem:()=>or});var ir=()=>typeof window>"u",lr=()=>!ir();var Ye="__IMX-",Ar=()=>lr()&&window.localStorage,Ke=s=>{if(s!==null)try{return JSON.parse(s)}catch{return s}},je=s=>typeof s=="string"?s:JSON.stringify(s),xr=s=>`${Ye}${s}`;function fr(s){if(Ar())return Ke(window.localStorage.getItem(xr(s)))}var or=(s,c)=>Ar()?(window.localStorage.setItem(xr(s),je(c)),!0):!1,He=s=>Ar()?(window.localStorage.removeItem(xr(s)),!0):!1;var Sr=0,Hr=s=>{let c=parseInt(s,10)*1e3,p=new Date(c),l=new Date;return Sr=p.getTime()-l.getTime(),Sr},Wr=()=>{let s=new Date().getTime()+Sr;return new Date(s).toISOString()};var sr=(E=>(E.RUNTIME_ID="rid",E.PASSPORT_CLIENT_ID="passportClientId",E.ENVIRONMENT="env",E.PUBLISHABLE_API_KEY="pak",E.IDENTITY="uid",E.DOMAIN="domain",E.SDK_VERSION="sdkVersion",E))(sr||{});var We="https://api.immutable.com",qe=s=>{if(typeof S<"u")return S.from(s,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(s)));throw new Error("Base64 encoding not supported in this environment")};async function hr(s,c){let p=JSON.stringify(c),l={payload:qe(p)},h=await fetch(`${We}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!h.ok){let w=await h.text().catch(()=>"");throw new Error(`Request failed (${h.status}): ${w||h.statusText}`)}return h.json()}var X,J,Xe=()=>{X=fr("metrics-events")||[],J=fr("metrics-runtime")||{};};Xe();var V=(s,c)=>{J={...J,[s]:c},or("metrics-runtime",J);},ur=s=>{if(J[s]!==void 0)return J[s]},qr=()=>J,Xr=()=>X,Jr=s=>{X.push(s),or("metrics-events",X);},zr=s=>{X=X.slice(s),or("metrics-events",X);},dr=s=>{let c=[];return Object.entries(s).forEach(([p,l])=>{(typeof p=="string"||typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&c.push([p,l.toString()]);}),c};var kr="2.12.4-alpha.7",Je=()=>ir()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",ze=()=>{if(ir())return "";let s;try{window.self!==window.top&&(s=Je());}catch{}return s||(s=window.location.hostname),s},Qe=()=>{if(V("sdkVersion",kr),ir())return {browser:"nodejs",sdkVersion:kr};let s=ze();return s&&V("domain",s),{sdkVersion:kr,browser:window.navigator.userAgent,domain:s,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},_r=!1,Qr=()=>_r,Zr=async()=>{_r=!0;try{let s=dr(Qe()),c=ur("rid"),p=ur("uid"),h=await hr("/v1/sdk/initialise",{version:1,data:{runtimeDetails:s,runtimeId:c,uId:p}}),{runtimeId:w,sTime:o}=h;V("rid",w),Hr(o);}catch{_r=!1;}};function R(s,c){return (...p)=>{try{let l=s(...p);return l instanceof Promise?l.catch(()=>c):l}catch{return c}}}function Ze(){return lr()||typeof T>"u"?!1:T.env.JEST_WORKER_ID!==void 0}var rt=R(Ze,!1);var et="imtbl__metrics",tn=5e3,en=1e3,z=(s,c)=>getGlobalisedValue(et,s,c),nt=(s,c)=>{let p=memorise(c,{lruOptions:{ttl:tn,max:en}});return getGlobalisedValue(et,s,p)};var nn=5e3,on=(s,c,p)=>{let l={event:`${s}.${c}`,time:Wr(),...p&&{properties:dr(p)}};Jr(l);},Q=R(nt("track",on)),sn=async()=>{if(Qr()===!1){await Zr();return}let s=Xr();if(s.length===0)return;let c=s.length,p=qr();await hr("/v1/sdk/metrics",{version:1,data:{events:s,details:p}})instanceof Error||zr(c);},un=R(sn),ot=async()=>{await un(),setTimeout(ot,nn);},it=!1,an=()=>{it||(it=!0,ot());};rt()||R(z("startFlushing",an))();var Pr=(s,c,p,l)=>Q(s,c,{...l||{},duration:Math.round(p)});var st=()=>{let s=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${s()}${s()}-${s()}-${s()}-${s()}-${s()}${s()}${s()}`};var cn=(...s)=>{if(!s.some(l=>!!l))return {};let p={};return s.forEach(l=>{l&&(p={...p,...l});}),p},pn=s=>s.replace(/[^a-zA-Z0-9\s\-_]/g,""),ln=(s,c)=>`${s}_${pn(c)}`,fn=(s,c,p=!0,l)=>{let h=st(),w=Date.now(),o=0,E=0,b={},C=(..._)=>cn(b,..._,{flowId:h,flowName:c});b=C(l);let B=_=>{_&&(b=C(_));},k=(_,f)=>{let d=ln(c,_),g=0,A=performance.now();o>0&&(g=A-E);let v=C(f,{flowEventName:_,flowStep:o});Pr(s,d,g,v),o++,E=A;};return p&&k("Start"),{details:{moduleName:s,flowName:c,flowId:h,flowStartTime:w},addEvent:R(k),addFlowProperties:R(B)}},hn=R(fn);var dn=(s,c,p,l)=>{let{message:h}=p,w=p.stack||"",{cause:o}=p;o instanceof Error&&(w=`${w}
|
|
4
|
+
var Ut=Object.defineProperty;var St=(s,c)=>{for(var p in c)Ut(s,p,{get:c[p],enumerable:!0});};function Br(s){throw new Error("Node.js process "+s+" is not supported by JSPM core outside of Node.js")}var G=[],tr=!1,H,cr=-1;function kt(){!tr||!H||(tr=!1,H.length?G=H.concat(G):cr=-1,G.length&&Vr());}function Vr(){if(!tr){var s=setTimeout(kt,0);tr=!0;for(var c=G.length;c;){for(H=G,G=[];++cr<c;)H&&H[cr].run();cr=-1,c=G.length;}H=null,tr=!1,clearTimeout(s);}}function _t(s){var c=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)c[p-1]=arguments[p];G.push(new Gr(s,c)),G.length===1&&!tr&&setTimeout(Vr,0);}function Gr(s,c){this.fun=s,this.array=c;}Gr.prototype.run=function(){this.fun.apply(null,this.array);};var Pt="browser",Rt="x64",bt="browser",Nt={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},vt=["/usr/bin/node"],Mt=[],Ct="v16.8.0",Lt={},Dt=function(s,c){console.warn((c?c+": ":"")+s);},$t=function(s){Br("binding");},Ft=function(s){return 0},Ot=function(){return "/"},Vt=function(s){},Gt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function M(){}var Yt=M,Kt=[];function jt(s){Br("_linkedBinding");}var Ht={},Wt=!1,qt={};function Xt(s){Br("dlopen");}function Jt(){return []}function zt(){return []}var Qt=M,Zt=M,Tr=function(){return {}},re=Tr,te=Tr,ee=M,ne=M,ie=M,oe={};function se(s,c){if(!s)throw new Error(c||"assertion error")}var ue={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ae=M,ce=M;function pe(){return !1}var le=M,fe=M,he=M,de=M,me=M,we=void 0,ge=void 0,ye=void 0,Ee=M,Ie=2,Be=1,Te="/bin/usr/node",Ae=9229,xe="node",Ue=[],Se=M,K={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};K.now===void 0&&(yr=Date.now(),K.timing&&K.timing.navigationStart&&(yr=K.timing.navigationStart),K.now=()=>Date.now()-yr);var yr;function ke(){return K.now()/1e3}var Er=1e9;function Ir(s){var c=Math.floor((Date.now()-K.now())*.001),p=K.now()*.001,l=Math.floor(p)+c,h=Math.floor(p%1*1e9);return s&&(l=l-s[0],h=h-s[1],h<0&&(l--,h+=Er)),[l,h]}Ir.bigint=function(s){var c=Ir(s);return typeof BigInt>"u"?c[0]*Er+c[1]:BigInt(c[0]*Er)+BigInt(c[1])};var _e=10,Pe={},Re=0;function j(){return T}var be=j,Ne=j,ve=j,Me=j,Ce=j,Le=M,De=j,$e=j;function Fe(s){return []}var T={version:Ct,versions:Lt,arch:Rt,platform:bt,release:Gt,_rawDebug:Yt,moduleLoadList:Kt,binding:$t,_linkedBinding:jt,_events:Pe,_eventsCount:Re,_maxListeners:_e,on:j,addListener:be,once:Ne,off:ve,removeListener:Me,removeAllListeners:Ce,emit:Le,prependListener:De,prependOnceListener:$e,listeners:Fe,domain:Ht,_exiting:Wt,config:qt,dlopen:Xt,uptime:ke,_getActiveRequests:Jt,_getActiveHandles:zt,reallyExit:Qt,_kill:Zt,cpuUsage:Tr,resourceUsage:re,memoryUsage:te,kill:ee,exit:ne,openStdin:ie,allowedNodeEnvironmentFlags:oe,assert:se,features:ue,_fatalExceptions:ae,setUncaughtExceptionCaptureCallback:ce,hasUncaughtExceptionCaptureCallback:pe,emitWarning:Dt,nextTick:_t,_tickCallback:le,_debugProcess:fe,_debugEnd:he,_startProfilerIdleNotifier:de,_stopProfilerIdleNotifier:me,stdout:we,stdin:ye,stderr:ge,abort:Ee,umask:Ft,chdir:Vt,cwd:Ot,env:Nt,title:Pt,argv:vt,execArgv:Mt,pid:Ie,ppid:Be,execPath:Te,debugPort:Ae,hrtime:Ir,argv0:xe,_preload_modules:Ue,setSourceMapsEnabled:Se};var nr={},Yr=!1;function Oe(){if(Yr)return nr;Yr=!0,nr.byteLength=E,nr.toByteArray=C,nr.fromByteArray=_;for(var s=[],c=[],p=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,w=l.length;h<w;++h)s[h]=l[h],c[l.charCodeAt(h)]=h;c[45]=62,c[95]=63;function o(f){var d=f.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=d);var A=g===d?0:4-g%4;return [g,A]}function E(f){var d=o(f),g=d[0],A=d[1];return (g+A)*3/4-A}function b(f,d,g){return (d+g)*3/4-g}function C(f){var d,g=o(f),A=g[0],v=g[1],P=new p(b(f,A,v)),D=0,F=v>0?A-4:A,L;for(L=0;L<F;L+=4)d=c[f.charCodeAt(L)]<<18|c[f.charCodeAt(L+1)]<<12|c[f.charCodeAt(L+2)]<<6|c[f.charCodeAt(L+3)],P[D++]=d>>16&255,P[D++]=d>>8&255,P[D++]=d&255;return v===2&&(d=c[f.charCodeAt(L)]<<2|c[f.charCodeAt(L+1)]>>4,P[D++]=d&255),v===1&&(d=c[f.charCodeAt(L)]<<10|c[f.charCodeAt(L+1)]<<4|c[f.charCodeAt(L+2)]>>2,P[D++]=d>>8&255,P[D++]=d&255),P}function B(f){return s[f>>18&63]+s[f>>12&63]+s[f>>6&63]+s[f&63]}function k(f,d,g){for(var A,v=[],P=d;P<g;P+=3)A=(f[P]<<16&16711680)+(f[P+1]<<8&65280)+(f[P+2]&255),v.push(B(A));return v.join("")}function _(f){for(var d,g=f.length,A=g%3,v=[],P=16383,D=0,F=g-A;D<F;D+=P)v.push(k(f,D,D+P>F?F:D+P));return A===1?(d=f[g-1],v.push(s[d>>2]+s[d<<4&63]+"==")):A===2&&(d=(f[g-2]<<8)+f[g-1],v.push(s[d>>10]+s[d>>4&63]+s[d<<2&63]+"=")),v.join("")}return nr}var pr={},Kr=!1;function Ve(){if(Kr)return pr;Kr=!0;return pr.read=function(s,c,p,l,h){var w,o,E=h*8-l-1,b=(1<<E)-1,C=b>>1,B=-7,k=p?h-1:0,_=p?-1:1,f=s[c+k];for(k+=_,w=f&(1<<-B)-1,f>>=-B,B+=E;B>0;w=w*256+s[c+k],k+=_,B-=8);for(o=w&(1<<-B)-1,w>>=-B,B+=l;B>0;o=o*256+s[c+k],k+=_,B-=8);if(w===0)w=1-C;else {if(w===b)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,l),w=w-C;}return (f?-1:1)*o*Math.pow(2,w-l)},pr.write=function(s,c,p,l,h,w){var o,E,b,C=w*8-h-1,B=(1<<C)-1,k=B>>1,_=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=l?0:w-1,d=l?1:-1,g=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(E=isNaN(c)?1:0,o=B):(o=Math.floor(Math.log(c)/Math.LN2),c*(b=Math.pow(2,-o))<1&&(o--,b*=2),o+k>=1?c+=_/b:c+=_*Math.pow(2,1-k),c*b>=2&&(o++,b/=2),o+k>=B?(E=0,o=B):o+k>=1?(E=(c*b-1)*Math.pow(2,h),o=o+k):(E=c*Math.pow(2,k-1)*Math.pow(2,h),o=0));h>=8;s[p+f]=E&255,f+=d,E/=256,h-=8);for(o=o<<h|E,C+=h;C>0;s[p+f]=o&255,f+=d,o/=256,C-=8);s[p+f-d]|=g*128;},pr}var W={},jr=!1;function Ge(){if(jr)return W;jr=!0;let s=Oe(),c=Ve(),p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;W.Buffer=o,W.SlowBuffer=v,W.INSPECT_MAX_BYTES=50;let l=2147483647;W.kMaxLength=l,o.TYPED_ARRAY_SUPPORT=h(),!o.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 h(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return !1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function w(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,o.prototype),r}function o(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return E(e,r,t)}o.poolSize=8192;function E(e,r,t){if(typeof e=="string")return k(e,r);if(ArrayBuffer.isView(e))return f(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(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return d(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return o.from(n,r,t);let i=g(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return o.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}o.from=function(e,r,t){return E(e,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function b(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 C(e,r,t){return b(e),e<=0?w(e):r!==void 0?typeof t=="string"?w(e).fill(r,t):w(e).fill(r):w(e)}o.alloc=function(e,r,t){return C(e,r,t)};function B(e){return b(e),w(e<0?0:A(e)|0)}o.allocUnsafe=function(e){return B(e)},o.allocUnsafeSlow=function(e){return B(e)};function k(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=P(e,r)|0,n=w(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function _(e){let r=e.length<0?0:A(e.length)|0,t=w(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function f(e){if(O(e,Uint8Array)){let r=new Uint8Array(e);return d(r.buffer,r.byteOffset,r.byteLength)}return _(e)}function d(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,o.prototype),n}function g(e){if(o.isBuffer(e)){let r=A(e.length)|0,t=w(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||gr(e.length)?w(0):_(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _(e.data)}function A(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function v(e){return +e!=e&&(e=0),o.alloc(+e)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let u=0,a=Math.min(n,i);u<a;++u)if(r[u]!==t[u]){n=r[u],i=t[u];break}return n<i?-1:i<n?1:0},o.isEncoding=function(r){switch(String(r).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}},o.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;let i=o.allocUnsafe(t),u=0;for(n=0;n<r.length;++n){let a=r[n];if(O(a,Uint8Array))u+a.length>i.length?(o.isBuffer(a)||(a=o.from(a)),a.copy(i,u)):Uint8Array.prototype.set.call(i,a,u);else if(o.isBuffer(a))a.copy(i,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=a.length;}return i};function P(e,r){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(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);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Or(e).length;default:if(i)return n?-1:wr(e).length;r=(""+r).toLowerCase(),i=!0;}}o.byteLength=P;function D(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return "";for(e||(e="utf8");;)switch(e){case"hex":return wt(this,r,t);case"utf8":case"utf-8":return br(this,r,t);case"ascii":return dt(this,r,t);case"latin1":case"binary":return mt(this,r,t);case"base64":return ft(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}o.prototype._isBuffer=!0;function F(e,r,t){let n=e[r];e[r]=e[t],e[t]=n;}o.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)F(this,t,t+1);return this},o.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)F(this,t,t+3),F(this,t+1,t+2);return this},o.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)F(this,t,t+7),F(this,t+1,t+6),F(this,t+2,t+5),F(this,t+3,t+4);return this},o.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?br(this,0,r):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(r){if(!o.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0},o.prototype.inspect=function(){let r="",t=W.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"},p&&(o.prototype[p]=o.prototype.inspect),o.prototype.compare=function(r,t,n,i,u){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),u===void 0&&(u=this.length),t<0||n>r.length||i<0||u>this.length)throw new RangeError("out of range index");if(i>=u&&t>=n)return 0;if(i>=u)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,u>>>=0,this===r)return 0;let a=u-i,m=n-t,x=Math.min(a,m),I=this.slice(i,u),U=r.slice(t,n);for(let y=0;y<x;++y)if(I[y]!==U[y]){a=I[y],m=U[y];break}return a<m?-1:m<a?1:0};function L(e,r,t,n,i){if(e.length===0)return -1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,gr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return -1;t=e.length-1;}else if(t<0)if(i)t=0;else return -1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:Rr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Rr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Rr(e,r,t,n,i){let u=1,a=e.length,m=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return -1;u=2,a/=2,m/=2,t/=2;}function x(U,y){return u===1?U[y]:U.readUInt16BE(y*u)}let I;if(i){let U=-1;for(I=t;I<a;I++)if(x(e,I)===x(r,U===-1?0:I-U)){if(U===-1&&(U=I),I-U+1===m)return U*u}else U!==-1&&(I-=I-U),U=-1;}else for(t+m>a&&(t=a-m),I=t;I>=0;I--){let U=!0;for(let y=0;y<m;y++)if(x(e,I+y)!==x(r,y)){U=!1;break}if(U)return I}return -1}o.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},o.prototype.indexOf=function(r,t,n){return L(this,r,t,n,!0)},o.prototype.lastIndexOf=function(r,t,n){return L(this,r,t,n,!1)};function ut(e,r,t,n){t=Number(t)||0;let i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let u=r.length;n>u/2&&(n=u/2);let a;for(a=0;a<n;++a){let m=parseInt(r.substr(a*2,2),16);if(gr(m))return a;e[t+a]=m;}return a}function at(e,r,t,n){return ar(wr(r,e.length-t),e,t,n)}function ct(e,r,t,n){return ar(Bt(r),e,t,n)}function pt(e,r,t,n){return ar(Or(r),e,t,n)}function lt(e,r,t,n){return ar(Tt(r,e.length-t),e,t,n)}o.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>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");let u=this.length-t;if((n===void 0||n>u)&&(n=u),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return ut(this,r,t,n);case"utf8":case"utf-8":return at(this,r,t,n);case"ascii":case"latin1":case"binary":return ct(this,r,t,n);case"base64":return pt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0;}},o.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,r,t){return r===0&&t===e.length?s.fromByteArray(e):s.fromByteArray(e.slice(r,t))}function br(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i<t;){let u=e[i],a=null,m=u>239?4:u>223?3:u>191?2:1;if(i+m<=t){let x,I,U,y;switch(m){case 1:u<128&&(a=u);break;case 2:x=e[i+1],(x&192)===128&&(y=(u&31)<<6|x&63,y>127&&(a=y));break;case 3:x=e[i+1],I=e[i+2],(x&192)===128&&(I&192)===128&&(y=(u&15)<<12|(x&63)<<6|I&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:x=e[i+1],I=e[i+2],U=e[i+3],(x&192)===128&&(I&192)===128&&(U&192)===128&&(y=(u&15)<<18|(x&63)<<12|(I&63)<<6|U&63,y>65535&&y<1114112&&(a=y));}}a===null?(a=65533,m=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=m;}return ht(n)}let Nr=4096;function ht(e){let r=e.length;if(r<=Nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=Nr));return t}function dt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function mt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function wt(e,r,t){let n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let u=r;u<t;++u)i+=At[e[u]];return i}function gt(e,r,t){let n=e.slice(r,t),i="";for(let u=0;u<n.length-1;u+=2)i+=String.fromCharCode(n[u]+n[u+1]*256);return i}o.prototype.slice=function(r,t){let n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);let i=this.subarray(r,t);return Object.setPrototypeOf(i,o.prototype),i};function N(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],u=1,a=0;for(;++a<t&&(u*=256);)i+=this[r+a]*u;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r+--t],u=1;for(;t>0&&(u*=256);)i+=this[r+--t]*u;return i},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,u=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(u)<<BigInt(32))}),o.prototype.readBigUInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],u=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return (BigInt(i)<<BigInt(32))+BigInt(u)}),o.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],u=1,a=0;for(;++a<t&&(u*=256);)i+=this[r+a]*u;return u*=128,i>=u&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=t,u=1,a=this[r+--i];for(;i>0&&(u*=256);)a+=this[r+--i]*u;return u*=128,a>=u&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return (BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),o.prototype.readBigInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return (BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)}),o.prototype.readFloatLE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!1,52,8)};function $(e,r,t,n,i,u){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<u)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let m=Math.pow(2,8*n)-1;$(this,r,t,n,m,0);}let u=1,a=0;for(this[t]=r&255;++a<n&&(u*=256);)this[t+a]=r/u&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let m=Math.pow(2,8*n)-1;$(this,r,t,n,m,0);}let u=n-1,a=1;for(this[t+u]=r&255;--u>=0&&(a*=256);)this[t+u]=r/a&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function vr(e,r,t,n,i){Fr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,t}function Mr(e,r,t,n,i){Fr(r,n,i,e,t,7);let u=Number(r&BigInt(4294967295));e[t+7]=u,u=u>>8,e[t+6]=u,u=u>>8,e[t+5]=u,u=u>>8,e[t+4]=u;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=a,a=a>>8,e[t+2]=a,a=a>>8,e[t+1]=a,a=a>>8,e[t]=a,t+8}o.prototype.writeBigUInt64LE=Y(function(r,t=0){return vr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Y(function(r,t=0){return Mr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let u=0,a=1,m=0;for(this[t]=r&255;++u<n&&(a*=256);)r<0&&m===0&&this[t+u-1]!==0&&(m=1),this[t+u]=(r/a>>0)-m&255;return t+n},o.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let u=n-1,a=1,m=0;for(this[t+u]=r&255;--u>=0&&(a*=256);)r<0&&m===0&&this[t+u+1]!==0&&(m=1),this[t+u]=(r/a>>0)-m&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=Y(function(r,t=0){return vr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Y(function(r,t=0){return Mr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(e,r,t,n,i,u){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Lr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,4),c.write(e,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return Lr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return Lr(this,r,t,!1,n)};function Dr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,8),c.write(e,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return Dr(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return Dr(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,i){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<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),r.length-t<i-n&&(i=r.length-t+n);let u=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),u},o.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=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"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a);}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let u;if(typeof r=="number")for(u=t;u<n;++u)this[u]=r;else {let a=o.isBuffer(r)?r:o.from(r,i),m=a.length;if(m===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(u=0;u<n-t;++u)this[u+t]=a[u%m];}return this};let Z={};function mr(e,r,t){Z[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.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}`}};}mr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),mr("ERR_INVALID_ARG_TYPE",function(e,r){return `The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),mr("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=$r(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=$r(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function $r(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return `${e.slice(0,t)}${r}`}function yt(e,r,t){rr(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&er(r,e.length-(t+1));}function Fr(e,r,t,n,i,u){if(e>t||e<r){let a=typeof r=="bigint"?"n":"",m;throw r===0||r===BigInt(0)?m=`>= 0${a} and < 2${a} ** ${(u+1)*8}${a}`:m=`>= -(2${a} ** ${(u+1)*8-1}${a}) and < 2 ** ${(u+1)*8-1}${a}`,new Z.ERR_OUT_OF_RANGE("value",m,e)}yt(n,i,u);}function rr(e,r){if(typeof e!="number")throw new Z.ERR_INVALID_ARG_TYPE(r,"number",e)}function er(e,r,t){throw Math.floor(e)!==e?(rr(e,t),new Z.ERR_OUT_OF_RANGE("offset","an integer",e)):r<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${r}`,e)}let Et=/[^+/0-9A-Za-z-_]/g;function It(e){if(e=e.split("=")[0],e=e.trim().replace(Et,""),e.length<2)return "";for(;e.length%4!==0;)e=e+"=";return e}function wr(e,r){r=r||1/0;let t,n=e.length,i=null,u=[];for(let a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&u.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&u.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536;}else i&&(r-=3)>-1&&u.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;u.push(t);}else if(t<2048){if((r-=2)<0)break;u.push(t>>6|192,t&63|128);}else if(t<65536){if((r-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128);}else if(t<1114112){if((r-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128);}else throw new Error("Invalid code point")}return u}function Bt(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Tt(e,r){let t,n,i,u=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,u.push(i),u.push(n);return u}function Or(e){return s.toByteArray(It(e))}function ar(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function O(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function gr(e){return e!==e}let At=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i];}return r}();function Y(e){return typeof BigInt>"u"?xt:e}function xt(){throw new Error("BigInt not supported")}return W}var q=Ge();q.Buffer;q.SlowBuffer;q.INSPECT_MAX_BYTES;q.kMaxLength;var S=q.Buffer;q.INSPECT_MAX_BYTES;q.kMaxLength;var Ur={};St(Ur,{deleteItem:()=>He,getItem:()=>fr,setItem:()=>or});var ir=()=>typeof window>"u",lr=()=>!ir();var Ye="__IMX-",Ar=()=>lr()&&window.localStorage,Ke=s=>{if(s!==null)try{return JSON.parse(s)}catch{return s}},je=s=>typeof s=="string"?s:JSON.stringify(s),xr=s=>`${Ye}${s}`;function fr(s){if(Ar())return Ke(window.localStorage.getItem(xr(s)))}var or=(s,c)=>Ar()?(window.localStorage.setItem(xr(s),je(c)),!0):!1,He=s=>Ar()?(window.localStorage.removeItem(xr(s)),!0):!1;var Sr=0,Hr=s=>{let c=parseInt(s,10)*1e3,p=new Date(c),l=new Date;return Sr=p.getTime()-l.getTime(),Sr},Wr=()=>{let s=new Date().getTime()+Sr;return new Date(s).toISOString()};var sr=(E=>(E.RUNTIME_ID="rid",E.PASSPORT_CLIENT_ID="passportClientId",E.ENVIRONMENT="env",E.PUBLISHABLE_API_KEY="pak",E.IDENTITY="uid",E.DOMAIN="domain",E.SDK_VERSION="sdkVersion",E))(sr||{});var We="https://api.immutable.com",qe=s=>{if(typeof S<"u")return S.from(s,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(s)));throw new Error("Base64 encoding not supported in this environment")};async function hr(s,c){let p=JSON.stringify(c),l={payload:qe(p)},h=await fetch(`${We}${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!h.ok){let w=await h.text().catch(()=>"");throw new Error(`Request failed (${h.status}): ${w||h.statusText}`)}return h.json()}var X,J,Xe=()=>{X=fr("metrics-events")||[],J=fr("metrics-runtime")||{};};Xe();var V=(s,c)=>{J={...J,[s]:c},or("metrics-runtime",J);},ur=s=>{if(J[s]!==void 0)return J[s]},qr=()=>J,Xr=()=>X,Jr=s=>{X.push(s),or("metrics-events",X);},zr=s=>{X=X.slice(s),or("metrics-events",X);},dr=s=>{let c=[];return Object.entries(s).forEach(([p,l])=>{(typeof p=="string"||typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&c.push([p,l.toString()]);}),c};var kr="2.12.4-alpha.8",Je=()=>ir()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",ze=()=>{if(ir())return "";let s;try{window.self!==window.top&&(s=Je());}catch{}return s||(s=window.location.hostname),s},Qe=()=>{if(V("sdkVersion",kr),ir())return {browser:"nodejs",sdkVersion:kr};let s=ze();return s&&V("domain",s),{sdkVersion:kr,browser:window.navigator.userAgent,domain:s,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},_r=!1,Qr=()=>_r,Zr=async()=>{_r=!0;try{let s=dr(Qe()),c=ur("rid"),p=ur("uid"),h=await hr("/v1/sdk/initialise",{version:1,data:{runtimeDetails:s,runtimeId:c,uId:p}}),{runtimeId:w,sTime:o}=h;V("rid",w),Hr(o);}catch{_r=!1;}};function R(s,c){return (...p)=>{try{let l=s(...p);return l instanceof Promise?l.catch(()=>c):l}catch{return c}}}function Ze(){return lr()||typeof T>"u"?!1:T.env.JEST_WORKER_ID!==void 0}var rt=R(Ze,!1);var et="imtbl__metrics",tn=5e3,en=1e3,z=(s,c)=>getGlobalisedValue(et,s,c),nt=(s,c)=>{let p=memorise(c,{lruOptions:{ttl:tn,max:en}});return getGlobalisedValue(et,s,p)};var nn=5e3,on=(s,c,p)=>{let l={event:`${s}.${c}`,time:Wr(),...p&&{properties:dr(p)}};Jr(l);},Q=R(nt("track",on)),sn=async()=>{if(Qr()===!1){await Zr();return}let s=Xr();if(s.length===0)return;let c=s.length,p=qr();await hr("/v1/sdk/metrics",{version:1,data:{events:s,details:p}})instanceof Error||zr(c);},un=R(sn),ot=async()=>{await un(),setTimeout(ot,nn);},it=!1,an=()=>{it||(it=!0,ot());};rt()||R(z("startFlushing",an))();var Pr=(s,c,p,l)=>Q(s,c,{...l||{},duration:Math.round(p)});var st=()=>{let s=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${s()}${s()}-${s()}-${s()}-${s()}-${s()}${s()}${s()}`};var cn=(...s)=>{if(!s.some(l=>!!l))return {};let p={};return s.forEach(l=>{l&&(p={...p,...l});}),p},pn=s=>s.replace(/[^a-zA-Z0-9\s\-_]/g,""),ln=(s,c)=>`${s}_${pn(c)}`,fn=(s,c,p=!0,l)=>{let h=st(),w=Date.now(),o=0,E=0,b={},C=(..._)=>cn(b,..._,{flowId:h,flowName:c});b=C(l);let B=_=>{_&&(b=C(_));},k=(_,f)=>{let d=ln(c,_),g=0,A=performance.now();o>0&&(g=A-E);let v=C(f,{flowEventName:_,flowStep:o});Pr(s,d,g,v),o++,E=A;};return p&&k("Start"),{details:{moduleName:s,flowName:c,flowId:h,flowStartTime:w},addEvent:R(k),addFlowProperties:R(B)}},hn=R(fn);var dn=(s,c,p,l)=>{let{message:h}=p,w=p.stack||"",{cause:o}=p;o instanceof Error&&(w=`${w}
|
|
5
5
|
Cause: ${o.message}
|
|
6
6
|
${o.stack}`),Q(s,`trackError_${c}`,{...l||{},errorMessage:h,errorStack:w,isTrackError:!0});},mn=R(dn);var wn=s=>{if(s.passportId)return `passport:${s.passportId.toLowerCase()}`;if(s.ethAddress)return `ethAddress:${s.ethAddress.toLowerCase()}`;throw new Error("invalid_identity")},gn=s=>{let c=wn(s);c&&(V("uid",c),Q("metrics","identify",s.traits));},yn=R(gn);var En=s=>{V("env",s);},In=R(z("setEnvironment",En)),Bn=s=>{V("passportClientId",s);},Tn=R(z("setPassportClientId",Bn)),An=s=>{V("pak",s);},xn=R(z("setPublishableApiKey",An)),Un=R(z("getDetail",ur));var go={localStorage:Ur};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
7
7
|
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var lruMemorise = require('lru-memorise');
|
|
4
4
|
var globalConst = require('global-const');
|
|
5
5
|
|
|
6
|
-
var tt=Object.defineProperty;var et=(t,e)=>{for(var r in e)tt(t,r,{get:e[r],enumerable:!0});};var D={};et(D,{deleteItem:()=>st,getItem:()=>y,setItem:()=>w});var g=()=>typeof window>"u",I=()=>!g();var rt="__IMX-",v=()=>I()&&window.localStorage,ot=t=>{if(t!==null)try{return JSON.parse(t)}catch{return t}},nt=t=>typeof t=="string"?t:JSON.stringify(t),h=t=>`${rt}${t}`;function y(t){if(v())return ot(window.localStorage.getItem(h(t)))}var w=(t,e)=>v()?(window.localStorage.setItem(h(t),nt(e)),!0):!1,st=t=>v()?(window.localStorage.removeItem(h(t)),!0):!1;var b=0,O=t=>{let e=parseInt(t,10)*1e3,r=new Date(e),o=new Date;return b=r.getTime()-o.getTime(),b},$=()=>{let t=new Date().getTime()+b;return new Date(t).toISOString()};var T=(i=>(i.RUNTIME_ID="rid",i.PASSPORT_CLIENT_ID="passportClientId",i.ENVIRONMENT="env",i.PUBLISHABLE_API_KEY="pak",i.IDENTITY="uid",i.DOMAIN="domain",i.SDK_VERSION="sdkVersion",i))(T||{});var it="https://api.immutable.com",at=t=>{if(typeof Buffer<"u")return Buffer.from(t,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(t)));throw new Error("Base64 encoding not supported in this environment")};async function k(t,e){let r=JSON.stringify(e),o={payload:at(r)},s=await fetch(`${it}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){let c=await s.text().catch(()=>"");throw new Error(`Request failed (${s.status}): ${c||s.statusText}`)}return s.json()}var d,m,ct=()=>{d=y("metrics-events")||[],m=y("metrics-runtime")||{};};ct();var a=(t,e)=>{m={...m,[t]:e},w("metrics-runtime",m);},E=t=>{if(m[t]!==void 0)return m[t]},B=()=>m,C=()=>d,V=t=>{d.push(t),w("metrics-events",d);},L=t=>{d=d.slice(t),w("metrics-events",d);},P=t=>{let e=[];return Object.entries(t).forEach(([r,o])=>{(typeof r=="string"||typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&e.push([r,o.toString()]);}),e};var N="2.12.4-alpha.
|
|
6
|
+
var tt=Object.defineProperty;var et=(t,e)=>{for(var r in e)tt(t,r,{get:e[r],enumerable:!0});};var D={};et(D,{deleteItem:()=>st,getItem:()=>y,setItem:()=>w});var g=()=>typeof window>"u",I=()=>!g();var rt="__IMX-",v=()=>I()&&window.localStorage,ot=t=>{if(t!==null)try{return JSON.parse(t)}catch{return t}},nt=t=>typeof t=="string"?t:JSON.stringify(t),h=t=>`${rt}${t}`;function y(t){if(v())return ot(window.localStorage.getItem(h(t)))}var w=(t,e)=>v()?(window.localStorage.setItem(h(t),nt(e)),!0):!1,st=t=>v()?(window.localStorage.removeItem(h(t)),!0):!1;var b=0,O=t=>{let e=parseInt(t,10)*1e3,r=new Date(e),o=new Date;return b=r.getTime()-o.getTime(),b},$=()=>{let t=new Date().getTime()+b;return new Date(t).toISOString()};var T=(i=>(i.RUNTIME_ID="rid",i.PASSPORT_CLIENT_ID="passportClientId",i.ENVIRONMENT="env",i.PUBLISHABLE_API_KEY="pak",i.IDENTITY="uid",i.DOMAIN="domain",i.SDK_VERSION="sdkVersion",i))(T||{});var it="https://api.immutable.com",at=t=>{if(typeof Buffer<"u")return Buffer.from(t,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(t)));throw new Error("Base64 encoding not supported in this environment")};async function k(t,e){let r=JSON.stringify(e),o={payload:at(r)},s=await fetch(`${it}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){let c=await s.text().catch(()=>"");throw new Error(`Request failed (${s.status}): ${c||s.statusText}`)}return s.json()}var d,m,ct=()=>{d=y("metrics-events")||[],m=y("metrics-runtime")||{};};ct();var a=(t,e)=>{m={...m,[t]:e},w("metrics-runtime",m);},E=t=>{if(m[t]!==void 0)return m[t]},B=()=>m,C=()=>d,V=t=>{d.push(t),w("metrics-events",d);},L=t=>{d=d.slice(t),w("metrics-events",d);},P=t=>{let e=[];return Object.entries(t).forEach(([r,o])=>{(typeof r=="string"||typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&e.push([r,o.toString()]);}),e};var N="2.12.4-alpha.8",pt=()=>g()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",lt=()=>{if(g())return "";let t;try{window.self!==window.top&&(t=pt());}catch{}return t||(t=window.location.hostname),t},dt=()=>{if(a("sdkVersion",N),g())return {browser:"nodejs",sdkVersion:N};let t=lt();return t&&a("domain",t),{sdkVersion:N,browser:window.navigator.userAgent,domain:t,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},R=!1,U=()=>R,K=async()=>{R=!0;try{let t=P(dt()),e=E("rid"),r=E("uid"),s=await k("/v1/sdk/initialise",{version:1,data:{runtimeDetails:t,runtimeId:e,uId:r}}),{runtimeId:c,sTime:p}=s;a("rid",c),O(p);}catch{R=!1;}};function n(t,e){return (...r)=>{try{let o=t(...r);return o instanceof Promise?o.catch(()=>e):o}catch{return e}}}function mt(){return I()||typeof process>"u"?!1:process.env.JEST_WORKER_ID!==void 0}var G=n(mt,!1);var J="imtbl__metrics",ut=5e3,gt=1e3,f=(t,e)=>globalConst.getGlobalisedValue(J,t,e),j=(t,e)=>{let r=lruMemorise.memorise(e,{lruOptions:{ttl:ut,max:gt}});return globalConst.getGlobalisedValue(J,t,r)};var wt=5e3,Tt=(t,e,r)=>{let o={event:`${t}.${e}`,time:$(),...r&&{properties:P(r)}};V(o);},u=n(j("track",Tt)),Et=async()=>{if(U()===!1){await K();return}let t=C();if(t.length===0)return;let e=t.length,r=B();await k("/v1/sdk/metrics",{version:1,data:{events:t,details:r}})instanceof Error||L(e);},It=n(Et),H=async()=>{await It(),setTimeout(H,wt);},z=!1,yt=()=>{z||(z=!0,H());};G()||n(f("startFlushing",yt))();var A=(t,e,r,o)=>u(t,e,{...o||{},duration:Math.round(r)});var X=()=>{let t=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`};var kt=(...t)=>{if(!t.some(o=>!!o))return {};let r={};return t.forEach(o=>{o&&(r={...r,...o});}),r},Pt=t=>t.replace(/[^a-zA-Z0-9\s\-_]/g,""),xt=(t,e)=>`${t}_${Pt(e)}`,St=(t,e,r=!0,o)=>{let s=X(),c=Date.now(),p=0,i=0,x={},S=(...l)=>kt(x,...l,{flowId:s,flowName:e});x=S(o);let Z=l=>{l&&(x=S(l));},F=(l,q)=>{let Q=xt(e,l),_=0,M=performance.now();p>0&&(_=M-i);let W=S(q,{flowEventName:l,flowStep:p});A(t,Q,_,W),p++,i=M;};return r&&F("Start"),{details:{moduleName:t,flowName:e,flowId:s,flowStartTime:c},addEvent:n(F),addFlowProperties:n(Z)}},vt=n(St);var ht=(t,e,r,o)=>{let{message:s}=r,c=r.stack||"",{cause:p}=r;p instanceof Error&&(c=`${c}
|
|
7
7
|
Cause: ${p.message}
|
|
8
8
|
${p.stack}`),u(t,`trackError_${e}`,{...o||{},errorMessage:s,errorStack:c,isTrackError:!0});},Dt=n(ht);var bt=t=>{if(t.passportId)return `passport:${t.passportId.toLowerCase()}`;if(t.ethAddress)return `ethAddress:${t.ethAddress.toLowerCase()}`;throw new Error("invalid_identity")},Nt=t=>{let e=bt(t);e&&(a("uid",e),u("metrics","identify",t.traits));},Rt=n(Nt);var At=t=>{a("env",t);},Ft=n(f("setEnvironment",At)),_t=t=>{a("passportClientId",t);},Mt=n(f("setPassportClientId",_t)),Ot=t=>{a("pak",t);},$t=n(f("setPublishableApiKey",Ot)),Bt=n(f("getDetail",E));var Oe={localStorage:D};
|
|
9
9
|
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memorise } from 'lru-memorise';
|
|
2
2
|
import { getGlobalisedValue } from 'global-const';
|
|
3
3
|
|
|
4
|
-
var tt=Object.defineProperty;var et=(t,e)=>{for(var r in e)tt(t,r,{get:e[r],enumerable:!0});};var D={};et(D,{deleteItem:()=>st,getItem:()=>y,setItem:()=>w});var g=()=>typeof window>"u",I=()=>!g();var rt="__IMX-",v=()=>I()&&window.localStorage,ot=t=>{if(t!==null)try{return JSON.parse(t)}catch{return t}},nt=t=>typeof t=="string"?t:JSON.stringify(t),h=t=>`${rt}${t}`;function y(t){if(v())return ot(window.localStorage.getItem(h(t)))}var w=(t,e)=>v()?(window.localStorage.setItem(h(t),nt(e)),!0):!1,st=t=>v()?(window.localStorage.removeItem(h(t)),!0):!1;var b=0,O=t=>{let e=parseInt(t,10)*1e3,r=new Date(e),o=new Date;return b=r.getTime()-o.getTime(),b},$=()=>{let t=new Date().getTime()+b;return new Date(t).toISOString()};var T=(i=>(i.RUNTIME_ID="rid",i.PASSPORT_CLIENT_ID="passportClientId",i.ENVIRONMENT="env",i.PUBLISHABLE_API_KEY="pak",i.IDENTITY="uid",i.DOMAIN="domain",i.SDK_VERSION="sdkVersion",i))(T||{});var it="https://api.immutable.com",at=t=>{if(typeof Buffer<"u")return Buffer.from(t,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(t)));throw new Error("Base64 encoding not supported in this environment")};async function k(t,e){let r=JSON.stringify(e),o={payload:at(r)},s=await fetch(`${it}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){let c=await s.text().catch(()=>"");throw new Error(`Request failed (${s.status}): ${c||s.statusText}`)}return s.json()}var d,m,ct=()=>{d=y("metrics-events")||[],m=y("metrics-runtime")||{};};ct();var a=(t,e)=>{m={...m,[t]:e},w("metrics-runtime",m);},E=t=>{if(m[t]!==void 0)return m[t]},B=()=>m,C=()=>d,V=t=>{d.push(t),w("metrics-events",d);},L=t=>{d=d.slice(t),w("metrics-events",d);},P=t=>{let e=[];return Object.entries(t).forEach(([r,o])=>{(typeof r=="string"||typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&e.push([r,o.toString()]);}),e};var N="2.12.4-alpha.
|
|
4
|
+
var tt=Object.defineProperty;var et=(t,e)=>{for(var r in e)tt(t,r,{get:e[r],enumerable:!0});};var D={};et(D,{deleteItem:()=>st,getItem:()=>y,setItem:()=>w});var g=()=>typeof window>"u",I=()=>!g();var rt="__IMX-",v=()=>I()&&window.localStorage,ot=t=>{if(t!==null)try{return JSON.parse(t)}catch{return t}},nt=t=>typeof t=="string"?t:JSON.stringify(t),h=t=>`${rt}${t}`;function y(t){if(v())return ot(window.localStorage.getItem(h(t)))}var w=(t,e)=>v()?(window.localStorage.setItem(h(t),nt(e)),!0):!1,st=t=>v()?(window.localStorage.removeItem(h(t)),!0):!1;var b=0,O=t=>{let e=parseInt(t,10)*1e3,r=new Date(e),o=new Date;return b=r.getTime()-o.getTime(),b},$=()=>{let t=new Date().getTime()+b;return new Date(t).toISOString()};var T=(i=>(i.RUNTIME_ID="rid",i.PASSPORT_CLIENT_ID="passportClientId",i.ENVIRONMENT="env",i.PUBLISHABLE_API_KEY="pak",i.IDENTITY="uid",i.DOMAIN="domain",i.SDK_VERSION="sdkVersion",i))(T||{});var it="https://api.immutable.com",at=t=>{if(typeof Buffer<"u")return Buffer.from(t,"utf-8").toString("base64");if(typeof btoa=="function")return btoa(unescape(encodeURIComponent(t)));throw new Error("Base64 encoding not supported in this environment")};async function k(t,e){let r=JSON.stringify(e),o={payload:at(r)},s=await fetch(`${it}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!s.ok){let c=await s.text().catch(()=>"");throw new Error(`Request failed (${s.status}): ${c||s.statusText}`)}return s.json()}var d,m,ct=()=>{d=y("metrics-events")||[],m=y("metrics-runtime")||{};};ct();var a=(t,e)=>{m={...m,[t]:e},w("metrics-runtime",m);},E=t=>{if(m[t]!==void 0)return m[t]},B=()=>m,C=()=>d,V=t=>{d.push(t),w("metrics-events",d);},L=t=>{d=d.slice(t),w("metrics-events",d);},P=t=>{let e=[];return Object.entries(t).forEach(([r,o])=>{(typeof r=="string"||typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&e.push([r,o.toString()]);}),e};var N="2.12.4-alpha.8",pt=()=>g()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",lt=()=>{if(g())return "";let t;try{window.self!==window.top&&(t=pt());}catch{}return t||(t=window.location.hostname),t},dt=()=>{if(a("sdkVersion",N),g())return {browser:"nodejs",sdkVersion:N};let t=lt();return t&&a("domain",t),{sdkVersion:N,browser:window.navigator.userAgent,domain:t,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},R=!1,U=()=>R,K=async()=>{R=!0;try{let t=P(dt()),e=E("rid"),r=E("uid"),s=await k("/v1/sdk/initialise",{version:1,data:{runtimeDetails:t,runtimeId:e,uId:r}}),{runtimeId:c,sTime:p}=s;a("rid",c),O(p);}catch{R=!1;}};function n(t,e){return (...r)=>{try{let o=t(...r);return o instanceof Promise?o.catch(()=>e):o}catch{return e}}}function mt(){return I()||typeof process>"u"?!1:process.env.JEST_WORKER_ID!==void 0}var G=n(mt,!1);var J="imtbl__metrics",ut=5e3,gt=1e3,f=(t,e)=>getGlobalisedValue(J,t,e),j=(t,e)=>{let r=memorise(e,{lruOptions:{ttl:ut,max:gt}});return getGlobalisedValue(J,t,r)};var wt=5e3,Tt=(t,e,r)=>{let o={event:`${t}.${e}`,time:$(),...r&&{properties:P(r)}};V(o);},u=n(j("track",Tt)),Et=async()=>{if(U()===!1){await K();return}let t=C();if(t.length===0)return;let e=t.length,r=B();await k("/v1/sdk/metrics",{version:1,data:{events:t,details:r}})instanceof Error||L(e);},It=n(Et),H=async()=>{await It(),setTimeout(H,wt);},z=!1,yt=()=>{z||(z=!0,H());};G()||n(f("startFlushing",yt))();var A=(t,e,r,o)=>u(t,e,{...o||{},duration:Math.round(r)});var X=()=>{let t=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${t()}${t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`};var kt=(...t)=>{if(!t.some(o=>!!o))return {};let r={};return t.forEach(o=>{o&&(r={...r,...o});}),r},Pt=t=>t.replace(/[^a-zA-Z0-9\s\-_]/g,""),xt=(t,e)=>`${t}_${Pt(e)}`,St=(t,e,r=!0,o)=>{let s=X(),c=Date.now(),p=0,i=0,x={},S=(...l)=>kt(x,...l,{flowId:s,flowName:e});x=S(o);let Z=l=>{l&&(x=S(l));},F=(l,q)=>{let Q=xt(e,l),_=0,M=performance.now();p>0&&(_=M-i);let W=S(q,{flowEventName:l,flowStep:p});A(t,Q,_,W),p++,i=M;};return r&&F("Start"),{details:{moduleName:t,flowName:e,flowId:s,flowStartTime:c},addEvent:n(F),addFlowProperties:n(Z)}},vt=n(St);var ht=(t,e,r,o)=>{let{message:s}=r,c=r.stack||"",{cause:p}=r;p instanceof Error&&(c=`${c}
|
|
5
5
|
Cause: ${p.message}
|
|
6
6
|
${p.stack}`),u(t,`trackError_${e}`,{...o||{},errorMessage:s,errorStack:c,isTrackError:!0});},Dt=n(ht);var bt=t=>{if(t.passportId)return `passport:${t.passportId.toLowerCase()}`;if(t.ethAddress)return `ethAddress:${t.ethAddress.toLowerCase()}`;throw new Error("invalid_identity")},Nt=t=>{let e=bt(t);e&&(a("uid",e),u("metrics","identify",t.traits));},Rt=n(Nt);var At=t=>{a("env",t);},Ft=n(f("setEnvironment",At)),_t=t=>{a("passportClientId",t);},Mt=n(f("setPassportClientId",_t)),Ot=t=>{a("pak",t);},$t=n(f("setPublishableApiKey",Ot)),Bt=n(f("getDetail",E));var Oe={localStorage:D};
|
|
7
7
|
|
package/package.json
CHANGED