PageSourceSearch

https://aimusicvideogenerators.com/_next/static/chunks/146ov6-ni2xfm.js?dpl=dpl_FpZHpQbEMNGTdYSdyqkxTTFAZpR6

js aimusicvideogenerators.com collected 2026-10-06 15:10:54 UTC 80,735 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67034,(e,t,r)=>{var s={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],s=t[1];return(r+s)*3/4-s},t.toByteArray=function(e){var t,r,n=l(e),o=n[0],a=n[1],u=new i((o+a)*3/4-a),h=0,f=a>0?o-4:o;for(r=0;r<f;r+=4)t=s[e.charCodeAt(r)]<<18|s[e.charCodeAt(r+1)]<<12|s[e.charCodeAt(r+2)]<<6|s[e.charCodeAt(r+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=255&t;return 2===a&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,u[h++]=255&t),1===a&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t),u},t.fromByteArray=function(e){for(var t,s=e.length,i=s%3,n=[],o=0,a=s-i;o<a;o+=16383)n.push(function(e,t,s){for(var i,n=[],o=t;o<s;o+=3)i=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return n.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?n.push(r[(t=e[s-1])>>2]+r[t<<4&63]+"=="):2===i&&n.push(r[(t=(e[s-2]<<8)+e[s-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),n.join("")};for(var r=[],s=[],i="u">typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],s[n.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var s=r===t?0:4-r%4;return[r,s]}s[45]=62,s[95]=63},72:function(e,t,r){"use strict";var s=r(675),i=r(783),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var s=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!a.isEncoding(i))throw TypeError("Unknown encoding: "+i);var n=0|g(s,i),l=o(n),u=l.write(s,i);return u!==n&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return f(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return function(e,t,r){var s;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(s=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),a.prototype),s}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var h=e.valueOf&&e.valueOf();if(null!=h&&h!==e)return a.from(h,t,r);var p=function(e){if(a.isBuffer(e)){var t=0|c(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),o(e<0?0:0|c(e))}function f(e){for(var t=e.length<0?0:0|c(e.length),r=o(t),s=0;s<t;s+=1)r[s]=255&e[s];return r}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!a.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&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."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return h(e)},a.allocUnsafeSlow=function(e){return h(e)};function c(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function g(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,s=arguments.length>2&&!0===arguments[2];if(!s&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(i)return s?-1:S(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i,n,o,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var s=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>s)&&(r=s);for(var i="",n=t;n<r;++n)i+=O[e[n]];return i}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var s="";r=Math.min(e.length,r);for(var i=t;i<r;++i)s+=String.fromCharCode(127&e[i]);return s}(this,t,r);case"latin1":case"binary":return function(e,t,r){var s="";r=Math.min(e.length,r);for(var i=t;i<r;++i)s+=String.fromCharCode(e[i]);return s}(this,t,r);case"base64":return i=this,n=t,o=r,0===n&&o===i.length?s.fromByteArray(i):s.fromByteArray(i.slice(n,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var s=e.slice(t,r),i="",n=0;n<s.length;n+=2)i+=String.fromCharCode(s[n]+256*s[n+1]);return i}(this,t,r);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function d(e,t,r){var s=e[t];e[t]=e[r],e[r]=s}function y(e,t,r,s,i){var n;if(0===e.length)return -1;if("string"==typeof r?(s=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(n=r*=1)!=n&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=a.from(t,s)),a.isBuffer(t))return 0===t.length?-1:m(e,t,r,s,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return m(e,[t],r,s,i)}throw TypeError("val must be string, number or Buffer")}function m(e,t,r,s,i){var n,o=1,a=e.length,l=t.length;if(void 0!==s&&("ucs2"===(s=String(s).toLowerCase())||"ucs-2"===s||"utf16le"===s||"utf-16le"===s)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(n=r;n<a;n++)if(u(e,n)===u(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*o}else -1!==h&&(n-=n-h),h=-1}else for(r+l>a&&(r=a-l),n=r;n>=0;n--){for(var f=!0,c=0;c<l;c++)if(u(e,n+c)!==u(t,c)){f=!1;break}if(f)return n}return -1}a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(A(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!
vendor: 11,979 bytes, line 1
1a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,s=t.length,i=0,n=Math.min(r,s);i<n;++i)if(e[i]!==t[i]){r=e[i],s=t[i];break}return r<s?-1:+(s<r)},a.isEncoding=function(e){switch(String(e).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}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,s=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var n=e[r];if(A(n,Uint8Array)&&(n=a.from(n)),!a.isBuffer(n))throw TypeError('"list" argument must be an Array of Buffers');n.copy(s,i),i+=n.length}return s},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(e,t,r,s,i){if(A(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===s&&(s=0),void 0===i&&(i=this.length),t<0||r>e.length||s<0||i>this.length)throw RangeError("out of range index");if(s>=i&&t>=r)return 0;if(s>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,s>>>=0,i>>>=0,this===e)return 0;for(var n=i-s,o=r-t,l=Math.min(n,o),u=this.slice(s,i),h=e.slice(t,r),f=0;f<l;++f)if(u[f]!==h[f]){n=u[f],o=h[f];break}return n<o?-1:+(o<n)},a.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var s=[],i=t;i<r;){var n,o,a,l,u=e[i],h=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(h=u);break;case 2:(192&(n=e[i+1]))==128&&(l=(31&u)<<6|63&n)>127&&(h=l);break;case 3:n=e[i+1],o=e[i+2],(192&n)==128&&(192&o)==128&&(l=(15&u)<<12|(63&n)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[i+1],o=e[i+2],a=e[i+3],(192&n)==128&&(192&o)==128&&(192&a)==128&&(l=(15&u)<<18|(63&n)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,f=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|1023&h),s.push(h),i+=f}var c=s,g=c.length;if(g<=4096)return String.fromCharCode.apply(String,c);for(var p="",d=0;d<g;)p+=String.fromCharCode.apply(String,c.slice(d,d+=4096));return p}function P(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,s,i,n){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<n)throw RangeError('"value" argument is out of bounds');if(r+s>e.length)throw RangeError("Index out of range")}function _(e,t,r,s,i,n){if(r+s>e.length||r<0)throw RangeError("Index out of range")}function w(e,t,r,s,n){return t*=1,r>>>=0,n||_(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,s,23,4),r+4}function F(e,t,r,s,n){return t*=1,r>>>=0,n||_(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,s,52,8),r+8}a.prototype.write=function(e,t,r,s){if(void 0===t)s="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)s=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===s&&(s="utf8")):(s=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,n,o,a,l,u,h,f,c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var g=!1;;)switch(s){case"hex":return function(e,t,r,s){r=Number(r)||0;var i=e.length-r;s?(s=Number(s))>i&&(s=i):s=i;var n=t.length;s>n/2&&(s=n/2);for(var o=0;o<s;++o){var a,l=parseInt(t.substr(2*o,2),16);if((a=l)!=a)break;e[r+o]=l}return o}(this,e,t,r);case"utf8":case"utf-8":return i=t,n=r,I(S(e,this.length-i),this,i,n);case"ascii":return o=t,a=r,I(x(e),this,o,a);case"latin1":case"binary":return function(e,t,r,s){return I(x(t),e,r,s)}(this,e,t,r);case"base64":return l=t,u=r,I(C(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=t,f=r,I(function(e,t){for(var r,s,i=[],n=0;n<e.length&&!((t-=2)<0);++n)s=(r=e.charCodeAt(n))>>8,i.push(r%256),i.push(s);return i}(e,this.length-h),this,h,f);default:if(g)throw TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),g=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var s=this.subarray(e,t);return Object.setPrototypeOf(s,a.prototype),s},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var s=this[e],i=1,n=0;++n<t&&(i*=256);)s+=this[e+n]*i;return s},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var s=this[e+--t],i=1;t>0&&(i*=256);)s+=this[e+--t]*i;return s},a.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var s=this[e],i=1,n=0;++n<t&&(i*=256);)s+=this[e+n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);for(var s=t,i=1,n=this[e+--s];s>0&&(i*=256);)n+=this[e+--s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readInt8=function(e,t){return(e>>>=0,t||P(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,s){if(e*=1,t>>>=0,r>>>=0,!s){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,s){if(e*=1,t>>>=0,r>>>=0,!s){var i=Math.pow(2,8*r)-1;b(this,e,t,r,i,0)}var n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,s){if(e*=1,t>>>=0,!s){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var n=0,o=1,a=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,s){if(e*=1,t>>>=0,!s){var i=Math.pow(2,8*r-1);b(this,e,t,r,i-1,-i)}var n=r-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return w(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return w(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,s){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),s||0===s||(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<r&&(s=r),s===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(s<0)throw RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-r&&(s=e.length-t+r);var i=s-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,s);else if(this===e&&r<t&&t<s)for(var n=i-1;n>=0;--n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,s),t);return i},a.prototype.fill=function(e,t,r,s){if("string"==typeof e){if("string"==typeof t?(s=t,t=0,r=this.length):"string"==typeof r&&(s=r,r=this.length),void 0!==s&&"string"!=typeof s)throw TypeError("encoding must be a string");if("string"==typeof s&&!a.isEncoding(s))throw TypeError("Unknown encoding: "+s);if(1===e.length){var i,n=e.charCodeAt(0);("utf8"===s&&n<128||"latin1"===s)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=a.isBuffer(e)?e:a.from(e,s),l=o.length;
1if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%l]}return this};var E=/[^+/0-9A-Za-z-_]/g;function S(e,t){t=t||1/0;for(var r,s=e.length,i=null,n=[],o=0;o<s;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===s){(t-=3)>-1&&n.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&n.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return n}function x(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function C(e){return s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,r,s){for(var i=0;i<s&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var O=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var s=16*r,i=0;i<16;++i)t[s+i]=e[r]+e[i];return t}()},783:function(e,t){t.read=function(e,t,r,s,i){var n,o,a=8*i-s-1,l=(1<<a)-1,u=l>>1,h=-7,f=r?i-1:0,c=r?-1:1,g=e[t+f];for(f+=c,n=g&(1<<-h)-1,g>>=-h,h+=a;h>0;n=256*n+e[t+f],f+=c,h-=8);for(o=n&(1<<-h)-1,n>>=-h,h+=s;h>0;o=256*o+e[t+f],f+=c,h-=8);if(0===n)n=1-u;else{if(n===l)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,s),n-=u}return(g?-1:1)*o*Math.pow(2,n-s)},t.write=function(e,t,r,s,i,n){var o,a,l,u=8*n-i-1,h=(1<<u)-1,f=h>>1,c=5960464477539062e-23*(23===i),g=s?0:n-1,p=s?1:-1,d=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?t+=c/l:t+=c*Math.pow(2,1-f),t*l>=2&&(o++,l/=2),o+f>=h?(a=0,o=h):o+f>=1?(a=(t*l-1)*Math.pow(2,i),o+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+g]=255&a,g+=p,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[r+g]=255&o,g+=p,o/=256,u-=8);e[r+g-p]|=128*d}}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},o=!0;try{s[e](r,r.exports,n),o=!1}finally{o&&delete i[e]}return r.exports}n.ab="/ROOT/node_modules/next/dist/compiled/buffer/",t.exports=n(72)},6552,e=>{"use strict";let t,r,s,i,n,o;var a,l,u,h=e.i(47167);let f=e=>{if("flags"in e){let t=c(e.flags),r=g(e.flags);return{...e,featureFlags:t,featureFlagPayloads:r}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([e,t])=>[e,d(t)])),s=Object.fromEntries(Object.entries(t).map(([e,t])=>{var s,i;return[e,{key:e,enabled:"string"==typeof(s=t)||s,variant:"string"==typeof s?s:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:(i=r[e])?JSON.stringify(i):void 0,description:void 0}}]}));return{...e,featureFlags:t,featureFlagPayloads:r,flags:s}}},c=e=>Object.fromEntries(Object.entries(e??{}).map(([e,t])=>[e,p(t)]).filter(([,e])=>void 0!==e)),g=e=>{let t=e??{};return Object.fromEntries(Object.keys(t).filter(e=>{let r=t[e];return r.enabled&&r.metadata&&void 0!==r.metadata.payload}).map(e=>{let r=t[e].metadata?.payload;return[e,r?d(r):void 0]}))},p=e=>void 0===e?void 0:e.variant??e.enabled,d=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}},y=(e,t)=>f({featureFlags:[...new Set([...Object.keys(e??{}),...Object.keys(t??{})])].filter(r=>!!e[r]||!!t[r]).reduce((t,r)=>(t[r]=e[r]??!0,t),{}),featureFlagPayloads:t??{}}),m=(e,t)=>({...e,enabled:v(t),variant:P(t)});function v(e){return"string"==typeof e||e}function P(e){return"string"==typeof e?e:void 0}async function b(e,t=!0){try{let t=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return await new Response(t).blob()}catch(e){return t&&console.error("Failed to gzip compress data",e),null}}let _="0123456789abcdef";class w{constructor(e){this.bytes=e}static ofInner(e){if(16===e.length)return new w(e);throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(s)||e<0||t<0||r<0||s<0||e>0xffffffffffff||t>4095||r>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");let i=new Uint8Array(16);return i[0]=e/0x10000000000,i[1]=e/0x100000000,i[2]=e/0x1000000,i[3]=e/65536,i[4]=e/256,i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>
1>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new w(i)}static parse(e){let t;switch(e.length){case 32:t=/^[0-9a-f]{32}$/i.exec(e)?.[0];break;case 36:t=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)?.slice(1,6).join("");break;case 38:t=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e)?.slice(1,6).join("");break;case 45:t=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)?.slice(1,6).join("")}if(t){let e=new Uint8Array(16);for(let r=0;r<16;r+=4){let s=parseInt(t.substring(2*r,2*r+8),16);e[r+0]=s>>>24,e[r+1]=s>>>16,e[r+2]=s>>>8,e[r+3]=s}return new w(e)}throw SyntaxError("could not parse UUID string")}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e+=_.charAt(this.bytes[t]>>>4),e+=_.charAt(15&this.bytes[t]),(3===t||5===t||7===t||9===t)&&(e+="-");return e}toHex(){let e="";for(let t=0;t<this.bytes.length;t++)e+=_.charAt(this.bytes[t]>>>4),e+=_.charAt(15&this.bytes[t]);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw Error("unreachable");if(e<=7)return this.bytes.every(e=>0===e)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every(e=>255===e)?"MAX":"VAR_RESERVED";throw Error("unreachable")}getVersion(){return"VAR_10"===this.getVariant()?this.bytes[6]>>>4:void 0}clone(){return new w(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){let r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class F{constructor(e){this.timestamp=0,this.counter=0,this.random=e??E()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,t){let r=this.generateOrAbortCore(e,t);return void 0===r&&(this.timestamp=0,r=this.generateOrAbortCore(e,t)),r}generateOrAbortCore(e,t){if(!Number.isInteger(e)||e<1||e>0xffffffffffff)throw RangeError("`unixTsMs` must be a 48-bit positive integer");if(t<0||t>0xffffffffffff)throw RangeError("`rollbackAllowance` out of reasonable range");if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+t>=this.timestamp))return;this.counter++,this.counter>0x3ffffffffff&&(this.timestamp++,this.resetCounter())}return w.fromFieldsV7(this.timestamp,Math.trunc(this.counter/0x40000000),this.counter&0x40000000-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){let e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,w.ofInner(e)}}let E=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),S=()=>(t||(t=new F)).generate();var x=((a={}).AnonymousId="anonymous_id",a.DistinctId="distinct_id",a.Props="props",a.EnablePersonProcessing="enable_person_processing",a.PersonMode="person_mode",a.FeatureFlagDetails="feature_flag_details",a.FeatureFlags="feature_flags",a.FeatureFlagPayloads="feature_flag_payloads",a.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",a.BootstrapFeatureFlags="bootstrap_feature_flags",a.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",a.OverrideFeatureFlags="override_feature_flags",a.Queue="queue",a.OptedOut="opted_out",a.SessionId="session_id",a.SessionStartTimestamp="session_start_timestamp",a.SessionLastTimestamp="session_timestamp",a.PersonProperties="person_properties",a.GroupProperties="group_properties",a.InstalledAppBuild="installed_app_build",a.InstalledAppVersion="installed_app_version",a.SessionReplay="session_replay",a.SurveyLastSeenDate="survey_last_seen_date",a.SurveysSeen="surveys_seen",a.Surveys="surveys",a.RemoteConfig="remote_config",a.FlagsEndpointWasHit="flags_endpoint_was_hit",a.DeviceId="device_id",a),C=((l={}).GZipJS="gzip-js",l.Base64="base64",l);function I(e){return null===e||"object"!=typeof e?e:Array.isArray(e)?e.map(I):Object.keys(e).sort().reduce((t,r)=>(t[r]=I(e[r]),t),{})}function A(e,t,r){return JSON.stringify({distinct_id:e,userPropertiesToSet:t?I(t):void 0,userPropertiesToSetOnce:r?I(r):void 0})}let O=Array.isArray,k=Object.prototype,R=k.hasOwnProperty,B=k.toString,$=O||function(e){return"[object Array]"===B.call(e)},T=e=>e===Object(e)&&!$(e),j=e=>
1{if(T(e)){for(let t in e)if(R.call(e,t))return!1;return!0}return!1},D=e=>"[object String]"==B.call(e);function M(e){return null===e||"object"!=typeof e}function L(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function U(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}let q="Android",N="BlackBerry",z="Nintendo",W="PlayStation",K="Xbox",H="Windows",G="(\\d+(\\.\\d+)?)";RegExp("Version/"+G),RegExp(K,"i"),RegExp(W+" \\w+","i"),RegExp(z+" \\w+","i"),RegExp(N+"|PlayBook|BB10","i");async function V(e,t){let r=null;for(let s=0;s<t.retryCount+1;s++){s>0&&await new Promise(e=>setTimeout(e,t.retryDelay));try{return await e()}catch(e){if(r=e,!t.retryCheck(e))throw e}}throw r}function J(){return new Date().toISOString()}function Q(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}RegExp("rv:"+G),RegExp("Edge?\\/"+G),RegExp("(Chrome|CrMo)\\/"+G),RegExp("CriOS\\/"+G),RegExp("(UCBrowser|UCWEB)\\/"+G),RegExp("(Opera|OPR)\\/"+G),RegExp("Firefox\\/"+G),RegExp("FxiOS\\/"+G),RegExp("Konqueror[:/]?"+G,"i"),RegExp(N+" "+G),RegExp("android\\s"+G,"i"),RegExp("SamsungBrowser\\/"+G),RegExp("(rv:|MSIE )"+G),RegExp("rv:"+G),RegExp(K+"; "+K+" (.*?)[);]","i"),RegExp(z,"i"),RegExp(W,"i"),RegExp(H,"i"),RegExp("("+q+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+q+")","i");let X=e=>e instanceof Error;function Y(e){return Promise.all(e.map(e=>(e??Promise.resolve()).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}var Z=e.i(67034);class ee{constructor(){this.events={},this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(e=>e!==t)}}emit(e,t){for(let r of this.events[e]||[])r(t);for(let r of this.events["*"]||[])r(e,t)}}class et{add(e){let t=S().toString();return this.promiseByIds[t]=e,e.catch(()=>{}).finally(()=>{delete this.promiseByIds[t]}),e}async join(){let e=Object.values(this.promiseByIds),t=e.length;for(;t>0;)await Promise.all(e),t=(e=Object.values(this.promiseByIds)).length}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}}let er=(e,t,r)=>{function s(i,...n){t(()=>{(0,r[i])(e,...n)})}return{info:(...e)=>{s("log",...e)},warn:(...e)=>{s("warn",...e)},error:(...e)=>{s("error",...e)},critical:(...t)=>{r.error(e,...t)},createLogger:s=>er(`${e} ${s}`,t,r)}};class es extends Error{constructor(e,t){super("HTTP error while fetching PostHog: status="+e.status+", reqByteLength="+t),this.response=e,this.reqByteLength=t,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}}class ei extends Error{constructor(e){super("Network error while fetching PostHog",e instanceof Error?{cause:e}:{}),this.error=e,this.name="PostHogFetchNetworkError"}}let en=(e,t)=>void 0!==t?{[e]:t}:{};async function eo(e){if(e instanceof es){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function ea(e){return"object"==typeof e&&(e instanceof es||e instanceof ei)}function el(e){return"object"==typeof e&&e instanceof es&&413===e.status}var eu=((u={}).FeatureFlags="feature_flags",u.Recordings="recordings",u);class eh{constructor(e,t={}){this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new et,this._events=new ee,this._isInitialized=!1,function(e,t){if(!e||"string"!=typeof e||0===e.trim().length)throw Error(t)}(e,"You must pass your PostHog project's api key."),this.apiKey=e,this.host=function(e){return e?.replace(/\/+$/,"")}(t.host||"https://us.i.posthog.com"),this.flushAt=t.flushAt?Math.max(t.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,t.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,t.maxQueueSize??1e3),this.flushInterval=t.flushInterval??1e4,this.preloadFeatureFlags=t.preloadFeatureFlags??!0,this.defaultOptIn=t.defaultOptIn??!0,this.disableSurveys=t.disableSurveys??!1,this._retryOptions={retryCount:t.fetchRetryCount??3,retryDelay:t.fetchRetryDelay??3e3,retryCheck:ea},this.requestTimeout=t.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=t.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=t.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=t.disableGeoip??!0,this.disabled=t.disabled??!1,this.historicalMigration=t?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this._logger=function(e,t=e=>e()){return er(e,t,function(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}())}("[PostHog]",this.logMsgIfDebug.bind(this)),this.evaluationContexts=t?.evaluationContexts??t?.evaluationEnvironments,t?.evaluationEnvironments&&!t?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!("CompressionStream"in globalThis)||(t?.disableCompression??!1)}logMsgIfDebug(e){this.isDebug&&e()}wrap(e){return this.disabled?void this._logger.warn("The client is disabled"):this._isInitialized?e():void this._initPromise.then(()=>e())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(x.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(x.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(x.OptedOut,!0)})}on(e,t){return this._events.on(e,t)}debug(e=!0){if(this.removeDebugCallback?.(),e){let e=this.on("*",(e,t)=>this._logger.info(e,t));this.removeDebugCallback=()=>{e(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(e){return{distinct_id:e.distinct_id,event:e.event,properties:{...e.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(e){return this.promiseQueue.add(e)}identifyStateless(e,t,r){this.wrap(()=>{let s={...this.buildPayload({distinct_id:e,event:"$identify",properties:t})};this.enqueue("identify",s,r)})}async identifyStatelessImmediate(e,t,r){let s={...this.buildPayload({distinct_id:e,event:"$identify",properties:t})};await this.sendImmediate("identify",s,r)}captureStateless(e,t,r,s){this.wrap(()=>{let i=this.buildPayload({distinct_id:e,event:t,properties:r});this.enqueue("capture",i,s)})}async captureStatelessImmediate(e,t,r,s){let i=this.buildPayload({distinct_id:e,event:t,properties:r});await this.sendImmediate("capture",i,s)}aliasStateless(e,t,r,s){this.wrap(()=>{let i=this.buildPayload({event:"$create_alias",distinct_id:t,properties:{...r||{},distinct_id:t,alias:e}});this.enqueue("alias",i,s)})}async aliasStatelessImmediate(e,t,r,s){let i=this.buildPayload({event:"$create_alias",distinct_id:t,properties:{...r||{},distinct_id:t,alias:e}});await this.sendImmediate("alias",i,s)}groupIdentifyStateless(e,t,r,s,i,n){this.wrap(()=>{let o=this.buildPayload({distinct_id:i||`$${e}_${t}`,event:"$groupidentify",properties:{$group_type:e,$group_key:t,$group_set:r||{},...n||{}}});this.enqueue("capture",o,s)})}async getRemoteConfig(){await this._initPromise;let e=this.host;"https://us.i.posthog.com"===e?e="https://us-assets.i.posthog.com":"https://eu.i.posthog.com"===e&&(e="https://eu-assets.i.posthog.com");let t=`${e}/array/${this.apiKey}/config`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(t,r,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(e=>e.json()).catch(e=>{this._logger.error("Remote config could not be loaded",e),this._events.emit("error",e)})}async getFlags(e,t={},r={},s={},i={},n=!1){await this._initPromise;let o=`${this.host}/flags/?v=2${n?"&config=true":""}`,a={token:this.apiKey,distinct_id:e,groups:t,person_properties:r,group_properties:s,...i};r.$device_id&&(a.$device_id=r.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(a.evaluation_contexts=this.evaluationContexts);let l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(a)};return this._logger.info("Flags URL",o),this.fetchWithRetry(o,l,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(e=>e.json()).then(e=>({success:!0,response:f(e)})).catch(e=>(this._events.emit("error",e),{success:!1,error:this.categorizeRequestError(e)}))}categorizeRequestError(e){if(e instanceof es)return{type:"api_error",statusCode:e.status};if(e instanceof ei){let t=e.error;return t instanceof Error&&("AbortError"===t.name||"TimeoutError"===t.name)?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(e,t,r={},s={},i={},n){await this._initPromise;let o=await this.getFeatureFlagDetailStateless(e,t,r,s,i,n);if(void 0===o)return{response:void 0,requestId:void 0};let a=p(o.response);return void 0===a&&(a=!1),{response:a,requestId:o.requestId}}async getFeatureFlagDetailStateless(e,t,r={},s={},i={},n){await this._initPromise;let o=await this.getFeatureFlagDetailsStateless(t,r,s,i,n,[e]);if(void 0!==o)return{response:o.flags[e],requestId:o.requestId,evaluatedAt:o.evaluatedAt}}async getFeatureFlagPayloadStateless(e,t,r={},s={},i={},n){await this._initPromise;let o=await this.getFeatureFlagPayloadsStateless(t,r,s,i,n,[e]);if(!o)return;let a=o[e];return void 0===a?null:a}async getFeatureFlagPayloadsStateless(e,t={},r={},s={},i,n){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(e,t,r,s,i,n)).payloads}async getFeatureFlagsStateless(e,t={},r={},s={},i,n){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(e,t,r,s,i,n)}async getFeatureFlagsAndPayloadsStateless(e,t={},r={},s={},i,n){await this._initPromise;let o=await this.getFeatureFlagDetailsStateless(e,t,r,s,i,n);return o?{flags:o.featureFlags,payloads:o.featureFlagPayloads,requestId:o.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(e,t={},r={},s={},i,n){await this._initPromise;let o={};(i??this.disableGeoip)&&(o.geoip_disable=!0),n&&(o.flag_keys_to_evaluate=n);let a=await this.getFlags(e,t,r,s,o);if(!a.success)return;let l=a.response;return(l.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),l.quotaLimited?.includes("feature_flags"))?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:l?.requestId,quotaLimited:l.quotaLimited}):l}async getSurveysStateless(){if(await this._initPromise,!0===this.disableSurveys)return this._logger.info("Loading surveys is disabled."),[];let e=`${this.host}/api/surveys/?token=${this.apiKey}`,t={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},r=await this.fetchWithRetry(e,t).then(e=>{if(200!==e.status||!e.json){let t=`Surveys API could not be loaded: ${e.status}`,r=Error(t);this._logger.error(r),this._events.emit("error",Error(t));return}return e.json()}).catch(e=>{this._logger.error("Surveys API could not be loaded",e),this._events.emit("error",e)}),s=r?.surveys;return s&&this._logger.info("Surveys fetched from API: ",JSON.stringify(s)),s??[]}get props(){return this._props||(this._props=this.getPersistedProperty(x.Props)),this._props||{}}set props(e){this._props=e}async register(e){this.wrap(()=>{this.props={...this.props,...e},this.setPersistedProperty(x.Props,this.props)})}async unregister(e){this.wrap(()=>{delete this.props[e],this.setPersistedProperty(x.Props,this.props)})}processBeforeEnqueue(e){return e}async flushStorage(){}enqueue(e,t,r){this.wrap(()=>
1{if(this.optedOut)return void this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let s=this.prepareMessage(e,t,r);if(null===(s=this.processBeforeEnqueue(s)))return;let i=this.getPersistedProperty(x.Queue)||[];i.length>=this.maxQueueSize&&(i.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),i.push({message:s}),this.setPersistedProperty(x.Queue,i),this._events.emit(e,s),i.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=Q(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(e,t,r){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let s=this.prepareMessage(e,t,r);if(null===(s=this.processBeforeEnqueue(s)))return;let i={api_key:this.apiKey,batch:[s],sent_at:J()};this.historicalMigration&&(i.historical_migration=!0);let n=JSON.stringify(i),o=`${this.host}/batch/`,a=this.disableCompression?null:await b(n,this.isDebug),l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...null!==a&&{"Content-Encoding":"gzip"}},body:a||n};try{await this.fetchWithRetry(o,l)}catch(e){this._events.emit("error",e)}}prepareMessage(e,t,r){let s={...t,type:e,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:r?.timestamp?r?.timestamp:J(),uuid:r?.uuid?r.uuid:S().toString()};return(r?.disableGeoip??this.disableGeoip)&&(s.properties||(s.properties={}),s.properties.$geoip_disable=!0),s.distinctId&&(s.distinct_id=s.distinctId,delete s.distinctId),s}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async e=>{await eo(e)})}async flush(){let e=Y([this.flushPromise]).then(()=>this._flush());return this.flushPromise=e,this.addPendingPromise(e),Y([e]).then(()=>{this.flushPromise===e&&(this.flushPromise=null)}),e}getCustomHeaders(){let e=this.getCustomUserAgent(),t={};return e&&""!==e&&(t["User-Agent"]=e),t}async _flush(){this.clearFlushTimer(),await this._initPromise;let e=this.getPersistedProperty(x.Queue)||[];if(!e.length)return;let t=[],r=e.length;for(;e.length>0&&t.length<r;){let r=e.slice(0,this.maxBatchSize),s=r.map(e=>e.message),i=async()=>{let t=(this.getPersistedProperty(x.Queue)||[]).slice(r.length);this.setPersistedProperty(x.Queue,t),e=t,await this.flushStorage()},n={api_key:this.apiKey,batch:s,sent_at:J()};this.historicalMigration&&(n.historical_migration=!0);let o=JSON.stringify(n),a=`${this.host}/batch/`,l=this.disableCompression?null:await b(o,this.isDebug),u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...null!==l&&{"Content-Encoding":"gzip"}},body:l||o},h={retryCheck:e=>!el(e)&&ea(e)};try{await this.fetchWithRetry(a,u,h)}catch(e){if(el(e)&&s.length>1){this.maxBatchSize=Math.max(1,Math.floor(s.length/2)),this._logger.warn(`Received 413 when sending batch of size ${s.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw e instanceof ei||await i(),this._events.emit("error",e),e}await i(),t.push(...s)}this._events.emit("flush",t)}async fetchWithRetry(e,t,r,s){let i=t.body?t.body:"",n=-1;try{n=i instanceof Blob?i.size:Z.Buffer.byteLength(i,"utf8")}catch{n=i instanceof Blob?i.size:new TextEncoder().encode(i).length}return await V(async()=>{let r=new AbortController,i=Q(()=>r.abort(),s??this.requestTimeout),o=null;try{o=await this.fetch(e,{signal:r.signal,...t})}catch(e){throw new ei(e)}finally{clearTimeout(i)}if("no-cors"!==t.mode&&(o.status<200||o.status>=400))throw new es(o,n);return o},{...this._retryOptions,...r})}async _shutdown(e=3e4){let t;await this._initPromise;let r=!1;this.clearFlushTimer();let s=async()=>{try{for(await this.promiseQueue.join();;){let e=this.getPersistedProperty(x.Queue)||[];if(0===e.length||(await this.flush(),r))break}}catch(e){if(!ea(e))throw e;await eo(e)}};try{return await Promise.race([new Promise((s,i)=>{t=Q(()=>{this._logger.error("Timed out while shutting down PostHog"),r=!0,i("Timeout while shutting down PostHog. Some events may not have been sent.")},e)}),s()])}finally{clearTimeout(t)}}async shutdown(e=3e4){return this.shutdownPromise?this._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):this.shutdownPromise=this._shutdown(e).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}}class ef extends eh{constructor(e,t){const r=t?.disableGeoip??!1,s=t?.featureFlagsRequestTimeoutMs??1e4;super(e,{...t,disableGeoip:r,featureFlagsRequestTimeoutMs:s}),this.flagCallReported={},this._sessionMaxLengthSeconds=86400,this.sessionProps={},this._cachedPersonProperties=null,this.sendFeatureFlagEvent=t?.sendFeatureFlagEvent??!0,this._sessionExpirationTimeSeconds=t?.sessionExpirationTimeSeconds??1800,this._personProfiles=t?.personProfiles??"identified_only",this._beforeSend=t?.before_send}setupBootstrap(e){let t=e?.bootstrap;if(!t)return;t.distinctId&&(t.isIdentifiedId?this.getPersistedProperty(x.DistinctId)||(this.setPersistedProperty(x.DistinctId,t.distinctId),this.setPersistedProperty(x.PersonMode,"identified")):this.getPersistedProperty(x.AnonymousId)||this.setPersistedProperty(x.AnonymousId,t.distinctId));let r=t.featureFlags,s=t.featureFlagPayloads??{};if(r&&Object.keys(r).length){let e=y(r,s);if(Object.keys(e.flags).length>0){this.setBootstrappedFeatureFlagDetails(e);let t=this.getKnownFeatureFlagDetails()||{flags:{},requestId:void 0},r={flags:{...e.flags,...t.flags},requestId:e.requestId};this.setKnownFeatureFlagDetails(r)}}}clearProps(){this.props=void 0,this.sessionProps={},this.flagCallReported={}}on(e,t){return this._events.on(e,t)}reset(e){this.wrap(()=>{let t=[x.Queue,...e||[]];for(let e of(this.clearProps(),this._cachedPersonProperties=null,Object.keys(x)))t.includes(x[e])||this.setPersistedProperty(x[e],null);this.reloadFeatureFlags()})}getCommonEventProperties(){let e=this.getFeatureFlags(),t={};if(e)for(let[r,s]of Object.entries(e))t[`$feature/${r}`]=s;return{...en("$active_feature_flags",e?Object.keys(e):void 0),...t,...super.getCommonEventProperties()}}enrichProperties(e){return{...this.props,...this.sessionProps,...e||{},...this.getCommonEventProperties(),$session_id:this.getSessionId()}}getSessionId(){if(!this._isInitialized)return"";let e=this.getPersistedProperty(x.SessionId),t=this.getPersistedProperty(x.SessionLastTimestamp)||0,r=this.getPersistedProperty(x.SessionStartTimestamp)||0,s=Date.now(),i=s-t,n=s-r;return(!e||i>1e3*this._sessionExpirationTimeSeconds||n>1e3*this._sessionMaxLengthSeconds)&&(e=S().toString(),this.setPersistedProperty(x.SessionId,e),this.setPersistedProperty(x.SessionStartTimestamp,s)),this.setPersistedProperty(x.SessionLastTimestamp,s),e}resetSessionId(){this.wrap(()=>{this.setPersistedProperty(x.SessionId,null),this.setPersistedProperty(x.SessionLastTimestamp,null),this.setPersistedProperty(x.SessionStartTimestamp,null)})}getAnonymousId(){if(!this._isInitialized)return"";let e=this.getPersistedProperty(x.AnonymousId);return e||(e=S().toString(),this.setPersistedProperty(x.AnonymousId,e)),e}getDistinctId(){return this._isInitialized?this.getPersistedProperty(x.DistinctId)||this.getAnonymousId():""}registerForSession(e){this.sessionProps={...this.sessionProps,...e}}unregisterForSession(e){delete this.sessionProps[e]}identify(e,t,r){this.wrap(()=>
1{if(!this._requirePersonProcessing("posthog.identify"))return;let s=this.getDistinctId();e=e||s,t?.$groups&&this.groups(t.$groups);let i=t?.$set_once;delete t?.$set_once;let n=t?.$set||t,o=this.enrichProperties({$anon_distinct_id:this.getAnonymousId(),...en("$set",n),...en("$set_once",i)}),a=T(n)?n:void 0,l=T(i)?i:void 0;e!==s?(this.setPersistedProperty(x.AnonymousId,s),this.setPersistedProperty(x.DistinctId,e),this.setPersistedProperty(x.PersonMode,"identified"),this.reloadFeatureFlags(),super.identifyStateless(e,o,r),this._cachedPersonProperties=A(e,a,l)):(a||l)&&this.setPersonProperties(a,l)})}capture(e,t,r){"$exception"!==e||r?._originatedFromCaptureException||this._logger.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.wrap(()=>{let s=this.getDistinctId();t?.$groups&&this.groups(t.$groups);let i=this.enrichProperties(t),n=this._hasPersonProcessing();i.$process_person_profile=n,i.$is_identified=this._isIdentified(),n&&this._requirePersonProcessing("capture"),super.captureStateless(s,e,i,r)})}alias(e){this.wrap(()=>{if(!this._requirePersonProcessing("posthog.alias"))return;let t=this.getDistinctId(),r=this.enrichProperties({});super.aliasStateless(e,t,r)})}autocapture(e,t,r={},s){this.wrap(()=>{let i={distinct_id:this.getDistinctId(),event:"$autocapture",properties:{...this.enrichProperties(r),$event_type:e,$elements:t}};this.enqueue("autocapture",i,s)})}groups(e){this.wrap(()=>{if(!this._requirePersonProcessing("posthog.group"))return;let t=this.props.$groups||{};this.register({$groups:{...t,...e}}),Object.keys(e).find(r=>t[r]!==e[r])&&this.reloadFeatureFlags()})}group(e,t,r,s){this.wrap(()=>{let i=(this.props.$groups||{})[e]!==t;this.groups({[e]:t}),(i||r)&&this.groupIdentify(e,t,r,s)})}groupIdentify(e,t,r,s){this.wrap(()=>{if(!this._requirePersonProcessing("posthog.groupIdentify"))return;let i=this.getDistinctId(),n=this.enrichProperties({});super.groupIdentifyStateless(e,t,r,s,i,n)})}setPersonPropertiesForFlags(e,t=!0){this.wrap(()=>{let r=this.getPersistedProperty(x.PersonProperties)||{},s=e?.$set||(e?.$set_once?{}:e),i=e?.$set_once,n={};if(i)for(let e in i)!Object.prototype.hasOwnProperty.call(i,e)||e in r||(n[e]=i[e]);this.setPersistedProperty(x.PersonProperties,{...r,...n,...s}),t&&this.reloadFeatureFlags()})}resetPersonPropertiesForFlags(){this.wrap(()=>{this.setPersistedProperty(x.PersonProperties,null)})}setGroupPropertiesForFlags(e){this.wrap(()=>{let t=this.getPersistedProperty(x.GroupProperties)||{};0!==Object.keys(t).length&&Object.keys(t).forEach(r=>{t[r]={...t[r],...e[r]},delete e[r]}),this.setPersistedProperty(x.GroupProperties,{...t,...e})})}resetGroupPropertiesForFlags(){this.wrap(()=>{this.setPersistedProperty(x.GroupProperties,null)})}async remoteConfigAsync(){return(await this._initPromise,this._remoteConfigResponsePromise)?this._remoteConfigResponsePromise:this._remoteConfigAsync()}async flagsAsync(e){let{sendAnonDistinctId:t=!0,fetchConfig:r=!1,triggerOnRemoteConfig:s=!1}=e??{};return(await this._initPromise,this._flagsResponsePromise)?(this._logger.info("Feature flags are being loaded already, queuing reload."),this._pendingFlagsRequest&&this._flagsResponsePromise.then(this._pendingFlagsRequest.resolve).catch(this._pendingFlagsRequest.reject),new Promise((e,i)=>{this._pendingFlagsRequest={sendAnonDistinctId:t,fetchConfig:r,triggerOnRemoteConfig:s,resolve:e,reject:i}})):this._flagsAsync({sendAnonDistinctId:t,fetchConfig:r,triggerOnRemoteConfig:s})}onRemoteConfig(e){}maybeNotifyRemoteConfig(e,t){if(e)try{this.onRemoteConfig(t)}catch(e){this._logger.error("Error in onRemoteConfig callback:",e)}}cacheSessionReplay(e,t){let r=t?.sessionRecording;r?(this.setPersistedProperty(x.SessionReplay,r),this._logger.info(`Session replay config from ${e}: `,JSON.stringify(r))):"boolean"==typeof r&&!1===r&&(this._logger.info(`Session replay config from ${e} disabled.`),this.setPersistedProperty(x.SessionReplay,null))}async _remoteConfigAsync(){return this._remoteConfigResponsePromise=this._initPromise.then(()=>{let e=this.getPersistedProperty(x.RemoteConfig);return this._logger.info("Cached remote config: ",JSON.stringify(e)),super.getRemoteConfig().then(t=>{if(t){let r={...t};if(delete r.surveys,this._logger.info("Fetched remote config: ",JSON.stringify(r)),!1===this.disableSurveys){let e=t.surveys,r=!0;Array.isArray(e)?this._logger.info("Surveys fetched from remote config: ",JSON.stringify(e)):(this._logger.info("There are no surveys."),r=!1),r?this.setPersistedProperty(x.Surveys,e):this.setPersistedProperty(x.Surveys,null)}else this.setPersistedProperty(x.Surveys,null);this.setPersistedProperty(x.RemoteConfig,r),this.cacheSessionReplay("remote config",t);let s=!1;!1===t.hasFeatureFlags?(this.setKnownFeatureFlagDetails({flags:{}}),this._logger.warn("Remote config has no feature flags, will not load feature flags.")):!1!==this.preloadFeatureFlags&&(s=!0,this.flagsAsync({sendAnonDistinctId:!0,fetchConfig:!0,triggerOnRemoteConfig:!0})),t.supportedCompression?.includes(C.GZipJS)||(this.disableCompression=!0),this.maybeNotifyRemoteConfig(!s,t),e=t}return e})}).finally(()=>{this._remoteConfigResponsePromise=void 0}),this._remoteConfigResponsePromise}async _flagsAsync(e){let t=e?.sendAnonDistinctId??!0,r=e?.fetchConfig??!1,s=e?.triggerOnRemoteConfig??!1;return this._flagsResponsePromise=this._initPromise.then(async()=>{let e=this.getDistinctId(),i=this.props.$groups||{},n=this.getPersistedProperty(x.PersonProperties)||{},o=this.getPersistedProperty(x.GroupProperties)||{},a=this.getPersistedProperty(x.DeviceId),l={$anon_distinct_id:t?this.getAnonymousId():void 0,$device_id:a??void 0},u=await super.getFlags(e,i,n,o,l,r);if(!u.success)return void this.setKnownFeatureFlagDetails({flags:this.getKnownFeatureFlagDetails()?.flags??{},requestError:u.error});let h=u.response;if(h?.quotaLimited?.includes(eu.FeatureFlags))return this.setKnownFeatureFlagDetails({flags:this.getKnownFeatureFlagDetails()?.flags??{},quotaLimited:h.quotaLimited}),this._logger.warn("[FEATURE FLAGS] Feature flags quota limit exceeded. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.maybeNotifyRemoteConfig(s,h),h;if(h?.featureFlags){this.sendFeatureFlagEvent&&(this.flagCallReported={});let e=h;if(h.errorsWhileComputingFlags){let t=this.getKnownFeatureFlagDetails();this._logger.info("Cached feature flags: ",JSON.stringify(t));let r={};for(let e in h.flags)h.flags[e].failed||(r[e]=h.flags[e]);e={...h,flags:{...t?.flags,...r}}}this.setKnownFeatureFlagDetails({flags:e.flags,requestId:h.requestId,evaluatedAt:h.evaluatedAt,errorsWhileComputingFlags:h.errorsWhileComputingFlags,quotaLimited:h.quotaLimited}),this.setPersistedProperty(x.FlagsEndpointWasHit,!0),this.cacheSessionReplay("flags",h),this.maybeNotifyRemoteConfig(s,h)}return h}).finally(()=>{this._flagsResponsePromise=void 0;
1let e=this._pendingFlagsRequest;e&&(this._pendingFlagsRequest=void 0,this._logger.info("Executing pending feature flags reload."),this.flagsAsync({sendAnonDistinctId:e.sendAnonDistinctId,fetchConfig:e.fetchConfig,triggerOnRemoteConfig:e.triggerOnRemoteConfig}).then(e.resolve).catch(e.reject))}),this._flagsResponsePromise}setKnownFeatureFlagDetails(e){this.wrap(()=>{this.setPersistedProperty(x.FeatureFlagDetails,e),this._events.emit("featureflags",c(e?.flags??{}))})}getKnownFeatureFlagDetails(){let e=this.getPersistedProperty(x.FeatureFlagDetails);if(!e){let e=this.getPersistedProperty(x.FeatureFlags),t=this.getPersistedProperty(x.FeatureFlagPayloads);if(void 0===e&&void 0===t)return;return y(e??{},t??{})}return f(e)}getStoredFlagDetails(){return this.getPersistedProperty(x.FeatureFlagDetails)}getKnownFeatureFlags(){let e=this.getKnownFeatureFlagDetails();if(e)return c(e.flags)}getBootstrappedFeatureFlagDetails(){let e=this.getPersistedProperty(x.BootstrapFeatureFlagDetails);if(e)return e}setBootstrappedFeatureFlagDetails(e){this.setPersistedProperty(x.BootstrapFeatureFlagDetails,e)}getBootstrappedFeatureFlags(){let e=this.getBootstrappedFeatureFlagDetails();if(e)return c(e.flags)}getBootstrappedFeatureFlagPayloads(){let e=this.getBootstrappedFeatureFlagDetails();if(e)return g(e.flags)}getFeatureFlagResult(e,t){return this._getFeatureFlagResult(e,t)}_getFeatureFlagResult(e,t={}){let r=this.getStoredFlagDetails(),s=this.getFeatureFlagDetails(),i=r?.quotaLimited?.includes(eu.FeatureFlags),n=s?.flags[e],o=(t.sendEvent??this.sendFeatureFlagEvent)&&!this.flagCallReported[e],a=p(n);if(o){let t=[];if(r?.requestError){let e,{type:s,statusCode:i}=r.requestError;"timeout"===s?t.push("timeout"):"api_error"===s&&void 0!==i?t.push((e=i,`api_error_${e}`)):"connection_error"===s?t.push("connection_error"):t.push("unknown_error")}else r&&(r.errorsWhileComputingFlags&&t.push("errors_while_computing_flags"),i?t.push("quota_limited"):void 0!==a||n||t.push("flag_missing"));let o=this.getBootstrappedFeatureFlags()?.[e],l=this.getBootstrappedFeatureFlagPayloads()?.[e],u=t.length>0?t.join(","):void 0;this.flagCallReported[e]=!0;let h={$feature_flag:e,$feature_flag_response:a,...en("$feature_flag_id",n?.metadata?.id),...en("$feature_flag_version",n?.metadata?.version),...en("$feature_flag_reason",n?.reason?.description??n?.reason?.code),...en("$feature_flag_bootstrapped_response",o),...en("$feature_flag_bootstrapped_payload",l),$used_bootstrap_value:!this.getPersistedProperty(x.FlagsEndpointWasHit),...en("$feature_flag_request_id",s?.requestId),...en("$feature_flag_evaluated_at",s?.evaluatedAt),...en("$feature_flag_error",u)};this.capture("$feature_flag_called",h)}if(void 0===a)switch(t.missingFlagBehavior){case"getFeatureFlagPayload":return s?{key:e,enabled:!1,payload:null}:void 0;
1case"getFeatureFlag":return s&&Object.keys(s.flags).length?{key:e,enabled:!1,payload:null}:void 0;case void 0:return}let l=n?.metadata?.payload,u=void 0!==l?d(l):null;return{key:e,enabled:v(a),variant:P(a),payload:u}}getFeatureFlag(e){let t=this._getFeatureFlagResult(e,{missingFlagBehavior:"getFeatureFlag"});return t?.variant??t?.enabled}getFeatureFlagPayload(e){let t=this._getFeatureFlagResult(e,{missingFlagBehavior:"getFeatureFlagPayload",sendEvent:!1});return t?.payload}getFeatureFlagPayloads(){return this.getFeatureFlagDetails()?.featureFlagPayloads}getFeatureFlags(){return this.getFeatureFlagDetails()?.featureFlags}getFeatureFlagDetails(){let e=this.getKnownFeatureFlagDetails(),t=this.getPersistedProperty(x.OverrideFeatureFlags);if(!t)return e;let r=(e=e??{featureFlags:{},featureFlagPayloads:{},flags:{}}).flags??{};for(let e in t)t[e]?r[e]=m(r[e],t[e]):delete r[e];return f({...e,flags:r})}getFeatureFlagsAndPayloads(){return{flags:this.getFeatureFlags(),payloads:this.getFeatureFlagPayloads()}}isFeatureEnabled(e){let t=this.getFeatureFlag(e);if(void 0!==t)return!!t}reloadFeatureFlags(e){this.flagsAsync({sendAnonDistinctId:!0}).then(t=>{e?.cb?.(void 0,t?.featureFlags)}).catch(t=>{e?.cb?.(t,void 0),e?.cb||this._logger.info("Error reloading feature flags",t)})}async reloadRemoteConfigAsync(){return await this.remoteConfigAsync()}async reloadFeatureFlagsAsync(e){return(await this.flagsAsync({sendAnonDistinctId:e}))?.featureFlags}onFeatureFlags(e){return this.on("featureflags",async()=>{let t=this.getFeatureFlags();t&&e(t)})}onFeatureFlag(e,t){return this.on("featureflags",async()=>{let r=this.getFeatureFlag(e);void 0!==r&&t(r)})}async overrideFeatureFlag(e){this.wrap(()=>null===e?this.setPersistedProperty(x.OverrideFeatureFlags,null):this.setPersistedProperty(x.OverrideFeatureFlags,e))}captureException(e,t){let r={$exception_level:"error",$exception_list:[{type:e instanceof Error?e.name:"Error",value:e instanceof Error?e.message:e,mechanism:{handled:!0,synthetic:!1}}],...t};this.capture("$exception",r,{_originatedFromCaptureException:!0})}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_feedback_text:t,$ai_trace_id:String(e)})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_metric_name:t,$ai_metric_value:String(r),$ai_trace_id:String(e)})}_isIdentified(){let e=this.getPersistedProperty(x.PersonMode);if("identified"===e)return!0;if(void 0===e){let e=this.getPersistedProperty(x.DistinctId),t=this.getPersistedProperty(x.AnonymousId);if(e&&t&&e!==t)return!0}return!1}_getGroups(){return this.props.$groups||{}}_hasPersonProcessing(){if("always"===this._personProfiles)return!0;if("never"===this._personProfiles)return!1;let e=this._isIdentified(),t=Object.keys(this._getGroups()).length>0,r=!0===this.getPersistedProperty(x.EnablePersonProcessing);return e||t||r}_requirePersonProcessing(e){return"never"===this._personProfiles?(this._logger.error(`${e} was called, but personProfiles is set to "never". This call will be ignored.`),!1):(this.setPersistedProperty(x.EnablePersonProcessing,!0),!0)}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.capture("$set",{$set:{},$set_once:{}})}setPersonProperties(e,t,r=!0){this.wrap(()=>{let s=null==e||j(e),i=null==t||j(t);if(s&&i||!this._requirePersonProcessing("posthog.setPersonProperties"))return;let n=A(this.getDistinctId(),e,t);this._cachedPersonProperties===n?this._logger.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored."):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},r),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=n)})}processBeforeEnqueue(e){if(!this._beforeSend)return e;let t=e.timestamp,r=e.properties||{},s={uuid:e.uuid,event:e.event,properties:r,$set:r.$set,$set_once:r.$set_once,timestamp:"string"==typeof t?new Date(t):t},i=this._runBeforeSend(s);if(!i)return null;let n={...i.properties??r};return void 0!==i.$set?n.$set=i.$set:delete n.$set,void 0!==i.$set_once?n.$set_once=i.$set_once:delete n.$set_once,{...e,uuid:i.uuid??e.uuid,event:i.event,properties:n,timestamp:i.timestamp}}_runBeforeSend(e){let t=this._beforeSend;if(!t)return e;let r=Array.isArray(t)?t:[t],s=e;for(let t of r)try{if(!(s=t(s)))return this._logger.info(`Event '${e.event}' was rejected in before_send function`),null}catch(t){this._logger.error(`Error in before_send function for event '${e.event}':`,t)}return s}}class ec{constructor(e,t,r=[]){this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t={}){let r=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),n=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(n,r),$exception_level:"error"}}async modifyFrames(e){for(let t of e)t.stacktrace&&t.stacktrace.frames&&$(t.
1stacktrace.frames)&&(t.stacktrace.frames=await this.applyModifiers(t.stacktrace.frames));return e}coerceFallback(e){return{type:"Error",value:"Unknown error",stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){let r,s;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),{...e,cause:r,stack:s}}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}async applyModifiers(e){let t=e;for(let e of this.modifiers)t=await e(t);return t}convertToExceptionList(e,t){let r={type:e.type,value:e.value,mechanism:{type:t.type??"generic",handled:t.handled??!0,synthetic:e.synthetic??!1}};e.stack&&(r.stacktrace={type:"raw",frames:e.stack});let s=[r];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,{...t,handled:!0})),s}buildParsingContext(e){return{chunkIdMap:function(e){let t=globalThis._posthogChunkIds;if(!t)return;let n=Object.keys(t);return i&&n.length===s?i:(s=n.length,i=n.reduce((s,i)=>{r||(r={});let n=r[i];if(n)s[n[0]]=n[1];else{let n=e(i);for(let e=n.length-1;e>=0;e--){let o=n[e],a=o?.filename,l=t[i];if(a&&l){s[a]=l,r[i]=[a,l];break}}}return s},{}))}(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,r=0){let s=(r,s)=>{if(s<=4){let i=this.buildCoercingContext(e,t,s);return this.applyCoercers(r,i)}};return{...t,syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,r),next:e=>s(e,r+1)}}}function eg(e,t,r,s,i){let n={platform:e,filename:t,function:"<anonymous>"===r?"?":r,in_app:!0};return void 0!==s&&(n.lineno=s),void 0!==i&&(n.colno=i),n}e.s(["ErrorPropertiesBuilder",0,ec],57220);let ep=(e,t)=>{let r=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return r||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ed=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ey=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,em=/\((\S*)(?::(\d+))(?::(\d+))\)/,ev=(e,t)=>{let r=ed.exec(e);if(r){let[,e,s,i]=r;return eg(t,e,"?",+s,+i)}let s=ey.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){let e=em.exec(s[2]);e&&(s[2]=e[1],s[3]=e[2],s[4]=e[3])}let[e,r]=ep(s[1]||"?",s[2]);return eg(t,r,e,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},eP=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eb=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e_=(e,t)=>
1{let r=eP.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let e=eb.exec(r[3]);e&&(r[1]=r[1]||"eval",r[3]=e[1],r[4]=e[2],r[5]="")}let e=r[3],s=r[1]||"?";return[s,e]=ep(s,e),eg(t,e,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},ew=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,eF=(e,t)=>{let r=ew.exec(e);return r?eg(t,r[2],r[1]||"?",+r[3],r[4]?+r[4]:void 0):void 0},eE=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,eS=(e,t)=>{let r=eE.exec(e);return r?eg(t,r[2],r[3]||"?",+r[1]):void 0},ex=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,eC=(e,t)=>{let r=ex.exec(e);return r?eg(t,r[5],r[3]||r[4]||"?",+r[1],+r[2]):void 0},eI=/^\s*[-]{4,}$/,eA=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,eO=(e,t)=>{let r=e.match(eA);if(r){let e,s,i,n,o;if(r[1]){let t=(i=r[1]).lastIndexOf(".");if("."===i[t-1]&&t--,t>0){e=i.slice(0,t),s=i.slice(t+1);let r=e.indexOf(".Module");r>0&&(i=i.slice(r+1),e=e.slice(0,r))}n=void 0}s&&(n=e,o=s),"<anonymous>"===s&&(o=void 0,i=void 0),void 0===i&&(o=o||"?",i=n?`${n}.${o}`:o);let a=r[2]?.startsWith("file://")?r[2].slice(7):r[2],l="native"===r[5];return a?.match(/\/[A-Z]:/)&&(a=a.slice(1)),a||!r[5]||l||(a=r[5]),{filename:a?decodeURI(a):void 0,module:void 0,function:i,lineno:ek(r[3]),colno:ek(r[4]),in_app:function(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==e&&!e.includes("node_modules/")}(a||"",l),platform:t}}if(e.match(eI))return{filename:e,platform:t}};function ek(e){return parseInt(e||"",10)||void 0}let eR=/\(error: (.*)\)/;function eB(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{var r;return{...e,filename:e.filename||((r=t)[r.length-1]||{}).filename,function:e.function||"?"}})}function e$(){return eT("web:javascript",ev,e_)}function eT(e,...t){return(r,s=0)=>{let i=[],n=r.split("\n");for(let r=s;r<n.length;r++){let s=n[r];if(s.length>1024)continue;let o=eR.test(s)?s.replace(eR,"$1"):s;if(!o.match(/\S*Error: /)){for(let r of t){let t=r(o,e);if(t){i.push(t);break}}if(i.length>=50)break}}return eB(i)}}e.s(["createDefaultStackParser",0,e$,"createStackParser",0,eT,"reverseAndStripFrames",0,eB],39850);class ej{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let r=D(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return L(e,"DOMException")}isDOMError(e){return L(e,"DOMError")}}e.s(["DOMExceptionCoercer",0,ej],53919);class eD{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}e.s(["ErrorCoercer",0,eD],1172);class eM{match(e){return L(e,"ErrorEvent")&&void 0!=e.error}coerce(e,t){let r=t.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["ErrorEventCoercer",0,eM],6914);let eL=["fatal","error","warning","log","info","debug"];function eU(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let e=r.length;e>0;e--){let s=r.slice(0,e).join(", ");if(!(s.length>t)){if(e===r.length)return s;return s.length<=t?s:`${s.slice(0,t)}...`}}return""}class eq{match(e){return"object"==typeof e&&null!==e}coerce(e,t){let r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return U(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;let t=this.getObjectClassName(e),r=eU(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${r}`}isSeverityLevel(e){return D(e)&&!(D(e)&&0===e.trim().length)&&eL.indexOf(e)>=0}getErrorPropertyFromObject(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(X(r))return r}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}
1e.s(["ObjectCoercer",0,eq],39140);class eN{match(e){return U(e)}coerce(e,t){let r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${eU(e)}`,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["EventCoercer",0,eN],23587);class ez{match(e){return M(e)}coerce(e,t){return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["PrimitiveCoercer",0,ez],29413);class eW{match(e){return L(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!U(e))return!1;try{let t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch{return!1}}coerce(e,t){let r=this.getUnhandledRejectionReason(e);return M(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:t.syntheticException?.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch{}return e}}e.s(["PromiseRejectionEventCoercer",0,eW],87906),e.s([],41608),e.s([],74619),e.i(74619),e.i(57220),e.i(39850),e.s(["chromeStackLineParser",0,ev,"createDefaultStackParser",0,e$,"createStackParser",0,eT,"geckoStackLineParser",0,e_,"nodeStackLineParser",0,eO,"opera10StackLineParser",0,eS,"opera11StackLineParser",0,eC,"reverseAndStripFrames",0,eB,"winjsStackLineParser",0,eF],55923),e.i(55923),e.i(41608),e.i(53919),e.i(1172),e.i(6914);let eK=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class eH{match(e){return"string"==typeof e}coerce(e,t){let[r,s]=this.getInfos(e);return{type:r??"Error",value:s??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){let t="Error",r=e,s=e.match(eK);return s&&(t=s[1],r=s[2]),[t,r]}}e.s(["StringCoercer",0,eH],67067),e.i(67067),e.i(39140),e.i(23587),e.i(29413),e.i(87906),e.s(["DOMExceptionCoercer",0,ej,"ErrorCoercer",0,eD,"ErrorEventCoercer",0,eM,"EventCoercer",0,eN,"ObjectCoercer",0,eq,"PrimitiveCoercer",0,ez,"PromiseRejectionEventCoercer",0,eW,"StringCoercer",0,eH],47116),e.i(47116);class eG{constructor(e){this._maxSize=e,this._cache=new Map}get(e){let t=this._cache.get(e);if(void 0!==t)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){this._cache.set(e,t)}reduce(){for(;this._cache.size>=this._maxSize;){let e=this._cache.keys().next().value;e&&this._cache.delete(e)}}}e.s(["ReduceableCache",0,eG],16634),e.i(16634),e.s(["DOMExceptionCoercer",0,ej,"ErrorCoercer",0,eD,"ErrorEventCoercer",0,eM,"ErrorPropertiesBuilder",0,ec,"EventCoercer",0,eN,"ObjectCoercer",0,eq,"PrimitiveCoercer",0,ez,"PromiseRejectionEventCoercer",0,eW,"ReduceableCache",0,eG,"StringCoercer",0,eH,"chromeStackLineParser",0,ev,"createDefaultStackParser",0,e$,"createStackParser",0,eT,"geckoStackLineParser",0,e_,"nodeStackLineParser",0,eO,"opera10StackLineParser",0,eS,"opera11StackLineParser",0,eC,"reverseAndStripFrames",0,eB,"winjsStackLineParser",0,eF],39339),e.i(39339);let eV="4.6.2";function eJ(e,t){return e.indexOf(t)>=0}function eQ(e,t,r){if(t=t||"",r||eJ(e," OPR/"))return eJ(e,"Mini")?"Opera Mini":"Opera";if(/(BlackBerry|PlayBook|BB10)/i.test(e))return"BlackBerry";if(eJ(e,"IEMobile")||eJ(e,"WPDesktop"))return"Internet Explorer Mobile";if(eJ(e,"SamsungBrowser/"))return"Samsung Internet";if(eJ(e,"Edge")||eJ(e,"Edg/"))return"Microsoft Edge";else if(eJ(e,"FBIOS"))return"Facebook Mobile";else if(eJ(e,"Chrome"))return"Chrome";else if(eJ(e,"CriOS"))return"Chrome iOS";else if(eJ(e,"UCWEB")||eJ(e,"UCBrowser"))return"UC Browser";else if(eJ(e,"FxiOS"))return"Firefox iOS";else if(eJ(t,"Apple"))return eJ(e,"Mobile")?"Mobile Safari":"Safari";else if(eJ(e,"Android"))return"Android Mobile";else if(eJ(e,"Konqueror"))return"Konqueror";else if(eJ(e,"Firefox"))return"Firefox";else if(eJ(e,"MSIE")||eJ(e,"Trident/"))return"Internet Explorer";else if(eJ(e,"Gecko"))return"Mozilla";else return""}let eX={getItem(e){try{let t=e+"=",r=document.cookie.split(";");for(let e=0;e<r.length;e++){let s=r[e];for(;" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null},setItem(e,t){try{let r=e+"="+encodeURIComponent(t)+"; path=/";document.cookie=r}catch(e){return}},removeItem(e){try{eX.setItem(e,"")}catch(e){return}},clear(){document.cookie=""},getAllKeys(){let e=document.cookie.split(";"),t=[];for(let r=0;r<e.length;r++){let s=e[r];for(;" "==s.charAt(0);)s=s.substring(1,s.length);t.push(s.split("=")[0])}return t}},eY=e=>({getItem:t=>e.getItem(t),setItem(t,r){e.setItem(t,r)},removeItem(t){e.removeItem(t)},clear(){e.clear()},getAllKeys(){let e=[];for(let t in localStorage)e.push(t);return e}}
1),eZ=(e,t="__mplssupport__")=>{try{if(e.setItem(t,"xyz"),"xyz"!==e.getItem(t))return!1;return e.removeItem(t),!0}catch(e){return!1}},e0=()=>{let e={};return{getItem:t=>e[t],setItem(t,r){e[t]=null!==r?r:void 0},removeItem(t){delete e[t]},clear(){for(let t in e)delete e[t]},getAllKeys(){let t=[];for(let r in e)t.push(r);return t}}};function e1(e,t,r){try{if(!(t in e))return()=>{};let s=e[t],i=r(s);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=s}}catch{return()=>{}}}class e2 extends ef{constructor(e,t){super(e,t),this._lastPathname="",this._storageKey=t?.persistence_name?`ph_${t.persistence_name}`:`ph_${e}_posthog`,this._storage=((e,t)=>{if(t){if(!n){let e=eY(t.localStorage);n=eZ(e)?e:void 0}if(!o){let e=eY(t.sessionStorage);o=eZ(e)?e:void 0}}switch(e){case"cookie":return eX||n||o||e0();case"localStorage":return n||o||e0();case"sessionStorage":return o||e0();default:return e0()}})(t?.persistence||"localStorage",this.getWindow()),this.setupBootstrap(t),t?.preloadFeatureFlags!==!1&&this.reloadFeatureFlags(),t?.captureHistoryEvents&&"u">typeof window&&(this._lastPathname=window?.location?.pathname||"",this.setupHistoryEventTracking())}getWindow(){return"u">typeof window?window:void 0}getPersistedProperty(e){return this._storageCache||(this._storageCache=JSON.parse(this._storage.getItem(this._storageKey)||"{}")||{}),this._storageCache[e]}setPersistedProperty(e,t){this._storageCache||(this._storageCache=JSON.parse(this._storage.getItem(this._storageKey)||"{}")||{}),null===t?delete this._storageCache[e]:this._storageCache[e]=t,this._storage.setItem(this._storageKey,JSON.stringify(this._storageCache))}fetch(e,t){let r="u">typeof fetch?fetch:void 0!==globalThis.fetch?globalThis.fetch:void 0;return r?r(e,t):Promise.reject(Error("Fetch API is not available in this environment."))}getLibraryId(){return"posthog-js-lite"}getLibraryVersion(){return eV}getCustomUserAgent(){}getCommonEventProperties(){return{...super.getCommonEventProperties(),...function(e){let t={};if(e?.navigator){let r,s=e.navigator.userAgent,i=function(e){if(!e?.navigator)return;let t=e.navigator.userAgent;if(/Windows/i.test(t))return/Phone/.test(t)||/WPDesktop/.test(t)?"Windows Phone":"Windows";if(/(iPhone|iPad|iPod)/.test(t))return"iOS";if(/Android/.test(t))return"Android";if(/(BlackBerry|PlayBook|BB10)/i.test(t))return"BlackBerry";if(/Mac/i.test(t))return"Mac OS X";else if(/Linux/.test(t))return"Linux";else if(/CrOS/.test(t))return"Chrome OS";else return}(e);t={...t,...void 0!==i&&{$os:i},$browser:eQ(s,e.navigator.vendor,!!e.opera),$referrer:e.document.referrer,$referring_domain:(r=e.document.referrer.split("/")).length>=3?r[2]:"",$device:function(e){if(/Windows Phone/i.test(e)||/WPDesktop/.test(e))return"Windows Phone";if(/iPad/.test(e))return"iPad";if(/iPod/.test(e))return"iPod Touch";if(/iPhone/.test(e))return"iPhone";if(/(BlackBerry|PlayBook|BB10)/i.test(e))return"BlackBerry";else if(/Android/.test(e))return"Android";else return""}(s),$current_url:e.location.href,$host:e.location.host,$pathname:e.location.pathname,$browser_version:function(e,t,r){let s={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[eQ(e,t,r)]||void 0;if(void 0===s)return null;let i=e.match(s);return i?parseFloat(i[i.length-2]):null}(s,e.navigator.vendor,!!e.opera),$screen_height:e.screen.height,$screen_width:e.screen.width,$screen_dpr:e.devicePixelRatio}}return{...t,$lib:"js",$lib_version:eV,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:new Date().getTime()/1e3}}(this.getWindow())}}setupHistoryEventTracking(){let e=this.getWindow();if(!e)return;let t=this;e1(e.history,"pushState",e=>function(r,s,i){e.call(this,r,s,i),t.captureNavigationEvent("pushState")}),e1(e.history,"replaceState",e=>function(r,s,i){e.call(this,r,s,i),t.captureNavigationEvent("replaceState")}),e.addEventListener("popstate",()=>{this.captureNavigationEvent("popstate")})}captureNavigationEvent(e){let t=this.getWindow();if(!t)return;let r=t.location.pathname;r!==this._lastPathname&&(this.capture("$pageview",{navigation_type:e}),this._lastPathname=r)}}let e6=null;e.s(["getPostHog",0,function(){if(e6)return e6;let e=h.default.env.NEXT_PUBLIC_POSTHOG_KEY??"phc_GNOXAK8XJeB7GNwevura28mxcTQqhdx6NUiqPDuCapQ",t=h.default.env.NEXT_PUBLIC_POSTHOG_HOST??"https://eu.i.posthog.com";return e?e6=new e2(e,{host:t,captureHistoryEvents:!0}):null}],6552)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.