posthog-js 1.422.2 → 1.422.3

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
- function e(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function t(t){return function(){var i=this,s=arguments;return new Promise((function(r,n){var o=t.apply(i,s);function a(t){e(o,r,n,a,l,"next",t)}function l(t){e(o,r,n,a,l,"throw",t)}a(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},i.apply(null,arguments)}var s={DEBUG:!1,LIB_VERSION:"0.6.1",LIB_NAME:"browser-common"};s.DEBUG=!1,s.LIB_VERSION="1.422.2",s.LIB_NAME="web";var r="$people_distinct_id",n="distinct_id",o="$device_id",a="$device_model",l="__alias",_="__timers",u="$dead_clicks_enabled_server_side",d="$session_recording_remote_config",c="$sesid",h="$session_is_sampled",p="$enabled_feature_flags",g="$active_feature_flags",v="$feature_flag_details",f="$feature_flag_payloads",m="$feature_flag_request_id",y="$minimal_flag_called_events",b="$stored_person_properties",w="$stored_group_properties",S="$groups",x="$surveys_loaded_at",P="$flag_call_reported",E="$feature_flag_errors",k="$feature_flag_evaluated_at",T="$user_state",I="$client_session_props",C="$capture_rate_limit",R="$initial_campaign_params",O="$initial_referrer_info",F="$initial_person_info",A="$epp",M="$posthog_cookieless",L="$cookieless_mode",D="$sdk_debug_extensions_init_method",N="$sdk_debug_extensions_init_time_ms",U="on_reject",q="always",B="anonymous",H="identified",G="identified_only",z="visibilitychange",V="beforeunload",j="$pageview",W="$pageleave",K="$identify",Y="$groupidentify",J="undefined"!=typeof window?window:void 0,Q="undefined"!=typeof globalThis?globalThis:J,X=null==Q?void 0:Q.navigator,Z=null==Q?void 0:Q.document,ee=null==Q?void 0:Q.location,te=null==Q?void 0:Q.fetch,ie=null!=Q&&Q.XMLHttpRequest&&"withCredentials"in new Q.XMLHttpRequest?Q.XMLHttpRequest:void 0,se=null==Q?void 0:Q.AbortController,re=null==Q?void 0:Q.CompressionStream,ne=null==X?void 0:X.userAgent,oe="undefined"!=typeof globalThis?globalThis:J;oe&&"undefined"==typeof self&&(oe.self=oe),oe&&"undefined"==typeof File&&(oe.File=function(){});var ae=null!=J?J:{},le=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],_e=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ue=["$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"],de=["token"],ce=["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","pinterestbot","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"],he=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return ce.concat(t).some((e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)}))};function pe(e,t){return-1!==e.indexOf(t)}var ge=function(e){return e.replace(/^\$/,"")},ve=Object.prototype,fe=ve.hasOwnProperty,me=ve.toString,ye=Array.isArray||function(e){return"[object Array]"===me.call(e)},be=e=>"function"==typeof e,we=e=>e===Object(e)&&!ye(e),Se=e=>{if(we(e)){for(var t in e)if(fe.call(e,t))return!1;return!0}return!1},xe=e=>void 0===e,Pe=e=>"[object String]"==me.call(e),Ee=e=>Pe(e)&&0===e.trim().length,ke=e=>null===e,Te=e=>xe(e)||ke(e),Ie=e=>"[object Number]"==me.call(e)&&e==e,Ce=e=>Ie(e)&&e>0,Re=e=>"[object Boolean]"===me.call(e),$e=e=>e instanceof FormData,Oe=e=>pe(ue,e),Fe=e=>pe(de,e),Ae=[!0,"true",1,"1","yes"],Me=e=>pe(Ae,e),Le=[!1,"false",0,"0","no"];function De(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Ie(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),De(r||i,t,i,s))}var Ne="Mobile",Ue="iOS",qe="Android",Be="Tablet",He=qe+" "+Be,Ge="iPad",ze="Apple",Ve=ze+" Watch",je="Safari",We="BlackBerry",Ke="Samsung",Ye=Ke+"Browser",Je=Ke+" Internet",Qe="Chrome",Xe=Qe+" OS",Ze=Qe+" "+Ue,et="Internet Explorer",tt=et+" "+Ne,it="Opera",st=it+" Mini",rt="Edge",nt="Microsoft "+rt,ot="Firefox",at=ot+" "+Ue,lt="Nintendo",_t="PlayStation",ut="Xbox",dt=qe+" "+Ne,ct=Ne+" "+je,ht="Windows",pt=ht+" Phone",gt="Nokia",vt="Ouya",ft="Generic",mt=ft+" "+Ne.toLowerCase(),yt=ft+" "+Be.toLowerCase(),bt="Konqueror",wt="Oculus Browser",St="Vivaldi",xt="Yandex",Pt="Whale",Et="DuckDuckGo",kt="Pale Moon",Tt="Waterfox",It="Brave",Ct="Google Search App",Rt="(\\d+(\\.\\d+)?)",$t=new RegExp("Version/"+Rt),Ot=new RegExp(ut,"i"),Ft=new RegExp(_t+" \\w+","i"),At=new RegExp(lt+" \\w+","i"),Mt=new RegExp(We+"|PlayBook|BB10","i"),Lt={"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"},Dt=function(e,t,i,s){t=t||"";var r=function(e){return null!=e&&e.brave?It:null}(i);return r||(null!=s&&s.detectGoogleSearchApp&&pe(e,"GSA/")?Ct:pe(e," OPR/")&&pe(e,"Mini")?st:pe(e," OPR/")?it:Mt.test(e)?We:pe(e,"IE"+Ne)||pe(e,"WPDesktop")?tt:pe(e,"OculusBrowser")?wt:pe(e,Ye)?Je:pe(e,rt)||pe(e,"Edg/")?nt:pe(e,St+"/")?St:pe(e,"YaBrowser/")?xt:pe(e,Pt+"/")?Pt:pe(e,Et+"/")||pe(e,"Ddg/")?Et:pe(e,"FBIOS")?"Facebook "+Ne:pe(e,"UCWEB")||pe(e,"UCBrowser")?"UC Browser":pe(e,"CriOS")?Ze:pe(e,"CrMo")||pe(e,Qe)?Qe:pe(e,qe)&&pe(e,je)?dt:pe(e,"FxiOS")?at:pe(e.toLowerCase(),bt.toLowerCase())?bt:pe(e,It+"/")?It:((e,t)=>t&&pe(t,ze)||function(e){return pe(e,je)&&!pe(e,Qe)&&!pe(e,qe)}(e))(e,t)?pe(e,Ne)?ct:je:pe(e,"PaleMoon/")?kt:pe(e,Tt+"/")?Tt:pe(e,ot)?ot:pe(e,"MSIE")||pe(e,"Trident/")?et:pe(e,"Gecko")?ot:"")},Nt={[tt]:[new RegExp("rv:"+Rt)],[nt]:[new RegExp(rt+"?\\/"+Rt)],[Qe]:[new RegExp("("+Qe+"|CrMo)\\/"+Rt)],[Ze]:[new RegExp("CriOS\\/"+Rt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Rt)],[je]:[$t],[ct]:[$t],[it]:[new RegExp("(Opera|OPR)\\/"+Rt)],[ot]:[new RegExp(ot+"\\/"+Rt)],[at]:[new RegExp("FxiOS\\/"+Rt)],[bt]:[new RegExp("Konqueror[:/]?"+Rt,"i")],[We]:[new RegExp(We+" "+Rt),$t],[dt]:[new RegExp("android\\s"+Rt,"i")],[Je]:[new RegExp(Ye+"\\/"+Rt)],[wt]:[new RegExp("OculusBrowser\\/"+Rt)],[St]:[new RegExp(St+"\\/"+Rt)],[xt]:[new RegExp("YaBrowser\\/"+Rt)],[Pt]:[new RegExp(Pt+"\\/"+Rt)],[It]:[new RegExp(It+"\\/"+Rt)],[Et]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Rt)],[kt]:[new RegExp("PaleMoon\\/"+Rt)],[Tt]:[new RegExp(Tt+"\\/"+Rt)],[Ct]:[new RegExp("GSA\\/"+Rt)],[et]:[new RegExp("(rv:|MSIE )"+Rt)],Mozilla:[new RegExp("rv:"+Rt)]},Ut=function(e,t,i,s){var r=Dt(e,t,i,s),n=Nt[r];if(xe(n))return null;for(var o=0;n.length>o;o++){var a=e.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},qt=[[new RegExp(ut+"; "+ut+" (.*?)[);]","i"),e=>[ut,e&&e[1]||""]],[new RegExp(lt,"i"),[lt,""]],[new RegExp(_t,"i"),[_t,""]],[Mt,[We,""]],[new RegExp(ht,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pt,""];if(new RegExp(Ne).test(t)&&!/IEMobile\b/.test(t))return[ht+" "+Ne,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=Lt[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[ht,s]}return[ht,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Ue,[e[3],e[4],e[5]||"0"].join(".")]:[Ue,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=xe(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+qe+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+qe+")","i"),e=>e&&e[2]?[qe,[e[2],e[3],e[4]||"0"].join(".")]:[qe,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xe,""]],[/Linux|debian/i,["Linux",""]]],Bt=function(e){return At.test(e)?lt:Ft.test(e)?_t:Ot.test(e)?ut:new RegExp(vt,"i").test(e)?vt:new RegExp("("+pt+"|WPDesktop)","i").test(e)?pt:/iPad/.test(e)?Ge:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ve:Mt.test(e)?We:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(gt,"i").test(e)?gt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ne).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?qe:He:new RegExp("(pda|"+Ne+")","i").test(e)?mt:new RegExp(Be,"i").test(e)&&!new RegExp(Be+" pc","i").test(e)?yt:""},Ht=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Gt(e,t){return"string"==typeof(i=e)&&Ht.test(i)?e:t();var i}function zt(e,t){var i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function Vt(e){return e?e.split("#")[0]:e}var jt,Wt="NativeGzipValidationError",Kt=e=>e.length>=2&&31===e[0]&&139===e[1],Yt=(e,t)=>e===_e.GZipJS||t===_e.GZipJS||"gzip"===t,Jt=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),Qt=e=>{throw zt(Wt,"Native gzip produced invalid output: "+e)},Xt=function(){var e=t((function*(e,t){18>e.size&&Qt("too-short");var i=new Uint8Array(yield e.slice(0,10).arrayBuffer());Kt(i)&&8===i[2]||Qt("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(jt)return jt;jt=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;jt[e]=t>>>0}return jt})(),i=4294967295,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(4294967295^i)>>>0})(t)&&Qt("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&Qt("invalid-size")}));return function(t,i){return e.apply(this,arguments)}}();function Zt(){return Zt=t((function*(e,i,s){void 0===i&&(i=!0);try{var r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(n.readable).blob(),_=(yield Promise.all([l,a]))[0];return yield Xt(_,r),_}catch(e){if(null!=s&&s.rethrow)throw e;return i&&console.error("Failed to gzip compress data",e),null}})),Zt.apply(this,arguments)}var ei=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={_log(t){if(J&&(s.DEBUG||J.POSTHOG_DEBUG||i)&&!xe(J.console)&&J.console){for(var r=("__rrweb_original__"in J.console[t]?J.console[t].__rrweb_original__:J.console[t]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("error",...t)},critical(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ei(e+" "+t,i)};return r},ti=ei("[PostHog.js]"),ii=ti.createLogger;function si(e,t){ye(e)&&e.forEach(t)}function ri(e,t){if(!Te(e))if(ye(e))e.forEach(t);else if($e(e))e.forEach(((e,i)=>t(e,i)));else for(var i in e)fe.call(e,i)&&t(e[i],i)}var ni=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e},oi=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){ti.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ti.critical(e)}}},ai=function(e){var t={};return ri(e,(function(e,i){(Pe(e)&&e.length>0||Ie(e))&&(t[i]=e)})),t};var li=["herokuapp.com","vercel.app","netlify.app"];function _i(e){var t=null==e?void 0:e.hostname;if(!Pe(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of li)if(i===s)return!1;return!0}function ui(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var di=e=>{if(Z){try{for(var t=e+"=",i=Z.cookie.split(";").filter((e=>e.length)),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ie(e)&&isFinite(e)&&Math.floor(e)===e});class ci{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new ci(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new ci(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class hi{generate(){var e=this.generateOrAbort();if(!xe(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(xe(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return ci.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}constructor(){this._timestamp=0,this._counter=0,this._random=new vi}}var pi,gi=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};J&&!xe(J.crypto)&&crypto.getRandomValues&&(gi=e=>crypto.getRandomValues(e));class vi{nextUint32(){return this._buffer.length>this._cursor||(gi(this._buffer),this._cursor=0),this._buffer[this._cursor++]}constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}}var fi=()=>mi().toString(),mi=()=>(pi||(pi=new hi)).generate(),yi="",bi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var wi={_is_supported:()=>!!Z,_error(e){ti.error("cookieStore error: "+e)},_get:di,_parse(e){var t;try{t=JSON.parse(wi._get(e))||{}}catch(e){}return t},_set(e,t,i,s,r){if(!Z)return!1;try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=Z),yi)return yi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+fi();!yi&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",yi=n)}return yi}(e);if(!i){var s=(e=>{var t=e.match(bi);return t?t[0]:""})(e);s!==i&&ti.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(Z.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(o="; secure");var _=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return _.length>3686.4&&ti.warn("cookieStore warning: large cookie, len="+_.length),Z.cookie=_,!0}catch(e){return!1}},_remove(e,t){if(null!=Z&&Z.cookie)try{wi._set(e,"",-1,t)}catch(e){return}}},Si=null,xi={_is_supported(){if(!ke(Si))return Si;var e=!0;if(xe(J))e=!1;else try{var t="__mplssupport__";xi._set(t,"xyz"),'"xyz"'!==xi._get(t)&&(e=!1),xi._remove(t)}catch(t){e=!1}return e||ti.error("localStorage unsupported; falling back to cookie store"),Si=e,e},_error(e){ti.error("localStorage error: "+e)},_get(e){try{return null==J?void 0:J.localStorage.getItem(e)}catch(e){xi._error(e)}return null},_parse(e){try{return JSON.parse(xi._get(e))||{}}catch(e){}return null},_set(e,t){try{return null==J||J.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){xi._error(e)}return!1},_remove(e){try{null==J||J.localStorage.removeItem(e)}catch(e){xi._error(e)}}},Pi=[b,g,p,v,f,m,k,E,P],Ei=[o,n,c,h,A,F,T],ki=e=>e+"_cpm",Ti=["__proto__","constructor","prototype"],Ii=e=>{if(!we(e))return{};var t={};return Object.keys(e).forEach((i=>{-1===Ti.indexOf(i)&&(t[i]=e[i])})),t},Ci=function(e,t){void 0===t&&(t=[]);var i={};return[...Ei,...t].forEach((t=>{var s=e[t];xe(s)||ke(s)||""===s||(i[t]=s)})),i},Ri=e=>{for(var t=5381,i=2166136261,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},$i=(e,t)=>({p:t,f:Ri(JSON.stringify(e))}),Oi=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=wi._parse(ki(e)),s=(null==i?void 0:i.f)===Ri(t)&&ye(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},Fi=(e,t)=>t+"|"+(wi._get(ki(e))||""),Ai={},Mi={_is_supported:()=>!0,_error(e){ti.error("memoryStorage error: "+e)},_get:e=>Ai[e]||null,_parse:e=>Ai[e]||null,_set:(e,t)=>(Ai[e]=t,!0),_remove(e){delete Ai[e]}},Li=null,Di={_is_supported(){if(!ke(Li))return Li;if(Li=!0,xe(J))Li=!1;else try{var e="__support__";Di._set(e,"xyz"),'"xyz"'!==Di._get(e)&&(Li=!1),Di._remove(e)}catch(e){Li=!1}return Li},_error(e){ti.error("sessionStorage error: ",e)},_get(e){try{return null==J?void 0:J.sessionStorage.getItem(e)}catch(e){Di._error(e)}return null},_parse(e){try{return JSON.parse(Di._get(e))||null}catch(e){}return null},_set(e,t){try{return null==J||J.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Di._error(e)}return!1},_remove(e){try{null==J||J.sessionStorage.removeItem(e)}catch(e){Di._error(e)}}};class Ni{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?0:this._storedConsent}isOptedOut(){return this._config.cookieless_mode===q||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===U}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get _storedConsent(){var e=this._storage._get(this._storageKey);return Me(e)?1:pe(Le,e)?0:-1}get _storage(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?xi:wi;if(!this._persistentStore||this._persistentStore!==t){this._persistentStore=t;var i="localStorage"===e?wi:xi;i._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Me(i._get(this._storageKey))),i._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&[null==X?void 0:X.doNotTrack,null==X?void 0:X.msDoNotTrack,ae.doNotTrack].some((e=>Me(e)))}}var Ui=["next","previous","prev",">","<","+","-","−","–"];ii("[Dead Clicks]");var qi=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(u)),s=e.instance.config.capture_dead_clicks;return Re(s)?s:!!we(s)||i},Bi=ii("[SegmentIntegration]");var Hi="posthog-js";function Gi(e,t){var s=void 0===t?{}:t,r=s.organization,n=s.projectId,o=s.prefix,a=s.severityAllowList,l=void 0===a?["error"]:a,_=s.sendExceptionsToPostHog,u=void 0===_||_;return t=>{var s,a,_,d,c;if("*"!==l&&!l.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p,g=(null==(s=t.exception)?void 0:s.values)||[],v=g.map((e=>i({},e,{stacktrace:e.stacktrace?i({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>i({},e,{platform:"web:javascript"})))}):void 0}))),f={$exception_message:(null==(a=g[0])?void 0:a.value)||t.message,$exception_type:null==(_=g[0])?void 0:_.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=g[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=g[0])?void 0:c.type,$sentry_tags:t.tags};return r&&n&&(f.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class zi{constructor(e,t,i,s,r,n){this.name=Hi,this.setupOnce=function(o){o(Gi(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class Vi{constructor(e){this._onSessionIdChange=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ti.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var i,s=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(i=null==J?void 0:J.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var i=this._currentPageview;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,_=r.lastContentY,u=r.maxContentY;if(!(xe(n)||xe(o)||xe(a)||xe(l)||xe(_)||xe(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),_=Math.ceil(_),u=Math.ceil(u);var d=n>1?De(o/n,0,1,ti):1,c=n>1?De(a/n,0,1,ti):1,h=l>1?De(_/l,0,1,ti):1,p=l>1?De(u/l,0,1,ti):1;s=ni(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:_,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var ji=["flags","surveys"],Wi={[r]:{exposure:"hidden"},[l]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[_]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$logs_capture_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"},[u]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[d]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[c]:{exposure:"hidden"},[h]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>ke(e)},$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"},[p]:{exposure:"hidden",storageGroup:"flags"},[g]:{exposure:"hidden",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},[v]:{exposure:"hidden",storageGroup:"flags"},[f]:{exposure:"hidden",storageGroup:"flags"},[m]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[y]:{exposure:"hidden",storageGroup:"flags"},$override_feature_flags:{exposure:"hidden"},$override_feature_flag_payloads:{exposure:"hidden"},[b]:{exposure:"hidden"},[w]:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[x]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},$surveys_activated_session:{exposure:"hidden"},$surveys_activated_timestamps:{exposure:"hidden"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[P]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},[S]:{exposure:"event"},[E]:{exposure:"hidden"},[k]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[C]:{exposure:"hidden"},[R]:{exposure:"hidden"},[O]:{exposure:"hidden"},[F]:{exposure:"hidden"},[A]:{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"},[D]:{exposure:"event"},[N]:{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_pending_trigger_conditions:{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"}},Ki=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Yi=e=>{var t=Wi[e];if(t)return t;for(var i of Ki){var s=i[1];if(0===e.indexOf(i[0]))return s}},Ji=(e,t)=>{try{return JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t)}catch(t){return s=[],null!==(i=JSON.stringify(e,(function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}})))&&void 0!==i?i:"null"}var i,s},Qi=e=>{var t=null==Z?void 0:Z.createElement("a");return xe(t)?null:(t.href=e,t)},Xi=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!ye(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){ti.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Zi=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),_=[],u=0;l.length>u;u++){var d=l[u].split("=");ye(d)&&(t.includes(d[0])?_.push(d[0]+"="+i):_.push(l[u]))}var c=a;return null!=o&&(c+="?"+_.join("&")),null!=r&&(c+="#"+r),c},es="https?://(.*)",ts=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],is=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ts],ss="<masked>",rs=["li_fat_id"];function ns(e,t){var i=is.concat(t||[]),s={};return ri(i,(function(t){var i=Xi(e,t);s[t]=i||null})),s}function os(e){var t=function(e){return e?0===e.search(es+"google.([^/?]*)")?"google":0===e.search(es+"bing.com")?"bing":0===e.search(es+"yahoo.com")?"yahoo":0===e.search(es+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",s={};if(!ke(t)){s.$search_engine=t;var r=Z?Xi(Z.referrer,i):"";r.length&&(s.ph_keyword=r)}return s}function as(){return navigator.language||navigator.userLanguage}var ls="$direct";function _s(){return(null==Z?void 0:Z.referrer)||ls}function us(e,t,i){void 0===i&&(i=!1);var s=e?[...ts,...t||[]]:[],r=i?Vt(null==ee?void 0:ee.href):null==ee?void 0:ee.href,n=null==r?void 0:r.substring(0,1e3);return{r:_s().substring(0,1e3),u:n?Zi(n,s,ss):void 0}}function ds(e,t){var i;void 0===t&&(t=!1);var s=e.r,r=e.u,n=t?Vt(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==ls?ls:null==(i=Qi(s))?void 0:i.host};if(n){o.$current_url=n;var a=Qi(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=ns(n);ni(o,l)}if(s){var _=os(s);ni(o,_)}return o}function cs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function hs(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ps={flags:k,surveys:x},gs=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],vs=e=>e+"_cookie_identity_change_pending",fs="main",ms=(e,t)=>{ri(e,((i,s)=>{var r=Yi(s);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,s)||delete e[s]}))};class ys{constructor(e,t,s){if(void 0===s&&(s=!0),this._slotState={},this._splitStorageEligible=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._config=e,this._ownsSplitStorage=s,this.props={},this._campaign_params_url=void 0,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),e.debug&&ti.info("Persistence loaded",e.persistence,i({},this.props)),this.update_config(e,e,t),this.save(),J){var r=()=>this.flush();ui(J,"beforeunload",r,{capture:!1}),ui(J,"pagehide",r,{capture:!1})}}_saveDebounceMs(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Ie(t)&&t>0?t:0}_rememberCurrentCookieProperties(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=Ci(e,this._config.cookie_persisted_properties||[]),i=$i(t,this._config.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=wi._get(this._name)||void 0;r&&Fi(this._name,r)===s&&(this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=r)}catch(e){}else try{var n=wi._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=n?Fi(this._name,n):void 0,this._lastSeenMainCookieValue=n}catch(e){}}syncCookieProperties(){return this._syncCookieProperties(this._config)}_syncCookieProperties(e,t){if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;var i;try{i=wi._get(this._name)||void 0}catch(e){}if(!i||i===this._lastSeenMainCookieValue)return!1;var s,r=Fi(this._name,i);try{s=Ii(JSON.parse(i))}catch(e){return!1}if((wi._get(this._name)||void 0)!==i)return!1;this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i;var o=Oi(this._name,i),a=[...Ei,...o.properties],_={};if(Object.keys(s).forEach((e=>{var t=s[e];(xe(t)||ke(t)||""===t||e===T&&t!==B&&t!==H)&&(_[e]=!0,delete s[e])})),Se(s))return!1;var u=n in s||s[T]===B||s[T]===H,d=this.props[n],c=this.props[T],h=ni({},this.props);[...Ei,...e.cookie_persisted_properties||[]].forEach((e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!_[e]&&(u||e!==n&&e!==T)){var t=h[e];!o.isValid&&-1!==Ei.indexOf(e)&&(!1===t||0===t)||delete h[e]}})),this.props=ni(h,s),!u||T in s||T in this.props||this._setProp(T,B);var y=this.props[n],S=this.props[T];return!u||y===d&&S===c||(this._cookieIdentityChangePending=!0,Di._set(vs(this._name),!0),this._deleteProp(b),this._deleteProp(g),this._deleteProp(p),this._deleteProp(v),this._deleteProp(f),this._deleteProp(m),this._deleteProp(k),this._deleteProp(E),this._deleteProp(P),S===B&&(c===H||s[T]===B||!xe(d)&&y!==d)&&(ms(this.props,s),this._deleteProp(w)),S===H?this.props.$user_id=y:delete this.props.$user_id,this._deleteProp(l)),!0}consumeCookieIdentityChange(){var e=vs(this._name),t=this._cookieIdentityChangePending||!!Di._get(e);return this._cookieIdentityChangePending=!1,t&&Di._remove(e),t}_beginCookieSyncSuppression(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))}_publishSuppressedCookieSnapshot(){this._cookieSyncSuppressed&&(xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[fs],this._writeNow(!0))}_endCookieSyncSuppression(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}}isDisabled(){return!!this._disabled}_buildStorage(e){-1===gs.indexOf(e.persistence.toLowerCase())&&(ti.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,s=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var s=[...Ei,...e];return i({},xi,{_parse(e){try{var i,r={};try{i=wi._get(e)||void 0,r=i?Ii(JSON.parse(i)):{}}catch(e){}var o,a=JSON.parse(xi._get(e)||"{}");if(t){var l=Oi(e,i),_=[...Ei,...l.properties],u={};Object.keys(r).forEach((e=>{var t=r[e];ke(t)||""===t||e===T&&t!==B&&t!==H||(u[e]=t)}));var d=n in u||u[T]===B||u[T]===H;if(Object.keys(u).length>0){var c,h=a[n],p=null!==(c=a[T])&&void 0!==c?c:B;s.forEach((e=>{if(-1!==_.indexOf(e)&&!(e in r)&&(d||e!==n&&e!==T)){var t=a[e];!l.isValid&&-1!==Ei.indexOf(e)&&(!1===t||0===t)||delete a[e]}})),!d||T in r||T in a||(a[T]=B),!d||(n in u?u[n]:a[n])===h&&(T in u?u[T]:a[T])===p||(Pi.forEach((e=>delete a[e])),u[T]===H&&n in u?a.$user_id=u[n]:delete a.$user_id,u[T]!==H&&(delete a[S],delete a[w]),delete a.__alias)}o=ni(a,u)}else o=ni(r,a);return xi._set(e,o),o}catch(e){}return null},_set(i,s,r,n,o,a){var l=xi._set(i,s,void 0,void 0,a);try{var _=Ci(s,e);if(Object.keys(_).length){if(t){var u=ki(i),d=$i(_,e);if(wi._set(u,d,r,n,o,a),wi._get(u)!==JSON.stringify(d)){wi._remove(u,n);var c=Ci(s);return wi._set(i,c,r,n,o,a),l}}wi._set(i,_,r,n,o,a)}}catch(e){xi._error(e)}return l},_remove(e,t){try{null==J||J.localStorage.removeItem(e),wi._remove(e,t),wi._remove(ki(e),t)}catch(e){xi._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&xi._is_supported()?(t=xi,r=!0):"localstorage+cookie"===o&&s._is_supported()?(t=s,r=!0):"sessionstorage"===o&&Di._is_supported()?t=Di:"memory"===o?t=Mi:"cookie"===o?t=wi:s._is_supported()?(t=s,r=!0):t=wi,this._splitStorageEligible=r,t}_groupEntryName(e){return this._name+"__"+e}_resolveSplitStorage(e){return this._splitStorageEligible&&!!e.split_storage}properties(){var e={};return ri(this.props,((t,i)=>{var s=Yi(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}})),e}load(e){if(void 0===e&&(e=!1),!this._disabled||e){var t=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),i=t?xi._parse(this._name):null,s={};if(t)try{ri(s=Ii(wi._parse(this._name)),((e,t)=>{(xe(e)||ke(e)||""===e)&&delete s[t]}))}catch(e){}var r=this._storage._parse(this._name);if(r&&(this.props=ni({},r)),this._splitStorage&&this._loadGroupEntries(),t&&r){var o,a,l=null==i?void 0:i[n],_=null!==(o=null==i?void 0:i[T])&&void 0!==o?o:B,u=r[n],d=null!==(a=r[T])&&void 0!==a?a:B;if(u!==l||d!==_){this._cookieIdentityChangePending=!0,Di._set(vs(this._name),!0);var c=ni({},this.props);Pi.forEach((e=>delete c[e])),d===B&&(_===H||s[T]===B||!xe(l)&&u!==l)&&(ms(c,s),delete c[w]),this.props=c;var h=new Set;Pi.forEach((e=>{var t,i=null==(t=Yi(e))?void 0:t.storageGroup;i&&h.add(i)})),h.forEach((e=>{var t={};ri(this.props,((i,s)=>{var r;(null==(r=Yi(s))?void 0:r.storageGroup)===e&&(t[s]=i)})),Se(t)?(xi._remove(this._groupEntryName(e)),this._slotState[e]={}):xi._set(this._groupEntryName(e),t)&&(this._slotState[e]={persisted:!0,fingerprint:this._entryFingerprint(t,e)})}))}}Di._get(vs(this._name))&&(this._cookieIdentityChangePending=!0)}}_loadGroupEntries(){for(var e of ji){var t=xi._parse(this._groupEntryName(e));if(t&&!Se(t)){var i=this._slotWriteState(e);i.persisted=!0,this._mainCarriesGroupKey(e)||(i.fingerprint=this._entryFingerprint(t,e)),this._groupEntryIsStale(e,t)||ni(this.props,t)}}}_mainCarriesGroupKey(e){return Object.keys(this.props).some((t=>{var i;return(null==(i=Yi(t))?void 0:i.storageGroup)===e}))}_groupEntryIsStale(e,t){var i=ps[e];if(!i)return!1;var s=t[i],r=this.props[i];return Ie(s)&&Ie(r)&&r>s}refreshKey(e){var t;if(!this._disabled){var i=this._splitStorage?null==(t=Yi(e))?void 0:t.storageGroup:void 0,s=i?xi._parse(this._groupEntryName(i)):this._storage._parse(this._name);if(s&&e in s)this._setProp(e,s[e]);else{if(i){var r=this._storage._parse(this._name);if(r&&e in r)return void this._setProp(e,r[e])}this._deleteProp(e)}}}save(){if(!this._disabled){var e=this._saveDebounceMs();e>0?xe(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout((()=>{this._pendingSaveTimer=void 0,this._writeNow()}),e)):this._writeNow()}}flush(){xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())}_writeNow(e){void 0===e&&(e=!1),this._disabled||this._cookieSyncSuppressed&&!e||(e||this.syncCookieProperties(),this._splitStorage?this._writeNowSplit():this._writeEntry(this._storage,this._name,this.props,fs)&&this._rememberCurrentCookieProperties(this.props))}_writeNowSplit(){var e=this._partitionProps(),t=e.main,i=e.groups;for(var s of(this._writeEntry(this._storage,this._name,t,fs)&&this._rememberCurrentCookieProperties(t),ji)){var r,n=i[s];(!Se(n)||null!=(r=this._slotState[s])&&r.persisted)&&this._writeEntry(xi,this._groupEntryName(s),n,s)}}_partitionProps(){var e={},t={flags:{},surveys:{}};return ri(this.props,((i,s)=>{var r,n=null==(r=Yi(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i})),{main:e,groups:t}}_entryFingerprint(e,t){if(t===fs)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var i={};return ri(e,((e,t)=>{var s;i[t]=null!=(s=Yi(t))&&s.volatile?"__volatile__":e})),JSON.stringify(i)}_writeEntry(e,t,i,s){var r,n=this._slotWriteState(s);if(s!==fs&&!n.dirty&&!xe(n.fingerprint))return!1;try{if((r=this._entryFingerprint(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e._set(t,i,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(n.dirty=!1,s!==fs&&(n.persisted=!0),xe(r)||(n.fingerprint=r),!0):(this._config.debug&&ti.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!i&&this._ownsSplitStorage)for(var s of ji)xi._remove(this._groupEntryName(s));i?delete this._slotState[fs]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(we(e)){this.syncCookieProperties(),xe(t)&&(t="None"),this._expire_days=xe(i)?this._default_expiry:i;var s=!1;if(ri(e,((e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this._setProp(i,e),s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(we(e)){this.syncCookieProperties(),this._expire_days=xe(t)?this._default_expiry:t;var i=!1;if(ri(e,((t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||we(t)||ye(t))&&(this._setProp(s,t),i=!0)})),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t="string"==typeof e?[e]:e,i=!1;for(var s of t)s in this.props&&(this._deleteProp(s),i=!0);i&&this.save()}update_campaign_params(){var e=null==Z?void 0:Z.URL;if(e!==this._campaign_params_url){var t=function(e,t,i){if(!Z)return{};var s,r=t?[...ts,...i||[]]:[],n=ns(Zi(Z.URL,r,ss),e),o=(s={},ri(rs,(function(e){var t=di(e);s[e]=t||null})),s);return ni(o,n)}(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Se(ai(t))||this.register(t),this._campaign_params_url=e}}update_search_keyword(){var e;this.register((e=null==Z?void 0:Z.referrer)?os(e):{})}update_referrer_info(){var e;this.register_once({$referrer:_s(),$referring_domain:null!=Z&&Z.referrer&&(null==(e=Qi(Z.referrer))?void 0:e.host)||ls},void 0)}set_initial_person_info(){this.props[R]||this.props[O]||this.register_once({[F]:us(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ri([O,R],(t=>{var i=this.props[t];i&&ri(i,(function(t,i){e["$initial_"+ge(i)]=t}))}));var t=this.props[F];if(t){var i=function(e,t){void 0===t&&(t=!1);var i=ds(e,t),s={};return ri(i,(function(e,t){s["$initial_"+ge(t)]=e})),s}(t,this._config.disable_capture_url_hashes);ni(e,i)}return e}safe_merge(e){return ri(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,s){var r=e.persistence!==t.persistence,n=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every(((e,t)=>e===s[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=r||n,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,l=e.disable_persistence||!!s,_=!!this._disabled&&!l;l||this._syncCookieProperties(t,_),this._config=e,!l&&(r||n||a)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._syncCookieProperties(i({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),_));var u=o||a?this._buildStorage(e):this._storage,d=this._resolveSplitStorage(e),c=o||d!==this._splitStorage,h=!l&&(c||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(_);try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this._storage=u,this._splitStorage=d,this.props=p,this.save()}else a&&(this._storage=u,l||(delete this._slotState[fs],this._writeNow()))}finally{h&&this._endCookieSyncSuppression()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[_]||{};i[e]=t,this._setProp(_,i),this.save()}remove_event_timer(e){var t=this.props[_]||{},i=t[e];return xe(i)||(delete t[e],this._setProp(_,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this._setProp(e,t),this.save()}_setProp(e,t){var i;this.props[e]=t,null!=(i=Yi(e))&&i.volatile||this._markGroupDirty(e)}_deleteProp(e){delete this.props[e],this._markGroupDirty(e)}_markGroupDirty(e){var t,i=null==(t=Yi(e))?void 0:t.storageGroup;i&&(this._slotWriteState(i).dirty=!0)}_slotWriteState(e){return this._slotState[e]||(this._slotState[e]={})}}function bs(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&be(i.then)&&i.then(void 0,(()=>{}))}}}}var ws={GZipJS:"gzip-js",Base64:"base64"},Ss={Activation:"events",Cancellation:"cancelEvents"},xs={Button:"button",Tab:"tab",Selector:"selector"},Ps={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"},Es={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ks={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Ts={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Is={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Cs={Once:"once",Recurring:"recurring",Always:"always"},Rs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},$s={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"},Os={Popover:"popover",Inline:"inline"},Fs={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},As={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"},Ms={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"},Ls=ii("[RateLimiter]");class Ds{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Ls.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Ls.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,i,s;void 0===e&&(e=!1);var r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(C))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var _=(Ie(a.dropped)?a.dropped:0)+1;a.dropped=_,!this.lastEventRateLimited&&this._captureWarning(_)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(C,a),{isRateLimited:l,remainingTokens:a.tokens}}_isPropertyAllowed(e){var t=this.instance.config.property_denylist;return!ye(t)||!t.includes(e)}_triggeringPage(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=ee&&ee.pathname)return""+(null!==(e=ee.origin)&&void 0!==e?e:"")+ee.pathname}_captureWarning(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this._triggeringPage(),o=this._isPropertyAllowed("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Ns=ii("[RemoteConfig]");class Us{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ae._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,i;null!=(t=ae.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=ae.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}_loadRemoteConfigJSON(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Ns.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Ns.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return Ns.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e.json,e)}));this._onRemoteConfig(e)}))}catch(e){Ns.error("Error loading remote config",e),this._onRemoteConfig()}}_onRemoteConfig(e,t){!e&&t&&(0===t.statusCode?t.error||Ns.warn("Failed to fetch remote config from PostHog."):Ns.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){Ns.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){Ns.error("Error loading feature flags",e)}}}var qs=["fatal","error","warning","log","info","debug"],Bs=Uint8Array,Hs=Uint16Array,Gs=Uint32Array,zs=new Bs([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]),Vs=new Bs([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]),js=new Bs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ws=function(e,t){for(var i=new Hs(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new Gs(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},Ks=Ws(zs,2),Ys=Ks[1];Ks[0][28]=258,Ys[258]=28;for(var Js=Ws(Vs,0)[1],Qs=new Hs(32768),Xs=0;32768>Xs;++Xs){var Zs=(43690&Xs)>>>1|(21845&Xs)<<1;Qs[Xs]=((65280&(Zs=(61680&(Zs=(52428&Zs)>>>2|(13107&Zs)<<2))>>>4|(3855&Zs)<<4))>>>8|(255&Zs)<<8)>>>1}var er=function(e,t,i){for(var s=e.length,r=0,n=new Hs(t);s>r;++r)++n[e[r]-1];var o,a=new Hs(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new Hs(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var _=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,c=d|(1<<u)-1;c>=d;++d)o[Qs[d]>>>l]=_}else for(o=new Hs(s),r=0;s>r;++r)o[r]=Qs[a[e[r]-1]++]>>>15-e[r];return o},tr=new Bs(288);for(Xs=0;144>Xs;++Xs)tr[Xs]=8;for(Xs=144;256>Xs;++Xs)tr[Xs]=9;for(Xs=256;280>Xs;++Xs)tr[Xs]=7;for(Xs=280;288>Xs;++Xs)tr[Xs]=8;var ir=new Bs(32);for(Xs=0;32>Xs;++Xs)ir[Xs]=5;var sr=er(tr,9,0),rr=er(ir,5,0),nr=function(e){return(e/8>>0)+(7&e&&1)},or=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof Hs?Hs:e instanceof Gs?Gs:Bs)(i-t);return s.set(e.subarray(t,i)),s},ar=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},lr=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},_r=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new Bs(0),0];if(1==r){var o=new Bs(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(e,t){return e.f-t.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],_=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[d].f>i[_].f?_++:d++],l=i[_!=u&&i[d].f>i[_].f?_++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var c=n[0].s;for(s=1;r>s;++s)n[s].s>c&&(c=n[s].s);var h=new Hs(c+1),p=ur(i[u-1],h,0);if(p>t){s=0;var g=0,v=p-t,f=1<<v;for(n.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r>s;++s){var m=n[s].s;if(t>=h[m])break;g+=f-(1<<p-h[m]),h[m]=t}for(g>>>=v;g>0;){var y=n[s].s;t>h[y]?g-=1<<t-h[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;h[b]==t&&(--h[b],++g)}p=t}return[new Bs(h),p]},ur=function(e,t,i){return-1==e.s?Math.max(ur(e.l,t,i+1),ur(e.r,t,i+1)):t[e.s]=i},dr=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Hs(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&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(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},cr=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},hr=function(e,t,i){var s=i.length,r=nr(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},pr=function(e,t,i,s,r,n,o,a,l,_,u){ar(t,u++,i),++r[256];for(var d=_r(r,15),c=d[0],h=d[1],p=_r(n,15),g=p[0],v=p[1],f=dr(c),m=f[0],y=f[1],b=dr(g),w=b[0],S=b[1],x=new Hs(19),P=0;m.length>P;++P)x[31&m[P]]++;for(P=0;w.length>P;++P)x[31&w[P]]++;for(var E=_r(x,7),k=E[0],T=E[1],I=19;I>4&&!k[js[I-1]];--I);var C,R,O,F,A=_+5<<3,M=cr(r,tr)+cr(n,ir)+o,L=cr(r,c)+cr(n,g)+o+14+3*I+cr(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(M>=A&&L>=A)return hr(t,u,e.subarray(l,l+_));if(ar(t,u,1+(M>L)),u+=2,M>L){C=er(c,h,0),R=c,O=er(g,v,0),F=g;var D=er(k,T,0);for(ar(t,u,y-257),ar(t,u+5,S-1),ar(t,u+10,I-4),u+=14,P=0;I>P;++P)ar(t,u+3*P,k[js[P]]);u+=3*I;for(var N=[m,w],U=0;2>U;++U){var q=N[U];for(P=0;q.length>P;++P)ar(t,u,D[B=31&q[P]]),u+=k[B],B>15&&(ar(t,u,q[P]>>>5&127),u+=q[P]>>>12)}}else C=sr,R=tr,O=rr,F=ir;for(P=0;a>P;++P)if(s[P]>255){var B;lr(t,u,C[257+(B=s[P]>>>18&31)]),u+=R[B+257],B>7&&(ar(t,u,s[P]>>>23&31),u+=zs[B]);var H=31&s[P];lr(t,u,O[H]),u+=F[H],H>3&&(lr(t,u,s[P]>>>5&8191),u+=Vs[H])}else lr(t,u,C[s[P]]),u+=R[s[P]];return lr(t,u,C[256]),u+R[256]},gr=new Gs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vr=function(){for(var e=new Gs(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),fr=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function mr(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p(t){for(var i=e,s=0;t.length>s;++s)i=vr[255&i^t[s]]^i>>>8;e=i},d(){return 4294967295^e}}}(),s=e.length;i.p(e);var r,n,o,a,l,_=(a=10+((r=t).filename&&r.filename.length+1||0),l=8,function(e,t,i,s,r,n){var o=e.length,a=new Bs(s+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(s,a.length-r),_=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?_=hr(l,_,e.subarray(u,d)):(l[u]=!0,_=hr(l,_,e.subarray(u,o)))}else{for(var c=gr[t-1],h=c>>>13,p=8191&c,g=(1<<i)-1,v=new Hs(32768),f=new Hs(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new Gs(25e3),S=new Hs(288),x=new Hs(32),P=0,E=0,k=(u=0,0),T=0,I=0;o>u;++u){var C=b(u),R=32767&u,O=f[C];if(v[R]=O,f[C]=R,u>=T){var F=o-u;if((P>7e3||k>24576)&&F>423){_=pr(e,l,0,w,S,x,E,k,I,u-I,_),k=P=E=0,I=u;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)x[A]=0}var M=2,L=0,D=p,N=R-O&32767;if(F>2&&C==b(u-N))for(var U=Math.min(h,F)-1,q=Math.min(32767,u),B=Math.min(258,F);q>=N&&--D&&R!=O;){if(e[u+M]==e[u+M-N]){for(var H=0;B>H&&e[u+H]==e[u+H-N];++H);if(H>M){if(M=H,L=N,H>U)break;var G=Math.min(N,H-2),z=0;for(A=0;G>A;++A){var V=u-N+A+32768&32767,j=V-v[V]+32768&32767;j>z&&(z=j,O=V)}}}N+=(R=O)-(O=v[R])+32768&32767}if(L){w[k++]=268435456|Ys[M]<<18|Js[L];var W=31&Ys[M],K=31&Js[L];E+=zs[W]+Vs[K],++S[257+W],++x[K],T=u+M,++P}else w[k++]=e[u],++S[e[u]]}}_=pr(e,l,!0,w,S,x,E,k,I,u-I,_)}return or(a,0,s+nr(_)+r)}(n=e,null==(o=t).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,l)),u=_.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&fr(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(_,t),fr(_,u-8,i.d()),fr(_,u-4,s),_}var yr=!!ie||!!te,br="text/plain",wr=!1,Sr=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},xr=function(e,t,s){var r;void 0===s&&(s=!0);var n=e.split("?"),o=n[0],a=n[1],l=i({},t),_=null!==(r=null==a?void 0:a.split("&").map((e=>{var t,i=e.split("="),r=i[0],n=s&&null!==(t=l[r])&&void 0!==t?t:i[1];return delete l[r],r+"="+n})))&&void 0!==r?r:[],u=function(e,t){var i,s;void 0===t&&(t="&");var r=[];return ri(e,(function(e,t){xe(e)||xe(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)})),r.join(t)}(l);return u&&_.push(u),_.length>0?o+"?"+_.join("&"):o},Pr=e=>{if(e._encodedBody)return e._encodedBody;var t=e.data,i=e.compression;if(t){if(i===ws.GZipJS){var s=mr(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new Bs(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;i>o;++o){if(r+5>s.length){var a=new Bs(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);128>l?n(l):2048>l?(n(192|l>>>6),n(128|63&l)):l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return or(s,0,r)}(Ji(t)),{mtime:0});return{contentType:br,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===ws.Base64){var r=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Ji(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ji(e)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Ji(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Er=e=>{var t,s,r=()=>"sendBeacon"===e.transport?{url:xr(e.url,{compression:ws.Base64}),encodedBody:Pr(i({},e,{compression:ws.Base64,_encodedBody:void 0}))}:{url:Sr(e.url,"compression"),encodedBody:Pr(i({},e,{compression:void 0,_encodedBody:void 0}))};try{t=Pr(e)}catch(t){if(Yt(e.compression,Xi(e.url,"compression")))return ti.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&Yt(e.compression,Xi(e.url,"compression"))&&!((s=t.body)instanceof ArrayBuffer?Kt(new Uint8Array(s)):ArrayBuffer.isView(s)&&Kt(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)))?(wr=!0,r()):{url:e.url,encodedBody:t}},kr=e=>{try{return Er(e)}catch(t){return ti.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Tr=function(){var e=t((function*(e){var t=Ji(e.data),r=yield function(e,t,i){return Zt.apply(this,arguments)}(t,s.DEBUG,{rethrow:!0});if(!r)return e;var n=yield r.arrayBuffer();return i({},e,{_encodedBody:{contentType:br,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Ir=/Failed to fetch|NetworkError|Load failed/i,Cr=e=>"TypeError"===(null==e?void 0:e.name)&&Ir.test((null==e?void 0:e.message)||""),Rr=e=>{var t=kr(e);if(t){var s=t.url,r=t.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.estimatedSize,_=new Headers;ri(e.headers,(function(e,t){_.append(t,e)})),o&&_.append("Content-Type",o);var u=null,d=!1;if(se){var c=new se;u={signal:c.signal,timeout:setTimeout((()=>{var t;d=!0,c.abort(zt("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}),e.timeout)}}var h=t=>{d&&"AbortError"===(null==t?void 0:t.name)||Cr(t)?ti.warn(t):ti.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var p;te(s,i({method:(null==e?void 0:e.method)||"GET",headers:_,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(l||0),body:a,signal:null==(p=u)?void 0:p.signal},e.fetchOptions)).then((t=>t.text().then((i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){ti.error(e)}null==e.callback||e.callback(s)})))).catch(h).finally((()=>u?clearTimeout(u.timeout):null))}catch(e){u&&clearTimeout(u.timeout),h(e)}}},$r=e=>{try{var t,s=Er(e),r=s.url,n=s.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var _=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(X.sendBeacon(r,_))return;var u=ye(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(ye(u)&&u.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(u.length/2),c=t=>ye(e.data)?t:i({},e.data,{batch:t});return $r(i({},e,{data:c(u.slice(0,d))})),void $r(i({},e,{data:c(u.slice(d))}))}ti.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Rr(i({},e,{_keepaliveDisabled:!0}))}catch(e){ti.warn("Beacon send failed",e)}},Or=(e,t,s,r)=>{var n="query"===r?"POST"===t?"sent_at":"_":void 0;return xr(s===ws.GZipJS?Sr(e,"compression"):e,i({},n?{[n]:Date.now().toString()}:{},s===ws.GZipJS?{}:{compression:s}))},Fr=[];te&&Fr.push({transport:"fetch",method:Rr}),ie&&Fr.push({transport:"XHR",method(e){var t=kr(e);if(t){var i=new ie,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;ri(e.headers,(function(e,t){i.setRequestHeader(t,e)})),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=X&&X.sendBeacon&&Fr.push({transport:"sendBeacon",method:$r});var Ar=3e3;class Mr{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=De((null==t?void 0:t.flush_interval_ms)||Ar,250,5e3,ti.createLogger("flush interval"),Ar),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},t=Object.values(e);[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))].map((e=>{this._sendRequestSafely(i({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),i=function(){var i=t[s],r=(new Date).getTime();i.data&&ye(i.data)&&ri(i.data,(e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e._sendRequestSafely(i)};for(var s in t)i()}}),this._flushTimeoutMs))}_sendRequestSafely(e){try{this._sendRequest(e)}catch(e){ti.error(e)}}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return ri(this._queue,(t=>{var s,r=t,n=(r?r.batchKey:null)||r.url;xe(e[n])&&(e[n]=i({},r,{data:[]})),null==(s=e[n].data)||s.push(r.data)})),this._queue=[],e}}var Lr=["retriesPerformedSoFar"];class Dr{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!xe(J)&&"onLine"in J.navigator&&(this._areWeOnline=J.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},ui(J,"online",this._onlineListener),ui(J,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var t=e.retriesPerformedSoFar,s=function(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}(e,Lr);Ce(t)&&(s.url=xr(s.url,{retry_count:t})),this._instance._send_request(i({},s,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this._enqueue(i({retriesPerformedSoFar:t},s));0===e.statusCode&&ti.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!=t?t:0)+" retries.")}null==s.callback||s.callback(e)}}))}_enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=Math.random()-.5;return Math.ceil(s+r*(s-i))}(t),s=Date.now()+i;this._queue.push({retryAt:s,requestOptions:e});var r="Enqueued failed request for retry in "+i;navigator.onLine||(r+=" (Browser is offline)"),ti.warn(r),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],i=this._queue.filter((i=>e>i.retryAt||(t.push(i),!1)));if(this._queue=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,xe(J)||(this._onlineListener&&(J.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(J.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue)){var t=e.requestOptions;try{this._instance._send_request(i({},t,{transport:"sendBeacon"}))}catch(e){ti.error(e)}}this._queue=[]}}class Nr{constructor(e){this._updateScrollData=()=>{var e,t,i,s;this._context||(this._context={});var r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this._context.lastScrollY=Math.ceil(n),this._context.maxScrollY=Math.max(n,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(i=this._context.maxContentY)&&void 0!==i?i:0),this._context.maxContentHeight=Math.max(l,null!==(s=this._context.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get _scrollRoot(){return this._instance.config.scroll_root_selector}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){ui(J,"scroll",this._updateScrollData,{capture:!0}),ui(J,"scrollend",this._updateScrollData,{capture:!0}),ui(J,"resize",this._updateScrollData)}scrollElement(){if(!this._scrollRoot)return null==J?void 0:J.document.documentElement;var e=ye(this._scrollRoot)?this._scrollRoot:[this._scrollRoot];for(var t of e){var i=null==J?void 0:J.document.querySelector(t);if(i)return i}}_scrollPosition(e){var t="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[t]||0}return J?"y"===e?J.scrollY||J.pageYOffset||J.document.documentElement.scrollTop||0:J.scrollX||J.pageXOffset||J.document.documentElement.scrollLeft||0:0}scrollY(){return this._scrollPosition("y")}scrollX(){return this._scrollPosition("x")}}var Ur=e=>us(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class qr{constructor(e,t,i,s){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var i={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[I]:i})}},this._instance=e,this._sessionIdManager=t,this._persistence=i,this._sessionSourceParamGenerator=s||Ur,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[I]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ds(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ri(ai(this.getSetOnceProps()),((t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+ge(i)]=t})),e}}class Br{on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var i of this._events[e]||[])i(t);for(var s of this._events["*"]||[])s(e,t)}constructor(){this._events={}}}var Hr=ii("[SessionId]"),Gr=864e5;class zr{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,i){var s;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Br,this._sessionHasBeenIdleTooLong=(e,t)=>!(!Ce(e)||!Ce(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===q)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||fi,this._windowIdGenerator=i||fi;var r=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*De(this._config.session_idle_timeout_seconds||1800,60,36e3,Hr.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+r+"_window_id",this._primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",this._canUseSessionStorage()){var n=Di._parse(this._window_id_storage_key),o=Di._parse(this._primary_window_exists_storage_key);n&&!o?this._windowId=n:Di._remove(this._window_id_storage_key),Di._set(this._primary_window_exists_storage_key,!0)}null!=(s=this._config.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return xe(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Di._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Di._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Di._parse(this._window_id_storage_key):null}_isActivityChangeBelowGranularity(e){var t=this._lastPersistedActivityTimestamp;return!ke(t)&&!ke(e)&&5e3>Math.abs(e-t)}_setSessionId(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this._sessionId||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,r&&!s||r&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register({[c]:[t,e,i]}))}_useCrossTabRefreshHardening(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Ce(t)&&t>0}_refreshSessionIdFromStorage(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(c):(this._persistence.flush(),this._persistence.load())}_flushPendingActivityTimestamp(){var e;if(!ke(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var t=this._getSessionId();t[1]===this._sessionId&&t[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register({[c]:[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this._persistence.flush())}}_freshestActivityTimestamp(){var e=this._getSessionId()[0],t=Ce(e)?e:0,i=Ce(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}_isSessionIdleAfterCrossTabRefresh(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())}_getSessionId(){var e=this._persistence.props[c];return ye(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void Hr.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void Hr.error("Invalid sessionID in bootstrap",e)}}(e);return!xe(i)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:i}:this._setSessionId(e,(new Date).getTime(),i),!0)}destroy(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&J&&(J.removeEventListener(V,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._flushPendingActivityTimestamp(),this._canUseSessionStorage()&&Di._remove(this._primary_window_exists_storage_key)},ui(J,V,this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this._config.cookieless_mode===q)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=t||(new Date).getTime(),r=this._sessionId;if(i)this._lastCookieSyncTimestamp=s;else if(ke(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>s||s-this._lastCookieSyncTimestamp>=1e3){var n,o;null==(n=(o=this._persistence).syncCookieProperties)||n.call(o),this._lastCookieSyncTimestamp=s}var a=this._getSessionId(),l=a[1],_=a[2],u=!xe(r)&&l!==r,d=this._freshestActivityTimestamp(),c=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>s+6e4||s-h.sessionStartTimestamp>Gr),g=h?p:Ce(_)&&Math.abs(s-_)>Gr,v=!1,f=u,m=!l||!!h,y=l,b=!m&&!e&&this._sessionHasBeenIdleTooLong(s,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(s))||Hr.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this._getSessionId();l=w[1],_=w[2]}if(m||b||g){f=!1;var S=h&&!p;l=S?h.sessionId:this._sessionIdGenerator(),c=this._windowIdGenerator(),Hr.info("new session ID assigned",{sessionId:l,windowId:c,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),_=S?h.sessionStartTimestamp:s,this._pendingBootstrapSession=void 0,v=!0}else c||(c=this._windowIdGenerator(),v=!0),(f=f||l!==y)&&(Hr.info("adopted cross-tab session id",{sessionId:l,windowId:c}),v=!0);var x=Ce(d)&&e&&!g?d:s,P=Ce(_)?_:(new Date).getTime();this._setWindowId(c),this._setSessionId(l,x,P),e||this._resetIdleTimer();var E={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:f};return v&&this._sessionIdChangedHandlers.forEach((e=>e(l,c,E))),{sessionId:l,windowId:c,sessionStartTimestamp:P,changeReason:v?E:void 0,lastActivityTimestamp:d}}_resetIdleTimer(){this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{if(!this._destroyed)if(this._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var e=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:e})}else this._resetIdleTimer()}),1.1*this.sessionTimeoutMs))}}function Vr(){return(Vr=t((function*(){var e=null==X?void 0:X.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return Pe(i)&&i.length>0?i:void 0}catch(e){return void ti.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}}))).apply(this,arguments)}function jr(e,t,i){return Ji({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var Wr="custom",Kr="i.posthog.com",Yr=/^\/static\//,Jr=["/s/","/e/","/i/"];class Qr{constructor(e){this._regionCache={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Kr,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(this._regionCache[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":Wr),this._regionCache[this.apiHost]}_staticAssetHostOverride(e){if(Yr.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}_urlKey(e){var t=Qi(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}_prepareEndpoint(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r){var n,o=(null==(n=Qi(i))?void 0:n.href)||i;s=r(new URL(o)).toString()}if(r&&"api"===e&&Jr.some((e=>0===t.indexOf(e)))){var a=this._urlKey(s);if(a){var l,_=this.apiHost,u=this._ingestionEndpoints;(null==(l=u)?void 0:l.apiHost)===_&&u.rewriteRequestPath===r||(u={apiHost:_,rewriteRequestPath:r,urls:new Set},this._ingestionEndpoints=u),u.urls.add(a)}}return s}isIngestionEndpoint(e){var t=this._ingestionEndpoints,i=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var i=this._staticAssetHostOverride(t);if(i)return this._prepareEndpoint(e,t,""+i+t)}if(this.region===Wr)return this._prepareEndpoint(e,t,this.apiHost+t);var s=Kr+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+s);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+s)}}}var Xr=ii("[Surveys]"),Zr={ignoreConditions:!1,ignoreDelay:!1,displayType:Os.Popover},en=ii("[PostHog ExternalIntegrations]"),tn={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class sn{constructor(e){this._instance=e}_loadScript(e,t){var i;null==(i=ae.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,(e=>{if(e)return en.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,s,r,n=i[0],o=i[1];!o||null!=(t=ae.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[n]||e._loadScript(tn[n],(()=>{var t;null==(t=ae.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[n])||t.start(e._instance)})),!o&&null!=(s=ae.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=ae.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())};for(var i of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;t()}}}class rn{constructor(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}add(e){var i=this;return t((function*(){if(i._disposed)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(i._extensions.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');i._extensions.set(e.name,e);try{var t=e.setup(i._client);t&&(yield t)}catch(t){var s=i._extensions.get(e.name)===e;s&&i._extensions.delete(e.name),i._logger.error('Failed to set up browser extension "'+e.name+'"',t),s&&i._disposeExtension(e)}}))()}getExtension(e){return this._extensions.get(e)}dispose(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();for(var t of(this._extensions.clear(),e))this._disposeExtension(t)}}_disposeExtension(e){try{var t=null==e.dispose?void 0:e.dispose();t&&be(t.then)&&t.then(void 0,(t=>{this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}))}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class nn{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);xe(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var on="extensionsRemoteConfig";class an{constructor(e){this._disposed=!1,this.instance=e,this._logger=ti,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new nn(e),this.onEvent=e=>bs(this.instance.on("eventCaptured",(t=>{try{e({event:t.event,properties:t.properties})}catch(e){this._logger.error("Browser extension event listener failed",e)}}))),this.onRemoteConfig=e=>{if(this._disposed)return bs((()=>{}));var t=t=>{try{e(t)}catch(e){this._logger.error("Browser extension remote config listener failed",e)}},i=this.instance._internalEventEmitter.on(on,t);return this._latestRemoteConfigResult&&t(this._latestRemoteConfigResult),bs(i)},this._runtime=new rn(ti.createLogger("[BrowserExtensions]"),this)}get logger(){return this._logger}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property(o))&&void 0!==e?e:this.distinctId}get deviceId(){var e=this.instance.get_property(o);return"string"==typeof e?e:void 0}get library(){return{name:s.LIB_NAME,version:s.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(i=null==r?void 0:r.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(s=null==r?void 0:r.sessionStartTimestamp)&&void 0!==s?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this._runtime.add(e)}getExtension(e){return this._runtime.getExtension(e)}capture(e,i,s){var r=this;return t((function*(){s?r.instance.capture(e,i,{timestamp:s.timestamp,uuid:s.uuid,$set:s.set,$set_once:s.setOnce}):r.instance.capture(e,i)}))()}registerDynamicEventProperties(e){return bs(this.instance._registerExtensionEventProperties(e))}handleRemoteConfig(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(on,e))}sendRequest(e,i){var s=this;return t((function*(){var t;void 0===i&&(i={});var r=s.instance.requestRouter.endpointFor(null!==(t=i.target)&&void 0!==t?t:"api",e),n={method:i.method,url:i.query?xr(r,i.query):r,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?_e.Base64:void 0,timestampMode:i.sentAt};return"sendBeacon"===i.transport?(s.instance._send_request(n),{statusCode:202}):new Promise((e=>{n.callback=e,s.instance._send_request(n)}))}))()}dispose(){this._disposed||(this._disposed=!0,this._runtime.dispose())}}var ln,_n={},un=0,dn=()=>{},cn='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',hn="Surveys module not available",pn="sanitize_properties is deprecated. Use before_send instead",gn="Invalid value for property_denylist config: ",vn=["token","distinct_id",L],fn="posthog",mn=!yr&&-1===(null==ne?void 0:ne.indexOf("MSIE"))&&-1===(null==ne?void 0:ne.indexOf("Mozilla")),yn=e=>{var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},bn=e=>{var t;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:_i(null==Z?void 0:Z.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:dn,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:ee&&Pe(null==ee?void 0:ee.search)&&-1!==ee.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:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==J||null==(t=J.location)?void 0:t.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(e){ti.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:G,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Ar},error_tracking:{},_onCapture:dn},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Ui,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:yn(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},wn=[["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"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Sn=e=>{var t={};for(var i of wn){var s=i[0],r=i[1];xe(e[s])||(t[r]=e[s])}var n=ni({},t,e),o=e.__preview_external_dependency_versioned_paths;return xe(o)||(xe(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),Pe(o)&&xe(e.asset_host)&&(n.asset_host=o)),ye(e.property_blacklist)&&(xe(e.property_denylist)?n.property_denylist=e.property_blacklist:ye(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ti.error(gn+e.property_denylist)),n};class xn{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ti.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Pn{_replaceExtension(e,t){if(e){var i=this._extensions.indexOf(e);-1!==i&&this._extensions.splice(i,1)}return this._extensions.push(t),null==t.initialize||t.initialize(),t}_inCookielessMode(){return this.config.cookieless_mode===q||this.config.cookieless_mode===U&&this.consent.isRejected()}_healCookielessSentinelDistinctId(){if(!this._inCookielessMode()&&this.get_distinct_id()===M){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||t===M){var i=this.config.get_device_id(fi());this.register({distinct_id:i,$device_id:i}),e.set_property(T,B)}this._sync_opt_out_with_persistence()}}}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new xn,this._personProcessingSetOncePropertiesSent=!1,this.version=s.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Br,this._extensions=[],this._extensionEventPropertyProducers=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=bn(),this.SentryIntegration=zi,this.sentryIntegration=e=>function(e,t){var i=Gi(e,t);return{name:Hi,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new Nr(this),this.pageViewManager=new Vi(this),this.rateLimiter=new Ds(this),this.requestRouter=new Qr(this),this.consent=new Ni(this),this.externalIntegrations=new sn(this);var t=null!==(e=Pn.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=Pe(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=Pe(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",(e=>ti.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,i){if(i&&i!==fn){var s,r=null!==(s=_n[i])&&void 0!==s?s:new Pn;return r._init(e,t,i),_n[i]=r,_n[fn][i]=r,r}return this._init(e,t,i)}_init(e,t,r){var n,o;void 0===t&&(t={});var l,_=Pe(e)?e.trim():"";if(!_)return ti.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 _!==(null==(l=this.config)?void 0:l.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+_+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=bn(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var u=bn(t.defaults),d=Sn(t),c=ni({},u,d,{name:r,token:_});we(u.rageclick)&&we(d.rageclick)&&(c.rageclick=ni({},u.rageclick,d.rageclick)),we(u.session_recording)&&we(d.session_recording)&&(c.session_recording=ni({},u.session_recording,d.session_recording)),this.set_config(c),this.config.on_xhr_error&&ti.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ws.GZipJS;var h=this._is_persistence_disabled();if(this.persistence=new ys(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ys(i({},this.config,{persistence:"sessionStorage"}),h,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!h&&Di._is_supported()){var p=Di._parse(this._sessionRegisteredPropertiesStorageKey);ye(p)&&p.forEach((e=>{Pe(e)&&this._sessionRegisteredPropKeys.add(e)}))}else Di._remove(this._sessionRegisteredPropertiesStorageKey);var g=i({},this.persistence.props),v=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Mr((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Dr(this),this.__request_queue=[];var f=this._inCookielessMode();if(f||(this.sessionManager=new zr(this),this.sessionPropsManager=new qr(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this._clearSessionRegisteredProps()}))),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(ti.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(f)}),0)):(ti.info("Initializing extensions synchronously"),this._initExtensions(f)),s.DEBUG=s.DEBUG||this.config.debug,s.DEBUG&&ti.info("Starting in debug mode",{this:this,config:t,thisC:i({},this.config),p:g,s:v}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=i({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var m=t.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(T);if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===B)this.identify(m);else if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===H)ti.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(fi()),S=t.bootstrap.isIdentifiedID?w:m;this.persistence.set_property(T,t.bootstrap.isIdentifiedID?H:B),this.register({distinct_id:m,$device_id:S})}}if(f)this.register_once({distinct_id:M,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(fi());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(T,B)}return ui(J,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||fi();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(T,H)),t()},r=i.user();"then"in r&&be(r.then)?r.then(s):s(r)}(e,(()=>{i.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Bi.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Bi.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Bi.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,j),identify:e=>t(e,K),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this._loaded())):this._loaded(),be(this.config._onCapture)&&this.config._onCapture!==dn&&(ti.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ti.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 Vr.apply(this,arguments)}().then((e=>{e&&this.register({[a]:e})})).catch(dn),this}_isSharedExtension(e){var t=e;return Pe(t.name)&&be(t.setup)}_enrollExtension(e,t){this._isSharedExtension(e)?t.push((()=>{this._getBrowserClientAdapter().add(e).catch((()=>null==e.dispose?void 0:e.dispose())).catch((t=>{ti.error('Failed to dispose browser extension "'+e.name+'"',t)}))})):this._extensions.push(e)}_enrollFeatureFlags(){var e,t,i,s,r,n,o=null!==(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)&&void 0!==e?e:null==(i=Pn.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(s=this._featureFlagsReloadingUnsubscribe)||s.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new o(this)),be(this.featureFlags.onReloading)&&be(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading((()=>{this._internalEventEmitter.emit("featureFlagsReloading",!0)})),this._getBrowserClientAdapter().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}_initExtensions(e){var t,s,r,n,o,a,l,_=performance.now(),u=i({},Pn.__defaultExtensionClasses,this.config.__extensionClasses),d=[];u.exceptions&&this._extensions.push(this.exceptions=null!==(t=this.exceptions)&&void 0!==t?t:new u.exceptions(this)),u.historyAutocapture&&this._extensions.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this._extensions.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this._extensions.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this._extensions.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this._enrollExtension(this.autocapture=new u.autocapture(this),d),u.surveys&&this._enrollExtension(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new u.surveys(this),d),u.logs&&this._enrollExtension(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),d),u.metrics&&this._extensions.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new u.conversations(this)),u.productTours&&this._extensions.push(this.productTours=new u.productTours(this)),u.heatmaps&&this._extensions.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this._extensions.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,qi)),u.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new u.experiments(this)),this._extensions.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}})),this._processInitTaskQueue(d,_)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var i=e.shift();if(i)try{i()}catch(e){ti.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[D]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[N]:s}),this.config.__preview_deferred_init_extensions&&ti.info("PostHog extensions initialized ("+s+"ms)")}_onRemoteConfig(e){var t;if(!Z||!Z.body)return ti.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(s.supportedCompression,ws.GZipJS)?ws.GZipJS:pe(s.supportedCompression,ws.Base64)?ws.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:G}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(e),this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}_loaded(){try{this.config.loaded(this)}catch(e){ti.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=ee&&ee.hostname){var e=ee.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this._inCookielessMode())&&this._captureInitialPageview()}),1),this._remoteConfigLoader=new Us(this),this._remoteConfigLoader.load()}_start_queue_if_opted_in(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())}_dom_loaded(){this.is_capturing()&&si(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(W),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this._requestQueue)||s.unload(),null==(r=this._retryQueue)||r.unload()):this._shouldCapturePageleave()&&this.capture(W,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?mn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=i({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(xe(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,s,r,n=i({},e);n.timeout=n.timeout||6e4;var o,a,l,_,u,d=null!==(t=n.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&xe(n.compression)&&n.data&&(n.compression=ws.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(u=(_=(ye(o=n.data)?o:[o]).map((e=>i({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{}))))[0])||null==(l=u.properties)?void 0:l.token)&&void 0!==a?a:null==u?void 0:u.token,batch:_,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),ye(e)?e.map((e=>i({},e,{sent_at:t}))):i({},e,{sent_at:t})}(n.data))),n.url=Or(n.url,n.method,n.compression,n.timestampMode);var c=Fr.filter((e=>!n.disableTransport||!e.transport||!n.disableTransport.includes(e.transport))),h=null!==(s=null==(r=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===d)return e[i]}(c))?void 0:r.method)&&void 0!==s?s:c[0].method;if(!h)throw new Error("No available transport method");var p=e=>{try{h(e)}catch(e){Cr(e)?ti.warn(e):ti.error(e),null==n.callback||n.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&n.data&&n.compression===ws.GZipJS&&re&&"undefined"!=typeof Promise&&!wr?Tr(n).then((e=>{p(e)})).catch((t=>{if(Jt(t))return wr=!0,void p(i({},n,{compression:void 0,url:Or(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return Jt(e)||t===Wt})(t)&&(wr=!0),p(n)})):h(n)})(i({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){un++;try{var t,i=[],s=[],r=[];si(e,(e=>{if(e)if(ye(t=e[0]))r.push(e);else if(be(e))try{e.call(this)}catch(t){ti.error("Error executing queued PostHog call",e,t)}else ye(e)&&"alias"===t?i.push(e):ye(e)&&-1!==t.indexOf("capture")&&be(this[t])?r.push(e):s.push(e)}));var n=function(e,t){si(e,(function(e){try{if(ye(e[0])){var i=t;ri(e,(function(e){i=i[e[0]].apply(i,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){ti.error("Error executing queued PostHog call",e,t)}}))};n(i,this),n(s,this),n(r,this)}finally{un--}}push(e){if(un>0&&ye(e)&&Pe(e[0])){var t=Pn.prototype[e[0]];be(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,s){var r,n,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!xe(e)&&Pe(e)){this._healCookielessSentinelDistinctId();var _=!this.config.opt_out_useragent_filter&&this._is_bot();if(!_||this.config.__preview_capture_bot_pageviews){var u=null!=s&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!Pe(null==t?void 0:t.$current_url)&&(ti.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=s&&s._originatedFromCaptureException||ti.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 d=new Date,c=(null==s?void 0:s.timestamp)||d,h=Gt(null==s?void 0:s.uuid,fi),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},c,h)};e===j&&this.config.__preview_capture_bot_pageviews&&_&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var g="$feature_flag_called"===e&&!1===p.properties.$feature_flag_has_experiment&&!0===this.get_property(y);(null==s?void 0:s.$set)&&!g&&(p.$set=null==s?void 0:s.$set);var v=null==s?void 0:s.$unset;v&&(p.$unset=v);var f,m,b,w=g?void 0:this._calculate_set_once_properties(null==s?void 0:s.$set_once,e!==Y,e===K);if(w&&(p.$set_once=w),null!=s&&s._noTruncate||(n=this.config.properties_string_max_length,o=p,a=e=>Pe(e)?e.slice(0,n):e,l=new Set,p=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!l.has(t)){var s;if(l.add(t),ye(t))s=[],si(t,(t=>{s.push(e(t))}));else{var r={};ri(t,((t,i)=>{l.has(t)||(r[i]=e(t,i))})),s=r}return s}}(o)),p.timestamp=c,xe(null==s?void 0:s.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=d),g&&(p.properties=function(e,t){void 0===t&&(t=[]);var i={},s=t=>{void 0!==e[t]&&(i[t]=e[t])};return le.forEach(s),t.forEach(s),i}(p.properties,vn)),e===Rs.DISMISSED||e===Rs.SENT){var S=null==t?void 0:t[$s.SURVEY_ID],x=null==t?void 0:t[$s.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>"seenSurvey_"+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Xr.error("Failed to persist survey seen state",e)}})({id:S,current_iteration:x}),p.$set=i({},p.$set,{[(f={id:S,current_iteration:x},m=e===Rs.SENT?"responded":"dismissed",b="$survey_"+m+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(b="$survey_"+m+"/"+f.id+"/"+f.current_iteration),b)]:!0})}else e===Rs.SHOWN&&(p.$set=i({},p.$set,{[$s.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===As.SHOWN){var P=null==t?void 0:t[Ms.TOUR_TYPE];P&&(p.$set=i({},p.$set,{[Ms.TOUR_LAST_SEEN_DATE+"/"+P]:(new Date).toISOString()}))}var E=i({},p.properties.$set,p.$set);if(Se(E)||this.setPersonPropertiesForFlags(E),!Te(this.config.before_send)){var k=this._runBeforeSend(p);if(!k)return;(p=k).uuid=Gt(p.uuid,fi)}this._internalEventEmitter.emit("eventCaptured",p);var T=null!==(r=null==s?void 0:s._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),I={method:"POST",url:T,data:p,compression:"best-available",timestampMode:"recordings"===(null==s?void 0:s._batchKey)||/\/s\/(?:\?|$)/.test(T)?"body":"capture-body",batchKey:null==s?void 0:s._batchKey,transport:null==s?void 0:s.transport};return!this.config.request_batching||s&&(null==s||!s._batchKey)||null!=s&&s.send_instantly?this._send_retriable_request(I):this._requestQueue.enqueue(I),p}ti.critical("This capture call is ignored due to client rate limiting.")}}else ti.error("No event name provided to posthog.capture")}else ti.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}getExtension(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)}_getBrowserClientAdapter(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new an(this)}_registerExtensionEventProperties(e){this._extensionEventPropertyProducers.push(e);var t=!0;return()=>{if(t){t=!1;var i=this._extensionEventPropertyProducers.indexOf(e);-1!==i&&this._extensionEventPropertyProducers.splice(i,1)}}}_processCookieIdentityChange(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,this.persistence.get_property(T)===B&&(null==(s=this.sessionPersistence)||s.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var a=o?void 0:this.persistence.remove_event_timer(e),l=i({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this._inCookielessMode()&&(l[L]=!0),"$snapshot"===e){var _=i({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=_.distinct_id,(!Pe(l.distinct_id)&&!Ie(l.distinct_id)||Ee(l.distinct_id))&&ti.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var u,d=function(e,t,i,r){var n,o,a,l;if(void 0===r&&(r=!1),!ne)return{};var _,u=e?[...ts,...t||[]]:[],d=function(e){for(var t=0;qt.length>t;t++){var i=qt[t],s=i[1],r=i[0].exec(e),n=r&&(be(s)?s(r,e):s);if(n)return n}return["",""]}(ne),c=d[0],h=d[1],p=null!=(_="undefined"!=typeof navigator?navigator:void 0)&&_.brave?{brave:!0}:{},g={};xe(i)||(g.detectGoogleSearchApp=i);var v={},f=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(o=navigator)?void 0:o.maxTouchPoints,y=null==J||null==(a=J.screen)?void 0:a.width,b=null==J||null==(l=J.screen)?void 0:l.height,w=null==J?void 0:J.devicePixelRatio;xe(f)||(v.userAgentDataPlatform=f),xe(m)||(v.maxTouchPoints=m),xe(y)||(v.screenWidth=y),xe(b)||(v.screenHeight=b),xe(w)||(v.devicePixelRatio=w);var S,x,P,E,k,T,I,C,R=ni(ai({$os:c,$os_version:h,$browser:Dt(ne,navigator.vendor,p,g),$device:Bt(ne),$device_type:(x=ne,P=v,C=Bt(x),C===Ge||C===He||"Kobo"===C||"Kindle Fire"===C||C===yt?Be:C===lt||C===ut||C===_t||C===vt?"Console":C===Ve?"Wearable":C?Ne:"Android"===(null==P?void 0:P.userAgentDataPlatform)&&(null!==(E=null==P?void 0:P.maxTouchPoints)&&void 0!==E?E:0)>0?600>Math.min(null!==(k=null==P?void 0:P.screenWidth)&&void 0!==k?k:0,null!==(T=null==P?void 0:P.screenHeight)&&void 0!==T?T:0)/(null!==(I=null==P?void 0:P.devicePixelRatio)&&void 0!==I?I:1)?Ne:Be:"Desktop"),$timezone:cs(),$timezone_offset:hs()}),{$current_url:Zi(r?Vt(null==ee?void 0:ee.href):null==ee?void 0:ee.href,u,ss),$host:null==ee?void 0:ee.host,$pathname:null==ee?void 0:ee.pathname,$raw_user_agent:ne.length>1e3?ne.substring(0,997)+"...":ne,$browser_version:Ut(ne,navigator.vendor,p,g),$browser_language:as(),$browser_language_prefix:(S=as(),"string"==typeof S?S.split("-")[0]:void 0),$screen_height:null==J?void 0:J.screen.height,$screen_width:null==J?void 0:J.screen.width,$viewport_height:null==J?void 0:J.innerHeight,$viewport_width:null==J?void 0:J.innerWidth,$lib:s.LIB_NAME,$lib_version:s.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return s.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=s.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 c=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime(),!0),h=c.windowId;l.$session_id=c.sessionId,l.$window_id=h}this.sessionPropsManager&&ni(l,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&ni(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Wr&&(l.$lib_custom_api_host=this.config.api_host),u=e!==j||o?e!==W||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),l=ni(l,u),e===j&&Z&&(l.title=Z.title),!xe(a)){var g=r.getTime()-a;l.$duration=parseFloat((g/1e3).toFixed(3))}ne&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var v=this.persistence.properties(),f=this.sessionPersistence.properties();ri(["$referrer","$referring_domain"],(e=>{e in v&&delete f[e]}));var m={};if(this._extensionEventPropertyProducers.length>0)for(var y of this._extensionEventPropertyProducers.slice())try{ni(m,y())}catch(e){ti.error("Failed to produce browser extension event properties",e)}(l=ni({},d,v,f,i({},m,l))).$is_identified=this._isIdentified(),ye(this.config.property_denylist)?ri(this.config.property_denylist,(function(e){delete l[e]})):ti.error(gn+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ti.error(pn),l=b(l,e));var w=this._hasPersonProcessing();return l.$process_person_profile=w,w&&!o&&this._requirePersonProcessing("_calculate_event_properties"),l}_calculate_set_once_properties(e,t,i){var s;if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!i)return e;var r=this.persistence.get_initial_props(),n=null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps(),o=ni({},r,n||{},e||{}),a=this.config.sanitize_properties;return a&&(ti.error(pn),o=a(o,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Se(o)?void 0:o}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach((e=>this._sessionRegisteredPropKeys.add(e))),this._persistSessionRegisteredPropKeys()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()}_register_single(e,t){this.register({[e]:t})}_clearSessionRegisteredProps(){this._sessionRegisteredPropKeys.forEach((e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)})),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()}_persistSessionRegisteredPropKeys(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!Di._is_supported())Di._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach((e=>t.push(e))),t.length>0?Di._set(this._sessionRegisteredPropertiesStorageKey,t):Di._remove(this._sessionRegisteredPropertiesStorageKey)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,s;return null!==(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:hn}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:hn})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:hn})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=Zr),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!==(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:hn}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!==(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:hn})}_validateIdentifyId(e){return!e||Ee(e)?(ti.critical("Unique user id has not been set in posthog.identify"),!1):e===M?(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ti.uninitializedWarning("posthog.identify");if(Ie(e)&&(e=e.toString(),ti.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._healCookielessSentinelDistinctId();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this._processCookieIdentityChange(!1),a=this.persistence._beginCookieSyncSuppression(),_=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property(o)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(l)&&(this.unregister(l),this.register({distinct_id:e}));var d,c=(this.persistence.get_property(T)||B)===B,h=e!==u,p=!h&&c;if(h&&c)this.persistence.set_property(T,H),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(K,{distinct_id:e,$anon_distinct_id:u},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=jr(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(u);else if(p){this.persistence.set_property(T,H);var g=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:g,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:g,$set_once:v}),this._cachedPersonProperties=jr(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(P)):p&&(t||i)&&this.reloadFeatureFlags(),_=!0}finally{a&&this.persistence._endCookieSyncSuppression(_)}}}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=jr(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ti.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(ye(e)?e:[e]).filter((e=>Pe(e)&&e.length>0));0!==i.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this._cachedPersonProperties=null)}group(e,t,s){var r;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var n=this.getGroups(),o=n[e]!==t;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:i({},n,{[e]:t})}),o||s){var a={$group_type:e,$group_key:t};s&&(a.$group_set=s),this.capture(Y,a)}s&&this.setGroupPropertiesForFlags({[e]:s}),o&&!s&&this.reloadFeatureFlags()}else ti.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=Re(e)?e:null==e?void 0:e.resetDeviceID,i=Re(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,i)}_reset(e,t,s){var r,n,l;if(void 0===t&&(t=!1),ti.info("reset"),!this.__loaded)return ti.uninitializedWarning("posthog.reset");var _=null==s?void 0:s.sessionID;this.config.bootstrap=s||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags());var u=this.get_property(o),c=this.get_property(a),h=this.get_property(d),p=this.is_capturing();this.consent.reset(),t||!p||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var g=null==(l=this.persistence)||null==l._beginCookieSyncSuppression?void 0:l._beginCookieSyncSuppression(),v=!1;try{var f,m,y,b,w,S,x,P,E,k,I,C,R;if(null==(f=this.persistence)||f.clear(),null==(m=this.sessionPersistence)||m.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),xe(h)||null==(k=this.persistence)||k.register({[d]:h}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(w=this.conversations)||w.reset(),null==(S=this.logs)||S.reset(),null==(x=this.metrics)||x.reset(),null==(P=this.persistence)||P.set_property(T,B),null==(E=this.sessionManager)||E.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===q)this.register_once({distinct_id:M,$device_id:null},"");else{var O=this.config.get_device_id(fi());this.register_once({distinct_id:O,$device_id:e?O:u},""),e||xe(c)||this.register({[a]:c})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),s)if(void 0===s.distinctID||this._inCookielessMode()||(null==(R=this.persistence)||R.set_property(T,s.isIdentifiedID?H:B),this.register({distinct_id:s.distinctID})),null==(I=this.featureFlags)||I.initialize(),!(xe(_)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(_,!0))){var F=i({},s);delete F.sessionID,this.config.bootstrap=F}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var A;g&&(null==(A=this.persistence)||null==A._endCookieSyncSuppression||A._endCookieSyncSuppression(v))}this.reloadFeatureFlags()}shutdown(e){var i=this;return t((function*(){var e,t,s,r,n;if(i.__loaded){i._getBrowserClientAdapter().dispose(),null==(e=i.sessionRecording)||e.dispose(),null==(t=i.logs)||t.flushLogs("sendBeacon"),null==(s=i.metrics)||s.flush("sendBeacon"),null==(r=i._requestQueue)||r.unload(),null==(n=i._retryQueue)||n.unload();try{var o;null==(o=i.featureFlags)||o.destroy()}catch(e){ti.error("Error while destroying feature flags",e)}}else ti.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(r)?(ti.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(xe(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(l,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ti.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=i({},this.config);if(we(e)){var r,n,o,a,l,_,u,d,c,h,p,g;ni(this.config,Sn(e));var v=this._is_persistence_disabled();null==(r=this.persistence)||r.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ys(i({},this.config,{persistence:"sessionStorage"}),v,!1);var f,m=this._checkLocalStorageForDebug(this.config.debug);Re(m)&&(this.config.debug=m),Re(this.config.debug)&&(this.config.debug?(s.DEBUG=!0,xi._is_supported()&&xi._set("ph_debug",!0),ti.info("set_config",{config:e,oldConfig:t,newConfig:i({},this.config)})):(s.DEBUG=!1,xi._is_supported()&&xi._remove("ph_debug"))),null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags()),null==(o=this.exceptionObserver)||o.onConfigChange(),null==(a=this.exceptions)||a.onConfigChange(),null==(l=this.sessionRecording)||l.startIfEnabledOrStop(),null==(_=this.tracingHeaders)||_.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(f=this.historyAutocapture)||f.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){s.LIB_NAME=e,s.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.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 e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var s=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(i({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Pn._noopLogger}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!==(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:fn;return t!==fn&&(t=fn+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(T))===H||(null==(t=this.sessionPersistence)?void 0:t.get_property(T))===H}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===G&&!this._isIdentified()&&Se(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[l])&&(null==(t=this.persistence)||null==(t=t.props)||!t[A]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ti.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(A,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==U)}_sync_opt_out_with_persistence(){var e,t,i,s,r,n=this._is_persistence_disabled();return this.is_capturing()||null==(i=this.logs)||i._onOptOut(),(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==q){if(this._inCookielessMode()){var i,s,r,n,o;this._reset(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new zr(this),this.pageViewManager=new Vi(this),this.persistence&&(this.sessionPropsManager=new qr(this,this.sessionManager,this.persistence));var a,l=null!==(r=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==r?r:null==(o=Pn.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new l(this)),this._lastRemoteConfig&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this._lastRemoteConfig)))}var _,u;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==U&&(null==(_=this.surveys)||_.loadIfEnabled()),(xe(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(u=null==e?void 0:e.captureEventName)&&void 0!==u?u:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else ti.warn(cn)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==q?(this.config.cookieless_mode===U&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===U&&(this.register({distinct_id:M,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())):ti.warn(cn)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===q||(this.config.cookieless_mode===U?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return X?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&he(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some((e=>he(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver}(X,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Z&&("visible"===Z.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(j,{title:Z.title},{send_instantly:!0}),this._visibilityStateListener&&(Z.removeEventListener(z,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),ui(Z,z,this._visibilityStateListener)))}debug(e){!1===e?(null==J||J.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==J||J.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}))}_shouldDisableFlags(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ti.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):function(e,t,i,s,r){var n=t in e&&!Te(e[t]),o=i in e&&!Te(e[i]);return n?e[t]:!!o&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,ti)}_runBeforeSend(e){var t;if(Te(this.config.before_send))return e;var i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Fe),s=ye(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),Te(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Oe(e.event)?ti.warn(o+". This can cause unexpected behavior."):ti.info(o),null}r.properties&&!Se(r.properties)||ti.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return ti.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&Te(r.properties[a]))return ti.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}_checkLocalStorageForDebug(e){var t=Re(e)&&!e,i=xi._is_supported()&&"true"===xi._get("ph_debug");return!t&&(!!i||e)}}Pn.__defaultExtensionClasses={},Pn._noopLogger={trace:ln=()=>{},debug:ln,info:ln,warn:ln,error:ln,fatal:ln},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=oi(e.prototype[t[i]])}(Pn,["identify"]);var En=function(){s.SDK_DIST_CHANNEL="npm";var e=_n[fn]=new Pn;return function(){function e(){e.done||(e.done=!0,mn=!1,ri(_n,(function(e){e._dom_loaded()})))}null!=Z&&Z.addEventListener?"complete"===Z.readyState?e():ui(Z,"DOMContentLoaded",e,{capture:!1}):J&&ti.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{ws as Compression,Fs as DEFAULT_PRODUCT_TOUR_APPEARANCE,Os as DisplaySurveyType,Pn as PostHog,As as ProductTourEventName,Ms as ProductTourEventProperties,Rs as SurveyEventName,$s as SurveyEventProperties,Ss as SurveyEventType,Ps as SurveyPosition,Is as SurveyQuestionBranchingType,Ts as SurveyQuestionType,Cs as SurveySchedule,Es as SurveyTabPosition,ks as SurveyType,xs as SurveyWidgetType,En as default,En as posthog,qs as severityLevels};
1
+ function e(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function t(t){return function(){var i=this,s=arguments;return new Promise((function(r,n){var o=t.apply(i,s);function a(t){e(o,r,n,a,l,"next",t)}function l(t){e(o,r,n,a,l,"throw",t)}a(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},i.apply(null,arguments)}var s={DEBUG:!1,LIB_VERSION:"0.6.2",LIB_NAME:"browser-common"};s.DEBUG=!1,s.LIB_VERSION="1.422.3",s.LIB_NAME="web";var r="$people_distinct_id",n="distinct_id",o="$device_id",a="$device_model",l="__alias",_="__timers",u="$dead_clicks_enabled_server_side",d="$session_recording_remote_config",c="$sesid",h="$session_is_sampled",p="$enabled_feature_flags",g="$active_feature_flags",v="$feature_flag_details",f="$feature_flag_payloads",m="$feature_flag_request_id",y="$minimal_flag_called_events",b="$stored_person_properties",w="$stored_group_properties",S="$groups",x="$surveys_loaded_at",P="$flag_call_reported",E="$feature_flag_errors",k="$feature_flag_evaluated_at",T="$user_state",I="$client_session_props",C="$capture_rate_limit",R="$initial_campaign_params",O="$initial_referrer_info",F="$initial_person_info",A="$epp",M="$posthog_cookieless",L="$cookieless_mode",D="$sdk_debug_extensions_init_method",N="$sdk_debug_extensions_init_time_ms",U="on_reject",q="always",B="anonymous",H="identified",G="identified_only",z="visibilitychange",V="beforeunload",j="$pageview",W="$pageleave",K="$identify",Y="$groupidentify",J="undefined"!=typeof window?window:void 0,Q="undefined"!=typeof globalThis?globalThis:J,X=null==Q?void 0:Q.navigator,Z=null==Q?void 0:Q.document,ee=null==Q?void 0:Q.location,te=null==Q?void 0:Q.fetch,ie=null!=Q&&Q.XMLHttpRequest&&"withCredentials"in new Q.XMLHttpRequest?Q.XMLHttpRequest:void 0,se=null==Q?void 0:Q.AbortController,re=null==Q?void 0:Q.CompressionStream,ne=null==X?void 0:X.userAgent,oe="undefined"!=typeof globalThis?globalThis:J;oe&&"undefined"==typeof self&&(oe.self=oe),oe&&"undefined"==typeof File&&(oe.File=function(){});var ae=null!=J?J:{},le=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],_e=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),ue=["$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"],de=["token"],ce=["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","pinterestbot","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"],he=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return ce.concat(t).some((e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)}))};function pe(e,t){return-1!==e.indexOf(t)}var ge=function(e){return e.replace(/^\$/,"")},ve=Object.prototype,fe=ve.hasOwnProperty,me=ve.toString,ye=Array.isArray||function(e){return"[object Array]"===me.call(e)},be=e=>"function"==typeof e,we=e=>e===Object(e)&&!ye(e),Se=e=>{if(we(e)){for(var t in e)if(fe.call(e,t))return!1;return!0}return!1},xe=e=>void 0===e,Pe=e=>"[object String]"==me.call(e),Ee=e=>Pe(e)&&0===e.trim().length,ke=e=>null===e,Te=e=>xe(e)||ke(e),Ie=e=>"[object Number]"==me.call(e)&&e==e,Ce=e=>Ie(e)&&e>0,Re=e=>"[object Boolean]"===me.call(e),$e=e=>e instanceof FormData,Oe=e=>pe(ue,e),Fe=e=>pe(de,e),Ae=[!0,"true",1,"1","yes"],Me=e=>pe(Ae,e),Le=[!1,"false",0,"0","no"];function De(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),Ie(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),De(r||i,t,i,s))}var Ne="Mobile",Ue="iOS",qe="Android",Be="Tablet",He=qe+" "+Be,Ge="iPad",ze="Apple",Ve=ze+" Watch",je="Safari",We="BlackBerry",Ke="Samsung",Ye=Ke+"Browser",Je=Ke+" Internet",Qe="Chrome",Xe=Qe+" OS",Ze=Qe+" "+Ue,et="Internet Explorer",tt=et+" "+Ne,it="Opera",st=it+" Mini",rt="Edge",nt="Microsoft "+rt,ot="Firefox",at=ot+" "+Ue,lt="Nintendo",_t="PlayStation",ut="Xbox",dt=qe+" "+Ne,ct=Ne+" "+je,ht="Windows",pt=ht+" Phone",gt="Nokia",vt="Ouya",ft="Generic",mt=ft+" "+Ne.toLowerCase(),yt=ft+" "+Be.toLowerCase(),bt="Konqueror",wt="Oculus Browser",St="Vivaldi",xt="Yandex",Pt="Whale",Et="DuckDuckGo",kt="Pale Moon",Tt="Waterfox",It="Brave",Ct="Google Search App",Rt="(\\d+(\\.\\d+)?)",$t=new RegExp("Version/"+Rt),Ot=new RegExp(ut,"i"),Ft=new RegExp(_t+" \\w+","i"),At=new RegExp(lt+" \\w+","i"),Mt=new RegExp(We+"|PlayBook|BB10","i"),Lt={"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"},Dt=function(e,t,i,s){t=t||"";var r=function(e){return null!=e&&e.brave?It:null}(i);return r||(null!=s&&s.detectGoogleSearchApp&&pe(e,"GSA/")?Ct:pe(e," OPR/")&&pe(e,"Mini")?st:pe(e," OPR/")?it:Mt.test(e)?We:pe(e,"IE"+Ne)||pe(e,"WPDesktop")?tt:pe(e,"OculusBrowser")?wt:pe(e,Ye)?Je:pe(e,rt)||pe(e,"Edg/")?nt:pe(e,St+"/")?St:pe(e,"YaBrowser/")?xt:pe(e,Pt+"/")?Pt:pe(e,Et+"/")||pe(e,"Ddg/")?Et:pe(e,"FBIOS")?"Facebook "+Ne:pe(e,"UCWEB")||pe(e,"UCBrowser")?"UC Browser":pe(e,"CriOS")?Ze:pe(e,"CrMo")||pe(e,Qe)?Qe:pe(e,qe)&&pe(e,je)?dt:pe(e,"FxiOS")?at:pe(e.toLowerCase(),bt.toLowerCase())?bt:pe(e,It+"/")?It:((e,t)=>t&&pe(t,ze)||function(e){return pe(e,je)&&!pe(e,Qe)&&!pe(e,qe)}(e))(e,t)?pe(e,Ne)?ct:je:pe(e,"PaleMoon/")?kt:pe(e,Tt+"/")?Tt:pe(e,ot)?ot:pe(e,"MSIE")||pe(e,"Trident/")?et:pe(e,"Gecko")?ot:"")},Nt={[tt]:[new RegExp("rv:"+Rt)],[nt]:[new RegExp(rt+"?\\/"+Rt)],[Qe]:[new RegExp("("+Qe+"|CrMo)\\/"+Rt)],[Ze]:[new RegExp("CriOS\\/"+Rt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Rt)],[je]:[$t],[ct]:[$t],[it]:[new RegExp("(Opera|OPR)\\/"+Rt)],[ot]:[new RegExp(ot+"\\/"+Rt)],[at]:[new RegExp("FxiOS\\/"+Rt)],[bt]:[new RegExp("Konqueror[:/]?"+Rt,"i")],[We]:[new RegExp(We+" "+Rt),$t],[dt]:[new RegExp("android\\s"+Rt,"i")],[Je]:[new RegExp(Ye+"\\/"+Rt)],[wt]:[new RegExp("OculusBrowser\\/"+Rt)],[St]:[new RegExp(St+"\\/"+Rt)],[xt]:[new RegExp("YaBrowser\\/"+Rt)],[Pt]:[new RegExp(Pt+"\\/"+Rt)],[It]:[new RegExp(It+"\\/"+Rt)],[Et]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Rt)],[kt]:[new RegExp("PaleMoon\\/"+Rt)],[Tt]:[new RegExp(Tt+"\\/"+Rt)],[Ct]:[new RegExp("GSA\\/"+Rt)],[et]:[new RegExp("(rv:|MSIE )"+Rt)],Mozilla:[new RegExp("rv:"+Rt)]},Ut=function(e,t,i,s){var r=Dt(e,t,i,s),n=Nt[r];if(xe(n))return null;for(var o=0;n.length>o;o++){var a=e.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},qt=[[new RegExp(ut+"; "+ut+" (.*?)[);]","i"),e=>[ut,e&&e[1]||""]],[new RegExp(lt,"i"),[lt,""]],[new RegExp(_t,"i"),[_t,""]],[Mt,[We,""]],[new RegExp(ht,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[pt,""];if(new RegExp(Ne).test(t)&&!/IEMobile\b/.test(t))return[ht+" "+Ne,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=Lt[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[ht,s]}return[ht,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Ue,[e[3],e[4],e[5]||"0"].join(".")]:[Ue,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=xe(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+qe+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+qe+")","i"),e=>e&&e[2]?[qe,[e[2],e[3],e[4]||"0"].join(".")]:[qe,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xe,""]],[/Linux|debian/i,["Linux",""]]],Bt=function(e){return At.test(e)?lt:Ft.test(e)?_t:Ot.test(e)?ut:new RegExp(vt,"i").test(e)?vt:new RegExp("("+pt+"|WPDesktop)","i").test(e)?pt:/iPad/.test(e)?Ge:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ve:Mt.test(e)?We:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(gt,"i").test(e)?gt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Ne).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?qe:He:new RegExp("(pda|"+Ne+")","i").test(e)?mt:new RegExp(Be,"i").test(e)&&!new RegExp(Be+" pc","i").test(e)?yt:""},Ht=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Gt(e,t){return"string"==typeof(i=e)&&Ht.test(i)?e:t();var i}function zt(e,t){var i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function Vt(e){return e?e.split("#")[0]:e}var jt,Wt="NativeGzipValidationError",Kt=e=>e.length>=2&&31===e[0]&&139===e[1],Yt=(e,t)=>e===_e.GZipJS||t===_e.GZipJS||"gzip"===t,Jt=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),Qt=e=>{throw zt(Wt,"Native gzip produced invalid output: "+e)},Xt=function(){var e=t((function*(e,t){18>e.size&&Qt("too-short");var i=new Uint8Array(yield e.slice(0,10).arrayBuffer());Kt(i)&&8===i[2]||Qt("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(jt)return jt;jt=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;jt[e]=t>>>0}return jt})(),i=4294967295,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(4294967295^i)>>>0})(t)&&Qt("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&Qt("invalid-size")}));return function(t,i){return e.apply(this,arguments)}}();function Zt(){return Zt=t((function*(e,i,s){void 0===i&&(i=!0);try{var r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then((()=>o.close())).catch(function(){var e=t((function*(e){try{yield o.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),l=new Response(n.readable).blob(),_=(yield Promise.all([l,a]))[0];return yield Xt(_,r),_}catch(e){if(null!=s&&s.rethrow)throw e;return i&&console.error("Failed to gzip compress data",e),null}})),Zt.apply(this,arguments)}var ei=function(e,t){var i=(void 0===t?{}:t).debugEnabled,r={_log(t){if(J&&(s.DEBUG||J.POSTHOG_DEBUG||i)&&!xe(J.console)&&J.console){for(var r=("__rrweb_original__"in J.console[t]?J.console[t].__rrweb_original__:J.console[t]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];r._log("error",...t)},critical(){for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ei(e+" "+t,i)};return r},ti=ei("[PostHog.js]"),ii=ti.createLogger;function si(e,t){ye(e)&&e.forEach(t)}function ri(e,t){if(!Te(e))if(ye(e))e.forEach(t);else if($e(e))e.forEach(((e,i)=>t(e,i)));else for(var i in e)fe.call(e,i)&&t(e[i],i)}var ni=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e},oi=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){ti.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ti.critical(e)}}},ai=function(e){var t={};return ri(e,(function(e,i){(Pe(e)&&e.length>0||Ie(e))&&(t[i]=e)})),t};var li=["herokuapp.com","vercel.app","netlify.app"];function _i(e){var t=null==e?void 0:e.hostname;if(!Pe(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of li)if(i===s)return!1;return!0}function ui(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var di=e=>{if(Z){try{for(var t=e+"=",i=Z.cookie.split(";").filter((e=>e.length)),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ie(e)&&isFinite(e)&&Math.floor(e)===e});class ci{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/Math.pow(2,40),r[1]=e/Math.pow(2,32),r[2]=e/Math.pow(2,24),r[3]=e/Math.pow(2,16),r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new ci(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new ci(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class hi{generate(){var e=this.generateOrAbort();if(!xe(e))return e;this._timestamp=0;var t=this.generateOrAbort();if(xe(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this._timestamp)this._timestamp=e,this._resetCounter();else{if(this._timestamp>=e+1e4)return;this._counter++,this._counter>4398046511103&&(this._timestamp++,this._resetCounter())}return ci.fromFieldsV7(this._timestamp,Math.trunc(this._counter/Math.pow(2,30)),this._counter&Math.pow(2,30)-1,this._random.nextUint32())}_resetCounter(){this._counter=1024*this._random.nextUint32()+(1023&this._random.nextUint32())}constructor(){this._timestamp=0,this._counter=0,this._random=new vi}}var pi,gi=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};J&&!xe(J.crypto)&&crypto.getRandomValues&&(gi=e=>crypto.getRandomValues(e));class vi{nextUint32(){return this._buffer.length>this._cursor||(gi(this._buffer),this._cursor=0),this._buffer[this._cursor++]}constructor(){this._buffer=new Uint32Array(8),this._cursor=1/0}}var fi=()=>mi().toString(),mi=()=>(pi||(pi=new hi)).generate(),yi="",bi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var wi={_is_supported:()=>!!Z,_error(e){ti.error("cookieStore error: "+e)},_get:di,_parse(e){var t;try{t=JSON.parse(wi._get(e))||{}}catch(e){}return t},_set(e,t,i,s,r){if(!Z)return!1;try{var n="",o="",a=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=Z),yi)return yi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+fi();!yi&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",yi=n)}return yi}(e);if(!i){var s=(e=>{var t=e.match(bi);return t?t[0]:""})(e);s!==i&&ti.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(Z.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(o="; secure");var _=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return _.length>3686.4&&ti.warn("cookieStore warning: large cookie, len="+_.length),Z.cookie=_,!0}catch(e){return!1}},_remove(e,t){if(null!=Z&&Z.cookie)try{wi._set(e,"",-1,t)}catch(e){return}}},Si=null,xi={_is_supported(){if(!ke(Si))return Si;var e=!0;if(xe(J))e=!1;else try{var t="__mplssupport__";xi._set(t,"xyz"),'"xyz"'!==xi._get(t)&&(e=!1),xi._remove(t)}catch(t){e=!1}return e||ti.error("localStorage unsupported; falling back to cookie store"),Si=e,e},_error(e){ti.error("localStorage error: "+e)},_get(e){try{return null==J?void 0:J.localStorage.getItem(e)}catch(e){xi._error(e)}return null},_parse(e){try{return JSON.parse(xi._get(e))||{}}catch(e){}return null},_set(e,t){try{return null==J||J.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){xi._error(e)}return!1},_remove(e){try{null==J||J.localStorage.removeItem(e)}catch(e){xi._error(e)}}},Pi=[b,g,p,v,f,m,k,E,P],Ei=[o,n,c,h,A,F,T],ki=e=>e+"_cpm",Ti=["__proto__","constructor","prototype"],Ii=e=>{if(!we(e))return{};var t={};return Object.keys(e).forEach((i=>{-1===Ti.indexOf(i)&&(t[i]=e[i])})),t},Ci=function(e,t){void 0===t&&(t=[]);var i={};return[...Ei,...t].forEach((t=>{var s=e[t];xe(s)||ke(s)||""===s||(i[t]=s)})),i},Ri=e=>{for(var t=5381,i=2166136261,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},$i=(e,t)=>({p:t,f:Ri(JSON.stringify(e))}),Oi=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=wi._parse(ki(e)),s=(null==i?void 0:i.f)===Ri(t)&&ye(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},Fi=(e,t)=>t+"|"+(wi._get(ki(e))||""),Ai={},Mi={_is_supported:()=>!0,_error(e){ti.error("memoryStorage error: "+e)},_get:e=>Ai[e]||null,_parse:e=>Ai[e]||null,_set:(e,t)=>(Ai[e]=t,!0),_remove(e){delete Ai[e]}},Li=null,Di={_is_supported(){if(!ke(Li))return Li;if(Li=!0,xe(J))Li=!1;else try{var e="__support__";Di._set(e,"xyz"),'"xyz"'!==Di._get(e)&&(Li=!1),Di._remove(e)}catch(e){Li=!1}return Li},_error(e){ti.error("sessionStorage error: ",e)},_get(e){try{return null==J?void 0:J.sessionStorage.getItem(e)}catch(e){Di._error(e)}return null},_parse(e){try{return JSON.parse(Di._get(e))||null}catch(e){}return null},_set(e,t){try{return null==J||J.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Di._error(e)}return!1},_remove(e){try{null==J||J.sessionStorage.removeItem(e)}catch(e){Di._error(e)}}};class Ni{constructor(e){this._instance=e}get _config(){return this._instance.config}get consent(){return this._getDnt()?0:this._storedConsent}isOptedOut(){return this._config.cookieless_mode===q||this.isRejected()||-1===this.consent&&this._config.cookieless_mode===U}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this._config.opt_out_capturing_by_default}optInOut(e){this._storage._set(this._storageKey,e?1:0,this._config.cookie_expiration,this._config.cross_subdomain_cookie,this._config.secure_cookie)}reset(){this._storage._remove(this._storageKey,this._config.cross_subdomain_cookie)}get _storageKey(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get _storedConsent(){var e=this._storage._get(this._storageKey);return Me(e)?1:pe(Le,e)?0:-1}get _storage(){var e=this._config.opt_out_capturing_persistence_type,t="localStorage"===e?xi:wi;if(!this._persistentStore||this._persistentStore!==t){this._persistentStore=t;var i="localStorage"===e?wi:xi;i._get(this._storageKey)&&(this._persistentStore._get(this._storageKey)||this.optInOut(Me(i._get(this._storageKey))),i._remove(this._storageKey,this._config.cross_subdomain_cookie))}return this._persistentStore}_getDnt(){return!!this._config.respect_dnt&&[null==X?void 0:X.doNotTrack,null==X?void 0:X.msDoNotTrack,ae.doNotTrack].some((e=>Me(e)))}}var Ui=["next","previous","prev",">","<","+","-","−","–"];ii("[Dead Clicks]");var qi=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(u)),s=e.instance.config.capture_dead_clicks;return Re(s)?s:!!we(s)||i},Bi=ii("[SegmentIntegration]");var Hi="posthog-js";function Gi(e,t){var s=void 0===t?{}:t,r=s.organization,n=s.projectId,o=s.prefix,a=s.severityAllowList,l=void 0===a?["error"]:a,_=s.sendExceptionsToPostHog,u=void 0===_||_;return t=>{var s,a,_,d,c;if("*"!==l&&!l.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p,g=(null==(s=t.exception)?void 0:s.values)||[],v=g.map((e=>i({},e,{stacktrace:e.stacktrace?i({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>i({},e,{platform:"web:javascript"})))}):void 0}))),f={$exception_message:(null==(a=g[0])?void 0:a.value)||t.message,$exception_type:null==(_=g[0])?void 0:_.type,$exception_level:t.level,$exception_list:v,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=g[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(c=g[0])?void 0:c.type,$sentry_tags:t.tags};return r&&n&&(f.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class zi{constructor(e,t,i,s,r,n){this.name=Hi,this.setupOnce=function(o){o(Gi(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class Vi{constructor(e){this._onSessionIdChange=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ti.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this._currentPageview=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._setupSessionRotationHandler()}_setupSessionRotationHandler(){var e;this._unsubscribeSessionId=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this._onSessionIdChange)}destroy(){var e;null==(e=this._unsubscribeSessionId)||e.call(this),this._unsubscribeSessionId=void 0}doPageView(e,t){var i,s=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(i=null==J?void 0:J.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this._previousPageViewProperties(e,null==(t=this._currentPageview)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this._currentPageview)?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var i=this._currentPageview;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,_=r.lastContentY,u=r.maxContentY;if(!(xe(n)||xe(o)||xe(a)||xe(l)||xe(_)||xe(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),_=Math.ceil(_),u=Math.ceil(u);var d=n>1?De(o/n,0,1,ti):1,c=n>1?De(a/n,0,1,ti):1,h=l>1?De(_/l,0,1,ti):1,p=l>1?De(u/l,0,1,ti):1;s=ni(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:c,$prev_pageview_last_content:_,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var ji=["flags","surveys"],Wi={[r]:{exposure:"hidden"},[l]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[_]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$logs_capture_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"},[u]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[d]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[c]:{exposure:"hidden"},[h]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>ke(e)},$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"},[p]:{exposure:"hidden",storageGroup:"flags"},[g]:{exposure:"hidden",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},[v]:{exposure:"hidden",storageGroup:"flags"},[f]:{exposure:"hidden",storageGroup:"flags"},[m]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[y]:{exposure:"hidden",storageGroup:"flags"},$override_feature_flags:{exposure:"hidden"},$override_feature_flag_payloads:{exposure:"hidden"},[b]:{exposure:"hidden"},[w]:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[x]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},$surveys_activated_session:{exposure:"hidden"},$surveys_activated_timestamps:{exposure:"hidden"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[P]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},[S]:{exposure:"event"},[E]:{exposure:"hidden"},[k]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[C]:{exposure:"hidden"},[R]:{exposure:"hidden"},[O]:{exposure:"hidden"},[F]:{exposure:"hidden"},[A]:{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"},[D]:{exposure:"event"},[N]:{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_pending_trigger_conditions:{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"}},Ki=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Yi=e=>{var t=Wi[e];if(t)return t;for(var i of Ki){var s=i[1];if(0===e.indexOf(i[0]))return s}},Ji=(e,t)=>{try{return JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t)}catch(t){return s=[],null!==(i=JSON.stringify(e,(function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}})))&&void 0!==i?i:"null"}var i,s},Qi=e=>{var t=null==Z?void 0:Z.createElement("a");return xe(t)?null:(t.href=e,t)},Xi=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!ye(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){ti.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Zi=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),_=[],u=0;l.length>u;u++){var d=l[u].split("=");ye(d)&&(t.includes(d[0])?_.push(d[0]+"="+i):_.push(l[u]))}var c=a;return null!=o&&(c+="?"+_.join("&")),null!=r&&(c+="#"+r),c},es="https?://(.*)",ts=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],is=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...ts],ss="<masked>",rs=["li_fat_id"];function ns(e,t){var i=is.concat(t||[]),s={};return ri(i,(function(t){var i=Xi(e,t);s[t]=i||null})),s}function os(e){var t=function(e){return e?0===e.search(es+"google.([^/?]*)")?"google":0===e.search(es+"bing.com")?"bing":0===e.search(es+"yahoo.com")?"yahoo":0===e.search(es+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",s={};if(!ke(t)){s.$search_engine=t;var r=Z?Xi(Z.referrer,i):"";r.length&&(s.ph_keyword=r)}return s}function as(){return navigator.language||navigator.userLanguage}var ls="$direct";function _s(){return(null==Z?void 0:Z.referrer)||ls}function us(e,t,i){void 0===i&&(i=!1);var s=e?[...ts,...t||[]]:[],r=i?Vt(null==ee?void 0:ee.href):null==ee?void 0:ee.href,n=null==r?void 0:r.substring(0,1e3);return{r:_s().substring(0,1e3),u:n?Zi(n,s,ss):void 0}}function ds(e,t){var i;void 0===t&&(t=!1);var s=e.r,r=e.u,n=t?Vt(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==ls?ls:null==(i=Qi(s))?void 0:i.host};if(n){o.$current_url=n;var a=Qi(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var l=ns(n);ni(o,l)}if(s){var _=os(s);ni(o,_)}return o}function cs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function hs(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var ps={flags:k,surveys:x},gs=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],vs=e=>e+"_cookie_identity_change_pending",fs="main",ms=(e,t)=>{ri(e,((i,s)=>{var r=Yi(s);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,s)||delete e[s]}))};class ys{constructor(e,t,s){if(void 0===s&&(s=!0),this._slotState={},this._splitStorageEligible=!1,this._splitStorage=!1,this._cookieIdentityChangePending=!1,this._cookieSyncSuppressed=!1,this._config=e,this._ownsSplitStorage=s,this.props={},this._campaign_params_url=void 0,this._name=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this._storage=this._buildStorage(e),this._splitStorage=this._resolveSplitStorage(e),this.load(),e.debug&&ti.info("Persistence loaded",e.persistence,i({},this.props)),this.update_config(e,e,t),this.save(),J){var r=()=>this.flush();ui(J,"beforeunload",r,{capture:!1}),ui(J,"pagehide",r,{capture:!1})}}_saveDebounceMs(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Ie(t)&&t>0?t:0}_rememberCurrentCookieProperties(e){if(this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase())if(e)try{var t=Ci(e,this._config.cookie_persisted_properties||[]),i=$i(t,this._config.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=wi._get(this._name)||void 0;r&&Fi(this._name,r)===s&&(this._lastSeenCookiePropertiesFingerprint=s,this._lastSeenMainCookieValue=r)}catch(e){}else try{var n=wi._get(this._name)||void 0;this._lastSeenCookiePropertiesFingerprint=n?Fi(this._name,n):void 0,this._lastSeenMainCookieValue=n}catch(e){}}syncCookieProperties(){return this._syncCookieProperties(this._config)}_syncCookieProperties(e,t){if(void 0===t&&(t=!1),this._disabled&&!t||this._cookieSyncSuppressed||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;var i;try{i=wi._get(this._name)||void 0}catch(e){}if(!i||i===this._lastSeenMainCookieValue)return!1;var s,r=Fi(this._name,i);try{s=Ii(JSON.parse(i))}catch(e){return!1}if((wi._get(this._name)||void 0)!==i)return!1;this._lastSeenCookiePropertiesFingerprint=r,this._lastSeenMainCookieValue=i;var o=Oi(this._name,i),a=[...Ei,...o.properties],_={};if(Object.keys(s).forEach((e=>{var t=s[e];(xe(t)||ke(t)||""===t||e===T&&t!==B&&t!==H)&&(_[e]=!0,delete s[e])})),Se(s))return!1;var u=n in s||s[T]===B||s[T]===H,d=this.props[n],c=this.props[T],h=ni({},this.props);[...Ei,...e.cookie_persisted_properties||[]].forEach((e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!_[e]&&(u||e!==n&&e!==T)){var t=h[e];!o.isValid&&-1!==Ei.indexOf(e)&&(!1===t||0===t)||delete h[e]}})),this.props=ni(h,s),!u||T in s||T in this.props||this._setProp(T,B);var y=this.props[n],S=this.props[T];return!u||y===d&&S===c||(this._cookieIdentityChangePending=!0,Di._set(vs(this._name),!0),this._deleteProp(b),this._deleteProp(g),this._deleteProp(p),this._deleteProp(v),this._deleteProp(f),this._deleteProp(m),this._deleteProp(k),this._deleteProp(E),this._deleteProp(P),S===B&&(c===H||s[T]===B||!xe(d)&&y!==d)&&(ms(this.props,s),this._deleteProp(w)),S===H?this.props.$user_id=y:delete this.props.$user_id,this._deleteProp(l)),!0}consumeCookieIdentityChange(){var e=vs(this._name),t=this._cookieIdentityChangePending||!!Di._get(e);return this._cookieIdentityChangePending=!1,t&&Di._remove(e),t}_beginCookieSyncSuppression(e){return void 0===e&&(e=!1),!(this._cookieSyncSuppressed||this._disabled&&!e||!this._config.cookieWinsOnConflict||"localstorage+cookie"!==this._config.persistence.toLowerCase()||(this._cookieSyncSuppressed=!0,0))}_publishSuppressedCookieSnapshot(){this._cookieSyncSuppressed&&(xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),delete this._slotState[fs],this._writeNow(!0))}_endCookieSyncSuppression(e){if(void 0===e&&(e=!0),this._cookieSyncSuppressed)try{e?this._publishSuppressedCookieSnapshot():xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0)}finally{this._cookieSyncSuppressed=!1}}isDisabled(){return!!this._disabled}_buildStorage(e){-1===gs.indexOf(e.persistence.toLowerCase())&&(ti.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,s=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var s=[...Ei,...e];return i({},xi,{_parse(e){try{var i,r={};try{i=wi._get(e)||void 0,r=i?Ii(JSON.parse(i)):{}}catch(e){}var o,a=JSON.parse(xi._get(e)||"{}");if(t){var l=Oi(e,i),_=[...Ei,...l.properties],u={};Object.keys(r).forEach((e=>{var t=r[e];ke(t)||""===t||e===T&&t!==B&&t!==H||(u[e]=t)}));var d=n in u||u[T]===B||u[T]===H;if(Object.keys(u).length>0){var c,h=a[n],p=null!==(c=a[T])&&void 0!==c?c:B;s.forEach((e=>{if(-1!==_.indexOf(e)&&!(e in r)&&(d||e!==n&&e!==T)){var t=a[e];!l.isValid&&-1!==Ei.indexOf(e)&&(!1===t||0===t)||delete a[e]}})),!d||T in r||T in a||(a[T]=B),!d||(n in u?u[n]:a[n])===h&&(T in u?u[T]:a[T])===p||(Pi.forEach((e=>delete a[e])),u[T]===H&&n in u?a.$user_id=u[n]:delete a.$user_id,u[T]!==H&&(delete a[S],delete a[w]),delete a.__alias)}o=ni(a,u)}else o=ni(r,a);return xi._set(e,o),o}catch(e){}return null},_set(i,s,r,n,o,a){var l=xi._set(i,s,void 0,void 0,a);try{var _=Ci(s,e);if(Object.keys(_).length){if(t){var u=ki(i),d=$i(_,e);if(wi._set(u,d,r,n,o,a),wi._get(u)!==JSON.stringify(d)){wi._remove(u,n);var c=Ci(s);return wi._set(i,c,r,n,o,a),l}}wi._set(i,_,r,n,o,a)}}catch(e){xi._error(e)}return l},_remove(e,t){try{null==J||J.localStorage.removeItem(e),wi._remove(e,t),wi._remove(ki(e),t)}catch(e){xi._error(e)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),r=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&xi._is_supported()?(t=xi,r=!0):"localstorage+cookie"===o&&s._is_supported()?(t=s,r=!0):"sessionstorage"===o&&Di._is_supported()?t=Di:"memory"===o?t=Mi:"cookie"===o?t=wi:s._is_supported()?(t=s,r=!0):t=wi,this._splitStorageEligible=r,t}_groupEntryName(e){return this._name+"__"+e}_resolveSplitStorage(e){return this._splitStorageEligible&&!!e.split_storage}properties(){var e={};return ri(this.props,((t,i)=>{var s=Yi(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}})),e}load(e){if(void 0===e&&(e=!1),!this._disabled||e){var t=this._config.cookieWinsOnConflict&&"localstorage+cookie"===this._config.persistence.toLowerCase(),i=t?xi._parse(this._name):null,s={};if(t)try{ri(s=Ii(wi._parse(this._name)),((e,t)=>{(xe(e)||ke(e)||""===e)&&delete s[t]}))}catch(e){}var r=this._storage._parse(this._name);if(r&&(this.props=ni({},r)),this._splitStorage&&this._loadGroupEntries(),t&&r){var o,a,l=null==i?void 0:i[n],_=null!==(o=null==i?void 0:i[T])&&void 0!==o?o:B,u=r[n],d=null!==(a=r[T])&&void 0!==a?a:B;if(u!==l||d!==_){this._cookieIdentityChangePending=!0,Di._set(vs(this._name),!0);var c=ni({},this.props);Pi.forEach((e=>delete c[e])),d===B&&(_===H||s[T]===B||!xe(l)&&u!==l)&&(ms(c,s),delete c[w]),this.props=c;var h=new Set;Pi.forEach((e=>{var t,i=null==(t=Yi(e))?void 0:t.storageGroup;i&&h.add(i)})),h.forEach((e=>{var t={};ri(this.props,((i,s)=>{var r;(null==(r=Yi(s))?void 0:r.storageGroup)===e&&(t[s]=i)})),Se(t)?(xi._remove(this._groupEntryName(e)),this._slotState[e]={}):xi._set(this._groupEntryName(e),t)&&(this._slotState[e]={persisted:!0,fingerprint:this._entryFingerprint(t,e)})}))}}Di._get(vs(this._name))&&(this._cookieIdentityChangePending=!0)}}_loadGroupEntries(){for(var e of ji){var t=xi._parse(this._groupEntryName(e));if(t&&!Se(t)){var i=this._slotWriteState(e);i.persisted=!0,this._mainCarriesGroupKey(e)||(i.fingerprint=this._entryFingerprint(t,e)),this._groupEntryIsStale(e,t)||ni(this.props,t)}}}_mainCarriesGroupKey(e){return Object.keys(this.props).some((t=>{var i;return(null==(i=Yi(t))?void 0:i.storageGroup)===e}))}_groupEntryIsStale(e,t){var i=ps[e];if(!i)return!1;var s=t[i],r=this.props[i];return Ie(s)&&Ie(r)&&r>s}refreshKey(e){var t;if(!this._disabled){var i=this._splitStorage?null==(t=Yi(e))?void 0:t.storageGroup:void 0,s=i?xi._parse(this._groupEntryName(i)):this._storage._parse(this._name);if(s&&e in s)this._setProp(e,s[e]);else{if(i){var r=this._storage._parse(this._name);if(r&&e in r)return void this._setProp(e,r[e])}this._deleteProp(e)}}}save(){if(!this._disabled){var e=this._saveDebounceMs();e>0?xe(this._pendingSaveTimer)&&(this._pendingSaveTimer=setTimeout((()=>{this._pendingSaveTimer=void 0,this._writeNow()}),e)):this._writeNow()}}flush(){xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0,this._writeNow())}_writeNow(e){void 0===e&&(e=!1),this._disabled||this._cookieSyncSuppressed&&!e||(e||this.syncCookieProperties(),this._splitStorage?this._writeNowSplit():this._writeEntry(this._storage,this._name,this.props,fs)&&this._rememberCurrentCookieProperties(this.props))}_writeNowSplit(){var e=this._partitionProps(),t=e.main,i=e.groups;for(var s of(this._writeEntry(this._storage,this._name,t,fs)&&this._rememberCurrentCookieProperties(t),ji)){var r,n=i[s];(!Se(n)||null!=(r=this._slotState[s])&&r.persisted)&&this._writeEntry(xi,this._groupEntryName(s),n,s)}}_partitionProps(){var e={},t={flags:{},surveys:{}};return ri(this.props,((i,s)=>{var r,n=null==(r=Yi(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i})),{main:e,groups:t}}_entryFingerprint(e,t){if(t===fs)return JSON.stringify(e)+"|"+this._expire_days+"|"+this._cross_subdomain+"|"+this._secure;var i={};return ri(e,((e,t)=>{var s;i[t]=null!=(s=Yi(t))&&s.volatile?"__volatile__":e})),JSON.stringify(i)}_writeEntry(e,t,i,s){var r,n=this._slotWriteState(s);if(s!==fs&&!n.dirty&&!xe(n.fingerprint))return!1;try{if((r=this._entryFingerprint(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e._set(t,i,this._expire_days,this._cross_subdomain,this._secure,this._config.debug)?(n.dirty=!1,s!==fs&&(n.persisted=!0),xe(r)||(n.fingerprint=r),!0):(this._config.debug&&ti.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(xe(this._pendingSaveTimer)||(clearTimeout(this._pendingSaveTimer),this._pendingSaveTimer=void 0),this._storage._remove(this._name,!1),this._storage._remove(this._name,!0),!i&&this._ownsSplitStorage)for(var s of ji)xi._remove(this._groupEntryName(s));i?delete this._slotState[fs]:this._slotState={},this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(we(e)){this.syncCookieProperties(),xe(t)&&(t="None"),this._expire_days=xe(i)?this._default_expiry:i;var s=!1;if(ri(e,((e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this._setProp(i,e),s=!0)})),s)return this.save(),!0}return!1}register(e,t){if(we(e)){this.syncCookieProperties(),this._expire_days=xe(t)?this._default_expiry:t;var i=!1;if(ri(e,((t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||we(t)||ye(t))&&(this._setProp(s,t),i=!0)})),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t="string"==typeof e?[e]:e,i=!1;for(var s of t)s in this.props&&(this._deleteProp(s),i=!0);i&&this.save()}update_campaign_params(){var e=null==Z?void 0:Z.URL;if(e!==this._campaign_params_url){var t=function(e,t,i){if(!Z)return{};var s,r=t?[...ts,...i||[]]:[],n=ns(Zi(Z.URL,r,ss),e),o=(s={},ri(rs,(function(e){var t=di(e);s[e]=t||null})),s);return ni(o,n)}(this._config.custom_campaign_params,this._config.mask_personal_data_properties,this._config.custom_personal_data_properties);Se(ai(t))||this.register(t),this._campaign_params_url=e}}update_search_keyword(){var e;this.register((e=null==Z?void 0:Z.referrer)?os(e):{})}update_referrer_info(){var e;this.register_once({$referrer:_s(),$referring_domain:null!=Z&&Z.referrer&&(null==(e=Qi(Z.referrer))?void 0:e.host)||ls},void 0)}set_initial_person_info(){this.props[R]||this.props[O]||this.register_once({[F]:us(this._config.mask_personal_data_properties,this._config.custom_personal_data_properties,this._config.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};ri([O,R],(t=>{var i=this.props[t];i&&ri(i,(function(t,i){e["$initial_"+ge(i)]=t}))}));var t=this.props[F];if(t){var i=function(e,t){void 0===t&&(t=!1);var i=ds(e,t),s={};return ri(i,(function(e,t){s["$initial_"+ge(t)]=e})),s}(t,this._config.disable_capture_url_hashes);ni(e,i)}return e}safe_merge(e){return ri(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,s){var r=e.persistence!==t.persistence,n=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every(((e,t)=>e===s[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=r||n,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,l=e.disable_persistence||!!s,_=!!this._disabled&&!l;l||this._syncCookieProperties(t,_),this._config=e,!l&&(r||n||a)&&(this._lastSeenCookiePropertiesFingerprint=void 0,this._lastSeenMainCookieValue=void 0,this._syncCookieProperties(i({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),_));var u=o||a?this._buildStorage(e):this._storage,d=this._resolveSplitStorage(e),c=o||d!==this._splitStorage,h=!l&&(c||e.cross_subdomain_cookie!==this._cross_subdomain||e.secure_cookie!==this._secure)&&this._beginCookieSyncSuppression(_);try{if(this._default_expiry=this._expire_days=e.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this._storage=u,this._splitStorage=d,this.props=p,this.save()}else a&&(this._storage=u,l||(delete this._slotState[fs],this._writeNow()))}finally{h&&this._endCookieSyncSuppression()}}set_disabled(e){this._disabled=e,this._disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this._cross_subdomain&&(this._cross_subdomain=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this._secure&&(this._secure=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[_]||{};i[e]=t,this._setProp(_,i),this.save()}remove_event_timer(e){var t=this.props[_]||{},i=t[e];return xe(i)||(delete t[e],this._setProp(_,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this._setProp(e,t),this.save()}_setProp(e,t){var i;this.props[e]=t,null!=(i=Yi(e))&&i.volatile||this._markGroupDirty(e)}_deleteProp(e){delete this.props[e],this._markGroupDirty(e)}_markGroupDirty(e){var t,i=null==(t=Yi(e))?void 0:t.storageGroup;i&&(this._slotWriteState(i).dirty=!0)}_slotWriteState(e){return this._slotState[e]||(this._slotState[e]={})}}function bs(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&be(i.then)&&i.then(void 0,(()=>{}))}}}}var ws={GZipJS:"gzip-js",Base64:"base64"},Ss={Activation:"events",Cancellation:"cancelEvents"},xs={Button:"button",Tab:"tab",Selector:"selector"},Ps={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"},Es={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},ks={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Ts={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Is={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Cs={Once:"once",Recurring:"recurring",Always:"always"},Rs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},$s={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"},Os={Popover:"popover",Inline:"inline"},Fs={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},As={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"},Ms={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"},Ls=ii("[RateLimiter]");class Ds{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{Ls.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void Ls.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,i,s;void 0===e&&(e=!1);var r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(C))&&void 0!==t?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var _=(Ie(a.dropped)?a.dropped:0)+1;a.dropped=_,!this.lastEventRateLimited&&this._captureWarning(_)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(C,a),{isRateLimited:l,remainingTokens:a.tokens}}_isPropertyAllowed(e){var t=this.instance.config.property_denylist;return!ye(t)||!t.includes(e)}_triggeringPage(){var e;if(this._isPropertyAllowed("$current_url")&&this._isPropertyAllowed("$pathname")&&null!=ee&&ee.pathname)return""+(null!==(e=ee.origin)&&void 0!==e?e:"")+ee.pathname}_captureWarning(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this._triggeringPage(),o=this._isPropertyAllowed("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Ns=ii("[RemoteConfig]");class Us{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ae._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}_loadRemoteConfigJs(e){var t,i;null!=(t=ae.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=ae.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}_loadRemoteConfigJSON(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Ns.info("Using preloaded remote config",this.remoteConfig),void this._onRemoteConfig(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Ns.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return Ns.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this._onRemoteConfig(e.json,e)}));this._onRemoteConfig(e)}))}catch(e){Ns.error("Error loading remote config",e),this._onRemoteConfig()}}_onRemoteConfig(e,t){!e&&t&&(0===t.statusCode?t.error||Ns.warn("Failed to fetch remote config from PostHog."):Ns.error("Failed to fetch remote config from PostHog."));try{this._instance._onRemoteConfig(e?{ok:!0,config:e}:{ok:!1})}catch(e){Ns.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){Ns.error("Error loading feature flags",e)}}}var qs=["fatal","error","warning","log","info","debug"],Bs=Uint8Array,Hs=Uint16Array,Gs=Uint32Array,zs=new Bs([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]),Vs=new Bs([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]),js=new Bs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ws=function(e,t){for(var i=new Hs(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new Gs(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},Ks=Ws(zs,2),Ys=Ks[1];Ks[0][28]=258,Ys[258]=28;for(var Js=Ws(Vs,0)[1],Qs=new Hs(32768),Xs=0;32768>Xs;++Xs){var Zs=(43690&Xs)>>>1|(21845&Xs)<<1;Qs[Xs]=((65280&(Zs=(61680&(Zs=(52428&Zs)>>>2|(13107&Zs)<<2))>>>4|(3855&Zs)<<4))>>>8|(255&Zs)<<8)>>>1}var er=function(e,t,i){for(var s=e.length,r=0,n=new Hs(t);s>r;++r)++n[e[r]-1];var o,a=new Hs(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new Hs(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var _=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,c=d|(1<<u)-1;c>=d;++d)o[Qs[d]>>>l]=_}else for(o=new Hs(s),r=0;s>r;++r)o[r]=Qs[a[e[r]-1]++]>>>15-e[r];return o},tr=new Bs(288);for(Xs=0;144>Xs;++Xs)tr[Xs]=8;for(Xs=144;256>Xs;++Xs)tr[Xs]=9;for(Xs=256;280>Xs;++Xs)tr[Xs]=7;for(Xs=280;288>Xs;++Xs)tr[Xs]=8;var ir=new Bs(32);for(Xs=0;32>Xs;++Xs)ir[Xs]=5;var sr=er(tr,9,0),rr=er(ir,5,0),nr=function(e){return(e/8>>0)+(7&e&&1)},or=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof Hs?Hs:e instanceof Gs?Gs:Bs)(i-t);return s.set(e.subarray(t,i)),s},ar=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},lr=function(e,t,i){var s=t/8>>0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},_r=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new Bs(0),0];if(1==r){var o=new Bs(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(e,t){return e.f-t.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],_=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[d].f>i[_].f?_++:d++],l=i[_!=u&&i[d].f>i[_].f?_++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var c=n[0].s;for(s=1;r>s;++s)n[s].s>c&&(c=n[s].s);var h=new Hs(c+1),p=ur(i[u-1],h,0);if(p>t){s=0;var g=0,v=p-t,f=1<<v;for(n.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r>s;++s){var m=n[s].s;if(t>=h[m])break;g+=f-(1<<p-h[m]),h[m]=t}for(g>>>=v;g>0;){var y=n[s].s;t>h[y]?g-=1<<t-h[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;h[b]==t&&(--h[b],++g)}p=t}return[new Bs(h),p]},ur=function(e,t,i){return-1==e.s?Math.max(ur(e.l,t,i+1),ur(e.r,t,i+1)):t[e.s]=i},dr=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Hs(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&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(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},cr=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},hr=function(e,t,i){var s=i.length,r=nr(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},pr=function(e,t,i,s,r,n,o,a,l,_,u){ar(t,u++,i),++r[256];for(var d=_r(r,15),c=d[0],h=d[1],p=_r(n,15),g=p[0],v=p[1],f=dr(c),m=f[0],y=f[1],b=dr(g),w=b[0],S=b[1],x=new Hs(19),P=0;m.length>P;++P)x[31&m[P]]++;for(P=0;w.length>P;++P)x[31&w[P]]++;for(var E=_r(x,7),k=E[0],T=E[1],I=19;I>4&&!k[js[I-1]];--I);var C,R,O,F,A=_+5<<3,M=cr(r,tr)+cr(n,ir)+o,L=cr(r,c)+cr(n,g)+o+14+3*I+cr(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(M>=A&&L>=A)return hr(t,u,e.subarray(l,l+_));if(ar(t,u,1+(M>L)),u+=2,M>L){C=er(c,h,0),R=c,O=er(g,v,0),F=g;var D=er(k,T,0);for(ar(t,u,y-257),ar(t,u+5,S-1),ar(t,u+10,I-4),u+=14,P=0;I>P;++P)ar(t,u+3*P,k[js[P]]);u+=3*I;for(var N=[m,w],U=0;2>U;++U){var q=N[U];for(P=0;q.length>P;++P)ar(t,u,D[B=31&q[P]]),u+=k[B],B>15&&(ar(t,u,q[P]>>>5&127),u+=q[P]>>>12)}}else C=sr,R=tr,O=rr,F=ir;for(P=0;a>P;++P)if(s[P]>255){var B;lr(t,u,C[257+(B=s[P]>>>18&31)]),u+=R[B+257],B>7&&(ar(t,u,s[P]>>>23&31),u+=zs[B]);var H=31&s[P];lr(t,u,O[H]),u+=F[H],H>3&&(lr(t,u,s[P]>>>5&8191),u+=Vs[H])}else lr(t,u,C[s[P]]),u+=R[s[P]];return lr(t,u,C[256]),u+R[256]},gr=new Gs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vr=function(){for(var e=new Gs(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),fr=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};function mr(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p(t){for(var i=e,s=0;t.length>s;++s)i=vr[255&i^t[s]]^i>>>8;e=i},d(){return 4294967295^e}}}(),s=e.length;i.p(e);var r,n,o,a,l,_=(a=10+((r=t).filename&&r.filename.length+1||0),l=8,function(e,t,i,s,r,n){var o=e.length,a=new Bs(s+o+5*(1+Math.floor(o/7e3))+r),l=a.subarray(s,a.length-r),_=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?_=hr(l,_,e.subarray(u,d)):(l[u]=!0,_=hr(l,_,e.subarray(u,o)))}else{for(var c=gr[t-1],h=c>>>13,p=8191&c,g=(1<<i)-1,v=new Hs(32768),f=new Hs(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new Gs(25e3),S=new Hs(288),x=new Hs(32),P=0,E=0,k=(u=0,0),T=0,I=0;o>u;++u){var C=b(u),R=32767&u,O=f[C];if(v[R]=O,f[C]=R,u>=T){var F=o-u;if((P>7e3||k>24576)&&F>423){_=pr(e,l,0,w,S,x,E,k,I,u-I,_),k=P=E=0,I=u;for(var A=0;286>A;++A)S[A]=0;for(A=0;30>A;++A)x[A]=0}var M=2,L=0,D=p,N=R-O&32767;if(F>2&&C==b(u-N))for(var U=Math.min(h,F)-1,q=Math.min(32767,u),B=Math.min(258,F);q>=N&&--D&&R!=O;){if(e[u+M]==e[u+M-N]){for(var H=0;B>H&&e[u+H]==e[u+H-N];++H);if(H>M){if(M=H,L=N,H>U)break;var G=Math.min(N,H-2),z=0;for(A=0;G>A;++A){var V=u-N+A+32768&32767,j=V-v[V]+32768&32767;j>z&&(z=j,O=V)}}}N+=(R=O)-(O=v[R])+32768&32767}if(L){w[k++]=268435456|Ys[M]<<18|Js[L];var W=31&Ys[M],K=31&Js[L];E+=zs[W]+Vs[K],++S[257+W],++x[K],T=u+M,++P}else w[k++]=e[u],++S[e[u]]}}_=pr(e,l,!0,w,S,x,E,k,I,u-I,_)}return or(a,0,s+nr(_)+r)}(n=e,null==(o=t).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,l)),u=_.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&fr(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(_,t),fr(_,u-8,i.d()),fr(_,u-4,s),_}var yr=!!ie||!!te,br="text/plain",wr=!1,Sr=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter((e=>e.split("=")[0]!==t)).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},xr=function(e,t,s){var r;void 0===s&&(s=!0);var n=e.split("?"),o=n[0],a=n[1],l=i({},t),_=null!==(r=null==a?void 0:a.split("&").map((e=>{var t,i=e.split("="),r=i[0],n=s&&null!==(t=l[r])&&void 0!==t?t:i[1];return delete l[r],r+"="+n})))&&void 0!==r?r:[],u=function(e,t){var i,s;void 0===t&&(t="&");var r=[];return ri(e,(function(e,t){xe(e)||xe(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)})),r.join(t)}(l);return u&&_.push(u),_.length>0?o+"?"+_.join("&"):o},Pr=e=>{if(e._encodedBody)return e._encodedBody;var t=e.data,i=e.compression;if(t){if(i===ws.GZipJS){var s=mr(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var s=new Bs(e.length+(e.length>>>1)),r=0,n=function(e){s[r++]=e},o=0;i>o;++o){if(r+5>s.length){var a=new Bs(r+8+(i-o<<1));a.set(s),s=a}var l=e.charCodeAt(o);128>l?n(l):2048>l?(n(192|l>>>6),n(128|63&l)):l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return or(s,0,r)}(Ji(t)),{mtime:0});return{contentType:br,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(i===ws.Base64){var r=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(Ji(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:Ji(e)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Ji(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Er=e=>{var t,s,r=()=>"sendBeacon"===e.transport?{url:xr(e.url,{compression:ws.Base64}),encodedBody:Pr(i({},e,{compression:ws.Base64,_encodedBody:void 0}))}:{url:Sr(e.url,"compression"),encodedBody:Pr(i({},e,{compression:void 0,_encodedBody:void 0}))};try{t=Pr(e)}catch(t){if(Yt(e.compression,Xi(e.url,"compression")))return ti.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&Yt(e.compression,Xi(e.url,"compression"))&&!((s=t.body)instanceof ArrayBuffer?Kt(new Uint8Array(s)):ArrayBuffer.isView(s)&&Kt(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)))?(wr=!0,r()):{url:e.url,encodedBody:t}},kr=e=>{try{return Er(e)}catch(t){return ti.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Tr=function(){var e=t((function*(e){var t=Ji(e.data),r=yield function(e,t,i){return Zt.apply(this,arguments)}(t,s.DEBUG,{rethrow:!0});if(!r)return e;var n=yield r.arrayBuffer();return i({},e,{_encodedBody:{contentType:br,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Ir=/Failed to fetch|NetworkError|Load failed/i,Cr=e=>"TypeError"===(null==e?void 0:e.name)&&Ir.test((null==e?void 0:e.message)||""),Rr=e=>{var t=kr(e);if(t){var s=t.url,r=t.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.estimatedSize,_=new Headers;ri(e.headers,(function(e,t){_.append(t,e)})),o&&_.append("Content-Type",o);var u=null,d=!1;if(se){var c=new se;u={signal:c.signal,timeout:setTimeout((()=>{var t;d=!0,c.abort(zt("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))}),e.timeout)}}var h=t=>{d&&"AbortError"===(null==t?void 0:t.name)||Cr(t)?ti.warn(t):ti.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var p;te(s,i({method:(null==e?void 0:e.method)||"GET",headers:_,keepalive:"POST"===e.method&&!e._keepaliveDisabled&&52428.8>(l||0),body:a,signal:null==(p=u)?void 0:p.signal},e.fetchOptions)).then((t=>t.text().then((i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){ti.error(e)}null==e.callback||e.callback(s)})))).catch(h).finally((()=>u?clearTimeout(u.timeout):null))}catch(e){u&&clearTimeout(u.timeout),h(e)}}},$r=e=>{try{var t,s=Er(e),r=s.url,n=s.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var _=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(X.sendBeacon(r,_))return;var u=ye(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(ye(u)&&u.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(u.length/2),c=t=>ye(e.data)?t:i({},e.data,{batch:t});return $r(i({},e,{data:c(u.slice(0,d))})),void $r(i({},e,{data:c(u.slice(d))}))}ti.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Rr(i({},e,{_keepaliveDisabled:!0}))}catch(e){ti.warn("Beacon send failed",e)}},Or=(e,t,s,r)=>{var n="query"===r?"POST"===t?"sent_at":"_":void 0;return xr(s===ws.GZipJS?Sr(e,"compression"):e,i({},n?{[n]:Date.now().toString()}:{},s===ws.GZipJS?{}:{compression:s}))},Fr=[];te&&Fr.push({transport:"fetch",method:Rr}),ie&&Fr.push({transport:"XHR",method(e){var t=kr(e);if(t){var i=new ie,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;ri(e.headers,(function(e,t){i.setRequestHeader(t,e)})),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}}}),null!=X&&X.sendBeacon&&Fr.push({transport:"sendBeacon",method:$r});var Ar=3e3;class Mr{constructor(e,t){this._isPaused=!0,this._queue=[],this._flushTimeoutMs=De((null==t?void 0:t.flush_interval_ms)||Ar,250,5e3,ti.createLogger("flush interval"),Ar),this._sendRequest=e}enqueue(e){this._queue.push(e),this._flushTimeout||this._setFlushTimeout()}unload(){this._clearFlushTimeout();var e=this._queue.length>0?this._formatQueue():{},t=Object.values(e);[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))].map((e=>{this._sendRequestSafely(i({},e,{transport:"sendBeacon"}))}))}enable(){this._isPaused=!1,this._setFlushTimeout()}_setFlushTimeout(){var e=this;this._isPaused||(this._flushTimeout=setTimeout((()=>{if(this._clearFlushTimeout(),this._queue.length>0){var t=this._formatQueue(),i=function(){var i=t[s],r=(new Date).getTime();i.data&&ye(i.data)&&ri(i.data,(e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp})),e._sendRequestSafely(i)};for(var s in t)i()}}),this._flushTimeoutMs))}_sendRequestSafely(e){try{this._sendRequest(e)}catch(e){ti.error(e)}}_clearFlushTimeout(){clearTimeout(this._flushTimeout),this._flushTimeout=void 0}_formatQueue(){var e={};return ri(this._queue,(t=>{var s,r=t,n=(r?r.batchKey:null)||r.url;xe(e[n])&&(e[n]=i({},r,{data:[]})),null==(s=e[n].data)||s.push(r.data)})),this._queue=[],e}}var Lr=["retriesPerformedSoFar"];class Dr{constructor(e){this._isPolling=!1,this._pollIntervalMs=3e3,this._queue=[],this._instance=e,this._queue=[],this._areWeOnline=!0,!xe(J)&&"onLine"in J.navigator&&(this._areWeOnline=J.navigator.onLine,this._onlineListener=()=>{this._areWeOnline=!0,this._flush()},this._offlineListener=()=>{this._areWeOnline=!1},ui(J,"online",this._onlineListener),ui(J,"offline",this._offlineListener))}get length(){return this._queue.length}retriableRequest(e){var t=e.retriesPerformedSoFar,s=function(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}(e,Lr);Ce(t)&&(s.url=xr(s.url,{retry_count:t})),this._instance._send_request(i({},s,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this._enqueue(i({retriesPerformedSoFar:t},s));0===e.statusCode&&ti.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!=t?t:0)+" retries.")}null==s.callback||s.callback(e)}}))}_enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,s=Math.min(18e5,t),r=Math.random()-.5;return Math.ceil(s+r*(s-i))}(t),s=Date.now()+i;this._queue.push({retryAt:s,requestOptions:e});var r="Enqueued failed request for retry in "+i;navigator.onLine||(r+=" (Browser is offline)"),ti.warn(r),this._isPolling||(this._isPolling=!0,this._poll())}_poll(){if(this._poller&&clearTimeout(this._poller),0===this._queue.length)return this._isPolling=!1,void(this._poller=void 0);this._poller=setTimeout((()=>{this._areWeOnline&&this._queue.length>0&&this._flush(),this._poll()}),this._pollIntervalMs)}_flush(){var e=Date.now(),t=[],i=this._queue.filter((i=>e>i.retryAt||(t.push(i),!1)));if(this._queue=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this._poller&&(clearTimeout(this._poller),this._poller=void 0),this._isPolling=!1,xe(J)||(this._onlineListener&&(J.removeEventListener("online",this._onlineListener),this._onlineListener=void 0),this._offlineListener&&(J.removeEventListener("offline",this._offlineListener),this._offlineListener=void 0)),this._queue)){var t=e.requestOptions;try{this._instance._send_request(i({},t,{transport:"sendBeacon"}))}catch(e){ti.error(e)}}this._queue=[]}}class Nr{constructor(e){this._updateScrollData=()=>{var e,t,i,s;this._context||(this._context={});var r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this._context.lastScrollY=Math.ceil(n),this._context.maxScrollY=Math.max(n,null!==(e=this._context.maxScrollY)&&void 0!==e?e:0),this._context.maxScrollHeight=Math.max(o,null!==(t=this._context.maxScrollHeight)&&void 0!==t?t:0),this._context.lastContentY=a,this._context.maxContentY=Math.max(a,null!==(i=this._context.maxContentY)&&void 0!==i?i:0),this._context.maxContentHeight=Math.max(l,null!==(s=this._context.maxContentHeight)&&void 0!==s?s:0)},this._instance=e}get _scrollRoot(){return this._instance.config.scroll_root_selector}getContext(){return this._context}resetContext(){var e=this._context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){ui(J,"scroll",this._updateScrollData,{capture:!0}),ui(J,"scrollend",this._updateScrollData,{capture:!0}),ui(J,"resize",this._updateScrollData)}scrollElement(){if(!this._scrollRoot)return null==J?void 0:J.document.documentElement;var e=ye(this._scrollRoot)?this._scrollRoot:[this._scrollRoot];for(var t of e){var i=null==J?void 0:J.document.querySelector(t);if(i)return i}}_scrollPosition(e){var t="y"===e?"scrollTop":"scrollLeft";if(this._scrollRoot){var i=this.scrollElement();return i&&i[t]||0}return J?"y"===e?J.scrollY||J.pageYOffset||J.document.documentElement.scrollTop||0:J.scrollX||J.pageXOffset||J.document.documentElement.scrollLeft||0:0}scrollY(){return this._scrollPosition("y")}scrollX(){return this._scrollPosition("x")}}var Ur=e=>us(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class qr{constructor(e,t,i,s){this._onSessionIdCallback=e=>{var t=this._getStored();if(!t||t.sessionId!==e){var i={sessionId:e,props:this._sessionSourceParamGenerator(this._instance)};this._persistence.register({[I]:i})}},this._instance=e,this._sessionIdManager=t,this._persistence=i,this._sessionSourceParamGenerator=s||Ur,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[I]}getSetOnceProps(){var e,t=null==(e=this._getStored())?void 0:e.props;return t?"r"in t?ds(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ri(ai(this.getSetOnceProps()),((t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+ge(i)]=t})),e}}class Br{on(e,t){return this._events[e]||(this._events[e]=[]),this._events[e].push(t),()=>{this._events[e]=this._events[e].filter((e=>e!==t))}}emit(e,t){for(var i of this._events[e]||[])i(t);for(var s of this._events["*"]||[])s(e,t)}constructor(){this._events={}}}var Hr=ii("[SessionId]"),Gr=864e5;class zr{on(e,t){return this._eventEmitter.on(e,t)}constructor(e,t,i){var s;if(this._lastPersistedActivityTimestamp=null,this._lastCookieSyncTimestamp=null,this._sessionIdChangedHandlers=[],this._beforeUnloadListener=void 0,this._destroyed=!1,this._eventEmitter=new Br,this._sessionHasBeenIdleTooLong=(e,t)=>!(!Ce(e)||!Ce(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===q)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this._config=e.config,this._persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._pendingBootstrapSession=void 0,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||fi,this._windowIdGenerator=i||fi;var r=this._config.persistence_name||this._config.token;if(this._sessionTimeoutMs=1e3*De(this._config.session_idle_timeout_seconds||1800,60,36e3,Hr.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this._resetIdleTimer(),this._window_id_storage_key="ph_"+r+"_window_id",this._primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",this._canUseSessionStorage()){var n=Di._parse(this._window_id_storage_key),o=Di._parse(this._primary_window_exists_storage_key);n&&!o?this._windowId=n:Di._remove(this._window_id_storage_key),Di._set(this._primary_window_exists_storage_key,!0)}null!=(s=this._config.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this._config.bootstrap.sessionID),this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return xe(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this._config.persistence&&!this._persistence._disabled&&Di._is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Di._set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Di._parse(this._window_id_storage_key):null}_isActivityChangeBelowGranularity(e){var t=this._lastPersistedActivityTimestamp;return!ke(t)&&!ke(e)&&5e3>Math.abs(e-t)}_setSessionId(e,t,i){var s=t!==this._sessionActivityTimestamp,r=!(e!==this._sessionId||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,r&&!s||r&&this._isActivityChangeBelowGranularity(t)||(this._lastPersistedActivityTimestamp=t,this._persistence.register({[c]:[t,e,i]}))}_useCrossTabRefreshHardening(){var e,t=null==(e=this._config)?void 0:e.persistence_save_debounce_ms;return Ce(t)&&t>0}_refreshSessionIdFromStorage(){this._useCrossTabRefreshHardening()?this._persistence.refreshKey(c):(this._persistence.flush(),this._persistence.load())}_flushPendingActivityTimestamp(){var e;if(!ke(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this._lastPersistedActivityTimestamp){this._refreshSessionIdFromStorage();var t=this._getSessionId();t[1]===this._sessionId&&t[2]===this._sessionStartTimestamp&&(this._lastPersistedActivityTimestamp=this._sessionActivityTimestamp,this._persistence.register({[c]:[this._sessionActivityTimestamp,null!==(e=this._sessionId)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this._persistence.flush())}}_freshestActivityTimestamp(){var e=this._getSessionId()[0],t=Ce(e)?e:0,i=Ce(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}_isSessionIdleAfterCrossTabRefresh(e){return this._refreshSessionIdFromStorage(),this._sessionHasBeenIdleTooLong(e,this._freshestActivityTimestamp())}_getSessionId(){var e=this._persistence.props[c];return ye(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._lastPersistedActivityTimestamp=null,this._pendingBootstrapSession=void 0,clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._setSessionId(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void Hr.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void Hr.error("Invalid sessionID in bootstrap",e)}}(e);return!xe(i)&&(t?this._pendingBootstrapSession={sessionId:e,sessionStartTimestamp:i}:this._setSessionId(e,(new Date).getTime(),i),!0)}destroy(){this._destroyed=!0,this._flushPendingActivityTimestamp(),clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=void 0,this._beforeUnloadListener&&J&&(J.removeEventListener(V,this._beforeUnloadListener,{capture:!1}),this._beforeUnloadListener=void 0),this._sessionIdChangedHandlers=[]}_listenToReloadWindow(){this._beforeUnloadListener=()=>{this._flushPendingActivityTimestamp(),this._canUseSessionStorage()&&Di._remove(this._primary_window_exists_storage_key)},ui(J,V,this._beforeUnloadListener,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this._config.cookieless_mode===q)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=t||(new Date).getTime(),r=this._sessionId;if(i)this._lastCookieSyncTimestamp=s;else if(ke(this._lastCookieSyncTimestamp)||this._lastCookieSyncTimestamp>s||s-this._lastCookieSyncTimestamp>=1e3){var n,o;null==(n=(o=this._persistence).syncCookieProperties)||n.call(o),this._lastCookieSyncTimestamp=s}var a=this._getSessionId(),l=a[1],_=a[2],u=!xe(r)&&l!==r,d=this._freshestActivityTimestamp(),c=this._getWindowId(),h=this._pendingBootstrapSession,p=!!h&&(h.sessionStartTimestamp>s+6e4||s-h.sessionStartTimestamp>Gr),g=h?p:Ce(_)&&Math.abs(s-_)>Gr,v=!1,f=u,m=!l||!!h,y=l,b=!m&&!e&&this._sessionHasBeenIdleTooLong(s,d);if(b){(b=this._isSessionIdleAfterCrossTabRefresh(s))||Hr.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this._getSessionId();l=w[1],_=w[2]}if(m||b||g){f=!1;var S=h&&!p;l=S?h.sessionId:this._sessionIdGenerator(),c=this._windowIdGenerator(),Hr.info("new session ID assigned",{sessionId:l,windowId:c,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),_=S?h.sessionStartTimestamp:s,this._pendingBootstrapSession=void 0,v=!0}else c||(c=this._windowIdGenerator(),v=!0),(f=f||l!==y)&&(Hr.info("adopted cross-tab session id",{sessionId:l,windowId:c}),v=!0);var x=Ce(d)&&e&&!g?d:s,P=Ce(_)?_:(new Date).getTime();this._setWindowId(c),this._setSessionId(l,x,P),e||this._resetIdleTimer();var E={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:f};return v&&this._sessionIdChangedHandlers.forEach((e=>e(l,c,E))),{sessionId:l,windowId:c,sessionStartTimestamp:P,changeReason:v?E:void 0,lastActivityTimestamp:d}}_resetIdleTimer(){this._destroyed||(clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{if(!this._destroyed)if(this._isSessionIdleAfterCrossTabRefresh((new Date).getTime())){var e=this._sessionId;this.resetSessionId(),this._eventEmitter.emit("forcedIdleReset",{idleSessionId:e})}else this._resetIdleTimer()}),1.1*this.sessionTimeoutMs))}}function Vr(){return(Vr=t((function*(){var e=null==X?void 0:X.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return Pe(i)&&i.length>0?i:void 0}catch(e){return void ti.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}}))).apply(this,arguments)}function jr(e,t,i){return Ji({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var Wr="custom",Kr="i.posthog.com",Yr=/^\/static\//,Jr=["/s/","/e/","/i/"];class Qr{constructor(e){this._regionCache={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Kr,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(this._regionCache[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":Wr),this._regionCache[this.apiHost]}_staticAssetHostOverride(e){if(Yr.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}_urlKey(e){var t=Qi(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}_prepareEndpoint(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r){var n,o=(null==(n=Qi(i))?void 0:n.href)||i;s=r(new URL(o)).toString()}if(r&&"api"===e&&Jr.some((e=>0===t.indexOf(e)))){var a=this._urlKey(s);if(a){var l,_=this.apiHost,u=this._ingestionEndpoints;(null==(l=u)?void 0:l.apiHost)===_&&u.rewriteRequestPath===r||(u={apiHost:_,rewriteRequestPath:r,urls:new Set},this._ingestionEndpoints=u),u.urls.add(a)}}return s}isIngestionEndpoint(e){var t=this._ingestionEndpoints,i=this._urlKey(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this._prepareEndpoint(e,t,this.uiHost+t);if("flags"===e)return this._prepareEndpoint(e,t,this.flagsApiHost+t);if("assets"===e){var i=this._staticAssetHostOverride(t);if(i)return this._prepareEndpoint(e,t,""+i+t)}if(this.region===Wr)return this._prepareEndpoint(e,t,this.apiHost+t);var s=Kr+t;switch(e){case"assets":return this._prepareEndpoint(e,t,"https://"+this.region+"-assets."+s);case"api":return this._prepareEndpoint(e,t,"https://"+this.region+"."+s)}}}var Xr=ii("[Surveys]"),Zr={ignoreConditions:!1,ignoreDelay:!1,displayType:Os.Popover},en=ii("[PostHog ExternalIntegrations]"),tn={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class sn{constructor(e){this._instance=e}_loadScript(e,t){var i;null==(i=ae.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,(e=>{if(e)return en.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(){var t,s,r,n=i[0],o=i[1];!o||null!=(t=ae.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[n]||e._loadScript(tn[n],(()=>{var t;null==(t=ae.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[n])||t.start(e._instance)})),!o&&null!=(s=ae.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=ae.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())};for(var i of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;t()}}}class rn{constructor(e,t){this._logger=e,this._client=t,this._extensions=new Map,this._disposed=!1}add(e){var i=this;return t((function*(){if(i._disposed)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(i._extensions.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');i._extensions.set(e.name,e);try{var t=e.setup(i._client);t&&(yield t)}catch(t){var s=i._extensions.get(e.name)===e;s&&i._extensions.delete(e.name),i._logger.error('Failed to set up browser extension "'+e.name+'"',t),s&&i._disposeExtension(e)}}))()}getExtension(e){return this._extensions.get(e)}dispose(){if(!this._disposed){this._disposed=!0;var e=Array.from(this._extensions.values()).reverse();for(var t of(this._extensions.clear(),e))this._disposeExtension(t)}}_disposeExtension(e){try{var t=null==e.dispose?void 0:e.dispose();t&&be(t.then)&&t.then(void 0,(t=>{this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}))}catch(t){this._logger.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class nn{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);xe(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var on="extensionsRemoteConfig";class an{constructor(e){this._disposed=!1,this.instance=e,this._logger=ti,this._latestRemoteConfigResult=e._lastRemoteConfig,this.kv=new nn(e),this.onEvent=e=>bs(this.instance.on("eventCaptured",(t=>{try{e({event:t.event,properties:t.properties})}catch(e){this._logger.error("Browser extension event listener failed",e)}}))),this.onRemoteConfig=e=>{if(this._disposed)return bs((()=>{}));var t=t=>{try{e(t)}catch(e){this._logger.error("Browser extension remote config listener failed",e)}},i=this.instance._internalEventEmitter.on(on,t);return this._latestRemoteConfigResult&&t(this._latestRemoteConfigResult),bs(i)},this._runtime=new rn(ti.createLogger("[BrowserExtensions]"),this)}get logger(){return this._logger}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property(o))&&void 0!==e?e:this.distinctId}get deviceId(){var e=this.instance.get_property(o);return"string"==typeof e?e:void 0}get library(){return{name:s.LIB_NAME,version:s.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!==(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())&&void 0!==e?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(i=null==r?void 0:r.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(s=null==r?void 0:r.sessionStartTimestamp)&&void 0!==s?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this._runtime.add(e)}getExtension(e){return this._runtime.getExtension(e)}capture(e,i,s){var r=this;return t((function*(){s?r.instance.capture(e,i,{timestamp:s.timestamp,uuid:s.uuid,$set:s.set,$set_once:s.setOnce}):r.instance.capture(e,i)}))()}registerDynamicEventProperties(e){return bs(this.instance._registerExtensionEventProperties(e))}handleRemoteConfig(e){this._disposed||(this._latestRemoteConfigResult=e,this.instance._internalEventEmitter.emit(on,e))}sendRequest(e,i){var s=this;return t((function*(){var t;void 0===i&&(i={});var r=s.instance.requestRouter.endpointFor(null!==(t=i.target)&&void 0!==t?t:"api",e),n={method:i.method,url:i.query?xr(r,i.query):r,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?_e.Base64:void 0,timestampMode:i.sentAt};return"sendBeacon"===i.transport?(s.instance._send_request(n),{statusCode:202}):new Promise((e=>{n.callback=e,s.instance._send_request(n)}))}))()}dispose(){this._disposed||(this._disposed=!0,this._runtime.dispose())}}var ln,_n={},un=0,dn=()=>{},cn='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',hn="Surveys module not available",pn="sanitize_properties is deprecated. Use before_send instead",gn="Invalid value for property_denylist config: ",vn=["token","distinct_id",L],fn="posthog",mn=!yr&&-1===(null==ne?void 0:ne.indexOf("MSIE"))&&-1===(null==ne?void 0:ne.indexOf("Mozilla")),yn=e=>{var t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},bn=e=>{var t;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:_i(null==Z?void 0:Z.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:dn,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:ee&&Pe(null==ee?void 0:ee.search)&&-1!==ee.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:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==J||null==(t=J.location)?void 0:t.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(e){ti.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:G,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Ar},error_tracking:{},_onCapture:dn},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Ui,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:yn(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},wn=[["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"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Sn=e=>{var t={};for(var i of wn){var s=i[0],r=i[1];xe(e[s])||(t[r]=e[s])}var n=ni({},t,e),o=e.__preview_external_dependency_versioned_paths;return xe(o)||(xe(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),Pe(o)&&xe(e.asset_host)&&(n.asset_host=o)),ye(e.property_blacklist)&&(xe(e.property_denylist)?n.property_denylist=e.property_blacklist:ye(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ti.error(gn+e.property_denylist)),n};class xn{constructor(){this.__forceAllowLocalhost=!1}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){ti.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Pn{_replaceExtension(e,t){if(e){var i=this._extensions.indexOf(e);-1!==i&&this._extensions.splice(i,1)}return this._extensions.push(t),null==t.initialize||t.initialize(),t}_inCookielessMode(){return this.config.cookieless_mode===q||this.config.cookieless_mode===U&&this.consent.isRejected()}_healCookielessSentinelDistinctId(){if(!this._inCookielessMode()&&this.get_distinct_id()===M){var e=this.persistence;if(e){this._is_persistence_disabled()||e.load(!0);var t=this.get_distinct_id();if(!t||t===M){var i=this.config.get_device_id(fi());this.register({distinct_id:i,$device_id:i}),e.set_property(T,B)}this._sync_opt_out_with_persistence()}}}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new xn,this._personProcessingSetOncePropertiesSent=!1,this.version=s.LIB_VERSION,this._sessionRegisteredPropKeys=new Set,this._sessionRegisteredPropertiesStorageKey="",this._internalEventEmitter=new Br,this._extensions=[],this._extensionEventPropertyProducers=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=bn(),this.SentryIntegration=zi,this.sentryIntegration=e=>function(e,t){var i=Gi(e,t);return{name:Hi,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._visibilityStateListener=null,this._initialPersonProfilesConfig=null,this._cachedPersonProperties=null,this.scrollManager=new Nr(this),this.pageViewManager=new Vi(this),this.rateLimiter=new Ds(this),this.requestRouter=new Qr(this),this.consent=new Ni(this),this.externalIntegrations=new sn(this);var t=null!==(e=Pn.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=Pe(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=Pe(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",(e=>ti.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,i){if(i&&i!==fn){var s,r=null!==(s=_n[i])&&void 0!==s?s:new Pn;return r._init(e,t,i),_n[i]=r,_n[fn][i]=r,r}return this._init(e,t,i)}_init(e,t,r){var n,o;void 0===t&&(t={});var l,_=Pe(e)?e.trim():"";if(!_)return ti.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 _!==(null==(l=this.config)?void 0:l.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+_+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=bn(t.defaults),t.debug=this._checkLocalStorageForDebug(t.debug),this._originalUserConfig=t,this._triggered_notifs=[],t.person_profiles?this._initialPersonProfilesConfig=t.person_profiles:t.process_person&&(this._initialPersonProfilesConfig=t.process_person);var u=bn(t.defaults),d=Sn(t),c=ni({},u,d,{name:r,token:_});we(u.rageclick)&&we(d.rageclick)&&(c.rageclick=ni({},u.rageclick,d.rageclick)),we(u.session_recording)&&we(d.session_recording)&&(c.session_recording=ni({},u.session_recording,d.session_recording)),this.set_config(c),this.config.on_xhr_error&&ti.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ws.GZipJS;var h=this._is_persistence_disabled();if(this.persistence=new ys(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ys(i({},this.config,{persistence:"sessionStorage"}),h,!1),this._sessionRegisteredPropertiesStorageKey="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!h&&Di._is_supported()){var p=Di._parse(this._sessionRegisteredPropertiesStorageKey);ye(p)&&p.forEach((e=>{Pe(e)&&this._sessionRegisteredPropKeys.add(e)}))}else Di._remove(this._sessionRegisteredPropertiesStorageKey);var g=i({},this.persistence.props),v=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this._requestQueue=new Mr((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Dr(this),this.__request_queue=[];var f=this._inCookielessMode();if(f||(this.sessionManager=new zr(this),this.sessionPropsManager=new qr(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this._clearSessionRegisteredProps()}))),this._enrollFeatureFlags(),this.config.__preview_deferred_init_extensions?(ti.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this._initExtensions(f)}),0)):(ti.info("Initializing extensions synchronously"),this._initExtensions(f)),s.DEBUG=s.DEBUG||this.config.debug,s.DEBUG&&ti.info("Starting in debug mode",{this:this,config:t,thisC:i({},this.config),p:g,s:v}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=i({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var m=t.bootstrap.distinctID,y=this.get_distinct_id(),b=this.persistence.get_property(T);if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===B)this.identify(m);else if(t.bootstrap.isIdentifiedID&&null!=y&&y!==m&&b===H)ti.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(fi()),S=t.bootstrap.isIdentifiedID?w:m;this.persistence.set_property(T,t.bootstrap.isIdentifiedID?H:B),this.register({distinct_id:m,$device_id:S})}}if(f)this.register_once({distinct_id:M,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(fi());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(T,B)}return ui(J,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||fi();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(T,H)),t()},r=i.user();"then"in r&&be(r.then)?r.then(s):s(r)}(e,(()=>{i.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Bi.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Bi.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Bi.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,j),identify:e=>t(e,K),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this._loaded())):this._loaded(),be(this.config._onCapture)&&this.config._onCapture!==dn&&(ti.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&ti.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 Vr.apply(this,arguments)}().then((e=>{e&&this.register({[a]:e})})).catch(dn),this}_isSharedExtension(e){var t=e;return Pe(t.name)&&be(t.setup)}_enrollExtension(e,t){this._isSharedExtension(e)?t.push((()=>{this._getBrowserClientAdapter().add(e).catch((()=>null==e.dispose?void 0:e.dispose())).catch((t=>{ti.error('Failed to dispose browser extension "'+e.name+'"',t)}))})):this._extensions.push(e)}_enrollFeatureFlags(){var e,t,i,s,r,n,o=null!==(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)&&void 0!==e?e:null==(i=Pn.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(s=this._featureFlagsReloadingUnsubscribe)||s.call(this),this._featureFlagsReloadingUnsubscribe=void 0,this.featureFlags=new o(this)),be(this.featureFlags.onReloading)&&be(this.featureFlags.setup)?this._featureFlagsReloadingUnsubscribe||(this._featureFlagsReloadingUnsubscribe=this.featureFlags.onReloading((()=>{this._internalEventEmitter.emit("featureFlagsReloading",!0)})),this._getBrowserClientAdapter().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}_initExtensions(e){var t,s,r,n,o,a,l,_=performance.now(),u=i({},Pn.__defaultExtensionClasses,this.config.__extensionClasses),d=[];u.exceptions&&this._extensions.push(this.exceptions=null!==(t=this.exceptions)&&void 0!==t?t:new u.exceptions(this)),u.historyAutocapture&&this._extensions.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this._extensions.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this._extensions.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this._extensions.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this._enrollExtension(this.autocapture=new u.autocapture(this),d),u.surveys&&this._enrollExtension(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new u.surveys(this),d),u.logs&&this._enrollExtension(this.logs=null!==(r=this.logs)&&void 0!==r?r:new u.logs(this),d),u.metrics&&this._extensions.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new u.metrics(this)),u.conversations&&this._extensions.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new u.conversations(this)),u.productTours&&this._extensions.push(this.productTours=new u.productTours(this)),u.heatmaps&&this._extensions.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this._extensions.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this._extensions.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this._extensions.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,qi)),u.toolbar&&this._extensions.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this._extensions.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new u.experiments(this)),this._extensions.forEach((e=>{e.initialize&&d.push((()=>{null==e.initialize||e.initialize()}))})),d.push((()=>{if(this._pendingRemoteConfig){var e=this._pendingRemoteConfig;this._pendingRemoteConfig=void 0,this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}})),this._processInitTaskQueue(d,_)}_processInitTaskQueue(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this._processInitTaskQueue(e,t)}),0);var i=e.shift();if(i)try{i()}catch(e){ti.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[D]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[N]:s}),this.config.__preview_deferred_init_extensions&&ti.info("PostHog extensions initialized ("+s+"ms)")}_onRemoteConfig(e){var t;if(!Z||!Z.body)return ti.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this._pendingRemoteConfig=e),this._lastRemoteConfig=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=pe(s.supportedCompression,ws.GZipJS)?ws.GZipJS:pe(s.supportedCompression,ws.Base64)?ws.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:G}),null==(t=this._browserClientAdapter)||t.handleRemoteConfig(e),this._extensions.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}_loaded(){try{this.config.loaded(this)}catch(e){ti.critical("`loaded` function failed",e)}if(this._start_queue_if_opted_in(),this.config.internal_or_test_user_hostname&&null!=ee&&ee.hostname){var e=ee.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this._inCookielessMode())&&this._captureInitialPageview()}),1),this._remoteConfigLoader=new Us(this),this._remoteConfigLoader.load()}_start_queue_if_opted_in(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this._requestQueue)||e.enable())}_dom_loaded(){this.is_capturing()&&si(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this._shouldCapturePageleave()&&this.capture(W),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this._requestQueue)||s.unload(),null==(r=this._retryQueue)||r.unload()):this._shouldCapturePageleave()&&this.capture(W,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?mn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=i({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(xe(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,s,r,n=i({},e);n.timeout=n.timeout||6e4;var o,a,l,_,u,d=null!==(t=n.transport)&&void 0!==t?t:"fetch";"sendBeacon"===d&&xe(n.compression)&&n.data&&(n.compression=ws.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(u=(_=(ye(o=n.data)?o:[o]).map((e=>i({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{}))))[0])||null==(l=u.properties)?void 0:l.token)&&void 0!==a?a:null==u?void 0:u.token,batch:_,sent_at:(new Date).toISOString()}:"body"===n.timestampMode&&(n.data=function(e,t){return void 0===t&&(t=(new Date).toISOString()),ye(e)?e.map((e=>i({},e,{sent_at:t}))):i({},e,{sent_at:t})}(n.data))),n.url=Or(n.url,n.method,n.compression,n.timestampMode);var c=Fr.filter((e=>!n.disableTransport||!e.transport||!n.disableTransport.includes(e.transport))),h=null!==(s=null==(r=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===d)return e[i]}(c))?void 0:r.method)&&void 0!==s?s:c[0].method;if(!h)throw new Error("No available transport method");var p=e=>{try{h(e)}catch(e){Cr(e)?ti.warn(e):ti.error(e),null==n.callback||n.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&n.data&&n.compression===ws.GZipJS&&re&&"undefined"!=typeof Promise&&!wr?Tr(n).then((e=>{p(e)})).catch((t=>{if(Jt(t))return wr=!0,void p(i({},n,{compression:void 0,url:Or(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return Jt(e)||t===Wt})(t)&&(wr=!0),p(n)})):h(n)})(i({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){un++;try{var t,i=[],s=[],r=[];si(e,(e=>{if(e)if(ye(t=e[0]))r.push(e);else if(be(e))try{e.call(this)}catch(t){ti.error("Error executing queued PostHog call",e,t)}else ye(e)&&"alias"===t?i.push(e):ye(e)&&-1!==t.indexOf("capture")&&be(this[t])?r.push(e):s.push(e)}));var n=function(e,t){si(e,(function(e){try{if(ye(e[0])){var i=t;ri(e,(function(e){i=i[e[0]].apply(i,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){ti.error("Error executing queued PostHog call",e,t)}}))};n(i,this),n(s,this),n(r,this)}finally{un--}}push(e){if(un>0&&ye(e)&&Pe(e[0])){var t=Pn.prototype[e[0]];be(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,s){var r,n,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(this.is_capturing())if(!xe(e)&&Pe(e)){this._healCookielessSentinelDistinctId();var _=!this.config.opt_out_useragent_filter&&this._is_bot();if(!_||this.config.__preview_capture_bot_pageviews){var u=null!=s&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!Pe(null==t?void 0:t.$current_url)&&(ti.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=s&&s._originatedFromCaptureException||ti.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 d=new Date,c=(null==s?void 0:s.timestamp)||d,h=Gt(null==s?void 0:s.uuid,fi),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},c,h)};e===j&&this.config.__preview_capture_bot_pageviews&&_&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var g="$feature_flag_called"===e&&!1===p.properties.$feature_flag_has_experiment&&!0===this.get_property(y);(null==s?void 0:s.$set)&&!g&&(p.$set=null==s?void 0:s.$set);var v=null==s?void 0:s.$unset;v&&(p.$unset=v);var f,m,b,w=g?void 0:this._calculate_set_once_properties(null==s?void 0:s.$set_once,e!==Y,e===K);if(w&&(p.$set_once=w),null!=s&&s._noTruncate||(n=this.config.properties_string_max_length,o=p,a=e=>Pe(e)?e.slice(0,n):e,l=new Set,p=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!l.has(t)){var s;if(l.add(t),ye(t))s=[],si(t,(t=>{s.push(e(t))}));else{var r={};ri(t,((t,i)=>{l.has(t)||(r[i]=e(t,i))})),s=r}return s}}(o)),p.timestamp=c,xe(null==s?void 0:s.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=d),g&&(p.properties=function(e,t){void 0===t&&(t=[]);var i={},s=t=>{void 0!==e[t]&&(i[t]=e[t])};return le.forEach(s),t.forEach(s),i}(p.properties,vn)),e===Rs.DISMISSED||e===Rs.SENT){var S=null==t?void 0:t[$s.SURVEY_ID],x=null==t?void 0:t[$s.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>"seenSurvey_"+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Xr.error("Failed to persist survey seen state",e)}})({id:S,current_iteration:x}),p.$set=i({},p.$set,{[(f={id:S,current_iteration:x},m=e===Rs.SENT?"responded":"dismissed",b="$survey_"+m+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(b="$survey_"+m+"/"+f.id+"/"+f.current_iteration),b)]:!0})}else e===Rs.SHOWN&&(p.$set=i({},p.$set,{[$s.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===As.SHOWN){var P=null==t?void 0:t[Ms.TOUR_TYPE];P&&(p.$set=i({},p.$set,{[Ms.TOUR_LAST_SEEN_DATE+"/"+P]:(new Date).toISOString()}))}var E=i({},p.properties.$set,p.$set);if(Se(E)||this.setPersonPropertiesForFlags(E),!Te(this.config.before_send)){var k=this._runBeforeSend(p);if(!k)return;(p=k).uuid=Gt(p.uuid,fi)}this._internalEventEmitter.emit("eventCaptured",p);var T=null!==(r=null==s?void 0:s._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),I={method:"POST",url:T,data:p,compression:"best-available",timestampMode:"recordings"===(null==s?void 0:s._batchKey)||/\/s\/(?:\?|$)/.test(T)?"body":"capture-body",batchKey:null==s?void 0:s._batchKey,transport:null==s?void 0:s.transport};return!this.config.request_batching||s&&(null==s||!s._batchKey)||null!=s&&s.send_instantly?this._send_retriable_request(I):this._requestQueue.enqueue(I),p}ti.critical("This capture call is ignored due to client rate limiting.")}}else ti.error("No event name provided to posthog.capture")}else ti.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}getExtension(e){var t;return null==(t=this._browserClientAdapter)?void 0:t.getExtension(e)}_getBrowserClientAdapter(){var e;return null!==(e=this._browserClientAdapter)&&void 0!==e?e:this._browserClientAdapter=new an(this)}_registerExtensionEventProperties(e){this._extensionEventPropertyProducers.push(e);var t=!0;return()=>{if(t){t=!1;var i=this._extensionEventPropertyProducers.indexOf(e);-1!==i&&this._extensionEventPropertyProducers.splice(i,1)}}}_processCookieIdentityChange(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this._cachedPersonProperties=null,this.persistence.get_property(T)===B&&(null==(s=this.sessionPersistence)||s.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this._processCookieIdentityChange();var a=o?void 0:this.persistence.remove_event_timer(e),l=i({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,this._inCookielessMode()&&(l[L]=!0),"$snapshot"===e){var _=i({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=_.distinct_id,(!Pe(l.distinct_id)&&!Ie(l.distinct_id)||Ee(l.distinct_id))&&ti.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var u,d=function(e,t,i,r){var n,o,a,l;if(void 0===r&&(r=!1),!ne)return{};var _,u=e?[...ts,...t||[]]:[],d=function(e){for(var t=0;qt.length>t;t++){var i=qt[t],s=i[1],r=i[0].exec(e),n=r&&(be(s)?s(r,e):s);if(n)return n}return["",""]}(ne),c=d[0],h=d[1],p=null!=(_="undefined"!=typeof navigator?navigator:void 0)&&_.brave?{brave:!0}:{},g={};xe(i)||(g.detectGoogleSearchApp=i);var v={},f=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(o=navigator)?void 0:o.maxTouchPoints,y=null==J||null==(a=J.screen)?void 0:a.width,b=null==J||null==(l=J.screen)?void 0:l.height,w=null==J?void 0:J.devicePixelRatio;xe(f)||(v.userAgentDataPlatform=f),xe(m)||(v.maxTouchPoints=m),xe(y)||(v.screenWidth=y),xe(b)||(v.screenHeight=b),xe(w)||(v.devicePixelRatio=w);var S,x,P,E,k,T,I,C,R=ni(ai({$os:c,$os_version:h,$browser:Dt(ne,navigator.vendor,p,g),$device:Bt(ne),$device_type:(x=ne,P=v,C=Bt(x),C===Ge||C===He||"Kobo"===C||"Kindle Fire"===C||C===yt?Be:C===lt||C===ut||C===_t||C===vt?"Console":C===Ve?"Wearable":C?Ne:"Android"===(null==P?void 0:P.userAgentDataPlatform)&&(null!==(E=null==P?void 0:P.maxTouchPoints)&&void 0!==E?E:0)>0?600>Math.min(null!==(k=null==P?void 0:P.screenWidth)&&void 0!==k?k:0,null!==(T=null==P?void 0:P.screenHeight)&&void 0!==T?T:0)/(null!==(I=null==P?void 0:P.devicePixelRatio)&&void 0!==I?I:1)?Ne:Be:"Desktop"),$timezone:cs(),$timezone_offset:hs()}),{$current_url:Zi(r?Vt(null==ee?void 0:ee.href):null==ee?void 0:ee.href,u,ss),$host:null==ee?void 0:ee.host,$pathname:null==ee?void 0:ee.pathname,$raw_user_agent:ne.length>1e3?ne.substring(0,997)+"...":ne,$browser_version:Ut(ne,navigator.vendor,p,g),$browser_language:as(),$browser_language_prefix:(S=as(),"string"==typeof S?S.split("-")[0]:void 0),$screen_height:null==J?void 0:J.screen.height,$screen_width:null==J?void 0:J.screen.width,$viewport_height:null==J?void 0:J.innerHeight,$viewport_width:null==J?void 0:J.innerWidth,$lib:s.LIB_NAME,$lib_version:s.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return s.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=s.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 c=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime(),!0),h=c.windowId;l.$session_id=c.sessionId,l.$window_id=h}this.sessionPropsManager&&ni(l,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&ni(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(p=this._retryQueue)?void 0:p.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Wr&&(l.$lib_custom_api_host=this.config.api_host),u=e!==j||o?e!==W||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),l=ni(l,u),e===j&&Z&&(l.title=Z.title),!xe(a)){var g=r.getTime()-a;l.$duration=parseFloat((g/1e3).toFixed(3))}ne&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser");var v=this.persistence.properties(),f=this.sessionPersistence.properties();ri(["$referrer","$referring_domain"],(e=>{e in v&&delete f[e]}));var m={};if(this._extensionEventPropertyProducers.length>0)for(var y of this._extensionEventPropertyProducers.slice())try{ni(m,y())}catch(e){ti.error("Failed to produce browser extension event properties",e)}(l=ni({},d,v,f,i({},m,l))).$is_identified=this._isIdentified(),ye(this.config.property_denylist)?ri(this.config.property_denylist,(function(e){delete l[e]})):ti.error(gn+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ti.error(pn),l=b(l,e));var w=this._hasPersonProcessing();return l.$process_person_profile=w,w&&!o&&this._requirePersonProcessing("_calculate_event_properties"),l}_calculate_set_once_properties(e,t,i){var s;if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent&&!i)return e;var r=this.persistence.get_initial_props(),n=null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps(),o=ni({},r,n||{},e||{}),a=this.config.sanitize_properties;return a&&(ti.error(pn),o=a(o,"$set_once")),t&&(this._personProcessingSetOncePropertiesSent=!0),Se(o)?void 0:o}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this._processCookieIdentityChange(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach((e=>this._sessionRegisteredPropKeys.add(e))),this._persistSessionRegisteredPropKeys()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this._sessionRegisteredPropKeys.delete(e),this._persistSessionRegisteredPropKeys()}_register_single(e,t){this.register({[e]:t})}_clearSessionRegisteredProps(){this._sessionRegisteredPropKeys.forEach((e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)})),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()}_persistSessionRegisteredPropKeys(){var e;if(this._sessionRegisteredPropertiesStorageKey)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e._disabled||!Di._is_supported())Di._remove(this._sessionRegisteredPropertiesStorageKey);else{var t=[];this._sessionRegisteredPropKeys.forEach((e=>t.push(e))),t.length>0?Di._set(this._sessionRegisteredPropertiesStorageKey,t):Di._remove(this._sessionRegisteredPropertiesStorageKey)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,s;return null!==(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:hn}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:hn})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:hn})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=Zr),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!==(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:hn}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!==(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:hn})}_validateIdentifyId(e){return!e||Ee(e)?(ti.critical("Unique user id has not been set in posthog.identify"),!1):e===M?(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ti.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return ti.uninitializedWarning("posthog.identify");if(Ie(e)&&(e=e.toString(),ti.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this._validateIdentifyId(e)&&this._requirePersonProcessing("posthog.identify")){this._healCookielessSentinelDistinctId();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this._processCookieIdentityChange(!1),a=this.persistence._beginCookieSyncSuppression(),_=!1;try{var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property(o)||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(l)&&(this.unregister(l),this.register({distinct_id:e}));var d,c=(this.persistence.get_property(T)||B)===B,h=e!==u,p=!h&&c;if(h&&c)this.persistence.set_property(T,H),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture(K,{distinct_id:e,$anon_distinct_id:u},{$set:t||{},$set_once:i||{}}),this._cachedPersonProperties=jr(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(u);else if(p){this.persistence.set_property(T,H);var g=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:g,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence._publishSuppressedCookieSnapshot(),this.capture("$set",{$set:g,$set_once:v}),this._cachedPersonProperties=jr(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(P)):p&&(t||i)&&this.reloadFeatureFlags(),_=!0}finally{a&&this.persistence._endCookieSyncSuppression(_)}}}setPersonProperties(e,t){if((e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")){var i=jr(this.get_distinct_id(),e,t);this._cachedPersonProperties!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this._cachedPersonProperties=i):ti.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(ye(e)?e:[e]).filter((e=>Pe(e)&&e.length>0));0!==i.length&&this._requirePersonProcessing("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this._cachedPersonProperties=null)}group(e,t,s){var r;if(e&&t){null==(r=this.persistence)||r.syncCookieProperties(),this._processCookieIdentityChange();var n=this.getGroups(),o=n[e]!==t;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:i({},n,{[e]:t})}),o||s){var a={$group_type:e,$group_key:t};s&&(a.$group_set=s),this.capture(Y,a)}s&&this.setGroupPropertiesForFlags({[e]:s}),o&&!s&&this.reloadFeatureFlags()}else ti.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=Re(e)?e:null==e?void 0:e.resetDeviceID,i=Re(e)||null==e?void 0:e.bootstrap;this._reset(t,!1,i)}_reset(e,t,s){var r,n,l;if(void 0===t&&(t=!1),ti.info("reset"),!this.__loaded)return ti.uninitializedWarning("posthog.reset");var _=null==s?void 0:s.sessionID;this.config.bootstrap=s||(null==(r=this._originalUserConfig)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags());var u=this.get_property(o),c=this.get_property(a),h=this.get_property(d),p=this.is_capturing();this.consent.reset(),t||!p||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var g=null==(l=this.persistence)||null==l._beginCookieSyncSuppression?void 0:l._beginCookieSyncSuppression(),v=!1;try{var f,m,y,b,w,S,x,P,E,k,I,C,R;if(null==(f=this.persistence)||f.clear(),null==(m=this.sessionPersistence)||m.clear(),this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys(),xe(h)||null==(k=this.persistence)||k.register({[d]:h}),null==(y=this.surveys)||y.reset(),null==(b=this.featureFlags)||b.reset(),null==(w=this.conversations)||w.reset(),null==(S=this.logs)||S.reset(),null==(x=this.metrics)||x.reset(),null==(P=this.persistence)||P.set_property(T,B),null==(E=this.sessionManager)||E.resetSessionId(),this._cachedPersonProperties=null,this.config.cookieless_mode===q)this.register_once({distinct_id:M,$device_id:null},"");else{var O=this.config.get_device_id(fi());this.register_once({distinct_id:O,$device_id:e?O:u},""),e||xe(c)||this.register({[a]:c})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),s)if(void 0===s.distinctID||this._inCookielessMode()||(null==(R=this.persistence)||R.set_property(T,s.isIdentifiedID?H:B),this.register({distinct_id:s.distinctID})),null==(I=this.featureFlags)||I.initialize(),!(xe(_)||null!=(C=this.sessionManager)&&C.setBootstrapSessionId(_,!0))){var F=i({},s);delete F.sessionID,this.config.bootstrap=F}delete this.config.identity_distinct_id,delete this.config.identity_hash,v=!0}finally{var A;g&&(null==(A=this.persistence)||null==A._endCookieSyncSuppression||A._endCookieSyncSuppression(v))}this.reloadFeatureFlags()}shutdown(e){var i=this;return t((function*(){var e,t,s,r,n;if(i.__loaded){i._getBrowserClientAdapter().dispose(),null==(e=i.sessionRecording)||e.dispose(),null==(t=i.logs)||t.flushLogs("sendBeacon"),null==(s=i.metrics)||s.flush("sendBeacon"),null==(r=i._requestQueue)||r.unload(),null==(n=i._retryQueue)||n.unload();try{var o;null==(o=i.featureFlags)||o.destroy()}catch(e){ti.error("Error while destroying feature flags",e)}}else ti.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(r)?(ti.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(xe(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(l,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(ti.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=i({},this.config);if(we(e)){var r,n,o,a,l,_,u,d,c,h,p,g;ni(this.config,Sn(e));var v=this._is_persistence_disabled();null==(r=this.persistence)||r.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ys(i({},this.config,{persistence:"sessionStorage"}),v,!1);var f,m=this._checkLocalStorageForDebug(this.config.debug);Re(m)&&(this.config.debug=m),Re(this.config.debug)&&(this.config.debug?(s.DEBUG=!0,xi._is_supported()&&xi._set("ph_debug",!0),ti.info("set_config",{config:e,oldConfig:t,newConfig:i({},this.config)})):(s.DEBUG=!1,xi._is_supported()&&xi._remove("ph_debug"))),null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags()),null==(o=this.exceptionObserver)||o.onConfigChange(),null==(a=this.exceptions)||a.onConfigChange(),null==(l=this.sessionRecording)||l.startIfEnabledOrStop(),null==(_=this.tracingHeaders)||_.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(f=this.historyAutocapture)||f.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this._sync_opt_out_with_persistence(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){s.LIB_NAME=e,s.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.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 e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var s=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(i({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Pn._noopLogger}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!==(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:fn;return t!==fn&&(t=fn+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(T))===H||(null==(t=this.sessionPersistence)?void 0:t.get_property(T))===H}_hasPersonProcessing(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===G&&!this._isIdentified()&&Se(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[l])&&(null==(t=this.persistence)||null==(t=t.props)||!t[A]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._requirePersonProcessing("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(ti.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(A,!0),!0)}_is_persistence_disabled(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==U)}_sync_opt_out_with_persistence(){var e,t,i,s,r,n=this._is_persistence_disabled();return this.is_capturing()||null==(i=this.logs)||i._onOptOut(),(null==(e=this.persistence)?void 0:e._disabled)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t._disabled)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this._sessionRegisteredPropKeys.clear(),this._persistSessionRegisteredPropKeys()),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==q){if(this._inCookielessMode()){var i,s,r,n,o;this._reset(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new zr(this),this.pageViewManager=new Vi(this),this.persistence&&(this.sessionPropsManager=new qr(this,this.sessionManager,this.persistence));var a,l=null!==(r=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==r?r:null==(o=Pn.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this._replaceExtension(this.sessionRecording,new l(this)),this._lastRemoteConfig&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this._lastRemoteConfig)))}var _,u;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),this._start_queue_if_opted_in(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==U&&(null==(_=this.surveys)||_.loadIfEnabled()),(xe(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(u=null==e?void 0:e.captureEventName)&&void 0!==u?u:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}else ti.warn(cn)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==q?(this.config.cookieless_mode===U&&this.consent.isOptedIn()&&this._reset(!0,!0),this.consent.optInOut(!1),this._sync_opt_out_with_persistence(),this.config.cookieless_mode===U&&(this.register({distinct_id:M,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._captureInitialPageview(),this._start_queue_if_opted_in())):ti.warn(cn)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===q||(this.config.cookieless_mode===U?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return X?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&he(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some((e=>he(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver}(X,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Z&&("visible"===Z.visibilityState?this._initialPageviewCaptured||(this._initialPageviewCaptured=!0,this.capture(j,{title:Z.title},{send_instantly:!0}),this._visibilityStateListener&&(Z.removeEventListener(z,this._visibilityStateListener),this._visibilityStateListener=null)):this._visibilityStateListener||(this._visibilityStateListener=this._captureInitialPageview.bind(this),ui(Z,z,this._visibilityStateListener)))}debug(e){!1===e?(null==J||J.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==J||J.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}))}_shouldDisableFlags(){var e=this._originalUserConfig||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ti.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):function(e,t,i,s,r){var n=t in e&&!Te(e[t]),o=i in e&&!Te(e[i]);return n?e[t]:!!o&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,ti)}_runBeforeSend(e){var t;if(Te(this.config.before_send))return e;var i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Fe),s=ye(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),Te(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Oe(e.event)?ti.warn(o+". This can cause unexpected behavior."):ti.info(o),null}r.properties&&!Se(r.properties)||ti.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return ti.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&Te(r.properties[a]))return ti.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager._currentPageview)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}_checkLocalStorageForDebug(e){var t=Re(e)&&!e,i=xi._is_supported()&&"true"===xi._get("ph_debug");return!t&&(!!i||e)}}Pn.__defaultExtensionClasses={},Pn._noopLogger={trace:ln=()=>{},debug:ln,info:ln,warn:ln,error:ln,fatal:ln},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=oi(e.prototype[t[i]])}(Pn,["identify"]);var En=function(){s.SDK_DIST_CHANNEL="npm";var e=_n[fn]=new Pn;return function(){function e(){e.done||(e.done=!0,mn=!1,ri(_n,(function(e){e._dom_loaded()})))}null!=Z&&Z.addEventListener?"complete"===Z.readyState?e():ui(Z,"DOMContentLoaded",e,{capture:!1}):J&&ti.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{ws as Compression,Fs as DEFAULT_PRODUCT_TOUR_APPEARANCE,Os as DisplaySurveyType,Pn as PostHog,As as ProductTourEventName,Ms as ProductTourEventProperties,Rs as SurveyEventName,$s as SurveyEventProperties,Ss as SurveyEventType,Ps as SurveyPosition,Is as SurveyQuestionBranchingType,Ts as SurveyQuestionType,Cs as SurveySchedule,Es as SurveyTabPosition,ks as SurveyType,xs as SurveyWidgetType,En as default,En as posthog,qs as severityLevels};
2
2
  //# sourceMappingURL=module.slim.no-external.js.map