var Eo=Object.create;var un=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var So=Object.getOwnPropertyNames;var Bo=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty;var ot=(e,r)=>()=>(e&&(r=e(e=0)),r);var K=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var xo=(e,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of So(r))!bo.call(e,c)&&c!==i&&un(e,c,{get:()=>r[c],enumerable:!(o=Lo(r,c))||o.enumerable});return e};var At=(e,r,i)=>(i=e!=null?Eo(Bo(e)):{},xo(r||!e||!e.__esModule?un(i,"default",{value:e,enumerable:!0}):i,e));var d=ot(()=>{});function Ao(e,r){this.fun=e,this.array=r}function cn(e){var r=Math.floor((Date.now()-Re.now())*.001),i=Re.now()*.001,o=Math.floor(i)+r,c=Math.floor(i%1*1e9);return e&&(o=o-e[0],c=c-e[1],c<0&&(o--,c+=hr)),[o,c]}var yu,Re,lr,hr,fn=ot(()=>{d();y();v();Ao.prototype.run=function(){this.fun.apply(null,this.array)};yu={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Re={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Re.now===void 0&&(lr=Date.now(),Re.timing&&Re.timing.navigationStart&&(lr=Re.timing.navigationStart),Re.now=()=>Date.now()-lr);hr=1e9;cn.bigint=function(e){var r=cn(e);return typeof BigInt>"u"?r[0]*hr+r[1]:BigInt(r[0]*hr)+BigInt(r[1])}});var v=ot(()=>{fn()});function Mo(){if(ln)return at;ln=!0,at.byteLength=h,at.toByteArray=w,at.fromByteArray=I;for(var e=[],r=[],i=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,l=o.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var M=L.indexOf("=");M===-1&&(M=S);var T=M===S?0:4-M%4;return[M,T]}function h(L){var S=u(L),M=S[0],T=S[1];return(M+T)*3/4-T}function E(L,S,M){return(S+M)*3/4-M}function w(L){var S,M=u(L),T=M[0],z=M[1],R=new i(E(L,T,z)),$=0,q=z>0?T-4:T,C;for(C=0;C>16&255,R[$++]=S>>8&255,R[$++]=S&255;return z===2&&(S=r[L.charCodeAt(C)]<<2|r[L.charCodeAt(C+1)]>>4,R[$++]=S&255),z===1&&(S=r[L.charCodeAt(C)]<<10|r[L.charCodeAt(C+1)]<<4|r[L.charCodeAt(C+2)]>>2,R[$++]=S>>8&255,R[$++]=S&255),R}function m(L){return e[L>>18&63]+e[L>>12&63]+e[L>>6&63]+e[L&63]}function A(L,S,M){for(var T,z=[],R=S;Rq?q:$+R));return T===1?(S=L[M-1],z.push(e[S>>2]+e[S<<4&63]+"==")):T===2&&(S=(L[M-2]<<8)+L[M-1],z.push(e[S>>10]+e[S>>4&63]+e[S<<2&63]+"=")),z.join("")}return at}function _o(){if(hn)return Mt;hn=!0;return Mt.read=function(e,r,i,o,c){var l,u,h=c*8-o-1,E=(1<>1,m=-7,A=i?c-1:0,I=i?-1:1,L=e[r+A];for(A+=I,l=L&(1<<-m)-1,L>>=-m,m+=h;m>0;l=l*256+e[r+A],A+=I,m-=8);for(u=l&(1<<-m)-1,l>>=-m,m+=o;m>0;u=u*256+e[r+A],A+=I,m-=8);if(l===0)l=1-w;else{if(l===E)return u?NaN:(L?-1:1)*(1/0);u=u+Math.pow(2,o),l=l-w}return(L?-1:1)*u*Math.pow(2,l-o)},Mt.write=function(e,r,i,o,c,l){var u,h,E,w=l*8-c-1,m=(1<>1,I=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=o?0:l-1,S=o?1:-1,M=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,u=m):(u=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-u))<1&&(u--,E*=2),u+A>=1?r+=I/E:r+=I*Math.pow(2,1-A),r*E>=2&&(u++,E/=2),u+A>=m?(h=0,u=m):u+A>=1?(h=(r*E-1)*Math.pow(2,c),u=u+A):(h=r*Math.pow(2,A-1)*Math.pow(2,c),u=0));c>=8;e[i+L]=h&255,L+=S,h/=256,c-=8);for(u=u<0;e[i+L]=u&255,L+=S,u/=256,w-=8);e[i+L-S]|=M*128},Mt}function Po(){if(gn)return Ue;gn=!0;let e=Mo(),r=_o(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ue.Buffer=u,Ue.SlowBuffer=z,Ue.INSPECT_MAX_BYTES=50;let o=2147483647;Ue.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=c(),!u.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 c(){try{let a=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(a,t),a.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(a){if(a>o)throw new RangeError('The value "'+a+'" is invalid for option "size"');let t=new Uint8Array(a);return Object.setPrototypeOf(t,u.prototype),t}function u(a,t,n){if(typeof a=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(a)}return h(a,t,n)}u.poolSize=8192;function h(a,t,n){if(typeof a=="string")return A(a,t);if(ArrayBuffer.isView(a))return L(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a);if(he(a,ArrayBuffer)||a&&he(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(he(a,SharedArrayBuffer)||a&&he(a.buffer,SharedArrayBuffer)))return S(a,t,n);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let s=a.valueOf&&a.valueOf();if(s!=null&&s!==a)return u.from(s,t,n);let f=M(a);if(f)return f;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return u.from(a[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof a)}u.from=function(a,t,n){return h(a,t,n)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function E(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function w(a,t,n){return E(a),a<=0?l(a):t!==void 0?typeof n=="string"?l(a).fill(t,n):l(a).fill(t):l(a)}u.alloc=function(a,t,n){return w(a,t,n)};function m(a){return E(a),l(a<0?0:T(a)|0)}u.allocUnsafe=function(a){return m(a)},u.allocUnsafeSlow=function(a){return m(a)};function A(a,t){if((typeof t!="string"||t==="")&&(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=R(a,t)|0,s=l(n),f=s.write(a,t);return f!==n&&(s=s.slice(0,f)),s}function I(a){let t=a.length<0?0:T(a.length)|0,n=l(t);for(let s=0;s=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return a|0}function z(a){return+a!=a&&(a=0),u.alloc(+a)}u.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==u.prototype},u.compare=function(t,n){if(he(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),he(n,Uint8Array)&&(n=u.from(n,n.offset,n.byteLength)),!u.isBuffer(t)||!u.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;let s=t.length,f=n.length;for(let g=0,p=Math.min(s,f);gf.length?(u.isBuffer(p)||(p=u.from(p)),p.copy(f,g)):Uint8Array.prototype.set.call(f,p,g);else if(u.isBuffer(p))p.copy(f,g);else throw new TypeError('"list" argument must be an Array of Buffers');g+=p.length}return f};function R(a,t){if(u.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||he(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof a);let n=a.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&n===0)return 0;let f=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return cr(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return sn(a).length;default:if(f)return s?-1:cr(a).length;t=(""+t).toLowerCase(),f=!0}}u.byteLength=R;function $(a,t,n){let s=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(a||(a="utf8");;)switch(a){case"hex":return ne(this,t,n);case"utf8":case"utf-8":return me(this,t,n);case"ascii":return ae(this,t,n);case"latin1":case"binary":return J(this,t,n);case"base64":return X(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,t,n);default:if(s)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),s=!0}}u.prototype._isBuffer=!0;function q(a,t,n){let s=a[t];a[t]=a[n],a[n]=s}u.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;nn&&(t+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,n,s,f,g){if(he(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),s===void 0&&(s=t?t.length:0),f===void 0&&(f=0),g===void 0&&(g=this.length),n<0||s>t.length||f<0||g>this.length)throw new RangeError("out of range index");if(f>=g&&n>=s)return 0;if(f>=g)return-1;if(n>=s)return 1;if(n>>>=0,s>>>=0,f>>>=0,g>>>=0,this===t)return 0;let p=g-f,_=s-n,W=Math.min(p,_),G=this.slice(f,g),k=t.slice(n,s);for(let F=0;F2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,fr(n)&&(n=f?0:a.length-1),n<0&&(n=a.length+n),n>=a.length){if(f)return-1;n=a.length-1}else if(n<0)if(f)n=0;else return-1;if(typeof t=="string"&&(t=u.from(t,s)),u.isBuffer(t))return t.length===0?-1:Z(a,t,n,s,f);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?f?Uint8Array.prototype.indexOf.call(a,t,n):Uint8Array.prototype.lastIndexOf.call(a,t,n):Z(a,[t],n,s,f);throw new TypeError("val must be string, number or Buffer")}function Z(a,t,n,s,f){let g=1,p=a.length,_=t.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(a.length<2||t.length<2)return-1;g=2,p/=2,_/=2,n/=2}function W(k,F){return g===1?k[F]:k.readUInt16BE(F*g)}let G;if(f){let k=-1;for(G=n;Gp&&(n=p-_),G=n;G>=0;G--){let k=!0;for(let F=0;F<_;F++)if(W(a,G+F)!==W(t,F)){k=!1;break}if(k)return G}return-1}u.prototype.includes=function(t,n,s){return this.indexOf(t,n,s)!==-1},u.prototype.indexOf=function(t,n,s){return C(this,t,n,s,!0)},u.prototype.lastIndexOf=function(t,n,s){return C(this,t,n,s,!1)};function Y(a,t,n,s){n=Number(n)||0;let f=a.length-n;s?(s=Number(s),s>f&&(s=f)):s=f;let g=t.length;s>g/2&&(s=g/2);let p;for(p=0;p>>0,isFinite(s)?(s=s>>>0,f===void 0&&(f="utf8")):(f=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let g=this.length-n;if((s===void 0||s>g)&&(s=g),t.length>0&&(s<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");let p=!1;for(;;)switch(f){case"hex":return Y(this,t,n,s);case"utf8":case"utf-8":return P(this,t,n,s);case"ascii":case"latin1":case"binary":return pe(this,t,n,s);case"base64":return Q(this,t,n,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n,s);default:if(p)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),p=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X(a,t,n){return t===0&&n===a.length?e.fromByteArray(a):e.fromByteArray(a.slice(t,n))}function me(a,t,n){n=Math.min(a.length,n);let s=[],f=t;for(;f239?4:g>223?3:g>191?2:1;if(f+_<=n){let W,G,k,F;switch(_){case 1:g<128&&(p=g);break;case 2:W=a[f+1],(W&192)===128&&(F=(g&31)<<6|W&63,F>127&&(p=F));break;case 3:W=a[f+1],G=a[f+2],(W&192)===128&&(G&192)===128&&(F=(g&15)<<12|(W&63)<<6|G&63,F>2047&&(F<55296||F>57343)&&(p=F));break;case 4:W=a[f+1],G=a[f+2],k=a[f+3],(W&192)===128&&(G&192)===128&&(k&192)===128&&(F=(g&15)<<18|(W&63)<<12|(G&63)<<6|k&63,F>65535&&F<1114112&&(p=F))}}p===null?(p=65533,_=1):p>65535&&(p-=65536,s.push(p>>>10&1023|55296),p=56320|p&1023),s.push(p),f+=_}return re(s)}let ee=4096;function re(a){let t=a.length;if(t<=ee)return String.fromCharCode.apply(String,a);let n="",s=0;for(;ss)&&(n=s);let f="";for(let g=t;gs&&(t=s),n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),nn)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(t,n,s){t=t>>>0,n=n>>>0,s||H(t,n,this.length);let f=this[t],g=1,p=0;for(;++p>>0,n=n>>>0,s||H(t,n,this.length);let f=this[t+--n],g=1;for(;n>0&&(g*=256);)f+=this[t+--n]*g;return f},u.prototype.readUint8=u.prototype.readUInt8=function(t,n){return t=t>>>0,n||H(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||H(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||H(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||H(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||H(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Ae(function(t){t=t>>>0,ye(t,"offset");let n=this[t],s=this[t+7];(n===void 0||s===void 0)&&nt(t,this.length-8);let f=n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,g=this[++t]+this[++t]*2**8+this[++t]*2**16+s*2**24;return BigInt(f)+(BigInt(g)<>>0,ye(t,"offset");let n=this[t],s=this[t+7];(n===void 0||s===void 0)&&nt(t,this.length-8);let f=n*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],g=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+s;return(BigInt(f)<>>0,n=n>>>0,s||H(t,n,this.length);let f=this[t],g=1,p=0;for(;++p=g&&(f-=Math.pow(2,8*n)),f},u.prototype.readIntBE=function(t,n,s){t=t>>>0,n=n>>>0,s||H(t,n,this.length);let f=n,g=1,p=this[t+--f];for(;f>0&&(g*=256);)p+=this[t+--f]*g;return g*=128,p>=g&&(p-=Math.pow(2,8*n)),p},u.prototype.readInt8=function(t,n){return t=t>>>0,n||H(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},u.prototype.readInt16LE=function(t,n){t=t>>>0,n||H(t,2,this.length);let s=this[t]|this[t+1]<<8;return s&32768?s|4294901760:s},u.prototype.readInt16BE=function(t,n){t=t>>>0,n||H(t,2,this.length);let s=this[t+1]|this[t]<<8;return s&32768?s|4294901760:s},u.prototype.readInt32LE=function(t,n){return t=t>>>0,n||H(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,n){return t=t>>>0,n||H(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Ae(function(t){t=t>>>0,ye(t,"offset");let n=this[t],s=this[t+7];(n===void 0||s===void 0)&&nt(t,this.length-8);let f=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(s<<24);return(BigInt(f)<>>0,ye(t,"offset");let n=this[t],s=this[t+7];(n===void 0||s===void 0)&&nt(t,this.length-8);let f=(n<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(f)<>>0,n||H(t,4,this.length),r.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,n){return t=t>>>0,n||H(t,4,this.length),r.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||H(t,8,this.length),r.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||H(t,8,this.length),r.read(this,t,!1,52,8)};function N(a,t,n,s,f,g){if(!u.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||ta.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,n,s,f){if(t=+t,n=n>>>0,s=s>>>0,!f){let _=Math.pow(2,8*s)-1;N(this,t,n,s,_,0)}let g=1,p=0;for(this[n]=t&255;++p>>0,s=s>>>0,!f){let _=Math.pow(2,8*s)-1;N(this,t,n,s,_,0)}let g=s-1,p=1;for(this[n+g]=t&255;--g>=0&&(p*=256);)this[n+g]=t/p&255;return n+s},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,1,255,0),this[n]=t&255,n+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function xe(a,t,n,s,f){rt(t,s,f,a,n,7);let g=Number(t&BigInt(4294967295));a[n++]=g,g=g>>8,a[n++]=g,g=g>>8,a[n++]=g,g=g>>8,a[n++]=g;let p=Number(t>>BigInt(32)&BigInt(4294967295));return a[n++]=p,p=p>>8,a[n++]=p,p=p>>8,a[n++]=p,p=p>>8,a[n++]=p,n}function de(a,t,n,s,f){rt(t,s,f,a,n,7);let g=Number(t&BigInt(4294967295));a[n+7]=g,g=g>>8,a[n+6]=g,g=g>>8,a[n+5]=g,g=g>>8,a[n+4]=g;let p=Number(t>>BigInt(32)&BigInt(4294967295));return a[n+3]=p,p=p>>8,a[n+2]=p,p=p>>8,a[n+1]=p,p=p>>8,a[n]=p,n+8}u.prototype.writeBigUInt64LE=Ae(function(t,n=0){return xe(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Ae(function(t,n=0){return de(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(t,n,s,f){if(t=+t,n=n>>>0,!f){let W=Math.pow(2,8*s-1);N(this,t,n,s,W-1,-W)}let g=0,p=1,_=0;for(this[n]=t&255;++g>0)-_&255;return n+s},u.prototype.writeIntBE=function(t,n,s,f){if(t=+t,n=n>>>0,!f){let W=Math.pow(2,8*s-1);N(this,t,n,s,W-1,-W)}let g=s-1,p=1,_=0;for(this[n+g]=t&255;--g>=0&&(p*=256);)t<0&&_===0&&this[n+g+1]!==0&&(_=1),this[n+g]=(t/p>>0)-_&255;return n+s},u.prototype.writeInt8=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1},u.prototype.writeInt16LE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2},u.prototype.writeInt16BE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2},u.prototype.writeInt32LE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4},u.prototype.writeInt32BE=function(t,n,s){return t=+t,n=n>>>0,s||N(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4},u.prototype.writeBigInt64LE=Ae(function(t,n=0){return xe(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Ae(function(t,n=0){return de(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ie(a,t,n,s,f,g){if(n+s>a.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(a,t,n,s,f){return t=+t,n=n>>>0,f||ie(a,t,n,4),r.write(a,t,n,s,23,4),n+4}u.prototype.writeFloatLE=function(t,n,s){return V(this,t,n,!0,s)},u.prototype.writeFloatBE=function(t,n,s){return V(this,t,n,!1,s)};function St(a,t,n,s,f){return t=+t,n=n>>>0,f||ie(a,t,n,8),r.write(a,t,n,s,52,8),n+8}u.prototype.writeDoubleLE=function(t,n,s){return St(this,t,n,!0,s)},u.prototype.writeDoubleBE=function(t,n,s){return St(this,t,n,!1,s)},u.prototype.copy=function(t,n,s,f){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(s||(s=0),!f&&f!==0&&(f=this.length),n>=t.length&&(n=t.length),n||(n=0),f>0&&f=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),t.length-n>>0,s=s===void 0?this.length:s>>>0,t||(t=0);let g;if(typeof t=="number")for(g=n;g2**32?f=Bt(String(n)):typeof n=="bigint"&&(f=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(f=Bt(f)),f+="n"),s+=` It must be ${t}. Received ${f}`,s},RangeError);function Bt(a){let t="",n=a.length,s=a[0]==="-"?1:0;for(;n>=s+4;n-=3)t=`_${a.slice(n-3,n)}${t}`;return`${a.slice(0,n)}${t}`}function bt(a,t,n){ye(t,"offset"),(a[t]===void 0||a[t+n]===void 0)&&nt(t,a.length-(n+1))}function rt(a,t,n,s,f,g){if(a>n||a3?t===0||t===BigInt(0)?_=`>= 0${p} and < 2${p} ** ${(g+1)*8}${p}`:_=`>= -(2${p} ** ${(g+1)*8-1}${p}) and < 2 ** ${(g+1)*8-1}${p}`:_=`>= ${t}${p} and <= ${n}${p}`,new ve.ERR_OUT_OF_RANGE("value",_,a)}bt(s,f,g)}function ye(a,t){if(typeof a!="number")throw new ve.ERR_INVALID_ARG_TYPE(t,"number",a)}function nt(a,t,n){throw Math.floor(a)!==a?(ye(a,n),new ve.ERR_OUT_OF_RANGE(n||"offset","an integer",a)):t<0?new ve.ERR_BUFFER_OUT_OF_BOUNDS:new ve.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,a)}let it=/[^+/0-9A-Za-z-_]/g;function po(a){if(a=a.split("=")[0],a=a.trim().replace(it,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function cr(a,t){t=t||1/0;let n,s=a.length,f=null,g=[];for(let p=0;p55295&&n<57344){if(!f){if(n>56319){(t-=3)>-1&&g.push(239,191,189);continue}else if(p+1===s){(t-=3)>-1&&g.push(239,191,189);continue}f=n;continue}if(n<56320){(t-=3)>-1&&g.push(239,191,189),f=n;continue}n=(f-55296<<10|n-56320)+65536}else f&&(t-=3)>-1&&g.push(239,191,189);if(f=null,n<128){if((t-=1)<0)break;g.push(n)}else if(n<2048){if((t-=2)<0)break;g.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;g.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;g.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return g}function mo(a){let t=[];for(let n=0;n>8,f=n%256,g.push(f),g.push(s);return g}function sn(a){return e.toByteArray(po(a))}function xt(a,t,n,s){let f;for(f=0;f=t.length||f>=a.length);++f)t[f+n]=a[f];return f}function he(a,t){return a instanceof t||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===t.name}function fr(a){return a!==a}let yo=function(){let a="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){let s=n*16;for(let f=0;f<16;++f)t[s+f]=a[n]+a[f]}return t}();function Ae(a){return typeof BigInt>"u"?wo:a}function wo(){throw new Error("BigInt not supported")}return Ue}var at,ln,Mt,hn,Ue,gn,Te,x,bu,xu,pn=ot(()=>{d();y();v();at={},ln=!1;Mt={},hn=!1;Ue={},gn=!1;Te=Po();Te.Buffer;Te.SlowBuffer;Te.INSPECT_MAX_BYTES;Te.kMaxLength;x=Te.Buffer,bu=Te.INSPECT_MAX_BYTES,xu=Te.kMaxLength});var y=ot(()=>{pn()});var gr=K(ce=>{"use strict";d();y();v();Object.defineProperty(ce,"__esModule",{value:!0});ce.CTI=ce.Products=ce.EnvironmentStage=void 0;var Oo;(function(e){e.ALPHA="alpha",e.BETA="beta",e.GAMMA="gamma",e.PROD="prod"})(Oo=ce.EnvironmentStage||(ce.EnvironmentStage={}));var Io;(function(e){e.VILA="vila",e.BWP="bwp"})(Io=ce.Products||(ce.Products={}));var Ro;(function(e){e[e.Shiraz=0]="Shiraz",e[e.BlitzenUI=1]="BlitzenUI",e[e.Asgard=2]="Asgard",e[e.Saltiefish=3]="Saltiefish",e[e.GenieCrystalWidgets=4]="GenieCrystalWidgets",e[e.Pasa=5]="Pasa",e[e.Mandvi=6]="Mandvi",e[e.Koel=7]="Koel",e[e.Avocado=8]="Avocado",e[e.GenieShuriWidgets=9]="GenieShuriWidgets",e[e.Havana=10]="Havana",e[e.GenieNovaWidgets=11]="GenieNovaWidgets",e[e.BluetickWidget=12]="BluetickWidget",e[e.Lima=13]="Lima",e[e.Scoville=14]="Scoville",e[e.Doppio=15]="Doppio",e[e.Irtysh=16]="Irtysh",e[e.Soapbox=17]="Soapbox",e[e.Cortado=18]="Cortado",e[e.Mercurius=19]="Mercurius",e[e.RioLemon=20]="RioLemon",e[e.BWPWidget=21]="BWPWidget",e[e.BWPCart=22]="BWPCart",e[e.WonderlandWidgetCart=23]="WonderlandWidgetCart",e[e.SpicyMaple=24]="SpicyMaple",e[e.MoccaWidgets=25]="MoccaWidgets",e[e.NebulaHelix=26]="NebulaHelix",e[e.MoccaWidgetsGamma=27]="MoccaWidgetsGamma",e[e.PostOrderIngressGamma=28]="PostOrderIngressGamma",e[e.PostOrderIngress=29]="PostOrderIngress",e[e.NebulaHourglass=30]="NebulaHourglass",e[e.SantosOrderHistoryGamma=31]="SantosOrderHistoryGamma",e[e.SantosOrderHistory=32]="SantosOrderHistory",e[e.NebulaHelixGamma=33]="NebulaHelixGamma",e[e.RFAElementsGamma=34]="RFAElementsGamma",e[e.RFAElements=35]="RFAElements",e[e.SoloGamma=36]="SoloGamma",e[e.Solo=37]="Solo",e[e.NurburgElements=38]="NurburgElements",e[e.NurburgElementsGamma=39]="NurburgElementsGamma",e[e.BwPPromoElementGamma=40]="BwPPromoElementGamma",e[e.BwPPromoElement=41]="BwPPromoElement",e[e.SantosMercs=42]="SantosMercs",e[e.SantosMercsGamma=43]="SantosMercsGamma",e[e.SantosReturnsGamma=44]="SantosReturnsGamma",e[e.SantosReturns=45]="SantosReturns",e[e.SantosOMElementsGamma=46]="SantosOMElementsGamma",e[e.SantosOMElements=47]="SantosOMElements",e[e.SantosPostOrderHostGamma=48]="SantosPostOrderHostGamma",e[e.SantosPostOrderHost=49]="SantosPostOrderHost",e[e.GenieChatElementGamma=50]="GenieChatElementGamma",e[e.GenieChatElement=51]="GenieChatElement",e[e.AsgardCart=52]="AsgardCart",e[e.SantosOrderHistoryElementGamma=53]="SantosOrderHistoryElementGamma",e[e.SantosOrderHistoryElement=54]="SantosOrderHistoryElement",e[e.SantosTrackingElementGamma=55]="SantosTrackingElementGamma",e[e.SantosTrackingElement=56]="SantosTrackingElement",e[e.SignInElementGamma=57]="SignInElementGamma",e[e.SignInElement=58]="SignInElement",e[e.SantosRainierWidget=59]="SantosRainierWidget",e[e.SantosRainierWidgetGamma=60]="SantosRainierWidgetGamma",e[e.SantosNebulaRosetteGamma=61]="SantosNebulaRosetteGamma",e[e.SantosNebulaRosette=62]="SantosNebulaRosette",e[e.SantosLandourGamma=63]="SantosLandourGamma",e[e.SantosLandour=64]="SantosLandour",e[e.ShirazDemo=65]="ShirazDemo",e[e.BWAPWidgetGamma=66]="BWAPWidgetGamma",e[e.BWAPWidgetProd=67]="BWAPWidgetProd"})(Ro=ce.CTI||(ce.CTI={}))});var xr=K((ku,Pn)=>{d();y();v();Pn.exports=ft;ft.default=ft;ft.stable=Mn;ft.stableStringify=Mn;var Rt="[...]",xn="[Circular]",De=[],Ce=[];function An(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function ft(e,r,i,o){typeof o>"u"&&(o=An()),Br(e,"",0,[],void 0,0,o);var c;try{Ce.length===0?c=JSON.stringify(e,r,i):c=JSON.stringify(e,_n(r),i)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;De.length!==0;){var l=De.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function We(e,r,i,o){var c=Object.getOwnPropertyDescriptor(o,i);c.get!==void 0?c.configurable?(Object.defineProperty(o,i,{value:e}),De.push([o,i,r,c])):Ce.push([r,i,e]):(o[i]=e,De.push([o,i,r]))}function Br(e,r,i,o,c,l,u){l+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hu.depthLimit){We(Rt,e,r,c);return}if(typeof u.edgesLimit<"u"&&i+1>u.edgesLimit){We(Rt,e,r,c);return}if(o.push(e),Array.isArray(e))for(h=0;hr?1:0}function Mn(e,r,i,o){typeof o>"u"&&(o=An());var c=br(e,"",0,[],void 0,0,o)||e,l;try{Ce.length===0?l=JSON.stringify(c,r,i):l=JSON.stringify(c,_n(r),i)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;De.length!==0;){var u=De.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return l}function br(e,r,i,o,c,l,u){l+=1;var h;if(typeof e=="object"&&e!==null){for(h=0;hu.depthLimit){We(Rt,e,r,c);return}if(typeof u.edgesLimit<"u"&&i+1>u.edgesLimit){We(Rt,e,r,c);return}if(o.push(e),Array.isArray(e))for(h=0;h0)for(var o=0;o{"use strict";d();y();v();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ICacheRegistryKey=void 0;Nt.ICacheRegistryKey=Symbol.for("@amzn/exs-gem-interface/ICacheRegistryKey")});var jn=K(Gt=>{"use strict";d();y();v();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ILogFactoryKey=void 0;Gt.ILogFactoryKey=Symbol.for("@amzn/exs-gem-interface/ILogFactory")});var zn=K(jt=>{"use strict";d();y();v();Object.defineProperty(jt,"__esModule",{value:!0});jt.IMetricsFactoryKey=void 0;jt.IMetricsFactoryKey=Symbol.for("@amzn/exs-gem-interface/IMetricsFactory")});var qn=K(Se=>{"use strict";d();y();v();var ea=Se&&Se.__createBinding||(Object.create?function(e,r,i,o){o===void 0&&(o=i);var c=Object.getOwnPropertyDescriptor(r,i);(!c||("get"in c?!r.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(e,o,c)}:function(e,r,i,o){o===void 0&&(o=i),e[o]=r[i]}),Pr=Se&&Se.__exportStar||function(e,r){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&ea(r,e,i)};Object.defineProperty(Se,"__esModule",{value:!0});Pr(Gn(),Se);Pr(jn(),Se);Pr(zn(),Se)});var Hn=K(zt=>{"use strict";d();y();v();Object.defineProperty(zt,"__esModule",{value:!0});zt.SupportedLogLevels=void 0;zt.SupportedLogLevels=["error","warn","info","debug"]});var pt=K(qt=>{"use strict";d();y();v();Object.defineProperty(qt,"__esModule",{value:!0});qt.ConfigBasedLoggingStrategy=void 0;var Wn=Hn(),ta=(e,r)=>{let i=e.getLoggingLevel();if(i==="none")return!1;let o=Wn.SupportedLogLevels.indexOf(i);return Wn.SupportedLogLevels.indexOf(r)<=o},Or=class e{static LOG_EVERYTHING_LOGGING_BEHAVIOUR={getLoggingLevel:()=>"debug"};config={};constructor(r){this.config=r??{}}canLog(r,i){let o=this.getLoggingBehaviour(r);return ta(o,i)}getLoggingBehaviour(r){let i=this.config[r];if(i)return{getLoggingLevel:()=>i.level};let o=this.config.default;return o?{getLoggingLevel:()=>o.level}:e.LOG_EVERYTHING_LOGGING_BEHAVIOUR}};qt.ConfigBasedLoggingStrategy=Or});var Ri=K((mt,$e)=>{d();y();v();var ra=200,ri="__lodash_hash_undefined__",ni=9007199254740991,Nr="[object Arguments]",na="[object Array]",ii="[object Boolean]",oi="[object Date]",ia="[object Error]",Gr="[object Function]",ai="[object GeneratorFunction]",Ht="[object Map]",si="[object Number]",jr="[object Object]",kn="[object Promise]",ui="[object RegExp]",Wt="[object Set]",ci="[object String]",fi="[object Symbol]",Rr="[object WeakMap]",li="[object ArrayBuffer]",kt="[object DataView]",hi="[object Float32Array]",gi="[object Float64Array]",pi="[object Int8Array]",mi="[object Int16Array]",di="[object Int32Array]",vi="[object Uint8Array]",yi="[object Uint8ClampedArray]",wi="[object Uint16Array]",Ei="[object Uint32Array]",oa=/[\\^$.*+?()[\]{}|]/g,aa=/\w*$/,sa=/^\[object .+?Constructor\]$/,ua=/^(?:0|[1-9]\d*)$/,D={};D[Nr]=D[na]=D[li]=D[kt]=D[ii]=D[oi]=D[hi]=D[gi]=D[pi]=D[mi]=D[di]=D[Ht]=D[si]=D[jr]=D[ui]=D[Wt]=D[ci]=D[fi]=D[vi]=D[yi]=D[wi]=D[Ei]=!0;D[ia]=D[Gr]=D[Rr]=!1;var ca=typeof window=="object"&&window&&window.Object===Object&&window,fa=typeof self=="object"&&self&&self.Object===Object&&self,Be=ca||fa||Function("return this")(),Li=typeof mt=="object"&&mt&&!mt.nodeType&&mt,$n=Li&&typeof $e=="object"&&$e&&!$e.nodeType&&$e,la=$n&&$n.exports===Li;function ha(e,r){return e.set(r[0],r[1]),e}function ga(e,r){return e.add(r),e}function pa(e,r){for(var i=-1,o=e?e.length:0;++i-1}function za(e,r){var i=this.__data__,o=Jt(i,e);return o<0?i.push([e,r]):i[o][1]=r,this}be.prototype.clear=Da;be.prototype.delete=Na;be.prototype.get=Ga;be.prototype.has=ja;be.prototype.set=za;function Ke(e){var r=-1,i=e?e.length:0;for(this.clear();++r-1&&e%1==0&&e-1&&e%1==0&&e<=ni}function Vt(e){var r=typeof e;return!!e&&(r=="object"||r=="function")}function As(e){return!!e&&typeof e=="object"}function Wr(e){return Oi(e)?Xa(e):is(e)}function Ms(){return[]}function _s(){return!1}$e.exports=Ls});var kr=K(Ve=>{"use strict";d();y();v();var Ps=Ve&&Ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.helpers=void 0;var Os=new Set(["string","number","bigint","boolean","null","undefined","symbol"]),Is=Ps(Ri()),Ui=e=>e instanceof Date,Ti=e=>e==null||e===void 0;Ve.helpers={isPremitiveType:e=>Ti(e)||Os.has(typeof e)||Ui(e),isSimpleObject:e=>!Ti(e)&&typeof e=="object"&&!Ui(e),deepClone:Is.default}});var Fi=K(Zt=>{"use strict";d();y();v();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.GemLogger=void 0;var Rs=kr(),$r=class e{logContext;loggingStrategy;transport;formatter;error=this.log("error");warn=this.log("warn");info=this.log("info");debug=this.log("debug");constructor(r,i,o,c,l){this.logContext=i,this.loggingStrategy=o,this.transport=c,this.formatter=l,this.logContext.logger=r}child(r,i){let o=Rs.helpers.deepClone(this.logContext);return Object.assign(o,i),new e(r,o,this.loggingStrategy,this.transport,this.formatter)}log(r){return(...i)=>{let{logger:o,...c}=this.logContext;if(!this.loggingStrategy.canLog(o,r))return;let l={level:r,logger:o,args:i,context:c};this.transport.write(l,this.formatter)}}};Zt.GemLogger=$r});var Ci=K(Ze=>{"use strict";d();y();v();var Us=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.JsonConsoleTransport=void 0;var Ts=Us(xr()),Kr=class{write(r,i){let o=i.format(r);console.log(Fs(o))}};Ze.JsonConsoleTransport=Kr;function Fs(e){function r(i,o){if(o instanceof Error){let c={};return Object.getOwnPropertyNames(o).forEach(l=>{c[l]=o[l]}),c}return o}try{return JSON.stringify(e,r)}catch{return(0,Ts.default)(e,r)}}});var Di=K(Xt=>{"use strict";d();y();v();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.UpperCaseLogLevelFormatter=void 0;Xt.UpperCaseLogLevelFormatter={format(e){return e.level=e.level.toUpperCase(),e}}});var Gi=K(Qt=>{"use strict";d();y();v();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Splatter=void 0;var Ni=kr();Qt.Splatter={format(e){if(!e.args)throw new Error("Meta property is required for splatting formatter");if(!Array.isArray(e.args))throw new Error("Meta property must be an array for the splatting formatter");let r=e,i=r.args.filter(E=>Ni.helpers.isPremitiveType(E)).map(E=>typeof E>"u"?"undefined":E===null?"null":typeof E=="symbol"?E.toString():E),o=i.length>0,c=o?i.join(" "):r.args[0],l=o?r.args:r.args.slice(1),u={...r.context},h=l?.length??0;for(;--h>=0;){let E=l[h];if(Ni.helpers.isSimpleObject(E))Object.assign(u,E);else continue}return{...u,message:c,logger:r.logger,level:r.level}}}});var ji=K(_e=>{"use strict";d();y();v();Object.defineProperty(_e,"__esModule",{value:!0});_e.combine=_e.Splatter=_e.UpperCaseLogLevelFormatter=void 0;var Cs=Di();Object.defineProperty(_e,"UpperCaseLogLevelFormatter",{enumerable:!0,get:function(){return Cs.UpperCaseLogLevelFormatter}});var Ds=Gi();Object.defineProperty(_e,"Splatter",{enumerable:!0,get:function(){return Ds.Splatter}});var Ns=(...e)=>({format(i){let o=i;return e.forEach(c=>o=c.format(o)),o}});_e.combine=Ns});var zi=K(er=>{"use strict";d();y();v();Object.defineProperty(er,"__esModule",{value:!0});er.DevLogger=void 0;var Jr=class e{name;loggingStrategy;transport;formatter;error=this.log("error");warn=this.log("warn");info=this.log("info");debug=this.log("debug");constructor(r,i,o,c){this.name=r,this.loggingStrategy=i,this.transport=o,this.formatter=c}child(r){return new e(r,this.loggingStrategy,this.transport,this.formatter)}log(r){return(...i)=>{if(!this.loggingStrategy.canLog(this.name,r))return;let o={level:r,logger:this.name,args:i,context:void 0};this.transport.write(o,this.formatter)}}};er.DevLogger=Jr});var rr=K(tr=>{"use strict";d();y();v();Object.defineProperty(tr,"__esModule",{value:!0});tr.LogManager=void 0;var Gs=Fi(),js=Ci(),Xe=ji(),zs=pt(),qs=zi(),Hs=(e,r,i,o)=>{let c=(0,Xe.combine)(Xe.UpperCaseLogLevelFormatter,Xe.Splatter);return new Gs.GemLogger(e,r,i,o,c)},Ws=(e,r,i)=>{let o=(0,Xe.combine)(Xe.UpperCaseLogLevelFormatter,Xe.Splatter);return new qs.DevLogger(e,r,i,o)},Yr=class{loggingStrategy;defaultContext;createLoggerOptions;constructor(r,i,o){this.loggingStrategy=r??new zs.ConfigBasedLoggingStrategy,this.defaultContext=i||{},this.createLoggerOptions=o}create(r,i){if(i=i||{},this.createLoggerOptions?.devMode){if(!this.createLoggerOptions?.transport)throw new Error("createLoggerOptions.transport must be provided when devMode = true");return Ws(r,this.loggingStrategy,this.createLoggerOptions.transport)}return Hs(r,{...this.defaultContext,...i},this.loggingStrategy,this.createLoggerOptions?.transport||new js.JsonConsoleTransport)}};tr.LogManager=Yr});var Vr=K(Pe=>{"use strict";d();y();v();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.createLogManager=Pe.LogManager=Pe.ConfigBasedLoggingStrategy=void 0;var ks=pt(),$s=rr(),Ks=pt();Object.defineProperty(Pe,"ConfigBasedLoggingStrategy",{enumerable:!0,get:function(){return Ks.ConfigBasedLoggingStrategy}});var Js=rr();Object.defineProperty(Pe,"LogManager",{enumerable:!0,get:function(){return Js.LogManager}});var Ys=(e,r,i)=>new $s.LogManager(new ks.ConfigBasedLoggingStrategy(e),r,i);Pe.createLogManager=Ys});var qi=K(Qe=>{"use strict";d();y();v();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.LogManager=Qe.ConfigBasedLoggingStrategy=void 0;var Vs=pt();Object.defineProperty(Qe,"ConfigBasedLoggingStrategy",{enumerable:!0,get:function(){return Vs.ConfigBasedLoggingStrategy}});var Zs=rr();Object.defineProperty(Qe,"LogManager",{enumerable:!0,get:function(){return Zs.LogManager}})});var Hi=K(fe=>{"use strict";d();y();v();var Xs=fe&&fe.__createBinding||(Object.create?function(e,r,i,o){o===void 0&&(o=i);var c=Object.getOwnPropertyDescriptor(r,i);(!c||("get"in c?!r.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(e,o,c)}:function(e,r,i,o){o===void 0&&(o=i),e[o]=r[i]}),Qs=fe&&fe.__exportStar||function(e,r){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&Xs(r,e,i)};Object.defineProperty(fe,"__esModule",{value:!0});fe.LoggingRegistration=fe.createLogManager=void 0;var eu=qn(),tu=Vr();Qs(qi(),fe);var ru=Vr();Object.defineProperty(fe,"createLogManager",{enumerable:!0,get:function(){return ru.createLogManager}});fe.LoggingRegistration={create(e,r,i){return[{key:eu.ILogFactoryKey,factory:o=>(0,tu.createLogManager)(r,e,i)}]}}});d();y();v();var mu=At(gr());d();y();v();d();y();v();d();y();v();d();y();v();var oe=Uint8Array,te=Uint16Array,Pt=Uint32Array,Er=new oe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Lr=new oe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),mn=new oe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),En=function(e,r){for(var i=new te(31),o=0;o<31;++o)i[o]=r+=1<>>1|(U&21845)<<1,we=(we&52428)>>>2|(we&13107)<<2,we=(we&61680)>>>4|(we&3855)<<4,dr[U]=((we&65280)>>>8|(we&255)<<8)>>>1;var we,U,ct=function(e,r,i){for(var o=e.length,c=0,l=new te(r);c>>E]=w}else for(h=new te(o),c=0;c>>15-e[c]);return h},Fe=new oe(288);for(U=0;U<144;++U)Fe[U]=8;var U;for(U=144;U<256;++U)Fe[U]=9;var U;for(U=256;U<280;++U)Fe[U]=7;var U;for(U=280;U<288;++U)Fe[U]=8;var U,_t=new oe(32);for(U=0;U<32;++U)_t[U]=5;var U,To=ct(Fe,9,0);var Fo=ct(_t,5,0);var Bn=function(e){return(e+7)/8|0},bn=function(e,r,i){(r==null||r<0)&&(r=0),(i==null||i>e.length)&&(i=e.length);var o=new(e.BYTES_PER_ELEMENT==2?te:e.BYTES_PER_ELEMENT==4?Pt:oe)(i-r);return o.set(e.subarray(r,i)),o};var Ee=function(e,r,i){i<<=r&7;var o=r/8|0;e[o]|=i,e[o+1]|=i>>>8},st=function(e,r,i){i<<=r&7;var o=r/8|0;e[o]|=i,e[o+1]|=i>>>8,e[o+2]|=i>>>16},pr=function(e,r){for(var i=[],o=0;oI&&(I=l[o].s);var L=new te(I+1),S=vr(i[m-1],L,0);if(S>r){var o=0,M=0,T=S-r,z=1<r)M+=z-(1<>>=T;M>0;){var $=l[o].s;L[$]=0&&M;--o){var q=l[o].s;L[q]==r&&(--L[q],++M)}S=r}return[new oe(L),S]},vr=function(e,r,i){return e.s==-1?Math.max(vr(e.l,r,i+1),vr(e.r,r,i+1)):r[e.s]=i},vn=function(e){for(var r=e.length;r&&!e[--r];);for(var i=new te(++r),o=0,c=e[0],l=1,u=function(E){i[o++]=E},h=1;h<=r;++h)if(e[h]==c&&h!=r)++l;else{if(!c&&l>2){for(;l>138;l-=138)u(32754);l>2&&(u(l>10?l-11<<5|28690:l-3<<5|12305),l=0)}else if(l>3){for(u(c),--l;l>6;l-=6)u(8304);l>2&&(u(l-3<<5|8208),l=0)}for(;l--;)u(c);l=1,c=e[h]}return[i.subarray(0,o),r]},ut=function(e,r){for(var i=0,o=0;o>>8,e[c+2]=e[c]^255,e[c+3]=e[c+1]^255;for(var l=0;l4&&!Q[mn[X-1]];--X);var me=w+5<<3,ee=ut(c,Fe)+ut(l,_t)+u,re=ut(c,I)+ut(l,M)+u+14+3*X+ut(Y,Q)+(2*Y[16]+3*Y[17]+7*Y[18]);if(me<=ee&&me<=re)return yr(r,m,e.subarray(E,E+w));var ae,J,ne,le;if(Ee(r,m,1+(re15&&(Ee(r,m,de[P]>>>5&127),m+=de[P]>>>12)}}else ae=To,J=Fe,ne=Fo,le=_t;for(var P=0;P255){var ie=o[P]>>>18&31;st(r,m,ae[ie+257]),m+=J[ie+257],ie>7&&(Ee(r,m,o[P]>>>23&31),m+=Er[ie]);var V=o[P]&31;st(r,m,ne[V]),m+=le[V],V>3&&(st(r,m,o[P]>>>5&8191),m+=Lr[V])}else st(r,m,ae[o[P]]),m+=J[o[P]];return st(r,m,ae[256]),m+J[256]},Co=new Pt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Sr=new oe(0),Do=function(e,r,i,o,c,l){var u=e.length,h=new oe(o+u+5*(1+Math.ceil(u/7e3))+c),E=h.subarray(o,h.length-c),w=0;if(!r||u<8)for(var m=0;m<=u;m+=65535){var A=m+65535;A>=u&&(E[w>>3]=l),w=yr(E,w+1,e.subarray(m,A))}else{for(var I=Co[r-1],L=I>>>13,S=I&8191,M=(1<7e3||Q>24576)&&ae>423){w=yn(e,E,0,C,Z,Y,pe,Q,X,m-X,w),Q=P=pe=0,X=m;for(var J=0;J<286;++J)Z[J]=0;for(var J=0;J<30;++J)Y[J]=0}var ne=2,le=0,H=S,N=ee-re&32767;if(ae>2&&me==q(m-N))for(var xe=Math.min(L,ae)-1,de=Math.min(32767,m),ie=Math.min(258,ae);N<=de&&--H&&ee!=re;){if(e[m+ne]==e[m+ne-N]){for(var V=0;Vne){if(ne=V,le=N,V>xe)break;for(var St=Math.min(N,V-2),ve=0,J=0;Jve&&(ve=bt,re=Ie)}}}ee=re,re=T[ee],N+=ee-re+32768&32767}if(le){C[Q++]=268435456|mr[ne]<<18|dn[le];var rt=mr[ne]&31,ye=dn[le]&31;pe+=Er[rt]+Lr[ye],++Z[257+rt],++Y[ye],O=m+ne,++P}else C[Q++]=e[m],++Z[e[m]]}}w=yn(e,E,l,C,Z,Y,pe,Q,X,m-X,w),!l&&w&7&&(w=yr(E,w+1,Sr))}return bn(h,0,o+Bn(w)+c)},No=function(){for(var e=new Int32Array(256),r=0;r<256;++r){for(var i=r,o=9;--o;)i=(i&1&&-306674912)^i>>>1;e[r]=i}return e}(),Go=function(){var e=-1;return{p:function(r){for(var i=e,o=0;o>>8;e=i},d:function(){return~e}}};var jo=function(e,r,i,o,c){return Do(e,r.level==null?6:r.level,r.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+r.mem,i,o,!c)};var wr=function(e,r,i){for(;i;++r)e[r]=i,i>>>=8},zo=function(e,r){var i=r.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=r.level<2?4:r.level==9?2:0,e[9]=3,r.mtime!=0&&wr(e,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),i){e[3]=8;for(var o=0;o<=i.length;++o)e[o+10]=i.charCodeAt(o)}};var qo=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Ot(e,r){r||(r={});var i=Go(),o=e.length;i.p(e);var c=jo(e,r,qo(r),8),l=c.length;return zo(c,r),wr(c,l-8,i.d()),wr(c,l-4,o),c}var wn=typeof TextEncoder<"u"&&new TextEncoder,Ho=typeof TextDecoder<"u"&&new TextDecoder,Wo=0;try{Ho.decode(Sr,{stream:!0}),Wo=1}catch{}function It(e,r){if(r){for(var i=new oe(e.length),o=0;o>1)),u=0,h=function(m){l[u++]=m},o=0;ol.length){var E=new oe(u+8+(c-o<<1));E.set(l),l=E}var w=e.charCodeAt(o);w<128||r?h(w):w<2048?(h(192|w>>6),h(128|w&63)):w>55295&&w<57344?(w=65536+(w&1047552)|e.charCodeAt(++o)&1023,h(240|w>>18),h(128|w>>12&63),h(128|w>>6&63),h(128|w&63)):(h(224|w>>12),h(128|w>>6&63),h(128|w&63))}return bn(l,0,u)}d();y();v();var In=At(xr()),Rn=At(gr());d();y();v();var $o=8192;function Ut(e){return Ot(It(JSON.stringify({logEvents:e}))).length}function Ft(e){return Ut(typeof e=="string"?[{type:1,message:e,timestamp:Date.now()}]:e)>=$o}function lt(e){function r(i,o){if(o instanceof Error){let c={};return Object.getOwnPropertyNames(o).forEach(l=>{c[l]=o[l]}),c}return o}try{return JSON.stringify(e,r)}catch{return(0,In.default)(e,r)}}function Un(e){let r=lt(e)||"";return Ft(r)?null:r}function ht({error:e,message:r}){return lt({level:0,error:e,message:r,namespace:Rn.CTI.Shiraz})}d();y();v();function ke(e,r){if(e>r)throw Error(`min ${e} is larger than max ${r}`);return Math.floor(Math.random()*(r-e))+e}d();y();v();d();y();v();var Ct=class{constructor(){this.items=[]}getAll(){return this.items}setAll(r){this.items=r}clearAll(){this.items.length=0}push(r){this.items.push(r)}pop(){return this.items.pop()}shift(){return this.items.shift()}unshift(r){this.items.unshift(r)}size(){return this.items.length}at(r){return this.items[r]}};var Ar=class{static init(){return new Ct}},Tn=Ar;d();y();v();var Ko="order.buywithprime.amazon.com";function Jo(e){return e.endsWith("tk.dubai.aws.dev")||e===Ko}var Yo="https://order.buywithprime.amazon.com/log",Vo=["localhost","127.0.0.1"];function Fn(){return Jo(window.location.hostname)?"/log":Yo}function Cn(){return Vo.includes(window.location.hostname)}var Zo=5e4,Dn=Fn(),Xo=200,Qo=Tn.init(),j=class e{static{this.isFirstLog=!0}static{this.logEvents=Qo}static{this.localhostLoggingEnabled=!1}static enableLocalHostLogging(){e.localhostLoggingEnabled=!0}static getLogEventCount(){return e.logEvents.size()}static async ingestLog(r,i){try{let o=Un(r);if(o===null){e.logEvents.push({type:1,message:ht({message:"message size too big"}),timestamp:Date.now()});return}e.logEvents.push({type:i,message:o,timestamp:Date.now()});let c=e.logEvents.getAll(),l=Ut(c);l>Zo&&(e.logEvents.clearAll(),e.logEvents.push({type:1,message:ht({message:`cleared logEvents as it is too large at ${l} bytes`}),timestamp:Date.now()}))}catch(o){e.logEvents.push({type:1,message:ht({error:o,message:"ingestLog failed"}),timestamp:Date.now()})}}static async sendLogs(r,i=!0){if(Cn()&&!e.localhostLoggingEnabled||r===0||e.logEvents.size()===0)return;let o=e.logEvents.getAll(),c=[o.shift()];for(;o.length>0&&c.lengthsetTimeout(()=>E(),ke(1e3,2e3))),await e.sendLogs(r-c.length)):e.queueError(Error(),"Failed to send beacon");return}e.isFirstLog||console.warn("navigator.sendBeacon is missing"),e.isFirstLog=!1;try{let h=await fetch(Dn,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:u});if(!h){e.queueError(new Error,"Failed to POST with fetch");return}if(!h.ok){await h.json().then(E=>e.queueError(E,"Failed to POST with fetch"));return}}catch(h){e.queueError(h,"Failed to POST with fetch")}await e.sendLogs(r-c.length)}static queueError(r,i){e.logEvents.push({type:1,message:ht({error:r,message:i}),timestamp:Date.now()})}};var gt=class e{static createLogger(r){return new e(r)}constructor(r){this.cti=r}log(r){return j.ingestLog({level:2,message:r,cti:this.cti},1)}warn(r){return j.ingestLog({level:1,message:r,cti:this.cti},1)}error(r){return j.ingestLog({level:0,error:r,cti:this.cti},1)}};d();y();v();var Ne=class e{constructor(r){this.eventHolder=[];this.cti=r,this.eventHolder.push({0:this.cti})}static createMetricsLogger(r){return new e(r)}async flush(){this.eventHolder.length<2||(await j.ingestLog([...this.eventHolder],0),this.eventHolder.length=0,this.eventHolder.push({0:this.cti}))}setNamespace(){throw new Error("Cannot set Namespace, namespace is configure via the CTI in the constructor")}setProperty(r,i){return this.eventHolder.push({1:[r,i]}),this}putDimensions(r){return this.eventHolder.push({2:r}),this}setDimensions(...r){return this.eventHolder.push({3:r}),this}putMetric(r,i,o){return this.eventHolder.push({4:[r,i,o]}),this}setTimestamp(r){return this.eventHolder.push({5:typeof r=="number"?r:r.getTime()}),this}new(){return new e(this.cti)}};d();y();v();var Ge=class e{static createMetricScopeFactory(r){return new e(r)}constructor(r){this.cti=r}metricScope(r){let{cti:i}=this;async function o(...c){let l=Ne.createMetricsLogger(i);try{return await r(l)(...c)}finally{try{await l.flush()}catch(u){j.queueError(u,"Failed to flush metrics")}}}return o}};d();y();v();var Mr=(O=>(O.Seconds="Seconds",O.Microseconds="Microseconds",O.Milliseconds="Milliseconds",O.Bytes="Bytes",O.Kilobytes="Kilobytes",O.Megabytes="Megabytes",O.Gigabytes="Gigabytes",O.Terabytes="Terabytes",O.Bits="Bits",O.Kilobits="Kilobits",O.Megabits="Megabits",O.Gigabits="Gigabits",O.Terabits="Terabits",O.Percent="Percent",O.Count="Count",O.BytesPerSecond="Bytes/Second",O.KilobytesPerSecond="Kilobytes/Second",O.MegabytesPerSecond="Megabytes/Second",O.GigabytesPerSecond="Gigabytes/Second",O.TerabytesPerSecond="Terabytes/Second",O.BitsPerSecond="Bits/Second",O.KilobitsPerSecond="Kilobits/Second",O.MegabitsPerSecond="Megabits/Second",O.GigabitsPerSecond="Gigabits/Second",O.TerabitsPerSecond="Terabits/Second",O.CountPerSecond="Count/Second",O.None="None",O))(Mr||{});d();y();v();d();y();v();d();y();v();var Dt;(function(e){e.CumulativeLayoutShift="CumulativeLayoutShift",e.LargestContentfulPaint="LargestContentfulPaint",e.FirstInputDelay="FirstInputDelay",e.InteractionToNextPaint="InteractionToNextPaint",e.FirstContentfulPaint="FirstContentfulPaint",e.TimeToFirstByte="TimeToFirstByte",e.RequestCount="RequestCount",e.RequestStatus="RequestStatus",e.RequestLatency="RequestLatency",e.RequestError="RequestError",e.TemplateRequestCount="TemplateRequestCount",e.TemplateRequestStatus="TemplateRequestStatus",e.TemplateRequestLatency="TemplateRequestLatency",e.TemplateRequestError="TemplateRequestError",e.LoadCount="LoadCount",e.LoadError="LoadError",e.LoadLatency="LoadLatency",e.RenderCount="RenderCount",e.RenderError="RenderError",e.RenderLatency="RenderLatency",e.InteractionCount="InteractionCount",e.InteractionError="InteractionError",e.InteractionLatency="InteractionLatency",e.ImpressionCount="ImpressionCount",e.ImpressionError="ImpressionError",e.ImpressionLatency="ImpressionLatency",e.JSCallCount="JSCallCount",e.JSCallError="JSCallError"})(Dt||(Dt={}));var Le=Dt;d();y();v();async function Nn(){try{await j.sendLogs(j.getLogEventCount())}finally{setTimeout(Nn,ke(1e4,12500))}}function _r(){let e=!1;function r(){e||(e=!0,Nn())}let i;function o(){clearTimeout(i),"requestIdleCallback"in window?window.requestIdleCallback(r,{timeout:ke(5e3,7500)}):setTimeout(r,50)}document.readyState==="complete"?o():(i=setTimeout(o,ke(5e3,7500)),window.addEventListener("load",o,{once:!0,passive:!0}));let c=!1;async function l(){c||(c=!0,await j.sendLogs(j.getLogEventCount(),!1))}document.addEventListener("visibilitychange",async()=>{document.visibilityState==="hidden"&&await l()}),window.addEventListener("pagehide",l,!1)}d();y();v();var Wi=At(Hi());d();y();v();var nu={debug:3,info:2,warn:1,error:0,DEBUG:3,INFO:2,WARN:1,ERROR:0},nr=class{constructor(r){this.cti=r;this.cti=r}write(r,i){let{message:o,logger:c,level:l,...u}=i.format(r),h=nu[r.level],E=h===0?"error":"message",w=Object.keys(u).length>0?{[E]:o,...u}:o,m={level:h,[E]:w,cti:this.cti};if(h===3){console.debug(o);return}j.ingestLog(m,1).catch(console.error)}};var yt=class{static createLogger(r,i){return(0,Wi.createLogManager)(void 0,i,{transport:new nr(r)})}};d();y();v();d();y();v();var ih=e=>{let r=typeof window>"u"?{}:window.storefront,i=r?.createMetricScopeFactory||Ge.createMetricScopeFactory,o=r?.queueError||j.queueError,c=i(e);return async(l,u,h)=>{let E=c.metricScope(w=>async()=>{if(h){if(h.Dimensions){let m=Array.isArray(h.Dimensions)?h.Dimensions:[h.Dimensions];w.setDimensions(...m)}h.Properties&&Object.entries(h.Properties).forEach(([m,A])=>{w.setProperty(m,A)})}w.setTimestamp(Date.now()),h?.Units?w.putMetric(l,u,h.Units):w.putMetric(l,u)});try{await E()}catch(w){await o(w,`Failed to push ${l} standard metric with config: ${lt(h)}`)}}};d();y();v();d();y();v();var Oe,Et,ro,or,en,no=-1,He=function(e){addEventListener("pageshow",function(r){r.persisted&&(no=r.timeStamp,e(r))},!0)},tn=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},sr=function(){var e=tn();return e&&e.activationStart||0},se=function(e,r){var i=tn(),o="navigate";return no>=0?o="back-forward-cache":i&&(document.prerendering||sr()>0?o="prerender":document.wasDiscarded?o="restore":i.type&&(o=i.type.replace(/_/g,"-"))),{name:e,value:r===void 0?-1:r,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:o}},tt=function(e,r,i){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var o=new PerformanceObserver(function(c){Promise.resolve().then(function(){r(c.getEntries())})});return o.observe(Object.assign({type:e,buffered:!0},i||{})),o}}catch{}},ue=function(e,r,i,o){var c,l;return function(u){r.value>=0&&(u||o)&&((l=r.value-(c||0))||c===void 0)&&(c=r.value,r.delta=l,r.rating=function(h,E){return h>E[1]?"poor":h>E[0]?"needs-improvement":"good"}(r.value,i),e(r))}},rn=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},ur=function(e){var r=function(i){i.type!=="pagehide"&&document.visibilityState!=="hidden"||e(i)};addEventListener("visibilitychange",r,!0),addEventListener("pagehide",r,!0)},nn=function(e){var r=!1;return function(i){r||(e(i),r=!0)}},et=-1,ki=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},ar=function(e){document.visibilityState==="hidden"&&et>-1&&(et=e.type==="visibilitychange"?e.timeStamp:0,iu())},$i=function(){addEventListener("visibilitychange",ar,!0),addEventListener("prerenderingchange",ar,!0)},iu=function(){removeEventListener("visibilitychange",ar,!0),removeEventListener("prerenderingchange",ar,!0)},on=function(){return et<0&&(et=ki(),$i(),He(function(){setTimeout(function(){et=ki(),$i()},0)})),{get firstHiddenTime(){return et}}},Lt=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ki=[1800,3e3],an=function(e,r){r=r||{},Lt(function(){var i,o=on(),c=se("FCP"),l=tt("paint",function(u){u.forEach(function(h){h.name==="first-contentful-paint"&&(l.disconnect(),h.startTimeo.value&&(o.value=c,o.entries=l,i())},h=tt("layout-shift",u);h&&(i=ue(e,o,Ji,r.reportAllChanges),ur(function(){u(h.takeRecords()),i(!0)}),He(function(){c=0,o=se("CLS",0),i=ue(e,o,Ji,r.reportAllChanges),rn(function(){return i()})}),setTimeout(i,0))}))},wt={passive:!0,capture:!0},ou=new Date,Yi=function(e,r){Oe||(Oe=r,Et=e,ro=new Date,ao(removeEventListener),oo())},oo=function(){if(Et>=0&&Et1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(i,o){var c=function(){Yi(i,o),u()},l=function(){u()},u=function(){removeEventListener("pointerup",c,wt),removeEventListener("pointercancel",l,wt)};addEventListener("pointerup",c,wt),addEventListener("pointercancel",l,wt)}(r,e):Yi(r,e)}},ao=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(r){return e(r,au,wt)})},Vi=[100,300],so=function(e,r){r=r||{},Lt(function(){var i,o=on(),c=se("FID"),l=function(E){E.startTimer.latency){if(i)i.entries.push(e),i.latency=Math.max(i.latency,e.duration);else{var o={id:e.interactionId,latency:e.duration,entries:[e]};Xr[o.id]=o,ge.push(o)}ge.sort(function(c,l){return l.latency-c.latency}),ge.splice(10).forEach(function(c){delete Xr[c.id]})}},lo=function(e,r){r=r||{},Lt(function(){var i;uu();var o,c=se("INP"),l=function(h){h.forEach(function(m){m.interactionId&&Qi(m),m.entryType==="first-input"&&!ge.some(function(A){return A.entries.some(function(I){return m.duration===I.duration&&m.startTime===I.startTime})})&&Qi(m)});var E,w=(E=Math.min(ge.length-1,Math.floor(Xi()/50)),ge[E]);w&&w.latency!==c.value&&(c.value=w.latency,c.entries=w.entries,o())},u=tt("event",l,{durationThreshold:(i=r.durationThreshold)!==null&&i!==void 0?i:40});o=ue(e,c,Zi,r.reportAllChanges),u&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&u.observe({type:"first-input",buffered:!0}),ur(function(){l(u.takeRecords()),c.value<0&&Xi()>0&&(c.value=0,c.entries=[]),o(!0)}),He(function(){ge=[],fo=co(),c=se("INP"),o=ue(e,c,Zi,r.reportAllChanges)}))})},eo=[2500,4e3],Qr={},ho=function(e,r){r=r||{},Lt(function(){var i,o=on(),c=se("LCP"),l=function(E){var w=E[E.length-1];w&&w.startTimeperformance.now())return;i.value=Math.max(l-sr(),0),i.entries=[c],o(!0),He(function(){i=se("TTFB",0),(o=ue(e,i,to,r.reportAllChanges))(!0)})}})};function fu(e,r,i,o){return e(r,i,{...o,Units:o?.Units??"Milliseconds"})}function lu(e,r,i,o){return e(r,i??1,{Units:"Count",...o})}async function hu(e,r){return lu(e,Le.LoadCount,1,r)}function gu(e,r){let i=o=>c=>fu(e,o,c.value,r);io(i(Le.CumulativeLayoutShift)),an(i(Le.FirstContentfulPaint)),so(i(Le.FirstInputDelay)),lo(i(Le.InteractionToNextPaint)),ho(i(Le.LargestContentfulPaint)),go(i(Le.TimeToFirstByte))}var pu={emitPageLoad:!0,emitWebVitals:!0};async function dh(e,r){let i={...pu,...r},o={Dimensions:i.dimensions,Properties:i.properties};i.emitPageLoad&&hu(e,o),i.emitWebVitals&&gu(e,o)}var{enableLocalHostLogging:Dh}=j,Nh=yt.createLogger;window.storefront=window.storefront||{};(!window.storefront.createMetricScopeFactory||!window.storefront.createLogger||!window.storefront.createMetricsLogger)&&_r();window.storefront.createMetricScopeFactory=window.storefront.createMetricScopeFactory||Ge.createMetricScopeFactory;window.storefront.createLogger=window.storefront.createLogger||gt.createLogger;window.storefront.createMetricsLogger=window.storefront.createMetricsLogger||Ne.createMetricsLogger;window.storefront.queueError=window.storefront.queueError||j.queueError;var{createMetricScopeFactory:Gh,createLogger:jh,createMetricsLogger:zh,queueError:qh}=window.storefront;var export_CTI=mu.CTI;export{export_CTI as CTI,Le as StandardMetricTypes,Mr as Unit,Nh as createExsLogger,jh as createLogger,Gh as createMetricScopeFactory,zh as createMetricsLogger,lu as emitCountMetric,fu as emitLatencyMetric,hu as emitPageLoadMetric,dh as emitStandardMetrics,gu as emitWebVitals,Dh as enableLocalHostLogging,ih as getStandardMetricLogger,qh as queueError,lt as safeStringify};