posthog-js 1.396.7 → 1.396.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,s=null==e?void 0:e.location,n=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,u=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,h=null!=t?t:{},d="1.396.7",v={DEBUG:!1,LIB_VERSION:d,LIB_NAME:"web",JS_SDK_VERSION:d};function c(t,e,i,r,s,n,o){try{var a=t[n](o),u=a.value}catch(t){return void i(t)}a.done?e(u):Promise.resolve(u).then(r,s)}function _(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var n=t.apply(e,i);function o(t){c(n,r,s,o,a,"next",t)}function a(t){c(n,r,s,o,a,"throw",t)}o(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}var f,g=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),m=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],w=["token"],y="NativeGzipValidationError",b=t=>t.length>=2&&31===t[0]&&139===t[1],x=(t,e)=>t===g.GZipJS||e===g.GZipJS||"gzip"===e,E=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),S=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=y,e},T=function(){var t=_((function*(t,e){18>t.size&&S("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());b(i)&&8===i[2]||S("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(f)return f;f=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;f[t]=e>>>0}return f})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&S("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&S("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function R(){return R=_((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),n=s.writable.getWriter(),o=n.write(r).then((()=>n.close())).catch(function(){var t=_((function*(t){try{yield n.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(s.readable).blob(),[u]=yield Promise.all([a,o]);return yield T(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),R.apply(this,arguments)}var P=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],k=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return P.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function O(t,e){return-1!==t.indexOf(e)}var I=function(t){return t.replace(/^\$/,"")},M=Object.prototype,A=M.hasOwnProperty,C=M.toString,U=Array.isArray||function(t){return"[object Array]"===C.call(t)},D=t=>"function"==typeof t,N=t=>t===Object(t)&&!U(t),L=t=>{if(N(t)){for(var e in t)if(A.call(t,e))return!1;return!0}return!1},B=t=>void 0===t,F=t=>"[object String]"==C.call(t),z=t=>F(t)&&0===t.trim().length,q=t=>null===t,j=t=>B(t)||q(t),H=t=>"[object Number]"==C.call(t)&&t==t,G=t=>H(t)&&t>0,W=t=>"[object Boolean]"===C.call(t),Y=t=>t instanceof FormData,V=t=>O(m,t),J=t=>O(w,t),K=[!0,"true",1,"1","yes"],X=t=>O(K,t),Q=[!1,"false",0,"0","no"];function Z(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),H(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),Z(s||i,e,i,r))}var tt="Mobile",et="iOS",it="Android",rt="Tablet",st=it+" "+rt,nt="iPad",ot="Apple",at=ot+" Watch",ut="Safari",lt="BlackBerry",ht="Samsung",dt=ht+"Browser",vt=ht+" Internet",ct="Chrome",_t=ct+" OS",pt=ct+" "+et,ft="Internet Explorer",gt=ft+" "+tt,mt="Opera",wt=mt+" Mini",yt="Edge",bt="Microsoft "+yt,xt="Firefox",Et=xt+" "+et,$t="Nintendo",St="PlayStation",Tt="Xbox",Rt=it+" "+tt,Pt=tt+" "+ut,kt="Windows",Ot=kt+" Phone",It="Nokia",Mt="Ouya",At="Generic",Ct=At+" "+tt.toLowerCase(),Ut=At+" "+rt.toLowerCase(),Dt="Konqueror",Nt="Oculus Browser",Lt="Vivaldi",Bt="Yandex",Ft="Whale",zt="DuckDuckGo",qt="Pale Moon",jt="Waterfox",Ht="Brave",Gt="Google Search App",Wt="(\\d+(\\.\\d+)?)",Yt=new RegExp("Version/"+Wt),Vt=new RegExp(Tt,"i"),Jt=new RegExp(St+" \\w+","i"),Kt=new RegExp($t+" \\w+","i"),Xt=new RegExp(lt+"|PlayBook|BB10","i"),Qt={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Zt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Ht:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&O(t,"GSA/")?Gt:O(t," OPR/")&&O(t,"Mini")?wt:O(t," OPR/")?mt:Xt.test(t)?lt:O(t,"IE"+tt)||O(t,"WPDesktop")?gt:O(t,"OculusBrowser")?Nt:O(t,dt)?vt:O(t,yt)||O(t,"Edg/")?bt:O(t,Lt+"/")?Lt:O(t,"YaBrowser/")?Bt:O(t,Ft+"/")?Ft:O(t,zt+"/")||O(t,"Ddg/")?zt:O(t,"FBIOS")?"Facebook "+tt:O(t,"UCWEB")||O(t,"UCBrowser")?"UC Browser":O(t,"CriOS")?pt:O(t,"CrMo")||O(t,ct)?ct:O(t,it)&&O(t,ut)?Rt:O(t,"FxiOS")?Et:O(t.toLowerCase(),Dt.toLowerCase())?Dt:O(t,Ht+"/")?Ht:((t,e)=>e&&O(e,ot)||function(t){return O(t,ut)&&!O(t,ct)&&!O(t,it)}(t))(t,e)?O(t,tt)?Pt:ut:O(t,"PaleMoon/")?qt:O(t,jt+"/")?jt:O(t,xt)?xt:O(t,"MSIE")||O(t,"Trident/")?ft:O(t,"Gecko")?xt:"")},te={[gt]:[new RegExp("rv:"+Wt)],[bt]:[new RegExp(yt+"?\\/"+Wt)],[ct]:[new RegExp("("+ct+"|CrMo)\\/"+Wt)],[pt]:[new RegExp("CriOS\\/"+Wt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Wt)],[ut]:[Yt],[Pt]:[Yt],[mt]:[new RegExp("(Opera|OPR)\\/"+Wt)],[xt]:[new RegExp(xt+"\\/"+Wt)],[Et]:[new RegExp("FxiOS\\/"+Wt)],[Dt]:[new RegExp("Konqueror[:/]?"+Wt,"i")],[lt]:[new RegExp(lt+" "+Wt),Yt],[Rt]:[new RegExp("android\\s"+Wt,"i")],[vt]:[new RegExp(dt+"\\/"+Wt)],[Nt]:[new RegExp("OculusBrowser\\/"+Wt)],[Lt]:[new RegExp(Lt+"\\/"+Wt)],[Bt]:[new RegExp("YaBrowser\\/"+Wt)],[Ft]:[new RegExp(Ft+"\\/"+Wt)],[Ht]:[new RegExp(Ht+"\\/"+Wt)],[zt]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Wt)],[qt]:[new RegExp("PaleMoon\\/"+Wt)],[jt]:[new RegExp(jt+"\\/"+Wt)],[Gt]:[new RegExp("GSA\\/"+Wt)],[ft]:[new RegExp("(rv:|MSIE )"+Wt)],Mozilla:[new RegExp("rv:"+Wt)]},ee=function(t,e,i,r){var s=Zt(t,e,i,r),n=te[s];if(B(n))return null;for(var o=0;n.length>o;o++){var a=t.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},ie=[[new RegExp(Tt+"; "+Tt+" (.*?)[);]","i"),t=>[Tt,t&&t[1]||""]],[new RegExp($t,"i"),[$t,""]],[new RegExp(St,"i"),[St,""]],[Xt,[lt,""]],[new RegExp(kt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ot,""];if(new RegExp(tt).test(e)&&!/IEMobile\b/.test(e))return[kt+" "+tt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Qt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[kt,r]}return[kt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[et,[t[3],t[4],t[5]||"0"].join(".")]:[et,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=B(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+it+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+it+")","i"),t=>t&&t[2]?[it,[t[2],t[3],t[4]||"0"].join(".")]:[it,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[_t,""]],[/Linux|debian/i,["Linux",""]]],re=function(t){return Kt.test(t)?$t:Jt.test(t)?St:Vt.test(t)?Tt:new RegExp(Mt,"i").test(t)?Mt:new RegExp("("+Ot+"|WPDesktop)","i").test(t)?Ot:/iPad/.test(t)?nt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?at:Xt.test(t)?lt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(It,"i").test(t)?It:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(tt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?it:st:new RegExp("(pda|"+tt+")","i").test(t)?Ct:new RegExp(rt,"i").test(t)&&!new RegExp(rt+" pc","i").test(t)?Ut:""},se=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ne(t,e){return"string"==typeof(i=t)&&se.test(i)?t:e();var i}function oe(t){return t?t.split("#")[0]:t}var ae=function(e,i){var{debugEnabled:r}=void 0===i?{}:i,s={k(i){if(t&&(v.DEBUG||h.POSTHOG_DEBUG||r)&&!B(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>ae(e+" "+t,i)};return s},ue=ae("[PostHog.js]"),le=ue.createLogger,he=le("[ExternalScriptsLoader]"),de=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return he.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==r?void 0:r.querySelectorAll("script");if(s)for(var n,o=function(){if(s[a].src===e){var t=s[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;s.length>a;a++)if(n=o())return n.v;var u=()=>{if(!r)return i("document not found");var s=r.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=e,s.onload=t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)},s.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(s=t.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(s);else{var n,o=r.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(s,o[0]):r.body.appendChild(s)}};null!=r&&r.body?u():null==r||r.addEventListener("DOMContentLoaded",u)};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if("toolbar"===e){var n=3e5;s=s+"&t="+Math.floor(Date.now()/n)*n}r=t.requestRouter.endpointFor("assets",s)}de(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");de(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);de(t,r,i)};var ve="$people_distinct_id",ce="$device_id",_e="$device_model",pe="__alias",fe="__timers",ge="$dead_clicks_enabled_server_side",me="$session_recording_remote_config",we="$sesid",ye="$session_is_sampled",be="$enabled_feature_flags",xe="$surveys_loaded_at",Ee="$flag_call_reported",$e="$feature_flag_evaluated_at",Se="$user_state",Te="$client_session_props",Re="$capture_rate_limit",Pe="$initial_campaign_params",ke="$initial_referrer_info",Oe="$initial_person_info",Ie="$epp",Me="$posthog_cookieless",Ae="$sdk_debug_extensions_init_method",Ce="$sdk_debug_extensions_init_time_ms",Ue="on_reject",De="always",Ne="anonymous",Le="identified",Be="identified_only",Fe="visibilitychange",ze="beforeunload",qe="$pageview",je="$pageleave",He="$identify",Ge="$groupidentify";function We(t,e){U(t)&&t.forEach(e)}function Ye(t,e){if(!j(t))if(U(t))t.forEach(e);else if(Y(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)A.call(t,i)&&e(t[i],i)}var Ve=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},Je=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ue.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ue.critical(t)}}},Ke=function(t){var e={};return Ye(t,(function(t,i){(F(t)&&t.length>0||H(t))&&(e[i]=t)})),e};var Xe=["herokuapp.com","vercel.app","netlify.app"];function Qe(t){var e=null==t?void 0:t.hostname;if(!F(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Xe)if(i===r)return!1;return!0}function Ze(t,e,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:s,passive:n})}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return H(t)&&isFinite(t)&&Math.floor(t)===t});class ti{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|e>>>8,s[7]=e,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new ti(s)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new ti(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class ei{constructor(){this.S=0,this.C=0,this.I=new si}generate(){var t=this.generateOrAbort();if(B(t)){this.S=0;var e=this.generateOrAbort();if(B(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.M();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return ti.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ii,ri=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!B(t.crypto)&&crypto.getRandomValues&&(ri=t=>crypto.getRandomValues(t));class si{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ri(this.R),this.O=0),this.R[this.O++]}}var ni=()=>oi().toString(),oi=()=>(ii||(ii=new ei)).generate(),ai="",ui=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var li={N:()=>!!r,D(t){ue.error("cookieStore error: "+t)},A(t){if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),s=0;i.length>s;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(li.A(t))||{}}catch(t){}return e},q(t,e,i,s,n){if(!r)return!1;try{var o="",a="",u=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ai)return ai;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),s=Math.min(i.length,8),n="dmn_chk_"+ni();!ai&&s--;){var o=i.slice(s).join("."),a=n+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",ai=o)}return ai}(t);if(!i){var s=(t=>{var e=t.match(ui);return e?e[0]:""})(t);s!==i&&ue.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(r.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),o="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+u+a;return h.length>3686.4&&ue.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},P(t,e){if(null!=r&&r.cookie)try{li.q(t,"",-1,e)}catch(t){return}}},hi=null,di={N(){if(!q(hi))return hi;var e=!0;if(B(t))e=!1;else try{var i="__mplssupport__";di.q(i,"xyz"),'"xyz"'!==di.A(i)&&(e=!1),di.P(i)}catch(t){e=!1}return e||ue.error("localStorage unsupported; falling back to cookie store"),hi=e,e},D(t){ue.error("localStorage error: "+t)},A(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){di.D(t)}return null},F(t){try{return JSON.parse(di.A(t))||{}}catch(t){}return null},q(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){di.D(t)}return!1},P(e){try{null==t||t.localStorage.removeItem(e)}catch(t){di.D(t)}}},vi=[ce,"distinct_id",we,ye,Ie,Oe,Se],ci={},_i={N:()=>!0,D(t){ue.error("memoryStorage error: "+t)},A:t=>ci[t]||null,F:t=>ci[t]||null,q:(t,e)=>(ci[t]=e,!0),P(t){delete ci[t]}},pi=null,fi={N(){if(!q(pi))return pi;if(pi=!0,B(t))pi=!1;else try{var e="__support__";fi.q(e,"xyz"),'"xyz"'!==fi.A(e)&&(pi=!1),fi.P(e)}catch(t){pi=!1}return pi},D(t){ue.error("sessionStorage error: ",t)},A(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){fi.D(t)}return null},F(t){try{return JSON.parse(fi.A(t))||null}catch(t){}return null},q(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){fi.D(t)}return!1},P(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){fi.D(t)}}};class gi{constructor(t){this._instance=t}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===De||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===Ue}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(t){this.Ct.q(this.It,t?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get St(){var t=this.Ct.A(this.It);return X(t)?1:O(Q,t)?0:-1}get Ct(){var t=this.Se.opt_out_capturing_persistence_type,e="localStorage"===t?di:li;if(!this.Tt||this.Tt!==e){this.Tt=e;var i="localStorage"===t?li:di;i.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(X(i.A(this.It))),i.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>X(t)))}}var mi=["next","previous","prev",">","<","+","-","−","–"];le("[Dead Clicks]");var wi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ge)),r=t.instance.config.capture_dead_clicks;return W(r)?r:!!N(r)||i},yi=le("[SegmentIntegration]");var bi="posthog-js";function xi(t,e){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===e?{}:e;return e=>{var a,u,l,h,d;if("*"!==n&&!n.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,_=(null==(a=e.exception)?void 0:a.values)||[],f=_.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$exception_type:null==(l=_[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=_[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+e.event_id),o&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class Ei{constructor(t,e,i,r,s,n){this.name=bi,this.setupOnce=function(o){o(xi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class $i{constructor(t){this.Rt=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ue.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Lt()}Lt(){var t;this.Ft=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Rt)}destroy(){var t;null==(t=this.Ft)||t.call(this),this.Ft=void 0}doPageView(e,i){var r,s=this.At(e,i);return this.Ot={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var e;return this.At(t,null==(e=this.Ot)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ot)?void 0:t.pageViewId}}At(t,e){var i=this.Ot;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=s;if(!(B(n)||B(o)||B(a)||B(u)||B(l)||B(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var d=n>1?Z(o/n,0,1,ue):1,v=n>1?Z(a/n,0,1,ue):1,c=u>1?Z(l/u,0,1,ue):1,_=u>1?Z(h/u,0,1,ue):1;r=Ve(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Si=["flags","surveys"],Ti={[ve]:{exposure:"hidden"},[pe]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[fe]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"},$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[ge]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[me]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[we]:{exposure:"hidden"},[ye]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:t=>q(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[be]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!N(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},$active_feature_flags:{exposure:"event",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},$feature_flag_details:{exposure:"hidden",storageGroup:"flags"},$feature_flag_payloads:{exposure:"event",storageGroup:"flags"},$feature_flag_request_id:{exposure:"event",storageGroup:"flags",volatile:!0},$override_feature_flags:{exposure:"event"},$override_feature_flag_payloads:{exposure:"hidden"},$stored_person_properties:{exposure:"hidden"},$stored_group_properties:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[xe]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Ee]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[$e]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},[Oe]:{exposure:"hidden"},[Ie]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[Ae]:{exposure:"event"},[Ce]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ri=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Pi=t=>{var e=Ti[t];if(e)return e;for(var[i,r]of Ri)if(0===t.indexOf(i))return r},ki=t=>{var e=null==r?void 0:r.createElement("a");return B(e)?null:(e.href=t,e)},Oi=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===e){i=n;break}}if(!U(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ue.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ii=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");U(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(u[h]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},Mi="https?://(.*)",Ai=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ci=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ai],Ui="<masked>",Di=["li_fat_id"];function Ni(t,e){var i=Ci.concat(e||[]),r={};return Ye(i,(function(e){var i=Oi(t,e);r[e]=i||null})),r}function Li(t){var e=function(t){return t?0===t.search(Mi+"google.([^/?]*)")?"google":0===t.search(Mi+"bing.com")?"bing":0===t.search(Mi+"yahoo.com")?"yahoo":0===t.search(Mi+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!q(e)){s.$search_engine=e;var n=r?Oi(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Bi(){return navigator.language||navigator.userLanguage}var Fi="$direct";function zi(){return(null==r?void 0:r.referrer)||Fi}function qi(t,e,i){void 0===i&&(i=!1);var r=t?[...Ai,...e||[]]:[],n=i?oe(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:zi().substring(0,1e3),u:o?Ii(o,r,Ui):void 0}}function ji(t,e){var i;void 0===e&&(e=!1);var{r:r,u:s}=t,n=e?oe(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==Fi?Fi:null==(i=ki(r))?void 0:i.host};if(n){o.$current_url=n;var a=ki(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var u=Ni(n);Ve(o,u)}if(r){var l=Li(r);Ve(o,l)}return o}function Hi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Gi(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Wi={flags:$e,surveys:xe},Yi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Vi="main";class Ji{constructor(e,i,r){if(void 0===r&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=r,this.props={},this.Bt=!1,this.jt=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ue.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Ze(t,"beforeunload",s,{capture:!1}),Ze(t,"pagehide",s,{capture:!1})}}zt(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return H(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){-1===Yi.indexOf(e.persistence.toLowerCase())&&(ue.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...vi,...e];return p({},di,{F(t){try{var e={};try{e=li.F(t)||{}}catch(t){}var r,s=JSON.parse(di.A(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];q(a)||""===a||(n[o]=a)}r=Ve(s,n)}else r=Ve(e,s);return di.q(t,r),r}catch(t){}return null},q(t,e,i,s,n,o){var a=di.q(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&li.q(t,u,i,s,n,o)}catch(t){di.D(t)}return a},P(e,i){try{null==t||t.localStorage.removeItem(e),li.P(e,i)}catch(t){di.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&di.N()?(i=di,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&fi.N()?i=fi:"memory"===n?i=_i:"cookie"===n?i=li:r.N()?(i=r,s=!0):i=li,this.Dt=s,i}Wt(t){return this.jt+"__"+t}Ut(t){return this.Dt&&!!t.split_storage}Gt(t){var e=null!=t?t:this.Se.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[$e];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return Ye(this.props,((e,i)=>{var r=Pi(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===be?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&Ve(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.Vt){var t=this.Ct.F(this.jt);t&&(this.props=Ve({},t)),this.Nt&&this.Zt()}}Zt(){for(var t of Si){var e=di.F(this.Wt(t));if(e&&!L(e)){var i=this.Qt(t);i.persisted=!0,this.Jt(t)||(i.fingerprint=this.Yt(e,t)),this.Kt(t,e)||Ve(this.props,e)}}}Jt(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Pi(e))?void 0:i.storageGroup)===t}))}Kt(t,e){var i=Wi[t];if(!i)return!1;var r=e[i],s=this.props[i];return H(r)&&H(s)&&s>r}refreshKey(t){var e;if(!this.Vt){var i=this.Nt?null==(e=Pi(t))?void 0:e.storageGroup:void 0,r=i?di.F(this.Wt(i)):this.Ct.F(this.jt);if(r&&t in r)this.Xt(t,r[t]);else{if(i){var s=this.Ct.F(this.jt);if(s&&t in s)return void this.Xt(t,s[t])}this.er(t)}}}save(){if(!this.Vt){var t=this.zt();t>0?B(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),t)):this.rr()}}flush(){B(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,Vi))}ir(){var{main:t,groups:e}=this.sr();for(var i of(this.nr(this.Ct,this.jt,t,Vi),Si)){var r,s=e[i];(!L(s)||null!=(r=this.$t[i])&&r.persisted)&&this.nr(di,this.Wt(i),s,i)}}sr(){var t={},e={};for(var i of Si)e[i]={};return Ye(this.props,((i,r)=>{var s,n=null==(s=Pi(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}Yt(t,e){if(e===Vi)return JSON.stringify(t)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return Ye(t,((t,e)=>{var r;i[e]=null!=(r=Pi(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}nr(t,e,i,r){var s=this.Qt(r);if(r===Vi||s.dirty||B(s.fingerprint)){var n;try{if((n=this.Yt(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.q(e,i,this.ar,this.lr,this.ur,this.Se.debug)?(s.dirty=!1,r!==Vi&&(s.persisted=!0),B(n)||(s.fingerprint=n)):this.Se.debug&&ue.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(B(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!e&&this.qt)for(var i of Si)di.P(this.Wt(i));e?delete this.$t[Vi]:this.$t={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(N(t)){B(e)&&(e="None"),this.ar=B(i)?this.hr:i;var r=!1;if(Ye(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(N(t)){this.ar=B(e)?this.hr:e;var i=!1;if(Ye(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.er(t),this.save())}update_campaign_params(){if(!this.Bt){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Ai,...i||[]]:[],o=Ni(Ii(r.URL,n,Ui),t),a=(s={},Ye(Di,(function(t){var e=li.A(t);s[t]=e||null})),s);return Ve(a,o)}(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);L(Ke(t))||this.register(t),this.Bt=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Li(t):{})}update_referrer_info(){var t;this.register_once({$referrer:zi(),$referring_domain:null!=r&&r.referrer&&(null==(t=ki(r.referrer))?void 0:t.host)||Fi},void 0)}set_initial_person_info(){this.props[Pe]||this.props[ke]||this.register_once({[Oe]:qi(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Ye([ke,Pe],(e=>{var i=this.props[e];i&&Ye(i,(function(e,i){t["$initial_"+I(i)]=e}))}));var e=this.props[Oe];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=ji(t,e),r={};return Ye(i,(function(t,e){r["$initial_"+I(e)]=t})),r}(e,this.Se.disable_capture_url_hashes);Ve(t,i)}return t}safe_merge(t){return Ye(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.hr=this.ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r?this.Ht(t):this.Ct,n=this.Ut(t);if(r||n!==this.Nt){var o=this.props;this.clear(),this.Ct=s,this.Nt=n,this.props=o,this.save()}}set_disabled(t){this.Vt=t,this.Vt?this.remove():this.save()}set_cross_subdomain(t){t!==this.lr&&(this.lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ur&&(this.ur=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[fe]||{};i[t]=e,this.Xt(fe,i),this.save()}remove_event_timer(t){var e=this.props[fe]||{},i=e[t];return B(i)||(delete e[t],this.Xt(fe,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Xt(t,e),this.save()}Xt(t,e){var i;this.props[t]=e,null!=(i=Pi(t))&&i.volatile||this.dr(t)}er(t){delete this.props[t],this.dr(t)}dr(t){var e,i=null==(e=Pi(t))?void 0:e.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(t){return this.$t[t]||(this.$t[t]={})}}var Ki={Activation:"events",Cancellation:"cancelEvents"},Xi={Button:"button",Tab:"tab",Selector:"selector"},Qi={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Zi={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},tr={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},er={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},ir={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},rr={Once:"once",Recurring:"recurring",Always:"always"},sr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},nr={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},or={Popover:"popover",Inline:"inline"},ar={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},ur={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},lr={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},hr=le("[RateLimiter]");class dr{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{hr.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void hr.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Re))&&void 0!==e?e:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Re,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var vr=le("[RemoteConfig]");class cr{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=h._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}cr(t){var e,i;null!=(e=h.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}vr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return vr.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void vr.warn("Remote config is disabled. Falling back to local config.");this.cr((t=>{if(!t)return vr.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((t=>{this.pr(t),this.gr()}));this.pr(t),this.gr()}))}catch(t){vr.error("Error loading remote config",t)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var t;if(!this.yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(t){var e;t||vr.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var _r=["fatal","error","warning","log","info","debug"],pr={GZipJS:"gzip-js",Base64:"base64"},fr=Uint8Array,gr=Uint16Array,mr=Uint32Array,wr=new fr([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]),yr=new fr([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]),br=new fr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xr=function(t,e){for(var i=new gr(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new mr(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},Er=xr(wr,2),$r=Er[1];Er[0][28]=258,$r[258]=28;for(var Sr=xr(yr,0)[1],Tr=new gr(32768),Rr=0;32768>Rr;++Rr){var Pr=(43690&Rr)>>>1|(21845&Rr)<<1;Tr[Rr]=((65280&(Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4))>>>8|(255&Pr)<<8)>>>1}var kr=function(t,e,i){for(var r=t.length,s=0,n=new gr(e);r>s;++s)++n[t[s]-1];var o,a=new gr(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new gr(1<<e);var u=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Tr[d]>>>u]=l}else for(o=new gr(r),s=0;r>s;++s)o[s]=Tr[a[t[s]-1]++]>>>15-t[s];return o},Or=new fr(288);for(Rr=0;144>Rr;++Rr)Or[Rr]=8;for(Rr=144;256>Rr;++Rr)Or[Rr]=9;for(Rr=256;280>Rr;++Rr)Or[Rr]=7;for(Rr=280;288>Rr;++Rr)Or[Rr]=8;var Ir=new fr(32);for(Rr=0;32>Rr;++Rr)Ir[Rr]=5;var Mr=kr(Or,9,0),Ar=kr(Ir,5,0),Cr=function(t){return(t/8>>0)+(7&t&&1)},Ur=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof gr?gr:t instanceof mr?mr:fr)(i-e);return r.set(t.subarray(e,i)),r},Dr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Nr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Lr=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var s=i.length,n=i.slice();if(!s)return[new fr(0),0];if(1==s){var o=new fr(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],u=i[1],l=0,h=1,d=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=s-1;)a=i[i[d].f>i[l].f?l++:d++],u=i[l!=h&&i[d].f>i[l].f?l++:d++],i[h++]={s:-1,f:a.f+u.f,l:a,r:u};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new gr(v+1),_=Br(i[h-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var w=n[r].s;e>c[w]?p-=1<<e-c[w]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;c[y]==e&&(--c[y],++p)}_=e}return[new fr(c),_]},Br=function(t,e,i){return-1==t.s?Math.max(Br(t.l,e,i+1),Br(t.r,e,i+1)):e[t.s]=i},Fr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new gr(++e),r=0,s=t[0],n=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==s&&a!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[i.subarray(0,r),e]},zr=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},qr=function(t,e,i){var r=i.length,s=Cr(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;r>n;++n)t[s+n+4]=i[n];return 8*(s+4+r)},jr=function(t,e,i,r,s,n,o,a,u,l,h){Dr(e,h++,i),++s[256];for(var d=Lr(s,15),v=d[0],c=d[1],_=Lr(n,15),p=_[0],f=_[1],g=Fr(v),m=g[0],w=g[1],y=Fr(p),b=y[0],x=y[1],E=new gr(19),S=0;m.length>S;++S)E[31&m[S]]++;for(S=0;b.length>S;++S)E[31&b[S]]++;for(var T=Lr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[br[k-1]];--k);var O,I,M,A,C=l+5<<3,U=zr(s,Or)+zr(n,Ir)+o,D=zr(s,v)+zr(n,p)+o+14+3*k+zr(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(U>=C&&D>=C)return qr(e,h,t.subarray(u,u+l));if(Dr(e,h,1+(U>D)),h+=2,U>D){O=kr(v,c,0),I=v,M=kr(p,f,0),A=p;var N=kr(R,P,0);for(Dr(e,h,w-257),Dr(e,h+5,x-1),Dr(e,h+10,k-4),h+=14,S=0;k>S;++S)Dr(e,h+3*S,R[br[S]]);h+=3*k;for(var L=[m,b],B=0;2>B;++B){var F=L[B];for(S=0;F.length>S;++S)Dr(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Dr(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=Mr,I=Or,M=Ar,A=Ir;for(S=0;a>S;++S)if(r[S]>255){var z;Nr(e,h,O[257+(z=r[S]>>>18&31)]),h+=I[z+257],z>7&&(Dr(e,h,r[S]>>>23&31),h+=wr[z]);var q=31&r[S];Nr(e,h,M[q]),h+=A[q],q>3&&(Nr(e,h,r[S]>>>5&8191),h+=yr[q])}else Nr(e,h,O[r[S]]),h+=I[r[S]];return Nr(e,h,O[256]),h+I[256]},Hr=new mr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gr=function(){for(var t=new mr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Wr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Yr(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Gr[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,u,l=(a=10+((s=e).filename&&s.filename.length+1||0),u=8,function(t,e,i,r,s,n){var o=t.length,a=new fr(r+o+5*(1+Math.floor(o/7e3))+s),u=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?l=qr(u,l,t.subarray(h,d)):(u[h]=!0,l=qr(u,l,t.subarray(h,o)))}else{for(var v=Hr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new gr(32768),g=new gr(p+1),m=Math.ceil(i/3),w=2*m,y=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<w)&p},b=new mr(25e3),x=new gr(288),E=new gr(32),S=0,T=0,R=(h=0,0),P=0,k=0;o>h;++h){var O=y(h),I=32767&h,M=g[O];if(f[I]=M,g[O]=I,h>=P){var A=o-h;if((S>7e3||R>24576)&&A>423){l=jr(t,u,0,b,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var C=0;286>C;++C)x[C]=0;for(C=0;30>C;++C)E[C]=0}var U=2,D=0,N=_,L=I-M&32767;if(A>2&&O==y(h-L))for(var B=Math.min(c,A)-1,F=Math.min(32767,h),z=Math.min(258,A);F>=L&&--N&&I!=M;){if(t[h+U]==t[h+U-L]){for(var q=0;z>q&&t[h+q]==t[h+q-L];++q);if(q>U){if(U=q,D=L,q>B)break;var j=Math.min(L,q-2),H=0;for(C=0;j>C;++C){var G=h-L+C+32768&32767,W=G-f[G]+32768&32767;W>H&&(H=W,M=G)}}}L+=(I=M)-(M=f[I])+32768&32767}if(D){b[R++]=268435456|$r[U]<<18|Sr[D];var Y=31&$r[U],V=31&Sr[D];T+=wr[Y]+yr[V],++x[257+Y],++E[V],P=h+U,++S}else b[R++]=t[h],++x[t[h]]}}l=jr(t,u,!0,b,x,E,T,R,k,h-k,l)}return Ur(a,0,r+Cr(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,u)),h=l.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Wr(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(l,e),Wr(l,h-8,i.d()),Wr(l,h-4,r),l}var Vr=!!o||!!n,Jr="text/plain",Kr=!1,Xr=(t,e)=>{var[i,r]=t.split("#"),[s,n]=i.split("?");if(!n)return t;var o=n.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},Qr=function(t,e,i){var r;void 0===i&&(i=!0);var[s,n]=t.split("?"),o=p({},e),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var e,[r,s]=t.split("="),n=i&&null!==(e=o[r])&&void 0!==e?e:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],u=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return Ye(t,(function(t,e){B(t)||B(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),s[s.length]=r+"="+i)})),s.join(e)}(o);return u&&a.push(u),s+"?"+a.join("&")},Zr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),ts=t=>{if(t.xt)return t.xt;var{data:e,compression:i}=t;if(e){if(i===pr.GZipJS){var r=Yr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new fr(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;i>o;++o){if(s+5>r.length){var a=new fr(s+8+(i-o<<1));a.set(r),r=a}var u=t.charCodeAt(o);128>u?n(u):2048>u?(n(192|u>>>6),n(128|63&u)):u>55295&&57344>u?(n(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),n(128|u>>>12&63),n(128|u>>>6&63),n(128|63&u)):(n(224|u>>>12),n(128|u>>>6&63),n(128|63&u))}return Ur(r,0,s)}(Zr(e)),{mtime:0});return{contentType:Jr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===pr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Zr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Zr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Zr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},es=t=>{var e,i,r=()=>({url:Xr(t.url,"compression"),encodedBody:ts(p({},t,{compression:void 0,xt:void 0}))});try{e=ts(t)}catch(e){if(x(t.compression,Oi(t.url,"compression")))return ue.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&x(t.compression,Oi(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?b(new Uint8Array(i)):ArrayBuffer.isView(i)&&b(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Kr=!0,r()):{url:t.url,encodedBody:e}},is=t=>{try{return es(t)}catch(e){return ue.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},rs=function(){var t=_((function*(t){var e=Zr(t.data),i=yield function(t,e,i){return R.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{xt:{contentType:Jr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),ss=(t,e)=>Qr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),ns=[];n&&ns.push({transport:"fetch",method(t){var e,i=is(t);if(i){var{url:r,encodedBody:s}=i,{contentType:o,body:u,estimatedSize:l}=null!=s?s:{},h=new Headers;Ye(t.headers,(function(t,e){h.append(e,t)})),o&&h.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout((()=>{var e,i;v=!0,c.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}n(r,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&52428.8>(l||0),body:u,signal:null==(e=d)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ue.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{v&&"AbortError"===(null==e?void 0:e.name)?ue.warn(e):ue.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>d?clearTimeout(d.timeout):null))}}}),o&&ns.push({transport:"XHR",method(t){var e=is(t);if(e){var i=new o,{url:r,encodedBody:s}=e;i.open(t.method||"GET",r,!0);var{contentType:n,body:a}=null!=s?s:{};Ye(t.headers,(function(t,e){i.setRequestHeader(e,t)})),n&&i.setRequestHeader("Content-Type",n),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&ns.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=es(t),{contentType:s,body:n}=null!=r?r:{};if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:s});i.sendBeacon(e,o)}catch(t){}}});var os=3e3;class as{constructor(t,e){this.br=!0,this._r=[],this.wr=Z((null==e?void 0:e.flush_interval_ms)||os,250,5e3,ue.createLogger("flush interval"),os),this.kr=t}enqueue(t){this._r.push(t),this.Sr||this.Cr()}unload(){this.Ir();var t=this._r.length>0?this.Tr():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.Er(p({},t,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var t=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var e=this.Tr(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&U(i.data)&&Ye(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.Er(i)};for(var r in e)i()}}),this.wr))}Er(t){try{this.kr(t)}catch(t){ue.error(t)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var t={};return Ye(this._r,(e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;B(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)})),this._r=[],t}}var us=["retriesPerformedSoFar"];class ls{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!B(t)&&"onLine"in t.navigator&&(this.Rr=t.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},Ze(t,"online",this.Or),Ze(t,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,i=function(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}(t,us);G(e)&&(i.url=Qr(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.st(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ue.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}st(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=Math.random()-.5;return Math.ceil(r+s*(r-i))}(e),r=Date.now()+i;this._r.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),ue.warn(s),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var t=Date.now(),e=[],i=this._r.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this._r=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,B(t)||(this.Or&&(t.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(t.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){ue.error(t)}this._r=[]}}class hs{constructor(t){this.Dr=()=>{var t,e,i,r;this.Nr||(this.Nr={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),u=(null==s?void 0:s.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(n),this.Nr.maxScrollY=Math.max(n,null!==(t=this.Nr.maxScrollY)&&void 0!==t?t:0),this.Nr.maxScrollHeight=Math.max(o,null!==(e=this.Nr.maxScrollHeight)&&void 0!==e?e:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(u,null!==(r=this.Nr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var t=this.Nr;return setTimeout(this.Dr,0),t}startMeasuringScrollPosition(){Ze(t,"scroll",this.Dr,{capture:!0}),Ze(t,"scrollend",this.Dr,{capture:!0}),Ze(t,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==t?void 0:t.document.documentElement;var e=U(this.qr)?this.qr:[this.qr];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Br(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.qr){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br("y")}scrollX(){return this.Br("x")}}var ds=t=>qi(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class vs{constructor(t,e,i,r){this.jr=t=>{var e=this.Hr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ur(this._instance)};this.zr.register({[Te]:i})}},this._instance=t,this.Vr=e,this.zr=i,this.Ur=r||ds,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[Te]}getSetOnceProps(){var t,e=null==(t=this.Hr())?void 0:t.props;return e?"r"in e?ji(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return Ye(Ke(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+I(i)]=e})),t}}class cs{constructor(){this.Wr={}}on(t,e){return this.Wr[t]||(this.Wr[t]=[]),this.Wr[t].push(e),()=>{this.Wr[t]=this.Wr[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Wr[t]||[])i(e);for(var r of this.Wr["*"]||[])r(t,e)}}var _s=le("[SessionId]");class ps{on(t,e){return this.Gr.on(t,e)}constructor(t,e,i){var r;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new cs,this.Kr=(t,e)=>!(!G(t)||!G(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===De)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=t.config,this.zr=t.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=e||ni,this.ri=i||ni;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Z(this.Se.session_idle_timeout_seconds||1800,60,36e3,_s.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+s+"_window_id",this.si="ph_"+s+"_primary_window_exists",this.oi()){var n=fi.F(this.ni),o=fi.F(this.si);n&&!o?this.Xr=n:fi.P(this.ni),fi.q(this.si,!0)}if(null!=(r=this.Se.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){_s.error("Invalid sessionID in bootstrap",t)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return B(this.Qr)&&(this.Qr=[]),this.Qr.push(t),this.ei&&t(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((e=>e!==t))}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&fi.N()}ui(t){t!==this.Xr&&(this.Xr=t,this.oi()&&fi.q(this.ni,t))}hi(){return this.Xr?this.Xr:this.oi()?fi.F(this.ni):null}di(t){var e=this.Zr;return!q(e)&&!q(t)&&5e3>Math.abs(t-e)}ai(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.ei||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.ei=t,s&&!r||s&&this.di(e)||(this.Zr=e,this.zr.register({[we]:[e,t,i]}))}ci(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}vi(){this.ci()?this.zr.refreshKey(we):(this.zr.flush(),this.zr.load())}fi(){var t;if(!q(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,e,i]=this.pi();e===this.ei&&i===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[we]:[this._sessionActivityTimestamp,null!==(t=this.ei)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[t]=this.pi(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}mi(t){return this.vi(),this.Kr(t,this.gi())}pi(){var t=this.zr.props[we];return U(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&t&&(t.removeEventListener(ze,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&fi.P(this.si)},Ze(t,ze,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Se.cookieless_mode===De)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.pi(),n=this.gi(),o=this.hi(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.Kr(i,n);v&&((v=this.mi(i))||_s.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.pi()),h||v||a?(r=this.ti(),o=this.ri(),_s.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.ri(),u=!0),(l=r!==d)&&(_s.info("adopted cross-tab session id",{sessionId:r,windowId:o}),u=!0));var c=G(n)&&t&&!a?n:i,_=G(s)?s:(new Date).getTime();this.ui(o),this.ai(r,c,_),t||this.ii();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.Qr.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>{if(!this.Yr)if(this.mi((new Date).getTime())){var t=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:t})}else this.ii()}),1.1*this.sessionTimeoutMs))}}function fs(){return(fs=_((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return F(r)&&r.length>0?r:void 0}catch(t){return void ue.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}))).apply(this,arguments)}function gs(t,e,i){return Zr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ms="custom",ws="i.posthog.com",ys=/^\/static\//;class bs{constructor(t){this.bi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+ws,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.bi[this.apiHost]||(this.bi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":ms),this.bi[this.apiHost]}wi(t){if(ys.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var i=this.wi(e);if(i)return""+i+e}if(this.region===ms)return this.apiHost+e;var r=ws+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var xs=le("[Surveys]"),Es={ignoreConditions:!1,ignoreDelay:!1,displayType:or.Popover},$s=le("[PostHog ExternalIntegrations]"),Ss={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ts{constructor(t){this._instance=t}Mt(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return $s.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,s,n;!r||null!=(i=h.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(Ss[e],(()=>{var i;null==(i=h.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(s=h.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=h.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[i,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;e(i)}}}var Rs,Ps={},ks=0,Os=()=>{},Is='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ms="Surveys module not available",As="sanitize_properties is deprecated. Use before_send instead",Cs="Invalid value for property_denylist config: ",Us="posthog",Ds=!Vr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Ns=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Qe(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Os,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:s&&F(null==s?void 0:s.search)&&-1!==s.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){ue.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Be,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:os},error_tracking:{},_onCapture:Os},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:mi,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(e))},Ls=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],Bs=t=>{var e={};for(var[i,r]of Ls)B(t[i])||(e[r]=t[i]);var s=Ve({},e,t),n=t.__preview_external_dependency_versioned_paths;return B(n)||(B(t.strict_script_versioning)&&(s.strict_script_versioning=!!n),F(n)&&B(t.asset_host)&&(s.asset_host=n)),U(t.property_blacklist)&&(B(t.property_denylist)?s.property_denylist=t.property_blacklist:U(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ue.error(Cs+t.property_denylist)),s};class Fs{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(t){ue.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class zs{ki(t,e){if(t){var i=this.Si.indexOf(t);-1!==i&&this.Si.splice(i,1)}return this.Si.push(e),null==e.initialize||e.initialize(),e}Ci(){return this.config.cookieless_mode===De||this.config.cookieless_mode===Ue&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Fs,this.Ii=!1,this.version=v.LIB_VERSION,this.Ti=new cs,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ns(),this.SentryIntegration=Ei,this.sentryIntegration=t=>function(t,e){var i=xi(t,e);return{name:bi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new hs(this),this.pageViewManager=new $i(this),this.rateLimiter=new dr(this),this.requestRouter=new bs(this),this.consent=new gi(this),this.externalIntegrations=new Ts(this);var e=null!==(t=zs.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=F(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=F(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ue.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Us){var r,s=null!==(r=Ps[i])&&void 0!==r?r:new zs;return s._init(t,e,i),Ps[i]=s,Ps[Us][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n;void 0===i&&(i={});var o=F(e)?e.trim():"";if(!o)return ue.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},i.debug=this.Oi(i.debug),this.Li=i,this.Fi=[],i.person_profiles?this.Pi=i.person_profiles:i.process_person&&(this.Pi=i.process_person);var a=Ns(i.defaults),u=Bs(i),l=Ve({},a,u,{name:r,token:o});N(a.rageclick)&&N(u.rageclick)&&(l.rageclick=Ve({},a.rageclick,u.rageclick)),N(a.session_recording)&&N(u.session_recording)&&(l.session_recording=Ve({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&ue.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:pr.GZipJS;var h=this.Ai();this.persistence=new Ji(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ji(p({},this.config,{persistence:"sessionStorage"}),h,!1);var d=p({},this.persistence.props),c=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$i=new as((t=>this.Di(t)),this.config.request_queue_config),this.Ni=new ls(this),this.__request_queue=[];var _=this.Ci();if(_||(this.sessionManager=new ps(this),this.sessionPropsManager=new vs(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ue.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.qi(_)}),0)):(ue.info("Initializing extensions synchronously"),this.qi(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&ue.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var f=i.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Se);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ne)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Le)ue.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var w=this.config.get_device_id(ni()),y=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(Se,i.bootstrap.isIdentifiedID?Le:Ne),this.register({distinct_id:f,$device_id:y})}}if(_)this.register_once({distinct_id:Me,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(ni());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Se,Ne)}return Ze(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||ni();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Se,Le)),e()},s=i.user();"then"in s&&D(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||yi.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(yi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yi.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,qe),identify:t=>e(t,He),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Bi())):this.Bi(),D(this.config._onCapture)&&this.config._onCapture!==Os&&(ue.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ue.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return fs.apply(this,arguments)}().then((t=>{t&&this.register({[_e]:t})})).catch(Os),this}qi(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},zs.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.Si.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.Si.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.Si.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.Si.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.Si.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.Si.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.Si.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.Si.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.Si.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.Si.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.Si.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.Si.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,wi)),l.toolbar&&this.Si.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.Si.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.Si.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.ji){var t=this.ji;this.ji=void 0,this.pr(t)}})),this.Hi(h,u)}Hi(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Hi(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ue.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ae]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ce]:r}),this.config.__preview_deferred_init_extensions&&ue.info("PostHog extensions initialized ("+r+"ms)")}pr(t){var e;if(!r||!r.body)return ue.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.ji=t),this.Ui=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=O(t.supportedCompression,pr.GZipJS)?pr.GZipJS:O(t.supportedCompression,pr.Base64)?pr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:Be}),this.Si.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Bi(){try{this.config.loaded(this)}catch(t){ue.critical("`loaded` function failed",t)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=s&&s.hostname){var t=s.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new cr(this),this.Wi.load()}zi(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.$i)||t.enable())}_dom_loaded(){this.is_capturing()&&We(this.__request_queue,(t=>this.Di(t))),this.__request_queue=[],this.zi()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(je),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.$i)||i.unload(),null==(r=this.Ni)||r.unload()):this.Gi()&&this.capture(je,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Ds?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(B(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=p({},t);s.timeout=s.timeout||6e4,s.url=ss(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=ns.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(t[i].transport===n)return t[i]}(o))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===pr.GZipJS&&u&&"undefined"!=typeof Promise&&!Kr?rs(s).then((t=>{a(t)})).catch((e=>{if(E(e))return Kr=!0,void a(p({},s,{compression:void 0,url:ss(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return E(t)||e===y})(e)&&(Kr=!0),a(s)})):a(s)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Di(t){this.Ni?this.Ni.retriableRequest(t):this._send_request(t)}_execute_array(t){ks++;try{var e,i=[],r=[],s=[];We(t,(t=>{if(t)if(U(e=t[0]))s.push(t);else if(D(t))try{t.call(this)}catch(e){ue.error("Error executing queued PostHog call",t,e)}else U(t)&&"alias"===e?i.push(t):U(t)&&-1!==e.indexOf("capture")&&D(this[e])?s.push(t):r.push(t)}));var n=function(t,e){We(t,(function(t){try{if(U(t[0])){var i=e;Ye(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ue.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{ks--}}push(t){if(ks>0&&U(t)&&F(t[0])){var e=zs.prototype[t[0]];D(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!B(t)&&F(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var l=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==l||!l.isRateLimited){null!=e&&e.$current_url&&!F(null==e?void 0:e.$current_url)&&(ue.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.Zi||ue.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.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=(null==i?void 0:i.timestamp)||h,v=ne(null==i?void 0:i.uuid,ni),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===qe&&this.config.__preview_capture_bot_pageviews&&u&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),l&&(c.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var _=null==i?void 0:i.$unset;_&&(c.$unset=_);var f,g,m,w=this.Qi(null==i?void 0:i.$set_once,t!==Ge,t===He);if(w&&(c.$set_once=w),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=c,o=t=>F(t)?t.slice(0,s):t,a=new Set,c=function t(e,i){return e!==Object(e)?o?o(e):e:a.has(e)?void 0:(a.add(e),U(e)?(r=[],We(e,(e=>{r.push(t(e))}))):(r={},Ye(e,((e,i)=>{a.has(e)||(r[i]=t(e,i))}))),r);var r}(n)),c.timestamp=d,B(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),t===sr.DISMISSED||t===sr.SENT){var y=null==e?void 0:e[nr.SURVEY_ID],b=null==e?void 0:e[nr.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i})("seenSurvey_",t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){xs.error("Failed to persist survey seen state",t)}})({id:y,current_iteration:b}),c.$set=p({},c.$set,{[(f={id:y,current_iteration:b},g=t===sr.SENT?"responded":"dismissed",m="$survey_"+g+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+g+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else t===sr.SHOWN&&(c.$set=p({},c.$set,{[nr.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===ur.SHOWN){var x=null==e?void 0:e[lr.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[lr.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(L(E)||this.setPersonPropertiesForFlags(E),!j(this.config.before_send)){var S=this.it(c);if(!S)return;(c=S).uuid=ne(c.uuid,ni)}this.Ti.emit("eventCaptured",c);var T={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Di(T):this.$i.enqueue(T),c}ue.critical("This capture call is ignored due to client rate limiting.")}}else ue.error("No event name provided to posthog.capture")}else ue.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;var u=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ci()&&(h.$cookieless_mode=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!F(h.distinct_id)&&!H(h.distinct_id)||z(h.distinct_id))&&ue.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r,n){var o,a,u,h;if(void 0===n&&(n=!1),!l)return{};var d,c,_,p,f,g,m,w,y,b=e?[...Ai,...i||[]]:[],[x,E]=function(t){for(var e=0;ie.length>e;e++){var[i,r]=ie[e],s=i.exec(t),n=s&&(D(r)?r(s,t):r);if(n)return n}return["",""]}(l),S=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},T={detectGoogleSearchApp:r},R=Ve(Ke({$os:x,$os_version:E,$browser:Zt(l,navigator.vendor,S,T),$device:re(l),$device_type:(_=l,p={userAgentDataPlatform:null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==t||null==(u=t.screen)?void 0:u.width,screenHeight:null==t||null==(h=t.screen)?void 0:h.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},y=re(_),y===nt||y===st||"Kobo"===y||"Kindle Fire"===y||y===Ut?rt:y===$t||y===Tt||y===St||y===Mt?"Console":y===at?"Wearable":y?tt:"Android"===(null==p?void 0:p.userAgentDataPlatform)&&(null!==(f=null==p?void 0:p.maxTouchPoints)&&void 0!==f?f:0)>0?600>Math.min(null!==(g=null==p?void 0:p.screenWidth)&&void 0!==g?g:0,null!==(m=null==p?void 0:p.screenHeight)&&void 0!==m?m:0)/(null!==(w=null==p?void 0:p.devicePixelRatio)&&void 0!==w?w:1)?tt:rt:"Desktop"),$timezone:Hi(),$timezone_offset:Gi()}),{$current_url:Ii(n?oe(null==s?void 0:s.href):null==s?void 0:s.href,b,Ui),$host:null==s?void 0:s.host,$pathname:null==s?void 0:s.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+"...":l,$browser_version:ee(l,navigator.vendor,S,T),$browser_language:Bi(),$browser_language_prefix:(c=Bi(),"string"==typeof c?c.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:v.LIB_NAME,$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return v.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=v.SDK_DIST_CHANNEL),R}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&Ve(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Ve(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Ni)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ms&&(h.$lib_custom_api_host=this.config.api_host),c=e!==qe||a?e!==je||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=Ve(h,c),e===qe&&r&&(h.title=r.title),!B(u)){var w=n.getTime()-u;h.$duration=parseFloat((w/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=Ve({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),U(this.config.property_denylist)?Ye(this.config.property_denylist,(function(t){delete h[t]})):ue.error(Cs+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(ue.error(As),h=y(h,e));var b=this.Ji();return h.$process_person_profile=b,b&&!a&&this.Yi("_calculate_event_properties"),h}Qi(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Ji())return t;if(this.Ii&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=Ve({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(ue.error(As),o=a(o,"$set_once")),e&&(this.Ii=!0),L(o)?void 0:o}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Ki(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Ti.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Ms}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Ms})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ms})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Es),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Ms}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Ms})}Xi(t){return!t||z(t)?(ue.critical("Unique user id has not been set in posthog.identify"),!1):t===Me?(ue.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ue.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ue.uninitializedWarning("posthog.identify");if(H(t)&&(t=t.toString(),ue.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(t)&&this.Yi("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ce)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(pe)&&(this.unregister(pe),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(Se)||Ne)===Ne;t!==r&&n?(this.persistence.set_property(Se,Le),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(He,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.Ri=gs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(Ee))}}setPersonProperties(t,e){if((t||e)&&this.Yi("posthog.setPersonProperties")){var i=gs(this.get_distinct_id(),t,e);this.Ri!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ri=i):ue.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(U(t)?t:[t]).filter((t=>F(t)&&t.length>0));0!==i.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ri=null)}group(t,e,i){if(t&&e){var r=this.getGroups(),s=r[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},r,{[t]:e})}),s||i){var n={$group_type:t,$group_key:e};i&&(n.$group_set=i),this.capture(Ge,n)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ue.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,i,r,s,n,o,a,u,l;if(ue.info("reset"),!this.__loaded)return ue.uninitializedWarning("posthog.reset");var h,d=this.get_property(ce),v=this.get_property(_e),c=this.get_property(me);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),B(c)||null==(h=this.persistence)||h.register({[me]:c}),null==(r=this.surveys)||r.reset(),null==(s=this.Wi)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(u=this.persistence)||u.set_property(Se,Ne),null==(l=this.sessionManager)||l.resetSessionId(),this.Ri=null,this.config.cookieless_mode===De)this.register_once({distinct_id:Me,$device_id:null},"");else{var _=this.config.get_device_id(ni());this.register_once({distinct_id:_,$device_id:t?_:d},""),t||B(v)||this.register({[_e]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var e=this;return _((function*(){var t,i,r,s;e.__loaded?(null==(t=e.logs)||t.flushLogs("sendBeacon"),null==(i=e.$i)||i.unload(),null==(r=e.Ni)||r.unload(),null==(s=e.featureFlags)||s.destroy()):ue.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.en()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.tn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(ve)?(ue.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(B(e)&&(e=this.get_distinct_id()),t!==e?(this.Ki(pe,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ue.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(N(t)){var i,r,s,n,o,a,u,l,h,d,c;Ve(this.config,Bs(t));var _=this.Ai();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ji(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.Oi(this.config.debug);W(f)&&(this.config.debug=f),W(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,di.N()&&di.q("ph_debug",!0),ue.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,di.N()&&di.P("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.rn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){v.LIB_NAME=t,v.LIB_VERSION=e}startSessionRecording(t){var e,i,r,s,n,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:zs.nn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Us;return e!==Us&&(e=Us+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Se))===Le||(null==(e=this.sessionPersistence)?void 0:e.get_property(Se))===Le}Ji(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Be&&!this._isIdentified()&&L(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[pe])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ie]))}Gi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(t){return"never"===this.config.person_profiles?(ue.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(Ie,!0),!0)}Ai(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ue)}rn(){var t,e,i,r,s=this.Ai();return(null==(t=this.persistence)?void 0:t.Vt)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Vt)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==De){if(this.Ci()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ps(this),this.pageViewManager=new $i(this),this.persistence&&(this.sessionPropsManager=new vs(this,this.sessionManager,this.persistence));var a,u=null!==(s=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==s?s:null==(o=zs.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.ki(this.sessionRecording,new u(this)),this.Ui&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Ui)))}var l,h;this.consent.optInOut(!0),this.rn(),this.zi(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ue&&(null==(l=this.surveys)||l.loadIfEnabled()),(B(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else ue.warn(Is)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==De?(this.config.cookieless_mode===Ue&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===Ue&&(this.register({distinct_id:Me,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):ue.warn(Is)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===De||(this.config.cookieless_mode===Ue?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&k(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>k(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}Vi(){r&&("visible"===r.visibilityState?this.Ei||(this.Ei=!0,this.capture(qe,{title:r.title},{send_instantly:!0}),this.Mi&&(r.removeEventListener(Fe,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),Ze(r,Fe,this.Mi)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}mr(){var t,e,i,r,s,n,o=this.Li||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ue.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",!1,r=ue,s=(e="advanced_disable_flags")in(t=o)&&!j(t[e]),n=i in t&&!j(t[i]),s?t[e]:!!n&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]))}it(t){var e;if(j(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(J),r=U(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),j(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return V(t.event)?ue.warn(o+". This can cause unexpected behavior."):ue.info(o),null}s.properties&&!L(s.properties)||ue.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&j(s.properties[a]))return ue.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return null==(t=this.pageViewManager.Ot)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Oi(t){var e=W(t)&&!t,i=di.N()&&"true"===di.A("ph_debug");return!e&&(!!i||t)}}zs.__defaultExtensionClasses={},zs.nn={trace:Rs=()=>{},debug:Rs,info:Rs,warn:Rs,error:Rs,fatal:Rs},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Je(t.prototype[e[i]])}(zs,["identify"]);var qs=function(){v.SDK_DIST_CHANNEL="npm";var e=Ps[Us]=new zs;return function(){function e(){e.done||(e.done=!0,Ds=!1,Ye(Ps,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ze(r,"DOMContentLoaded",e,{capture:!1}):t&&ue.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{pr as Compression,ar as DEFAULT_PRODUCT_TOUR_APPEARANCE,or as DisplaySurveyType,zs as PostHog,ur as ProductTourEventName,lr as ProductTourEventProperties,sr as SurveyEventName,nr as SurveyEventProperties,Ki as SurveyEventType,Qi as SurveyPosition,ir as SurveyQuestionBranchingType,er as SurveyQuestionType,rr as SurveySchedule,Zi as SurveyTabPosition,tr as SurveyType,Xi as SurveyWidgetType,qs as default,qs as posthog,_r as severityLevels};
1
+ var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,s=null==e?void 0:e.location,n=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,u=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,h=null!=t?t:{},d="1.396.8",v={DEBUG:!1,LIB_VERSION:d,LIB_NAME:"web",JS_SDK_VERSION:d};function c(t,e,i,r,s,n,o){try{var a=t[n](o),u=a.value}catch(t){return void i(t)}a.done?e(u):Promise.resolve(u).then(r,s)}function _(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var n=t.apply(e,i);function o(t){c(n,r,s,o,a,"next",t)}function a(t){c(n,r,s,o,a,"throw",t)}o(void 0)}))}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},p.apply(null,arguments)}var f,g=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),m=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],w=["token"],y="NativeGzipValidationError",b=t=>t.length>=2&&31===t[0]&&139===t[1],x=(t,e)=>t===g.GZipJS||e===g.GZipJS||"gzip"===e,E=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),S=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=y,e},T=function(){var t=_((function*(t,e){18>t.size&&S("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());b(i)&&8===i[2]||S("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(f)return f;f=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;f[t]=e>>>0}return f})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&S("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&S("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function R(){return R=_((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),n=s.writable.getWriter(),o=n.write(r).then((()=>n.close())).catch(function(){var t=_((function*(t){try{yield n.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(s.readable).blob(),[u]=yield Promise.all([a,o]);return yield T(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),R.apply(this,arguments)}var P=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],k=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return P.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function O(t,e){return-1!==t.indexOf(e)}var I=function(t){return t.replace(/^\$/,"")},M=Object.prototype,A=M.hasOwnProperty,C=M.toString,U=Array.isArray||function(t){return"[object Array]"===C.call(t)},D=t=>"function"==typeof t,N=t=>t===Object(t)&&!U(t),L=t=>{if(N(t)){for(var e in t)if(A.call(t,e))return!1;return!0}return!1},B=t=>void 0===t,F=t=>"[object String]"==C.call(t),z=t=>F(t)&&0===t.trim().length,q=t=>null===t,j=t=>B(t)||q(t),H=t=>"[object Number]"==C.call(t)&&t==t,G=t=>H(t)&&t>0,W=t=>"[object Boolean]"===C.call(t),Y=t=>t instanceof FormData,V=t=>O(m,t),J=t=>O(w,t),K=[!0,"true",1,"1","yes"],X=t=>O(K,t),Q=[!1,"false",0,"0","no"];function Z(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),H(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),Z(s||i,e,i,r))}var tt="Mobile",et="iOS",it="Android",rt="Tablet",st=it+" "+rt,nt="iPad",ot="Apple",at=ot+" Watch",ut="Safari",lt="BlackBerry",ht="Samsung",dt=ht+"Browser",vt=ht+" Internet",ct="Chrome",_t=ct+" OS",pt=ct+" "+et,ft="Internet Explorer",gt=ft+" "+tt,mt="Opera",wt=mt+" Mini",yt="Edge",bt="Microsoft "+yt,xt="Firefox",Et=xt+" "+et,$t="Nintendo",St="PlayStation",Tt="Xbox",Rt=it+" "+tt,Pt=tt+" "+ut,kt="Windows",Ot=kt+" Phone",It="Nokia",Mt="Ouya",At="Generic",Ct=At+" "+tt.toLowerCase(),Ut=At+" "+rt.toLowerCase(),Dt="Konqueror",Nt="Oculus Browser",Lt="Vivaldi",Bt="Yandex",Ft="Whale",zt="DuckDuckGo",qt="Pale Moon",jt="Waterfox",Ht="Brave",Gt="Google Search App",Wt="(\\d+(\\.\\d+)?)",Yt=new RegExp("Version/"+Wt),Vt=new RegExp(Tt,"i"),Jt=new RegExp(St+" \\w+","i"),Kt=new RegExp($t+" \\w+","i"),Xt=new RegExp(lt+"|PlayBook|BB10","i"),Qt={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Zt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Ht:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&O(t,"GSA/")?Gt:O(t," OPR/")&&O(t,"Mini")?wt:O(t," OPR/")?mt:Xt.test(t)?lt:O(t,"IE"+tt)||O(t,"WPDesktop")?gt:O(t,"OculusBrowser")?Nt:O(t,dt)?vt:O(t,yt)||O(t,"Edg/")?bt:O(t,Lt+"/")?Lt:O(t,"YaBrowser/")?Bt:O(t,Ft+"/")?Ft:O(t,zt+"/")||O(t,"Ddg/")?zt:O(t,"FBIOS")?"Facebook "+tt:O(t,"UCWEB")||O(t,"UCBrowser")?"UC Browser":O(t,"CriOS")?pt:O(t,"CrMo")||O(t,ct)?ct:O(t,it)&&O(t,ut)?Rt:O(t,"FxiOS")?Et:O(t.toLowerCase(),Dt.toLowerCase())?Dt:O(t,Ht+"/")?Ht:((t,e)=>e&&O(e,ot)||function(t){return O(t,ut)&&!O(t,ct)&&!O(t,it)}(t))(t,e)?O(t,tt)?Pt:ut:O(t,"PaleMoon/")?qt:O(t,jt+"/")?jt:O(t,xt)?xt:O(t,"MSIE")||O(t,"Trident/")?ft:O(t,"Gecko")?xt:"")},te={[gt]:[new RegExp("rv:"+Wt)],[bt]:[new RegExp(yt+"?\\/"+Wt)],[ct]:[new RegExp("("+ct+"|CrMo)\\/"+Wt)],[pt]:[new RegExp("CriOS\\/"+Wt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Wt)],[ut]:[Yt],[Pt]:[Yt],[mt]:[new RegExp("(Opera|OPR)\\/"+Wt)],[xt]:[new RegExp(xt+"\\/"+Wt)],[Et]:[new RegExp("FxiOS\\/"+Wt)],[Dt]:[new RegExp("Konqueror[:/]?"+Wt,"i")],[lt]:[new RegExp(lt+" "+Wt),Yt],[Rt]:[new RegExp("android\\s"+Wt,"i")],[vt]:[new RegExp(dt+"\\/"+Wt)],[Nt]:[new RegExp("OculusBrowser\\/"+Wt)],[Lt]:[new RegExp(Lt+"\\/"+Wt)],[Bt]:[new RegExp("YaBrowser\\/"+Wt)],[Ft]:[new RegExp(Ft+"\\/"+Wt)],[Ht]:[new RegExp(Ht+"\\/"+Wt)],[zt]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Wt)],[qt]:[new RegExp("PaleMoon\\/"+Wt)],[jt]:[new RegExp(jt+"\\/"+Wt)],[Gt]:[new RegExp("GSA\\/"+Wt)],[ft]:[new RegExp("(rv:|MSIE )"+Wt)],Mozilla:[new RegExp("rv:"+Wt)]},ee=function(t,e,i,r){var s=Zt(t,e,i,r),n=te[s];if(B(n))return null;for(var o=0;n.length>o;o++){var a=t.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},ie=[[new RegExp(Tt+"; "+Tt+" (.*?)[);]","i"),t=>[Tt,t&&t[1]||""]],[new RegExp($t,"i"),[$t,""]],[new RegExp(St,"i"),[St,""]],[Xt,[lt,""]],[new RegExp(kt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ot,""];if(new RegExp(tt).test(e)&&!/IEMobile\b/.test(e))return[kt+" "+tt,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Qt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[kt,r]}return[kt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[et,[t[3],t[4],t[5]||"0"].join(".")]:[et,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=B(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+it+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+it+")","i"),t=>t&&t[2]?[it,[t[2],t[3],t[4]||"0"].join(".")]:[it,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[_t,""]],[/Linux|debian/i,["Linux",""]]],re=function(t){return Kt.test(t)?$t:Jt.test(t)?St:Vt.test(t)?Tt:new RegExp(Mt,"i").test(t)?Mt:new RegExp("("+Ot+"|WPDesktop)","i").test(t)?Ot:/iPad/.test(t)?nt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?at:Xt.test(t)?lt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(It,"i").test(t)?It:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(tt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?it:st:new RegExp("(pda|"+tt+")","i").test(t)?Ct:new RegExp(rt,"i").test(t)&&!new RegExp(rt+" pc","i").test(t)?Ut:""},se=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ne(t,e){return"string"==typeof(i=t)&&se.test(i)?t:e();var i}function oe(t){return t?t.split("#")[0]:t}var ae=function(e,i){var{debugEnabled:r}=void 0===i?{}:i,s={k(i){if(t&&(v.DEBUG||h.POSTHOG_DEBUG||r)&&!B(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>ae(e+" "+t,i)};return s},ue=ae("[PostHog.js]"),le=ue.createLogger,he=le("[ExternalScriptsLoader]"),de=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return he.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==r?void 0:r.querySelectorAll("script");if(s)for(var n,o=function(){if(s[a].src===e){var t=s[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;s.length>a;a++)if(n=o())return n.v;var u=()=>{if(!r)return i("document not found");var s=r.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=e,s.onload=t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)},s.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(s=t.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(s);else{var n,o=r.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(s,o[0]):r.body.appendChild(s)}};null!=r&&r.body?u():null==r||r.addEventListener("DOMContentLoaded",u)};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if("toolbar"===e){var n=3e5;s=s+"&t="+Math.floor(Date.now()/n)*n}r=t.requestRouter.endpointFor("assets",s)}de(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");de(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);de(t,r,i)};var ve="$people_distinct_id",ce="$device_id",_e="$device_model",pe="__alias",fe="__timers",ge="$dead_clicks_enabled_server_side",me="$session_recording_remote_config",we="$sesid",ye="$session_is_sampled",be="$enabled_feature_flags",xe="$surveys_loaded_at",Ee="$flag_call_reported",$e="$feature_flag_evaluated_at",Se="$user_state",Te="$client_session_props",Re="$capture_rate_limit",Pe="$initial_campaign_params",ke="$initial_referrer_info",Oe="$initial_person_info",Ie="$epp",Me="$posthog_cookieless",Ae="$sdk_debug_extensions_init_method",Ce="$sdk_debug_extensions_init_time_ms",Ue="on_reject",De="always",Ne="anonymous",Le="identified",Be="identified_only",Fe="visibilitychange",ze="beforeunload",qe="$pageview",je="$pageleave",He="$identify",Ge="$groupidentify";function We(t,e){U(t)&&t.forEach(e)}function Ye(t,e){if(!j(t))if(U(t))t.forEach(e);else if(Y(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)A.call(t,i)&&e(t[i],i)}var Ve=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},Je=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ue.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ue.critical(t)}}},Ke=function(t){var e={};return Ye(t,(function(t,i){(F(t)&&t.length>0||H(t))&&(e[i]=t)})),e};var Xe=["herokuapp.com","vercel.app","netlify.app"];function Qe(t){var e=null==t?void 0:t.hostname;if(!F(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Xe)if(i===r)return!1;return!0}function Ze(t,e,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:s,passive:n})}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return H(t)&&isFinite(t)&&Math.floor(t)===t});class ti{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|e>>>8,s[7]=e,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new ti(s)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new ti(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class ei{constructor(){this.S=0,this.C=0,this.I=new si}generate(){var t=this.generateOrAbort();if(B(t)){this.S=0;var e=this.generateOrAbort();if(B(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.M();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return ti.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ii,ri=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!B(t.crypto)&&crypto.getRandomValues&&(ri=t=>crypto.getRandomValues(t));class si{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ri(this.R),this.O=0),this.R[this.O++]}}var ni=()=>oi().toString(),oi=()=>(ii||(ii=new ei)).generate(),ai="",ui=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var li={N:()=>!!r,D(t){ue.error("cookieStore error: "+t)},A(t){if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),s=0;i.length>s;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(li.A(t))||{}}catch(t){}return e},q(t,e,i,s,n){if(!r)return!1;try{var o="",a="",u=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ai)return ai;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),s=Math.min(i.length,8),n="dmn_chk_"+ni();!ai&&s--;){var o=i.slice(s).join("."),a=n+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",ai=o)}return ai}(t);if(!i){var s=(t=>{var e=t.match(ui);return e?e[0]:""})(t);s!==i&&ue.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(r.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),o="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+u+a;return h.length>3686.4&&ue.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},P(t,e){if(null!=r&&r.cookie)try{li.q(t,"",-1,e)}catch(t){return}}},hi=null,di={N(){if(!q(hi))return hi;var e=!0;if(B(t))e=!1;else try{var i="__mplssupport__";di.q(i,"xyz"),'"xyz"'!==di.A(i)&&(e=!1),di.P(i)}catch(t){e=!1}return e||ue.error("localStorage unsupported; falling back to cookie store"),hi=e,e},D(t){ue.error("localStorage error: "+t)},A(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){di.D(t)}return null},F(t){try{return JSON.parse(di.A(t))||{}}catch(t){}return null},q(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){di.D(t)}return!1},P(e){try{null==t||t.localStorage.removeItem(e)}catch(t){di.D(t)}}},vi=[ce,"distinct_id",we,ye,Ie,Oe,Se],ci={},_i={N:()=>!0,D(t){ue.error("memoryStorage error: "+t)},A:t=>ci[t]||null,F:t=>ci[t]||null,q:(t,e)=>(ci[t]=e,!0),P(t){delete ci[t]}},pi=null,fi={N(){if(!q(pi))return pi;if(pi=!0,B(t))pi=!1;else try{var e="__support__";fi.q(e,"xyz"),'"xyz"'!==fi.A(e)&&(pi=!1),fi.P(e)}catch(t){pi=!1}return pi},D(t){ue.error("sessionStorage error: ",t)},A(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){fi.D(t)}return null},F(t){try{return JSON.parse(fi.A(t))||null}catch(t){}return null},q(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){fi.D(t)}return!1},P(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){fi.D(t)}}};class gi{constructor(t){this._instance=t}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===De||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===Ue}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(t){this.Ct.q(this.It,t?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get St(){var t=this.Ct.A(this.It);return X(t)?1:O(Q,t)?0:-1}get Ct(){var t=this.Se.opt_out_capturing_persistence_type,e="localStorage"===t?di:li;if(!this.Tt||this.Tt!==e){this.Tt=e;var i="localStorage"===t?li:di;i.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(X(i.A(this.It))),i.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>X(t)))}}var mi=["next","previous","prev",">","<","+","-","−","–"];le("[Dead Clicks]");var wi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ge)),r=t.instance.config.capture_dead_clicks;return W(r)?r:!!N(r)||i},yi=le("[SegmentIntegration]");var bi="posthog-js";function xi(t,e){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===e?{}:e;return e=>{var a,u,l,h,d;if("*"!==n&&!n.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,_=(null==(a=e.exception)?void 0:a.values)||[],f=_.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$exception_type:null==(l=_[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(h=_[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+e.event_id),o&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class Ei{constructor(t,e,i,r,s,n){this.name=bi,this.setupOnce=function(o){o(xi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class $i{constructor(t){this.Rt=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ue.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Lt()}Lt(){var t;this.Ft=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Rt)}destroy(){var t;null==(t=this.Ft)||t.call(this),this.Ft=void 0}doPageView(e,i){var r,s=this.At(e,i);return this.Ot={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var e;return this.At(t,null==(e=this.Ot)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ot)?void 0:t.pageViewId}}At(t,e){var i=this.Ot;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=s;if(!(B(n)||B(o)||B(a)||B(u)||B(l)||B(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var d=n>1?Z(o/n,0,1,ue):1,v=n>1?Z(a/n,0,1,ue):1,c=u>1?Z(l/u,0,1,ue):1,_=u>1?Z(h/u,0,1,ue):1;r=Ve(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Si=["flags","surveys"],Ti={[ve]:{exposure:"hidden"},[pe]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[fe]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"},$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[ge]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[me]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[we]:{exposure:"hidden"},[ye]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:t=>q(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[be]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!N(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},$active_feature_flags:{exposure:"event",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},$feature_flag_details:{exposure:"hidden",storageGroup:"flags"},$feature_flag_payloads:{exposure:"event",storageGroup:"flags"},$feature_flag_request_id:{exposure:"event",storageGroup:"flags",volatile:!0},$override_feature_flags:{exposure:"event"},$override_feature_flag_payloads:{exposure:"hidden"},$stored_person_properties:{exposure:"hidden"},$stored_group_properties:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[xe]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Ee]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[$e]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},[Oe]:{exposure:"hidden"},[Ie]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[Ae]:{exposure:"event"},[Ce]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ri=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Pi=t=>{var e=Ti[t];if(e)return e;for(var[i,r]of Ri)if(0===t.indexOf(i))return r},ki=t=>{var e=null==r?void 0:r.createElement("a");return B(e)?null:(e.href=t,e)},Oi=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===e){i=n;break}}if(!U(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ue.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ii=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");U(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(u[h]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},Mi="https?://(.*)",Ai=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ci=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ai],Ui="<masked>",Di=["li_fat_id"];function Ni(t,e){var i=Ci.concat(e||[]),r={};return Ye(i,(function(e){var i=Oi(t,e);r[e]=i||null})),r}function Li(t){var e=function(t){return t?0===t.search(Mi+"google.([^/?]*)")?"google":0===t.search(Mi+"bing.com")?"bing":0===t.search(Mi+"yahoo.com")?"yahoo":0===t.search(Mi+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!q(e)){s.$search_engine=e;var n=r?Oi(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Bi(){return navigator.language||navigator.userLanguage}var Fi="$direct";function zi(){return(null==r?void 0:r.referrer)||Fi}function qi(t,e,i){void 0===i&&(i=!1);var r=t?[...Ai,...e||[]]:[],n=i?oe(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:zi().substring(0,1e3),u:o?Ii(o,r,Ui):void 0}}function ji(t,e){var i;void 0===e&&(e=!1);var{r:r,u:s}=t,n=e?oe(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==Fi?Fi:null==(i=ki(r))?void 0:i.host};if(n){o.$current_url=n;var a=ki(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var u=Ni(n);Ve(o,u)}if(r){var l=Li(r);Ve(o,l)}return o}function Hi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Gi(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Wi={flags:$e,surveys:xe},Yi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Vi="main";class Ji{constructor(e,i,r){if(void 0===r&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=r,this.props={},this.Bt=!1,this.jt=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ue.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Ze(t,"beforeunload",s,{capture:!1}),Ze(t,"pagehide",s,{capture:!1})}}zt(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return H(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){-1===Yi.indexOf(e.persistence.toLowerCase())&&(ue.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...vi,...e];return p({},di,{F(t){try{var e={};try{e=li.F(t)||{}}catch(t){}var r,s=JSON.parse(di.A(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];q(a)||""===a||(n[o]=a)}r=Ve(s,n)}else r=Ve(e,s);return di.q(t,r),r}catch(t){}return null},q(t,e,i,s,n,o){var a=di.q(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&li.q(t,u,i,s,n,o)}catch(t){di.D(t)}return a},P(e,i){try{null==t||t.localStorage.removeItem(e),li.P(e,i)}catch(t){di.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&di.N()?(i=di,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&fi.N()?i=fi:"memory"===n?i=_i:"cookie"===n?i=li:r.N()?(i=r,s=!0):i=li,this.Dt=s,i}Wt(t){return this.jt+"__"+t}Ut(t){return this.Dt&&!!t.split_storage}Gt(t){var e=null!=t?t:this.Se.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[$e];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return Ye(this.props,((e,i)=>{var r=Pi(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===be?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&Ve(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.Vt){var t=this.Ct.F(this.jt);t&&(this.props=Ve({},t)),this.Nt&&this.Zt()}}Zt(){for(var t of Si){var e=di.F(this.Wt(t));if(e&&!L(e)){var i=this.Qt(t);i.persisted=!0,this.Jt(t)||(i.fingerprint=this.Yt(e,t)),this.Kt(t,e)||Ve(this.props,e)}}}Jt(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Pi(e))?void 0:i.storageGroup)===t}))}Kt(t,e){var i=Wi[t];if(!i)return!1;var r=e[i],s=this.props[i];return H(r)&&H(s)&&s>r}refreshKey(t){var e;if(!this.Vt){var i=this.Nt?null==(e=Pi(t))?void 0:e.storageGroup:void 0,r=i?di.F(this.Wt(i)):this.Ct.F(this.jt);if(r&&t in r)this.Xt(t,r[t]);else{if(i){var s=this.Ct.F(this.jt);if(s&&t in s)return void this.Xt(t,s[t])}this.er(t)}}}save(){if(!this.Vt){var t=this.zt();t>0?B(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),t)):this.rr()}}flush(){B(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,Vi))}ir(){var{main:t,groups:e}=this.sr();for(var i of(this.nr(this.Ct,this.jt,t,Vi),Si)){var r,s=e[i];(!L(s)||null!=(r=this.$t[i])&&r.persisted)&&this.nr(di,this.Wt(i),s,i)}}sr(){var t={},e={};for(var i of Si)e[i]={};return Ye(this.props,((i,r)=>{var s,n=null==(s=Pi(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}Yt(t,e){if(e===Vi)return JSON.stringify(t)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return Ye(t,((t,e)=>{var r;i[e]=null!=(r=Pi(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}nr(t,e,i,r){var s=this.Qt(r);if(r===Vi||s.dirty||B(s.fingerprint)){var n;try{if((n=this.Yt(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.q(e,i,this.ar,this.lr,this.ur,this.Se.debug)?(s.dirty=!1,r!==Vi&&(s.persisted=!0),B(n)||(s.fingerprint=n)):this.Se.debug&&ue.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(B(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!e&&this.qt)for(var i of Si)di.P(this.Wt(i));e?delete this.$t[Vi]:this.$t={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(N(t)){B(e)&&(e="None"),this.ar=B(i)?this.hr:i;var r=!1;if(Ye(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(N(t)){this.ar=B(e)?this.hr:e;var i=!1;if(Ye(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.er(t),this.save())}update_campaign_params(){if(!this.Bt){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Ai,...i||[]]:[],o=Ni(Ii(r.URL,n,Ui),t),a=(s={},Ye(Di,(function(t){var e=li.A(t);s[t]=e||null})),s);return Ve(a,o)}(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);L(Ke(t))||this.register(t),this.Bt=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Li(t):{})}update_referrer_info(){var t;this.register_once({$referrer:zi(),$referring_domain:null!=r&&r.referrer&&(null==(t=ki(r.referrer))?void 0:t.host)||Fi},void 0)}set_initial_person_info(){this.props[Pe]||this.props[ke]||this.register_once({[Oe]:qi(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};Ye([ke,Pe],(e=>{var i=this.props[e];i&&Ye(i,(function(e,i){t["$initial_"+I(i)]=e}))}));var e=this.props[Oe];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=ji(t,e),r={};return Ye(i,(function(t,e){r["$initial_"+I(e)]=t})),r}(e,this.Se.disable_capture_url_hashes);Ve(t,i)}return t}safe_merge(t){return Ye(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.hr=this.ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),s=r?this.Ht(t):this.Ct,n=this.Ut(t);if(r||n!==this.Nt){var o=this.props;this.clear(),this.Ct=s,this.Nt=n,this.props=o,this.save()}}set_disabled(t){this.Vt=t,this.Vt?this.remove():this.save()}set_cross_subdomain(t){t!==this.lr&&(this.lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ur&&(this.ur=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[fe]||{};i[t]=e,this.Xt(fe,i),this.save()}remove_event_timer(t){var e=this.props[fe]||{},i=e[t];return B(i)||(delete e[t],this.Xt(fe,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Xt(t,e),this.save()}Xt(t,e){var i;this.props[t]=e,null!=(i=Pi(t))&&i.volatile||this.dr(t)}er(t){delete this.props[t],this.dr(t)}dr(t){var e,i=null==(e=Pi(t))?void 0:e.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(t){return this.$t[t]||(this.$t[t]={})}}var Ki={Activation:"events",Cancellation:"cancelEvents"},Xi={Button:"button",Tab:"tab",Selector:"selector"},Qi={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Zi={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},tr={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},er={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},ir={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},rr={Once:"once",Recurring:"recurring",Always:"always"},sr={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},nr={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},or={Popover:"popover",Inline:"inline"},ar={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},ur={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},lr={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},hr=le("[RateLimiter]");class dr{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{hr.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void hr.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Re))&&void 0!==e?e:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Re,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var vr=le("[RemoteConfig]");class cr{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=h._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}cr(t){var e,i;null!=(e=h.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}vr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return vr.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void vr.warn("Remote config is disabled. Falling back to local config.");this.cr((t=>{if(!t)return vr.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((t=>{this.pr(t),this.gr()}));this.pr(t),this.gr()}))}catch(t){vr.error("Error loading remote config",t)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var t;if(!this.yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(t){var e;t||vr.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var _r=["fatal","error","warning","log","info","debug"],pr={GZipJS:"gzip-js",Base64:"base64"},fr=Uint8Array,gr=Uint16Array,mr=Uint32Array,wr=new fr([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]),yr=new fr([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]),br=new fr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xr=function(t,e){for(var i=new gr(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new mr(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},Er=xr(wr,2),$r=Er[1];Er[0][28]=258,$r[258]=28;for(var Sr=xr(yr,0)[1],Tr=new gr(32768),Rr=0;32768>Rr;++Rr){var Pr=(43690&Rr)>>>1|(21845&Rr)<<1;Tr[Rr]=((65280&(Pr=(61680&(Pr=(52428&Pr)>>>2|(13107&Pr)<<2))>>>4|(3855&Pr)<<4))>>>8|(255&Pr)<<8)>>>1}var kr=function(t,e,i){for(var r=t.length,s=0,n=new gr(e);r>s;++s)++n[t[s]-1];var o,a=new gr(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new gr(1<<e);var u=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Tr[d]>>>u]=l}else for(o=new gr(r),s=0;r>s;++s)o[s]=Tr[a[t[s]-1]++]>>>15-t[s];return o},Or=new fr(288);for(Rr=0;144>Rr;++Rr)Or[Rr]=8;for(Rr=144;256>Rr;++Rr)Or[Rr]=9;for(Rr=256;280>Rr;++Rr)Or[Rr]=7;for(Rr=280;288>Rr;++Rr)Or[Rr]=8;var Ir=new fr(32);for(Rr=0;32>Rr;++Rr)Ir[Rr]=5;var Mr=kr(Or,9,0),Ar=kr(Ir,5,0),Cr=function(t){return(t/8>>0)+(7&t&&1)},Ur=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof gr?gr:t instanceof mr?mr:fr)(i-e);return r.set(t.subarray(e,i)),r},Dr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Nr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Lr=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var s=i.length,n=i.slice();if(!s)return[new fr(0),0];if(1==s){var o=new fr(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],u=i[1],l=0,h=1,d=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=s-1;)a=i[i[d].f>i[l].f?l++:d++],u=i[l!=h&&i[d].f>i[l].f?l++:d++],i[h++]={s:-1,f:a.f+u.f,l:a,r:u};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new gr(v+1),_=Br(i[h-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var w=n[r].s;e>c[w]?p-=1<<e-c[w]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;c[y]==e&&(--c[y],++p)}_=e}return[new fr(c),_]},Br=function(t,e,i){return-1==t.s?Math.max(Br(t.l,e,i+1),Br(t.r,e,i+1)):e[t.s]=i},Fr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new gr(++e),r=0,s=t[0],n=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==s&&a!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[i.subarray(0,r),e]},zr=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},qr=function(t,e,i){var r=i.length,s=Cr(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;r>n;++n)t[s+n+4]=i[n];return 8*(s+4+r)},jr=function(t,e,i,r,s,n,o,a,u,l,h){Dr(e,h++,i),++s[256];for(var d=Lr(s,15),v=d[0],c=d[1],_=Lr(n,15),p=_[0],f=_[1],g=Fr(v),m=g[0],w=g[1],y=Fr(p),b=y[0],x=y[1],E=new gr(19),S=0;m.length>S;++S)E[31&m[S]]++;for(S=0;b.length>S;++S)E[31&b[S]]++;for(var T=Lr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[br[k-1]];--k);var O,I,M,A,C=l+5<<3,U=zr(s,Or)+zr(n,Ir)+o,D=zr(s,v)+zr(n,p)+o+14+3*k+zr(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(U>=C&&D>=C)return qr(e,h,t.subarray(u,u+l));if(Dr(e,h,1+(U>D)),h+=2,U>D){O=kr(v,c,0),I=v,M=kr(p,f,0),A=p;var N=kr(R,P,0);for(Dr(e,h,w-257),Dr(e,h+5,x-1),Dr(e,h+10,k-4),h+=14,S=0;k>S;++S)Dr(e,h+3*S,R[br[S]]);h+=3*k;for(var L=[m,b],B=0;2>B;++B){var F=L[B];for(S=0;F.length>S;++S)Dr(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Dr(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=Mr,I=Or,M=Ar,A=Ir;for(S=0;a>S;++S)if(r[S]>255){var z;Nr(e,h,O[257+(z=r[S]>>>18&31)]),h+=I[z+257],z>7&&(Dr(e,h,r[S]>>>23&31),h+=wr[z]);var q=31&r[S];Nr(e,h,M[q]),h+=A[q],q>3&&(Nr(e,h,r[S]>>>5&8191),h+=yr[q])}else Nr(e,h,O[r[S]]),h+=I[r[S]];return Nr(e,h,O[256]),h+I[256]},Hr=new mr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gr=function(){for(var t=new mr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Wr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Yr(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Gr[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,u,l=(a=10+((s=e).filename&&s.filename.length+1||0),u=8,function(t,e,i,r,s,n){var o=t.length,a=new fr(r+o+5*(1+Math.floor(o/7e3))+s),u=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?l=qr(u,l,t.subarray(h,d)):(u[h]=!0,l=qr(u,l,t.subarray(h,o)))}else{for(var v=Hr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new gr(32768),g=new gr(p+1),m=Math.ceil(i/3),w=2*m,y=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<w)&p},b=new mr(25e3),x=new gr(288),E=new gr(32),S=0,T=0,R=(h=0,0),P=0,k=0;o>h;++h){var O=y(h),I=32767&h,M=g[O];if(f[I]=M,g[O]=I,h>=P){var A=o-h;if((S>7e3||R>24576)&&A>423){l=jr(t,u,0,b,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var C=0;286>C;++C)x[C]=0;for(C=0;30>C;++C)E[C]=0}var U=2,D=0,N=_,L=I-M&32767;if(A>2&&O==y(h-L))for(var B=Math.min(c,A)-1,F=Math.min(32767,h),z=Math.min(258,A);F>=L&&--N&&I!=M;){if(t[h+U]==t[h+U-L]){for(var q=0;z>q&&t[h+q]==t[h+q-L];++q);if(q>U){if(U=q,D=L,q>B)break;var j=Math.min(L,q-2),H=0;for(C=0;j>C;++C){var G=h-L+C+32768&32767,W=G-f[G]+32768&32767;W>H&&(H=W,M=G)}}}L+=(I=M)-(M=f[I])+32768&32767}if(D){b[R++]=268435456|$r[U]<<18|Sr[D];var Y=31&$r[U],V=31&Sr[D];T+=wr[Y]+yr[V],++x[257+Y],++E[V],P=h+U,++S}else b[R++]=t[h],++x[t[h]]}}l=jr(t,u,!0,b,x,E,T,R,k,h-k,l)}return Ur(a,0,r+Cr(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,u)),h=l.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Wr(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(l,e),Wr(l,h-8,i.d()),Wr(l,h-4,r),l}var Vr=!!o||!!n,Jr="text/plain",Kr=!1,Xr=(t,e)=>{var[i,r]=t.split("#"),[s,n]=i.split("?");if(!n)return t;var o=n.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},Qr=function(t,e,i){var r;void 0===i&&(i=!0);var[s,n]=t.split("?"),o=p({},e),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var e,[r,s]=t.split("="),n=i&&null!==(e=o[r])&&void 0!==e?e:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],u=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return Ye(t,(function(t,e){B(t)||B(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),s[s.length]=r+"="+i)})),s.join(e)}(o);return u&&a.push(u),s+"?"+a.join("&")},Zr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),ts=t=>{if(t.xt)return t.xt;var{data:e,compression:i}=t;if(e){if(i===pr.GZipJS){var r=Yr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new fr(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;i>o;++o){if(s+5>r.length){var a=new fr(s+8+(i-o<<1));a.set(r),r=a}var u=t.charCodeAt(o);128>u?n(u):2048>u?(n(192|u>>>6),n(128|63&u)):u>55295&&57344>u?(n(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),n(128|u>>>12&63),n(128|u>>>6&63),n(128|63&u)):(n(224|u>>>12),n(128|u>>>6&63),n(128|63&u))}return Ur(r,0,s)}(Zr(e)),{mtime:0});return{contentType:Jr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===pr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Zr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Zr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Zr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},es=t=>{var e,i,r=()=>({url:Xr(t.url,"compression"),encodedBody:ts(p({},t,{compression:void 0,xt:void 0}))});try{e=ts(t)}catch(e){if(x(t.compression,Oi(t.url,"compression")))return ue.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&x(t.compression,Oi(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?b(new Uint8Array(i)):ArrayBuffer.isView(i)&&b(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Kr=!0,r()):{url:t.url,encodedBody:e}},is=t=>{try{return es(t)}catch(e){return ue.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},rs=function(){var t=_((function*(t){var e=Zr(t.data),i=yield function(t,e,i){return R.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{xt:{contentType:Jr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),ss=(t,e)=>Qr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),ns=[];n&&ns.push({transport:"fetch",method(t){var e,i=is(t);if(i){var{url:r,encodedBody:s}=i,{contentType:o,body:u,estimatedSize:l}=null!=s?s:{},h=new Headers;Ye(t.headers,(function(t,e){h.append(e,t)})),o&&h.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout((()=>{var e,i;v=!0,c.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}n(r,p({method:(null==t?void 0:t.method)||"GET",headers:h,keepalive:"POST"===t.method&&52428.8>(l||0),body:u,signal:null==(e=d)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ue.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{v&&"AbortError"===(null==e?void 0:e.name)?ue.warn(e):ue.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>d?clearTimeout(d.timeout):null))}}}),o&&ns.push({transport:"XHR",method(t){var e=is(t);if(e){var i=new o,{url:r,encodedBody:s}=e;i.open(t.method||"GET",r,!0);var{contentType:n,body:a}=null!=s?s:{};Ye(t.headers,(function(t,e){i.setRequestHeader(e,t)})),n&&i.setRequestHeader("Content-Type",n),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&ns.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=es(t),{contentType:s,body:n}=null!=r?r:{};if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:s});i.sendBeacon(e,o)}catch(t){}}});var os=3e3;class as{constructor(t,e){this.br=!0,this._r=[],this.wr=Z((null==e?void 0:e.flush_interval_ms)||os,250,5e3,ue.createLogger("flush interval"),os),this.kr=t}enqueue(t){this._r.push(t),this.Sr||this.Cr()}unload(){this.Ir();var t=this._r.length>0?this.Tr():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.Er(p({},t,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var t=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var e=this.Tr(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&U(i.data)&&Ye(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.Er(i)};for(var r in e)i()}}),this.wr))}Er(t){try{this.kr(t)}catch(t){ue.error(t)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var t={};return Ye(this._r,(e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;B(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)})),this._r=[],t}}var us=["retriesPerformedSoFar"];class ls{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!B(t)&&"onLine"in t.navigator&&(this.Rr=t.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},Ze(t,"online",this.Or),Ze(t,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,i=function(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}(t,us);G(e)&&(i.url=Qr(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.st(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ue.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}st(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=Math.random()-.5;return Math.ceil(r+s*(r-i))}(e),r=Date.now()+i;this._r.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),ue.warn(s),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout((()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()}),this.Pr)}Lr(){var t=Date.now(),e=[],i=this._r.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this._r=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,B(t)||(this.Or&&(t.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(t.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){ue.error(t)}this._r=[]}}class hs{constructor(t){this.Dr=()=>{var t,e,i,r;this.Nr||(this.Nr={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),u=(null==s?void 0:s.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(n),this.Nr.maxScrollY=Math.max(n,null!==(t=this.Nr.maxScrollY)&&void 0!==t?t:0),this.Nr.maxScrollHeight=Math.max(o,null!==(e=this.Nr.maxScrollHeight)&&void 0!==e?e:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(u,null!==(r=this.Nr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var t=this.Nr;return setTimeout(this.Dr,0),t}startMeasuringScrollPosition(){Ze(t,"scroll",this.Dr,{capture:!0}),Ze(t,"scrollend",this.Dr,{capture:!0}),Ze(t,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==t?void 0:t.document.documentElement;var e=U(this.qr)?this.qr:[this.qr];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Br(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.qr){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br("y")}scrollX(){return this.Br("x")}}var ds=t=>qi(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class vs{constructor(t,e,i,r){this.jr=t=>{var e=this.Hr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ur(this._instance)};this.zr.register({[Te]:i})}},this._instance=t,this.Vr=e,this.zr=i,this.Ur=r||ds,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[Te]}getSetOnceProps(){var t,e=null==(t=this.Hr())?void 0:t.props;return e?"r"in e?ji(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return Ye(Ke(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+I(i)]=e})),t}}class cs{constructor(){this.Wr={}}on(t,e){return this.Wr[t]||(this.Wr[t]=[]),this.Wr[t].push(e),()=>{this.Wr[t]=this.Wr[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Wr[t]||[])i(e);for(var r of this.Wr["*"]||[])r(t,e)}}var _s=le("[SessionId]");class ps{on(t,e){return this.Gr.on(t,e)}constructor(t,e,i){var r;if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new cs,this.Kr=(t,e)=>!(!G(t)||!G(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===De)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=t.config,this.zr=t.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=e||ni,this.ri=i||ni;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Z(this.Se.session_idle_timeout_seconds||1800,60,36e3,_s.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+s+"_window_id",this.si="ph_"+s+"_primary_window_exists",this.oi()){var n=fi.F(this.ni),o=fi.F(this.si);n&&!o?this.Xr=n:fi.P(this.ni),fi.q(this.si,!0)}if(null!=(r=this.Se.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){_s.error("Invalid sessionID in bootstrap",t)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return B(this.Qr)&&(this.Qr=[]),this.Qr.push(t),this.ei&&t(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter((e=>e!==t))}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&fi.N()}ui(t){t!==this.Xr&&(this.Xr=t,this.oi()&&fi.q(this.ni,t))}hi(){return this.Xr?this.Xr:this.oi()?fi.F(this.ni):null}di(t){var e=this.Zr;return!q(e)&&!q(t)&&5e3>Math.abs(t-e)}ai(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.ei||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.ei=t,s&&!r||s&&this.di(e)||(this.Zr=e,this.zr.register({[we]:[e,t,i]}))}ci(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}vi(){this.ci()?this.zr.refreshKey(we):(this.zr.flush(),this.zr.load())}fi(){var t;if(!q(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,e,i]=this.pi();e===this.ei&&i===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[we]:[this._sessionActivityTimestamp,null!==(t=this.ei)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[t]=this.pi(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}mi(t){return this.vi(),this.Kr(t,this.gi())}pi(){var t=this.zr.props[we];return U(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&t&&(t.removeEventListener(ze,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&fi.P(this.si)},Ze(t,ze,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Se.cookieless_mode===De)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.pi(),n=this.gi(),o=this.hi(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.Kr(i,n);v&&((v=this.mi(i))||_s.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.pi()),h||v||a?(r=this.ti(),o=this.ri(),_s.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.ri(),u=!0),(l=r!==d)&&(_s.info("adopted cross-tab session id",{sessionId:r,windowId:o}),u=!0));var c=G(n)&&t&&!a?n:i,_=G(s)?s:(new Date).getTime();this.ui(o),this.ai(r,c,_),t||this.ii();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.Qr.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout((()=>{if(!this.Yr)if(this.mi((new Date).getTime())){var t=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:t})}else this.ii()}),1.1*this.sessionTimeoutMs))}}function fs(){return(fs=_((function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return F(r)&&r.length>0?r:void 0}catch(t){return void ue.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}))).apply(this,arguments)}function gs(t,e,i){return Zr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ms="custom",ws="i.posthog.com",ys=/^\/static\//;class bs{constructor(t){this.bi={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+ws,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.bi[this.apiHost]||(this.bi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":ms),this.bi[this.apiHost]}wi(t){if(ys.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var i=this.wi(e);if(i)return""+i+e}if(this.region===ms)return this.apiHost+e;var r=ws+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var xs=le("[Surveys]"),Es={ignoreConditions:!1,ignoreDelay:!1,displayType:or.Popover},$s=le("[PostHog ExternalIntegrations]"),Ss={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ts{constructor(t){this._instance=t}Mt(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return $s.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,s,n;!r||null!=(i=h.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(Ss[e],(()=>{var i;null==(i=h.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(s=h.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=h.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[i,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;e(i)}}}var Rs,Ps={},ks=0,Os=()=>{},Is='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ms="Surveys module not available",As="sanitize_properties is deprecated. Use before_send instead",Cs="Invalid value for property_denylist config: ",Us="posthog",Ds=!Vr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Ns=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Qe(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Os,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:s&&F(null==s?void 0:s.search)&&-1!==s.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){ue.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Be,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:os},error_tracking:{},_onCapture:Os},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:mi,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(e))},Ls=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],Bs=t=>{var e={};for(var[i,r]of Ls)B(t[i])||(e[r]=t[i]);var s=Ve({},e,t),n=t.__preview_external_dependency_versioned_paths;return B(n)||(B(t.strict_script_versioning)&&(s.strict_script_versioning=!!n),F(n)&&B(t.asset_host)&&(s.asset_host=n)),U(t.property_blacklist)&&(B(t.property_denylist)?s.property_denylist=t.property_blacklist:U(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ue.error(Cs+t.property_denylist)),s};class Fs{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(t){ue.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class zs{ki(t,e){if(t){var i=this.Si.indexOf(t);-1!==i&&this.Si.splice(i,1)}return this.Si.push(e),null==e.initialize||e.initialize(),e}Ci(){return this.config.cookieless_mode===De||this.config.cookieless_mode===Ue&&this.consent.isRejected()}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var t;this.webPerformance=new Fs,this.Ii=!1,this.version=v.LIB_VERSION,this.Ti=new cs,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ns(),this.SentryIntegration=Ei,this.sentryIntegration=t=>function(t,e){var i=xi(t,e);return{name:bi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new hs(this),this.pageViewManager=new $i(this),this.rateLimiter=new dr(this),this.requestRouter=new bs(this),this.consent=new gi(this),this.externalIntegrations=new Ts(this);var e=null!==(t=zs.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=F(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=F(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ue.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Us){var r,s=null!==(r=Ps[i])&&void 0!==r?r:new zs;return s._init(t,e,i),Ps[i]=s,Ps[Us][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n;void 0===i&&(i={});var o=F(e)?e.trim():"";if(!o)return ue.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},i.debug=this.Oi(i.debug),this.Li=i,this.Fi=[],i.person_profiles?this.Pi=i.person_profiles:i.process_person&&(this.Pi=i.process_person);var a=Ns(i.defaults),u=Bs(i),l=Ve({},a,u,{name:r,token:o});N(a.rageclick)&&N(u.rageclick)&&(l.rageclick=Ve({},a.rageclick,u.rageclick)),N(a.session_recording)&&N(u.session_recording)&&(l.session_recording=Ve({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&ue.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:pr.GZipJS;var h=this.Ai();this.persistence=new Ji(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ji(p({},this.config,{persistence:"sessionStorage"}),h,!1);var d=p({},this.persistence.props),c=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$i=new as((t=>this.Di(t)),this.config.request_queue_config),this.Ni=new ls(this),this.__request_queue=[];var _=this.Ci();if(_||(this.sessionManager=new ps(this),this.sessionPropsManager=new vs(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ue.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.qi(_)}),0)):(ue.info("Initializing extensions synchronously"),this.qi(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&ue.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var f=i.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Se);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ne)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Le)ue.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var w=this.config.get_device_id(ni()),y=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(Se,i.bootstrap.isIdentifiedID?Le:Ne),this.register({distinct_id:f,$device_id:y})}}if(_)this.register_once({distinct_id:Me,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(ni());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Se,Ne)}return Ze(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||ni();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Se,Le)),e()},s=i.user();"then"in s&&D(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||yi.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(yi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yi.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,qe),identify:t=>e(t,He),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Bi())):this.Bi(),D(this.config._onCapture)&&this.config._onCapture!==Os&&(ue.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ue.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return fs.apply(this,arguments)}().then((t=>{t&&this.register({[_e]:t})})).catch(Os),this}qi(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},zs.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.Si.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.Si.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.Si.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.Si.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.Si.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.Si.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.Si.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.Si.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.Si.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.Si.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.Si.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.Si.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,wi)),l.toolbar&&this.Si.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.Si.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.Si.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.ji){var t=this.ji;this.ji=void 0,this.pr(t)}})),this.Hi(h,u)}Hi(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Hi(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ue.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ae]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ce]:r}),this.config.__preview_deferred_init_extensions&&ue.info("PostHog extensions initialized ("+r+"ms)")}pr(t){var e;if(!r||!r.body)return ue.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.ji=t),this.Ui=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=O(t.supportedCompression,pr.GZipJS)?pr.GZipJS:O(t.supportedCompression,pr.Base64)?pr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:Be}),this.Si.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Bi(){try{this.config.loaded(this)}catch(t){ue.critical("`loaded` function failed",t)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=s&&s.hostname){var t=s.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()}),1),this.Wi=new cr(this),this.Wi.load()}zi(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.$i)||t.enable())}_dom_loaded(){this.is_capturing()&&We(this.__request_queue,(t=>this.Di(t))),this.__request_queue=[],this.zi()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(je),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.$i)||i.unload(),null==(r=this.Ni)||r.unload()):this.Gi()&&this.capture(je,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Ds?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(B(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=p({},t);s.timeout=s.timeout||6e4,s.url=ss(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=ns.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(t[i].transport===n)return t[i]}(o))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===pr.GZipJS&&u&&"undefined"!=typeof Promise&&!Kr?rs(s).then((t=>{a(t)})).catch((e=>{if(E(e))return Kr=!0,void a(p({},s,{compression:void 0,url:ss(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return E(t)||e===y})(e)&&(Kr=!0),a(s)})):a(s)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}Di(t){this.Ni?this.Ni.retriableRequest(t):this._send_request(t)}_execute_array(t){ks++;try{var e,i=[],r=[],s=[];We(t,(t=>{if(t)if(U(e=t[0]))s.push(t);else if(D(t))try{t.call(this)}catch(e){ue.error("Error executing queued PostHog call",t,e)}else U(t)&&"alias"===e?i.push(t):U(t)&&-1!==e.indexOf("capture")&&D(this[e])?s.push(t):r.push(t)}));var n=function(t,e){We(t,(function(t){try{if(U(t[0])){var i=e;Ye(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ue.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{ks--}}push(t){if(ks>0&&U(t)&&F(t[0])){var e=zs.prototype[t[0]];D(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!B(t)&&F(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var l=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==l||!l.isRateLimited){null!=e&&e.$current_url&&!F(null==e?void 0:e.$current_url)&&(ue.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.Zi||ue.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.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=(null==i?void 0:i.timestamp)||h,v=ne(null==i?void 0:i.uuid,ni),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===qe&&this.config.__preview_capture_bot_pageviews&&u&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),l&&(c.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var _=null==i?void 0:i.$unset;_&&(c.$unset=_);var f,g,m,w=this.Qi(null==i?void 0:i.$set_once,t!==Ge,t===He);if(w&&(c.$set_once=w),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=c,o=t=>F(t)?t.slice(0,s):t,a=new Set,c=function t(e,i){return e!==Object(e)?o?o(e):e:a.has(e)?void 0:(a.add(e),U(e)?(r=[],We(e,(e=>{r.push(t(e))}))):(r={},Ye(e,((e,i)=>{a.has(e)||(r[i]=t(e,i))}))),r);var r}(n)),c.timestamp=d,B(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),t===sr.DISMISSED||t===sr.SENT){var y=null==e?void 0:e[nr.SURVEY_ID],b=null==e?void 0:e[nr.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i})("seenSurvey_",t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){xs.error("Failed to persist survey seen state",t)}})({id:y,current_iteration:b}),c.$set=p({},c.$set,{[(f={id:y,current_iteration:b},g=t===sr.SENT?"responded":"dismissed",m="$survey_"+g+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+g+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else t===sr.SHOWN&&(c.$set=p({},c.$set,{[nr.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===ur.SHOWN){var x=null==e?void 0:e[lr.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[lr.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(L(E)||this.setPersonPropertiesForFlags(E),!j(this.config.before_send)){var S=this.it(c);if(!S)return;(c=S).uuid=ne(c.uuid,ni)}this.Ti.emit("eventCaptured",c);var T={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Di(T):this.$i.enqueue(T),c}ue.critical("This capture call is ignored due to client rate limiting.")}}else ue.error("No event name provided to posthog.capture")}else ue.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;var u=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Ci()&&(h.$cookieless_mode=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!F(h.distinct_id)&&!H(h.distinct_id)||z(h.distinct_id))&&ue.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r,n){var o,a,u,h;if(void 0===n&&(n=!1),!l)return{};var d,c,_,p,f,g,m,w,y,b=e?[...Ai,...i||[]]:[],[x,E]=function(t){for(var e=0;ie.length>e;e++){var[i,r]=ie[e],s=i.exec(t),n=s&&(D(r)?r(s,t):r);if(n)return n}return["",""]}(l),S=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},T={detectGoogleSearchApp:r},R=Ve(Ke({$os:x,$os_version:E,$browser:Zt(l,navigator.vendor,S,T),$device:re(l),$device_type:(_=l,p={userAgentDataPlatform:null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==t||null==(u=t.screen)?void 0:u.width,screenHeight:null==t||null==(h=t.screen)?void 0:h.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},y=re(_),y===nt||y===st||"Kobo"===y||"Kindle Fire"===y||y===Ut?rt:y===$t||y===Tt||y===St||y===Mt?"Console":y===at?"Wearable":y?tt:"Android"===(null==p?void 0:p.userAgentDataPlatform)&&(null!==(f=null==p?void 0:p.maxTouchPoints)&&void 0!==f?f:0)>0?600>Math.min(null!==(g=null==p?void 0:p.screenWidth)&&void 0!==g?g:0,null!==(m=null==p?void 0:p.screenHeight)&&void 0!==m?m:0)/(null!==(w=null==p?void 0:p.devicePixelRatio)&&void 0!==w?w:1)?tt:rt:"Desktop"),$timezone:Hi(),$timezone_offset:Gi()}),{$current_url:Ii(n?oe(null==s?void 0:s.href):null==s?void 0:s.href,b,Ui),$host:null==s?void 0:s.host,$pathname:null==s?void 0:s.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+"...":l,$browser_version:ee(l,navigator.vendor,S,T),$browser_language:Bi(),$browser_language_prefix:(c=Bi(),"string"==typeof c?c.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:v.LIB_NAME,$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return v.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=v.SDK_DIST_CHANNEL),R}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&Ve(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Ve(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Ni)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ms&&(h.$lib_custom_api_host=this.config.api_host),c=e!==qe||a?e!==je||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=Ve(h,c),e===qe&&r&&(h.title=r.title),!B(u)){var w=n.getTime()-u;h.$duration=parseFloat((w/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=Ve({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),U(this.config.property_denylist)?Ye(this.config.property_denylist,(function(t){delete h[t]})):ue.error(Cs+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(ue.error(As),h=y(h,e));var b=this.Ji();return h.$process_person_profile=b,b&&!a&&this.Yi("_calculate_event_properties"),h}Qi(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Ji())return t;if(this.Ii&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=Ve({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(ue.error(As),o=a(o,"$set_once")),e&&(this.Ii=!0),L(o)?void 0:o}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Ki(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Ti.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Ms}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Ms})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ms})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Es),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Ms}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Ms})}Xi(t){return!t||z(t)?(ue.critical("Unique user id has not been set in posthog.identify"),!1):t===Me?(ue.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ue.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ue.uninitializedWarning("posthog.identify");if(H(t)&&(t=t.toString(),ue.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(t)&&this.Yi("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ce)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(pe)&&(this.unregister(pe),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(Se)||Ne)===Ne;t!==r&&n?(this.persistence.set_property(Se,Le),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(He,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.Ri=gs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(Ee))}}setPersonProperties(t,e){if((t||e)&&this.Yi("posthog.setPersonProperties")){var i=gs(this.get_distinct_id(),t,e);this.Ri!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Ri=i):ue.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(U(t)?t:[t]).filter((t=>F(t)&&t.length>0));0!==i.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ri=null)}group(t,e,i){if(t&&e){var r=this.getGroups(),s=r[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},r,{[t]:e})}),s||i){var n={$group_type:t,$group_key:e};i&&(n.$group_set=i),this.capture(Ge,n)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ue.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,i,r,s,n,o,a,u,l;if(ue.info("reset"),!this.__loaded)return ue.uninitializedWarning("posthog.reset");var h,d=this.get_property(ce),v=this.get_property(_e),c=this.get_property(me);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),B(c)||null==(h=this.persistence)||h.register({[me]:c}),null==(r=this.surveys)||r.reset(),null==(s=this.Wi)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(u=this.persistence)||u.set_property(Se,Ne),null==(l=this.sessionManager)||l.resetSessionId(),this.Ri=null,this.config.cookieless_mode===De)this.register_once({distinct_id:Me,$device_id:null},"");else{var _=this.config.get_device_id(ni());this.register_once({distinct_id:_,$device_id:t?_:d},""),t||B(v)||this.register({[_e]:v})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var e=this;return _((function*(){var t,i,r,s;e.__loaded?(null==(t=e.logs)||t.flushLogs("sendBeacon"),null==(i=e.$i)||i.unload(),null==(r=e.Ni)||r.unload(),null==(s=e.featureFlags)||s.destroy()):ue.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.en()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.tn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(ve)?(ue.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(B(e)&&(e=this.get_distinct_id()),t!==e?(this.Ki(pe,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ue.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(N(t)){var i,r,s,n,o,a,u,l,h,d,c;Ve(this.config,Bs(t));var _=this.Ai();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Ji(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.Oi(this.config.debug);W(f)&&(this.config.debug=f),W(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,di.N()&&di.q("ph_debug",!0),ue.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,di.N()&&di.P("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.rn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){v.LIB_NAME=t,v.LIB_VERSION=e}startSessionRecording(t){var e,i,r,s,n,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:zs.nn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Us;return e!==Us&&(e=Us+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Se))===Le||(null==(e=this.sessionPersistence)?void 0:e.get_property(Se))===Le}Ji(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Be&&!this._isIdentified()&&L(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[pe])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ie]))}Gi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(t){return"never"===this.config.person_profiles?(ue.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(Ie,!0),!0)}Ai(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ue)}rn(){var t,e,i,r,s=this.Ai();return(null==(t=this.persistence)?void 0:t.Vt)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Vt)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==De){if(this.Ci()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ps(this),this.pageViewManager=new $i(this),this.persistence&&(this.sessionPropsManager=new vs(this,this.sessionManager,this.persistence));var a,u=null!==(s=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==s?s:null==(o=zs.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.ki(this.sessionRecording,new u(this)),this.Ui&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Ui)))}var l,h;this.consent.optInOut(!0),this.rn(),this.zi(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ue&&(null==(l=this.surveys)||l.loadIfEnabled()),(B(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else ue.warn(Is)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==De?(this.config.cookieless_mode===Ue&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===Ue&&(this.register({distinct_id:Me,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Vi(),this.zi())):ue.warn(Is)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===De||(this.config.cookieless_mode===Ue?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&k(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>k(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}Vi(){r&&("visible"===r.visibilityState?this.Ei||(this.Ei=!0,this.capture(qe,{title:r.title},{send_instantly:!0}),this.Mi&&(r.removeEventListener(Fe,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),Ze(r,Fe,this.Mi)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}mr(){var t,e,i,r,s,n,o=this.Li||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ue.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",!1,r=ue,s=(e="advanced_disable_flags")in(t=o)&&!j(t[e]),n=i in t&&!j(t[i]),s?t[e]:!!n&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]))}it(t){var e;if(j(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(J),r=U(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),j(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return V(t.event)?ue.warn(o+". This can cause unexpected behavior."):ue.info(o),null}s.properties&&!L(s.properties)||ue.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&j(s.properties[a]))return ue.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return null==(t=this.pageViewManager.Ot)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Oi(t){var e=W(t)&&!t,i=di.N()&&"true"===di.A("ph_debug");return!e&&(!!i||t)}}zs.__defaultExtensionClasses={},zs.nn={trace:Rs=()=>{},debug:Rs,info:Rs,warn:Rs,error:Rs,fatal:Rs},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Je(t.prototype[e[i]])}(zs,["identify"]);var qs=function(){v.SDK_DIST_CHANNEL="npm";var e=Ps[Us]=new zs;return function(){function e(){e.done||(e.done=!0,Ds=!1,Ye(Ps,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ze(r,"DOMContentLoaded",e,{capture:!1}):t&&ue.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{pr as Compression,ar as DEFAULT_PRODUCT_TOUR_APPEARANCE,or as DisplaySurveyType,zs as PostHog,ur as ProductTourEventName,lr as ProductTourEventProperties,sr as SurveyEventName,nr as SurveyEventProperties,Ki as SurveyEventType,Qi as SurveyPosition,ir as SurveyQuestionBranchingType,er as SurveyQuestionType,rr as SurveySchedule,Zi as SurveyTabPosition,tr as SurveyType,Xi as SurveyWidgetType,qs as default,qs as posthog,_r as severityLevels};
2
2
  //# sourceMappingURL=module.slim.js.map